This is an automated email from the ASF dual-hosted git repository.
turcsanyi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/main by this push:
new d79b390836 NIFI-10056 Wrap table scan in a kerberos action in
KuduLookupService so that expired TGTs are renewed automatically.
d79b390836 is described below
commit d79b3908360265eb0d50a5ce298a00c3054cdf82
Author: Tamas Palfy <[email protected]>
AuthorDate: Wed May 25 18:40:27 2022 +0200
NIFI-10056 Wrap table scan in a kerberos action in KuduLookupService so
that expired TGTs are renewed automatically.
This closes #10056.
Signed-off-by: Peter Turcsanyi <[email protected]>
---
.../org/apache/nifi/controller/kudu/KuduLookupService.java | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git
a/nifi-nar-bundles/nifi-kudu-bundle/nifi-kudu-controller-service/src/main/java/org/apache/nifi/controller/kudu/KuduLookupService.java
b/nifi-nar-bundles/nifi-kudu-bundle/nifi-kudu-controller-service/src/main/java/org/apache/nifi/controller/kudu/KuduLookupService.java
index 93b0ce61aa..5656fdb9e5 100644
---
a/nifi-nar-bundles/nifi-kudu-bundle/nifi-kudu-controller-service/src/main/java/org/apache/nifi/controller/kudu/KuduLookupService.java
+++
b/nifi-nar-bundles/nifi-kudu-bundle/nifi-kudu-controller-service/src/main/java/org/apache/nifi/controller/kudu/KuduLookupService.java
@@ -246,7 +246,19 @@ public class KuduLookupService extends
AbstractControllerService implements Reco
@Override
public Optional<Record> lookup(Map<String, Object> coordinates) {
+ Optional<Record> record;
+ if (kerberosUser != null) {
+ final KerberosAction<Optional<Record>> kerberosAction = new
KerberosAction<>(kerberosUser, () -> getRecord(coordinates), getLogger());
+ record = kerberosAction.execute();
+ } else {
+ record = getRecord(coordinates);
+ }
+
+ return record;
+ }
+
+ private Optional<Record> getRecord(Map<String, Object> coordinates) {
//Scanner
KuduScanner.KuduScannerBuilder builder =
kuduClient.newScannerBuilder(table);