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

HDDS-2628. Make AuditMessage parameters strongly typed #277

Merged
merged 2 commits into from
Dec 2, 2019

Conversation

adoroszlai
Copy link
Contributor

What changes were proposed in this pull request?

  1. Improve type safety in AuditMessage$Builder for methods forOperation and withResult by using existing interface AuditAction and enum AuditEventStatus respectively instead of Strings.
  2. Use existing Server.getRemoteAddress() instead of Server.getRemoteIp().getHostAddress() with null check
  3. Define and use getRemoteUserName() along the same lines

https://issues.apache.org/jira/browse/HDDS-2628

How was this patch tested?

Created keys using Freon, verified audit log entries.

2019-11-27 20:48:16,206 | INFO  | SCMAudit | user=hadoop | ip=172.23.0.3 | op=ALLOCATE_BLOCK {owner=88982149-2c09-4cd7-8e38-fba8f23cff5e, size=268435456, type=RATIS, factor=ONE} | ret=SUCCESS |
2019-11-27 20:48:45,879 | INFO  | SCMAudit | user=hadoop | ip=172.23.0.4 | op=SEND_HEARTBEAT {datanodeUUID=4e2ee488-6dc6-45f8-9f02-02f1a5cff554, command=[]} | ret=SUCCESS |
2019-11-27 20:48:16,208 | INFO  | OMAudit | user=hadoop | ip=172.23.0.2 | op=ALLOCATE_KEY {volume=vol1, bucket=bucket1, key=OkoBsDwxuj/9, dataSize=10240, replicationType=RATIS, replicationFactor=ONE, keyLocationInfo=[blockID {
  containerBlockID {
    containerID: 1
    localID: 103211840058556425
    ...

https://github.com/adoroszlai/hadoop-ozone/runs/323724573

Copy link
Contributor

@dineshchitlangia dineshchitlangia left a comment

Choose a reason for hiding this comment

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

Thanks @adoroszlai for the improvement.

@dineshchitlangia dineshchitlangia merged commit 33b3c16 into apache:master Dec 2, 2019
@adoroszlai adoroszlai deleted the HDDS-2628 branch December 2, 2019 07:25
@adoroszlai
Copy link
Contributor Author

Thanks @dineshchitlangia for reviewing and merging it.

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.

2 participants