@Override public void run(String[] args, Map<String, Object> conf, String command) throws Exception { // We are pretending to be nimbus here. IStormClusterState state = ClusterUtils.mkStormClusterState(conf, new ClusterStateContext(DaemonType.NIMBUS, conf)); for (String topologyId: args) { System.out.println(topologyId + ":"); Credentials creds = state.credentials(topologyId, null); if (creds != null) { for (String key : creds.get_creds().keySet()) { System.out.println("\t" + key); } } } }
public void checkCredentialsChanged() { Credentials newCreds = workerState.stormClusterState.credentials(topologyId, null); if (!ObjectUtils.equals(newCreds, credentialsAtom.get())) { // This does not have to be atomic, worst case we update when one is not needed ClientAuthUtils.updateSubject(subject, autoCreds, (null == newCreds) ? null : newCreds.get_creds()); for (IRunningExecutor executor : executorsAtom.get()) { executor.credentialsChanged(newCreds); } credentialsAtom.set(newCreds); } }
Map<String, Object> topoConf = Collections.unmodifiableMap(Utils.merge(conf, tryReadTopoConf(id, topoCache))); synchronized (credUpdateLock) { Credentials origCreds = state.credentials(id, null); if (origCreds != null) { Map<String, String> origCredsMap = origCreds.get_creds();
Credentials origCreds = state.credentials(topoId, null); if (origCreds != null) { Map<String, String> mergedCreds = origCreds.get_creds();
workerState.stormClusterState.credentials(topologyId, Worker.this::checkCredentialsChanged);
Credentials initialCredentials = stormClusterState.credentials(topologyId, null); Map<String, String> initCreds = new HashMap<>(); if (initialCredentials != null) {