Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[INLONG][feature][audit] audit-sdk module #1929

Closed
wants to merge 8 commits into from
Closed

[INLONG][feature][audit] audit-sdk module #1929

wants to merge 8 commits into from

Conversation

doleyzi
Copy link
Contributor

@doleyzi doleyzi commented Dec 8, 2021

add audit-sdk module
Fixes #1734

add inlong audit adk
edit pom info
code formatting
add  License to the Apache Software Foundation (ASF)
add License to the Apache Software Foundation (ASF)
Use checkstyle standard code
@codecov-commenter
Copy link

Codecov Report

Merging #1929 (9608f05) into master (1a905c6) will decrease coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1929      +/-   ##
============================================
- Coverage     12.26%   12.26%   -0.01%     
- Complexity     1155     1157       +2     
============================================
  Files           413      413              
  Lines         35225    35225              
  Branches       5542     5542              
============================================
- Hits           4322     4320       -2     
  Misses        30133    30133              
- Partials        770      772       +2     
Impacted Files Coverage Δ
.../java/org/apache/flume/sink/tubemq/TubemqSink.java 51.42% <0.00%> (-4.00%) ⬇️
.../producer/qltystats/DefaultBrokerRcvQltyStats.java 45.31% <0.00%> (+1.17%) ⬆️
.../client/producer/qltystats/BrokerStatsItemSet.java 72.09% <0.00%> (+4.65%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1a905c6...9608f05. Read the comment docs.

The audit sdk is used to count the receiving and sending volume of each module in real time according to the cycle,
and the statistical results are sent to the audit access layer according to the cycle.

##features
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a space before features.

<dependency>
<groupId>org.apache.inlong</groupId>
<artifactId>audit-common</artifactId>
<version>0.12.0-incubating-SNAPSHOT</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use ${project.version}.

@@ -38,6 +38,7 @@
<module>audit-docker</module>
<module>audit-store</module>
<module>audit-common</module>
<module>audit-sdk</module>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more spaces should be moved before <module>.

The audit sdk uses log production time as the audit standard,
which can ensure that each module is reconciled in accordance with the unified audit standard.

## usage
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here we can add more guides about how to use this SDK.

dockerId = dockerID2.substring(n + 1, 12);
}
} catch (IOException e) {
System.out.println(e.getMessage());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not print exceptions to the console.

} catch (Exception e3) {
System.out.println(e3.getMessage());
return;
} finally {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's recommended to use try-with-resource instead of try-finally.

future = client.connect(ipPortObj.addr).await();
senderChannel = new SenderChannel(future.getChannel(), ipPortObj, 10);
} catch (InterruptedException e) {
System.out.println(e.getMessage());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

public void getChannel() {
Channel channel = senderChannel.getChannel();
System.out.println(channel.getConfig().getConnectTimeoutMillis());
System.out.println(channel.getRemoteAddress());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use assert instead of print to the console.


sender.setHasSendError(true);
isError = sender.isHasSendError();
System.out.println(isError);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Standardize unit testing and log printing
update README
@doleyzi doleyzi closed this Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] [InLong audit] AuditSdk
4 participants