granthenke commented on a change in pull request #3387: NIFI-6009 ScanKudu 
Processor & KuduPut Processor Delete Operation
URL: https://github.com/apache/nifi/pull/3387#discussion_r273566196
 
 

 ##########
 File path: 
nifi-nar-bundles/nifi-kudu-bundle/nifi-kudu-processors/src/main/java/org/apache/nifi/kudu/PutKudu.java
 ##########
 @@ -279,43 +217,56 @@ public void onTrigger(final ProcessContext context, 
final ProcessSession session
         if (flowFiles.isEmpty()) {
             return;
         }
+        final KuduClientService clientService = 
context.getProperty(KUDU_CLIENT_SERVICE).asControllerService(KuduClientService.class);
+        kerberosUser = clientService.getKerberosUser();
 
         final KerberosUser user = kerberosUser;
         if (user == null) {
-            trigger(context, session, flowFiles);
+            trigger(context, session, flowFiles, clientService);
             return;
         }
 
         final PrivilegedExceptionAction<Void> privelegedAction = () -> {
-            trigger(context, session, flowFiles);
+            trigger(context, session, flowFiles, clientService);
             return null;
         };
 
         final KerberosAction<Void> action = new KerberosAction<>(user, 
privelegedAction, getLogger());
         action.execute();
     }
 
-    private void trigger(final ProcessContext context, final ProcessSession 
session, final List<FlowFile> flowFiles) throws ProcessException {
-        final KuduSession kuduSession = getKuduSession(kuduClient);
+    private void trigger(final ProcessContext context, final ProcessSession 
session, final List<FlowFile> flowFiles,  KuduClientService clientService) 
throws ProcessException {
 
 Review comment:
   Can the clientService be a class variable so it doesn't need to be passed? 
Similar to the `kuduClient` before clientService was added.

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


With regards,
Apache Git Services

Reply via email to