mneethiraj commented on code in PR #1231:
URL: https://github.com/apache/ranger/pull/1231#discussion_r3993975992


##########
audit-server/audit-common/src/main/java/org/apache/ranger/audit/server/AuditServerConstants.java:
##########
@@ -135,11 +135,15 @@ private AuditServerConstants() {}
     public static final String PROP_DISPATCHER_MAX_POLL_INTERVAL_MS          = 
"max.poll.interval.ms";
     public static final String PROP_DISPATCHER_HEARTBEAT_INTERVAL_MS         = 
"heartbeat.interval.ms";
     public static final String PROP_DISPATCHER_PARTITION_ASSIGNMENT_STRATEGY = 
"partition.assignment.strategy";
+    public static final String PROP_DISPATCHER_AUTH_RETRY_DELAY_MS           = 
"auth.retry.delay.ms";

Review Comment:
   I suggest replacing "auth" with "authz" - to make it clear this 
configuration is about retry on authorization failure (instead of 
authentication failure).
    `PROP_DISPATCHER_AUTH_RETRY_DELAY_MS` => 
`PROP_DISPATCHER_AUTHZ_RETRY_DELAY_MS`
    `auth.retry.delay.ms` => `authz.retry.delay.ms`



##########
audit-server/audit-dispatcher/dispatcher-common/src/main/java/org/apache/ranger/audit/dispatcher/kafka/AuditDispatcherBase.java:
##########
@@ -54,10 +59,13 @@ public abstract class AuditDispatcherBase implements 
AuditDispatcher {
 
     protected final AtomicBoolean                 running               = new 
AtomicBoolean(false);
     protected final Map<String, DispatcherWorker> dispatcherWorkers     = new 
ConcurrentHashMap<>();
+    protected final Map<String, Future<?>>        workerFutures         = new 
ConcurrentHashMap<>();
     protected ExecutorService                     dispatcherThreadPool;
     protected int                                 dispatcherThreadCount = 1;
     protected String                              offsetCommitStrategy  = 
AuditServerConstants.DEFAULT_OFFSET_COMMIT_STRATEGY;
     protected long                                offsetCommitInterval  = 
AuditServerConstants.DEFAULT_OFFSET_COMMIT_INTERVAL_MS;
+    protected long                                authRetryDelayMs      = 
AuditServerConstants.DEFAULT_DISPATCHER_AUTH_RETRY_DELAY_MS;

Review Comment:
   Consider marking members `authRetryDelayMs` and `pollErrorRetryDelayMs` as 
`final`, and initializing them only in the constructor at lines 105 and 106 
below.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to