Package org.apache.thrift7

Examples of org.apache.thrift7.TSerializer


    StormTopology topology = null;
    try {
      StormTopology stormtopology = StormConfig
          .read_nimbus_topology_code(conf, id);
      if (stormtopology == null) {
        throw new TException("topology:" + id + "is null");
      }

      Map<Object, Object> topologyConf = (Map<Object, Object>) StormConfig
          .read_nimbus_topology_conf(conf, id);

      topology = Common.system_topology(topologyConf, stormtopology);
    } catch (Exception e) {
      LOG.error("Failed to get topology " + id + ",", e);
      throw new TException("Failed to get system_topology");
    }
    return topology;
  }
View Full Code Here


          throw new NotAliveException("Failed to update metricsMonitor status as " + topologyName + " is not alive");
        }
    } catch(Exception e) {
      String errMsg = "Failed to update metricsMonitor " + topologyName;
      LOG.error(errMsg, e);
      throw new TException(e);
    }
   
  }
View Full Code Here

        }
       
    } catch(Exception e) {
      String errMsg = "Failed to get topology Metric Data " + topologyId;
      LOG.error(errMsg, e);
      throw new TException(e);
    }
   
    return topologyMetricInfo;
  }
View Full Code Here

    private static ThreadLocal<TSerializer> threadSer = new ThreadLocal<TSerializer>();
    private static ThreadLocal<TDeserializer> threadDes = new ThreadLocal<TDeserializer>();
   
    public static byte[] thriftSerialize(TBase t) {
        try {
            TSerializer ser = threadSer.get();
            if (ser == null) {
                ser = new TSerializer();
                threadSer.set(ser);
            }
            return ser.serialize(t);
        } catch (TException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

        try {
            if(host==null) {
                throw new IllegalArgumentException("Nimbus host is not set");
            }
            conn = new TFramedTransport(new TSocket(host, port));
            client = new Nimbus.Client(new TBinaryProtocol(conn));
            conn.open();
        } catch(TException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

        }
    }
   
    private void connect() throws TException {
        conn = new TFramedTransport(new TSocket(host, port));
        client = new DistributedRPC.Client(new TBinaryProtocol(conn));
        conn.open();
    }
View Full Code Here

 
  Map conf=StormConfig.read_storm_config();
  String host=String.valueOf(conf.get(Config.NIMBUS_HOST));
  Integer port=StormUtils.parseInt(conf.get(Config.NIMBUS_THRIFT_PORT));
  TFramedTransport transport=new TFramedTransport(new TSocket(host, port));
  TBinaryProtocol prot=new TBinaryProtocol(transport);
  Nimbus.Client client=new Nimbus.Client(prot);
  transport.open();
  try{
      client.killTopologyWithOpts(name,ops);
  }finally{
View Full Code Here

 
  Map conf=StormConfig.read_storm_config();
  String host=String.valueOf(conf.get(Config.NIMBUS_HOST));
  Integer port=StormUtils.parseInt(conf.get(Config.NIMBUS_THRIFT_PORT));
  TFramedTransport transport=new TFramedTransport(new TSocket(host, port));
  TBinaryProtocol prot=new TBinaryProtocol(transport);
  Nimbus.Client client=new Nimbus.Client(prot);
  transport.open();
  try{
      if(args[0].equals("cluster"))
      {
View Full Code Here

        }
    }
   
    private void connect() throws TException {
        conn = new TFramedTransport(new TSocket(host, port));
        client = new DistributedRPCInvocations.Client(new TBinaryProtocol(conn));
        conn.open();
    }
View Full Code Here

    * Constructor.
    */
  public ThriftReader(InputStream stream, TBaseCreator creator) {
    this.inputStream = stream;
    this.creator = creator;
    binaryIn = new TBinaryProtocol(new TIOStreamTransport(inputStream));
  }
View Full Code Here

TOP

Related Classes of org.apache.thrift7.TSerializer

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.