mirror of https://github.com/apache/nifi.git
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:
parent
98ec2563e9
commit
d79b390836
|
@ -246,7 +246,19 @@ public class KuduLookupService extends AbstractControllerService implements Reco
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<Record> lookup(Map<String, Object> coordinates) {
|
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
|
//Scanner
|
||||||
KuduScanner.KuduScannerBuilder builder = kuduClient.newScannerBuilder(table);
|
KuduScanner.KuduScannerBuilder builder = kuduClient.newScannerBuilder(table);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue