Package backtype.storm.generated.Nimbus

Examples of backtype.storm.generated.Nimbus.Client


  private static long startTime;

  // both local and clustered execution

  private static void clusterKillTopology(Map conf, String topologyName) {
    final Client client = getNimbusStub(conf);
    try {
      client.killTopology(topologyName);
      // //Killing a topology right after all the processing is completed
      // KillOptions options = new KillOptions();
      // options.set_wait_secs(0);
      // client.killTopologyWithOpts(topologyName, options);
    } catch (final NotAliveException ex) {
View Full Code Here


        nimbus = new NimbusClient(securityMap, nimbusHost, nimbusThriftPort);
      } catch (TTransportException e) {
        LOG.info(MyUtilities.getStackTrace(e));
        System.exit(1);
      }
      final Client client = nimbus.getClient();
      return client;
    } else
      throw new RuntimeException("Call getNimbusStub only in cluster mode.");
  }
View Full Code Here

    }
  }

  // if we are in local mode, we cannot obtain these information
  public static void writeStormStats(Map conf) {
    final Client client = getNimbusStub(conf);
    final StringBuilder sb = new StringBuilder("");

    try {
      final ClusterSummary clusterInfo = client.getClusterInfo();
      final int numOfTopologies = clusterInfo.get_topologies_size();
      sb.append("In total there is ").append(numOfTopologies).append(" topologies.\n");

      final Iterator<TopologySummary> topologyIter = clusterInfo.get_topologies_iterator();
      while (topologyIter.hasNext()) {
        final TopologySummary topologySummary = topologyIter.next();

        // print out basic information about topologies
        final String topologyName = topologySummary.get_name();
        sb.append("For topology ").append(topologyName).append(":\n");
        final int numTasks = topologySummary.get_num_tasks();
        sb.append(numTasks).append(" tasks, ");
        final int numWorkers = topologySummary.get_num_workers();
        sb.append(numWorkers).append(" workers, ");
        final int uptimeSecs = topologySummary.get_uptime_secs();
        sb.append(uptimeSecs).append(" uptime seconds.\n");

        final String topologyID = topologySummary.get_id();
        final String topologyConf = client.getTopologyConf(topologyID);
        sb.append("Topology configuration is \n");
        sb.append(topologyConf);
        sb.append("\n");

        final TopologyInfo topologyInfo = client.getTopologyInfo(topologyID);

        // print more about each task
        final Iterator<ExecutorSummary> execIter = topologyInfo.get_executors_iterator();
        boolean globalFailed = false;
        while (execIter.hasNext()) {
View Full Code Here

    nimbus = new NimbusClient(conf, NIMBUS_HOST, NIMBUS_THRIFT_PORT);
  } catch (TTransportException e) {
    e.printStackTrace();
    System.exit(1);
  }
        Client client=nimbus.getClient();
        return client;
    }
View Full Code Here

        }
        return topologySummary;
    }   

    public static String writeTopologyInfo(){
        Client client=getNimbusStub();
        StringBuilder sb=new StringBuilder("");

        try {
            ClusterSummary clusterInfo = client.getClusterInfo();
            int numOfTopologies = clusterInfo.get_topologies_size();
            sb.append("In total there is ").append(numOfTopologies).append(" topologies.\n");

            Iterator<TopologySummary> topologyIter = clusterInfo.get_topologies_iterator();
            while(topologyIter.hasNext()){
                TopologySummary topologySummary= topologyIter.next();

                //print out basic information about topologies
                String topologyName = topologySummary.get_name();
                sb.append("For topology ").append(topologyName).append(":\n");
                int numTasks = topologySummary.get_num_tasks();
                sb.append(numTasks).append(" tasks, ");
                int numWorkers = topologySummary.get_num_workers();
                sb.append(numWorkers).append(" workers, ");
                int uptimeSecs = topologySummary.get_uptime_secs();
                sb.append(uptimeSecs).append(" uptime seconds.\n");

                String topologyID = topologySummary.get_id();
                String topologyConf = client.getTopologyConf(topologyID);
                sb.append("Topology configuration is \n");
                sb.append(topologyConf);
                sb.append("\n");

                TopologyInfo topologyInfo = client.getTopologyInfo(topologyID);

                //print more about each task
                Iterator<ExecutorSummary> execIter = topologyInfo.get_executors_iterator();
                boolean globalFailed = false;
                while(execIter.hasNext()){
View Full Code Here

          System.out.println("KILLED");
        }
    }
    
    private static int topDone(String topName){
        Client client=getNimbusStub();
        try {
            ClusterSummary clusterInfo = client.getClusterInfo();
            Iterator<TopologySummary> topologyIter = clusterInfo.get_topologies_iterator();
            while(topologyIter.hasNext()){
                TopologySummary topologySummary= topologyIter.next();
                String topologyName = topologySummary.get_name();
                if (topologyName.equals(topName)){
View Full Code Here

    nimbus = new NimbusClient(conf, NIMBUS_HOST, NIMBUS_THRIFT_PORT);
  } catch (TTransportException e) {
    e.printStackTrace();
    System.exit(1);
  }
        Client client=nimbus.getClient();
        return client;
    }
View Full Code Here

  public static List nimbusClientandConn(String host, Integer port)
      throws TTransportException {
    TSocket ts = new TSocket(host, port);
    TFramedTransport tt = new TFramedTransport(ts);
    TBinaryProtocol prot = new TBinaryProtocol(tt);
    Client nc = new Client(prot);
    ts.open();
    List l = new ArrayList();
    l.add(nc);
    l.add(tt);
    return l;
View Full Code Here

TOP

Related Classes of backtype.storm.generated.Nimbus.Client

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.