-
Notifications
You must be signed in to change notification settings - Fork 415
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
[Minor] Improve log messages #6531
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -168,7 +168,7 @@ protected List<RangerPolicy> wildcardSearchPolies( | |
try { | ||
return rangerClient.findPolicies(searchFilters); | ||
} catch (RangerServiceException e) { | ||
throw new AuthorizationPluginException(e, "Failed to find the policies in the Ranger"); | ||
throw new AuthorizationPluginException(e, "Failed to find policies in Ranger"); | ||
} | ||
} | ||
|
||
|
@@ -278,10 +278,10 @@ private void removeSchemaMetadataObject(AuthorizationMetadataObject authzMetadat | |
authzMetadataObject instanceof PathBasedMetadataObject, | ||
"The metadata object must be a PathBasedMetadataObject"); | ||
Preconditions.checkArgument( | ||
authzMetadataObject.type() == SCHEMA, "The metadata object type must be SCHEMA"); | ||
authzMetadataObject.type() == SCHEMA, "The metadata object type must be a schema"); | ||
Preconditions.checkArgument( | ||
authzMetadataObject.names().size() == 1, | ||
"The size of the metadata object's name must be 1."); | ||
"The size of the metadata object's size must be 1."); | ||
if (RangerHelper.RESOURCE_ALL.equals(authzMetadataObject.name())) { | ||
// Remove all schema in this catalog | ||
String catalogName = authzMetadataObject.names().get(0); | ||
|
@@ -361,9 +361,9 @@ private void removeTableMetadataObject(AuthorizationMetadataObject authzMetadata | |
authzMetadataObject instanceof PathBasedMetadataObject, | ||
"The metadata object must be a PathBasedMetadataObject"); | ||
Preconditions.checkArgument( | ||
authzMetadataObject.names().size() == 3, "The metadata object names must be 3"); | ||
authzMetadataObject.names().size() == 3, "The metadata object size must be 3"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Em ... What is "metadata object size"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Names must be 3" makes no sense, "size must be 3" does. This message is aimed at programmers, and they would understand that it needs to have 3 elements in it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The size of the name or the metadata's object size or the metadata's name size, or if you really want to be verbose, the number of elements in the metadata's object's name. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Metadata object has a name identifier. The name identifier consists of names. This should be size of names instead of size of object. |
||
Preconditions.checkArgument( | ||
authzMetadataObject.type() == PATH, "The metadata object type must be PATH"); | ||
authzMetadataObject.type() == PATH, "The metadata object type must be a path"); | ||
removePolicyByMetadataObject(authzMetadataObject); | ||
} | ||
|
||
|
@@ -625,7 +625,7 @@ public Boolean onMetadataUpdated(MetadataObjectChange... changes) throws Runtime | |
((MetadataObjectChange.RenameMetadataObject) change).newMetadataObject(); | ||
Preconditions.checkArgument( | ||
metadataObject.type() == newMetadataObject.type(), | ||
"The old and new metadata object type must be equal!"); | ||
"The old and new metadata object types must be equal!"); | ||
if (metadataObject.type() == MetadataObject.Type.METALAKE) { | ||
// Rename the metalake name | ||
this.metalake = newMetadataObject.name(); | ||
|
@@ -641,13 +641,13 @@ public Boolean onMetadataUpdated(MetadataObjectChange... changes) throws Runtime | |
translateMetadataObject(newMetadataObject); | ||
Preconditions.checkArgument( | ||
oldAuthzMetadataObjects.size() == newAuthzMetadataObjects.size(), | ||
"The old and new metadata objects size must be equal!"); | ||
"The old and new metadata objects sizes must be equal!"); | ||
for (int i = 0; i < oldAuthzMetadataObjects.size(); i++) { | ||
AuthorizationMetadataObject oldAuthMetadataObject = oldAuthzMetadataObjects.get(i); | ||
AuthorizationMetadataObject newAuthzMetadataObject = newAuthzMetadataObjects.get(i); | ||
if (oldAuthMetadataObject.equals(newAuthzMetadataObject)) { | ||
LOG.info( | ||
"The metadata object({}) and new metadata object({}) are equal, so ignore rename!", | ||
"The metadata object({}) and new metadata object({}) are equal, so ignoring rename!", | ||
oldAuthMetadataObject.fullName(), | ||
newAuthzMetadataObject.fullName()); | ||
continue; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check this again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"name must be 1" makes no sense unless you mean the name must be the letter 1, which is not intended here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean "The size of the metadata object's size" doesn't make sense ... WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it makes sense to me, and I don't think most people would find that confusing - as a Precondition, it's more aimed at developers.