congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
ClusterUtils.mkStormClusterState
Code IndexAdd Tabnine to your IDE (free)

How to use
mkStormClusterState
method
in
org.apache.storm.cluster.ClusterUtils

Best Java code snippets using org.apache.storm.cluster.ClusterUtils.mkStormClusterState (Showing top 12 results out of 315)

origin: apache/storm

private static IStormClusterState makeStormClusterState(Map<String, Object> conf) throws Exception {
  return ClusterUtils.mkStormClusterState(conf, new ClusterStateContext(DaemonType.NIMBUS, conf));
}
origin: apache/storm

private static IStormClusterState buildStateIfNeeded(Map<String, Object> conf, ThriftConnectionType connectionType) {
  IStormClusterState state = null;
  if (ClientAuthUtils.areWorkerTokensEnabledServer(connectionType, conf)) {
    try {
      state = ClusterUtils.mkStormClusterState(conf, new ClusterStateContext(DaemonType.UNKNOWN, conf));
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
  return state;
}
origin: apache/storm

@Override
public void run(String[] args, Map<String, Object> conf, String command) throws Exception {
  IStormClusterState stormClusterState = ClusterUtils.mkStormClusterState(conf, new ClusterStateContext(DaemonType.NIMBUS, conf));
  Map<String, SupervisorInfo> infos = stormClusterState.allSupervisorInfo();
  if (args.length <= 0) {
    for (Map.Entry<String, SupervisorInfo> entry: infos.entrySet()) {
      System.out.println(entry.getKey() + ":");
      System.out.println(prettyPrint(entry.getValue()));
    }
  } else {
    for (String arg : args) {
      System.out.println(arg + ":");
      System.out.println(prettyPrint(infos.get(arg)));
    }
  }
}
origin: apache/storm

@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);
      }
    }
  }
}
origin: apache/storm

@Override
public void run(String[] args, Map<String, Object> conf, String command) throws Exception {
  IStormClusterState stormClusterState = ClusterUtils.mkStormClusterState(conf, new ClusterStateContext(DaemonType.NIMBUS, conf));
  stormClusterState.syncRemoteAssignments(null);
  stormClusterState.syncRemoteIds(null);
  stormClusterState.setAssignmentsBackendSynchronized();
  Map<String, Assignment> infos = stormClusterState.assignmentsInfo();
  if (args.length <= 0) {
    for (Map.Entry<String, Assignment> entry: infos.entrySet()) {
      System.out.println(entry.getKey() + ":");
      System.out.println(prettyPrint(entry.getValue()));
    }
  } else {
    for (String arg : args) {
      System.out.println(arg + ":");
      System.out.println(prettyPrint(infos.get(arg)));
    }
  }
}
origin: apache/storm

@Override
public void prepare(Map<String, Object> conf, String overrideBase, NimbusInfo nimbusInfo, ILeaderElector leaderElector) {
  this.conf = conf;
  this.nimbusInfo = nimbusInfo;
  zkClient = BlobStoreUtils.createZKClient(conf, DaemonType.NIMBUS);
  if (overrideBase == null) {
    overrideBase = ConfigUtils.absoluteStormBlobStoreDir(conf);
  }
  File baseDir = new File(overrideBase, BASE_BLOBS_DIR_NAME);
  try {
    fbs = new FileBlobStoreImpl(baseDir, conf);
  } catch (IOException e) {
    throw new RuntimeException(e);
  }
  _aclHandler = new BlobStoreAclHandler(conf);
  try {
    this.stormClusterState = ClusterUtils.mkStormClusterState(conf, new ClusterStateContext(DaemonType.NIMBUS, conf));
  } catch (Exception e) {
    e.printStackTrace();
  }
  timer = new Timer("BLOB-STORE-TIMER", true);
  this.leaderElector = leaderElector;
}
origin: apache/storm

@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);
    }
  }
}
origin: apache/storm

  this.stormClusterState = ClusterUtils.mkStormClusterState(workerData.getStateStorage(),
                               new ClusterStateContext(DaemonType.WORKER, topoConf));
} catch (Exception e) {
origin: apache/storm

ClusterStateContext csContext = new ClusterStateContext(DaemonType.WORKER, topologyConf);
IStateStorage stateStorage = ClusterUtils.mkStateStorage(conf, topologyConf, csContext);
IStormClusterState stormClusterState = ClusterUtils.mkStormClusterState(stateStorage, null, csContext);
origin: apache/storm

  this.stormClusterState = ClusterUtils.mkStormClusterState(conf,
                               new ClusterStateContext(DaemonType.SUPERVISOR, conf));
} catch (Exception e) {
origin: apache/storm

  ClusterUtils.mkStormClusterState(conf, new ClusterStateContext(DaemonType.NIMBUS, conf));
WorkerTokenManager wtMan = new WorkerTokenManager(conf, state);
Subject bob = testConnectWithTokenFor(wtMan, conf, server, "bob", "topo-bob");
origin: org.apache.storm/storm-core

  this.stormClusterState = ClusterUtils.mkStormClusterState(conf, acls, new ClusterStateContext(DaemonType.SUPERVISOR));
} catch (Exception e) {
  LOG.error("supervisor can't create stormClusterState");
org.apache.storm.clusterClusterUtilsmkStormClusterState

Popular methods of ClusterUtils

  • errorStormRoot
  • assignmentPath
  • backpressurePath
  • backpressureStormRoot
  • blobstoreMaxKeySequenceNumberPath
  • blobstorePath
  • convertExecutorBeats
    Ensures that we only return heartbeats for executors assigned to this worker
  • credentialsPath
  • errorPath
  • lastErrorPath
  • logConfigPath
  • maybeDeserialize
  • logConfigPath,
  • maybeDeserialize,
  • mkStateStorage,
  • mkStateStorageImpl,
  • mkStormClusterStateImpl,
  • mkTopoAcls,
  • mkTopoReadOnlyAcls,
  • mkTopoReadWriteAcls,
  • nimbusPath

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getContentResolver (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setScale (BigDecimal)
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • BoxLayout (javax.swing)
  • JOptionPane (javax.swing)
  • JPanel (javax.swing)
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now