public static BlobStore getNimbusBlobStore(Map<String, Object> conf, NimbusInfo nimbusInfo, ILeaderElector leaderElector) { return getNimbusBlobStore(conf, null, nimbusInfo, leaderElector); }
public static ClientBlobStore getClientBlobStoreForSupervisor(Map<String, Object> conf) { ClientBlobStore store; if (ConfigUtils.isLocalMode(conf)) { store = new LocalModeClientBlobStore(getNimbusBlobStore(conf, null, null)); } else { store = (ClientBlobStore) ReflectionUtils.newInstance( (String) conf.get(DaemonConfig.SUPERVISOR_BLOBSTORE)); } store.prepare(conf); return store; }
@Override public void run(String[] args, Map<String, Object> conf, String command) throws Exception { for (String arg: args) { System.out.println(arg + ":"); StormTopology topo; File f = new File(arg); if (f.exists()) { topo = Utils.deserialize(FileUtils.readFileToByteArray(f), StormTopology.class); } else { //assume it is a topology id final String key = ConfigUtils.masterStormCodeKey(arg); try (BlobStore store = ServerUtils.getNimbusBlobStore(conf, NimbusInfo.fromConf(conf), null)) { topo = Utils.deserialize(store.readBlob(key, Nimbus.NIMBUS_SUBJECT), StormTopology.class); } } System.out.println(prettyPrint(topo)); } }
@Override public void run(String[] args, Map<String, Object> conf, String command) throws Exception { try (BlobStore nimbusBlobStore = ServerUtils.getNimbusBlobStore(conf, NimbusInfo.fromConf(conf), null)) { IStormClusterState stormClusterState = ClusterUtils.mkStormClusterState(conf, new ClusterStateContext(DaemonType.NIMBUS, conf)); Set<String> blobStoreTopologyIds = nimbusBlobStore.filterAndListKeys(key -> ConfigUtils.getIdFromBlobKey(key)); Set<String> activeTopologyIds = new HashSet<>(stormClusterState.activeStorms()); Sets.SetView<String> diffTopology = Sets.difference(activeTopologyIds, blobStoreTopologyIds); LOG.info("active-topology-ids [{}] blob-topology-ids [{}] diff-topology [{}]", activeTopologyIds, blobStoreTopologyIds, diffTopology); for (String corruptId : diffTopology) { stormClusterState.removeStorm(corruptId); } } }
BlobStore bs = ServerUtils.getNimbusBlobStore(conf, NimbusInfo.fromConf(conf), null); try { Subject nimbusSubject = new Subject();
blobStore = ServerUtils.getNimbusBlobStore(conf, this.nimbusHostPortInfo, null);