use of com.continuuity.weave.api.SecureStore in project weave by continuuity.
the class YarnWeaveRunnerService method updateSecureStores.
private void updateSecureStores(Table<String, RunId, SecureStore> secureStores) {
for (Table.Cell<String, RunId, SecureStore> cell : secureStores.cellSet()) {
Object store = cell.getValue().getStore();
if (!(store instanceof Credentials)) {
LOG.warn("Only Hadoop Credentials is supported. Ignore update for {}.", cell);
continue;
}
Credentials credentials = (Credentials) store;
if (credentials.getAllTokens().isEmpty()) {
// Nothing to update.
continue;
}
try {
updateCredentials(cell.getRowKey(), cell.getColumnKey(), credentials);
synchronized (YarnWeaveRunnerService.this) {
// Notify the application for secure store updates if it is still running.
YarnWeaveController controller = controllers.get(cell.getRowKey(), cell.getColumnKey());
if (controller != null) {
controller.secureStoreUpdated();
}
}
} catch (Throwable t) {
LOG.warn("Failed to update secure store for {}.", cell, t);
}
}
}
Aggregations