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 <turcsanyi@apache.org>
This commit is contained in:
Tamas Palfy 2022-05-25 18:40:27 +02:00 committed by Peter Turcsanyi
parent 98ec2563e9
commit d79b390836
No known key found for this signature in database
GPG Key ID: 55A813F1C3E553DC
1 changed files with 12 additions and 0 deletions

View File

@ -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);