aasha commented on a change in pull request #2240:
URL: https://github.com/apache/hive/pull/2240#discussion_r648504479
##########
File path: common/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java
##########
@@ -627,7 +627,9 @@
REPL_INVALID_ARGUMENTS(40012, "Invalid arguments error : {0}.", true),
REPL_INVALID_ALTER_TABLE(40013, "{0}Unable to alter table{1}", true),
REPL_PERMISSION_DENIED(40014,
"{0}org.apache.hadoop.security.AccessControlException{1}", true),
- REPL_DISTCP_SNAPSHOT_EXCEPTION(40015, "SNAPSHOT_ERROR", true)
+ REPL_DISTCP_SNAPSHOT_EXCEPTION(40015, "SNAPSHOT_ERROR", true),
+ RANGER_AUTHORISATION_FAILED(40016, "Authorisation Failure while
communicating to Ranger admin", true),
Review comment:
type : authorization
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ranger/RangerRestClientImpl.java
##########
@@ -202,12 +238,14 @@ public RangerExportPolicyList
importRangerPolicies(RangerExportPolicyList ranger
String finalUrl = getRangerImportUrl(baseUrl, dbName);
LOG.debug("URL to import policies on target Ranger: {}", finalUrl);
Retryable retryable = Retryable.builder()
- .withHiveConf(hiveConf)
- .withRetryOnException(Exception.class).build();
+ .withHiveConf(hiveConf).withFailOnException(RuntimeException.class)
+ .withRetryOnException(SemanticException.class).build();
try {
return retryable.executeCallable(() ->
importRangerPoliciesPlain(jsonRangerExportPolicyList,
rangerPoliciesJsonFileName,
serviceMapJsonFileName, jsonServiceMap, finalUrl,
rangerExportPolicyList, hiveConf));
+ } catch (RuntimeException e) {
Review comment:
you are catching a runtime exception and throwing a semantic exception.
why are you doing that?
##########
File path: common/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java
##########
@@ -627,7 +627,9 @@
REPL_INVALID_ARGUMENTS(40012, "Invalid arguments error : {0}.", true),
REPL_INVALID_ALTER_TABLE(40013, "{0}Unable to alter table{1}", true),
REPL_PERMISSION_DENIED(40014,
"{0}org.apache.hadoop.security.AccessControlException{1}", true),
- REPL_DISTCP_SNAPSHOT_EXCEPTION(40015, "SNAPSHOT_ERROR", true)
+ REPL_DISTCP_SNAPSHOT_EXCEPTION(40015, "SNAPSHOT_ERROR", true),
+ RANGER_AUTHORISATION_FAILED(40016, "Authorisation Failure while
communicating to Ranger admin", true),
Review comment:
error code is same. it should be different. Check if any of the existing
errror codes that can be reused.
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ranger/RangerRestClientImpl.java
##########
@@ -90,11 +86,13 @@ public RangerExportPolicyList exportRangerPolicies(String
sourceRangerEndpoint,
"cannot be empty", ReplUtils.REPL_RANGER_SERVICE));
}
Retryable retryable = Retryable.builder()
- .withHiveConf(hiveConf)
- .withRetryOnException(Exception.class).build();
+ .withHiveConf(hiveConf).withFailOnException(RuntimeException.class)
+ .withRetryOnException(URISyntaxException.class).build();
Review comment:
what is the use of retry in case of URISyntaxException?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]