Java 类com.facebook.thrift.protocol.TBinaryProtocol 实例源码

项目:hadoop-2.6.0-cdh5.4.3    文件:HadoopThriftServer.java   
/**
 * Constrcts a server object
 */
public HadoopThriftServer(String [] args) {

  if (args.length > 0) {
    serverPort = new Integer(args[0]);
  }
  try {
    ServerSocket ssock = createServerSocket(serverPort);
    TServerTransport serverTransport = new TServerSocket(ssock);
    Iface handler = new HadoopThriftHandler("hdfs-thrift-dhruba");
    ThriftHadoopFileSystem.Processor processor = new ThriftHadoopFileSystem.Processor(handler);
    TThreadPoolServer.Options options = new TThreadPoolServer.Options();
    options.minWorkerThreads = 10;
    server = new TThreadPoolServer(processor, serverTransport,
                                           new TTransportFactory(),
                                           new TTransportFactory(),
                                           new TBinaryProtocol.Factory(),
                                           new TBinaryProtocol.Factory(), 
                                           options);
    System.out.println("Starting the hadoop thrift server on port [" + serverPort + "]...");
    HadoopThriftHandler.LOG.info("Starting the hadoop thrift server on port [" +serverPort + "]...");
    System.out.flush();

  } catch (Exception x) {
    x.printStackTrace();
  }
}
项目:hadoop-on-lustre    文件:HadoopThriftServer.java   
/**
 * Constrcts a server object
 */
public HadoopThriftServer(String [] args) {

  if (args.length > 0) {
    serverPort = new Integer(args[0]);
  }
  try {
    ServerSocket ssock = createServerSocket(serverPort);
    TServerTransport serverTransport = new TServerSocket(ssock);
    Iface handler = new HadoopThriftHandler("hdfs-thrift-dhruba");
    ThriftHadoopFileSystem.Processor processor = new ThriftHadoopFileSystem.Processor(handler);
    TThreadPoolServer.Options options = new TThreadPoolServer.Options();
    options.minWorkerThreads = 10;
    server = new TThreadPoolServer(processor, serverTransport,
                                           new TTransportFactory(),
                                           new TTransportFactory(),
                                           new TBinaryProtocol.Factory(),
                                           new TBinaryProtocol.Factory(), 
                                           options);
    System.out.println("Starting the hadoop thrift server on port [" + serverPort + "]...");
    HadoopThriftHandler.LOG.info("Starting the hadoop thrift server on port [" +serverPort + "]...");
    System.out.flush();

  } catch (Exception x) {
    x.printStackTrace();
  }
}
项目:hadoop-0.20    文件:HadoopThriftServer.java   
/**
 * Constrcts a server object
 */
public HadoopThriftServer(String [] args) {

  if (args.length > 0) {
    serverPort = new Integer(args[0]);
  }
  try {
    ServerSocket ssock = createServerSocket(serverPort);
    TServerTransport serverTransport = new TServerSocket(ssock);
    Iface handler = new HadoopThriftHandler("hdfs-thrift-dhruba");
    ThriftHadoopFileSystem.Processor processor = new ThriftHadoopFileSystem.Processor(handler);
    TThreadPoolServer.Options options = new TThreadPoolServer.Options();
    options.minWorkerThreads = 10;
    server = new TThreadPoolServer(processor, serverTransport,
                                           new TTransportFactory(),
                                           new TTransportFactory(),
                                           new TBinaryProtocol.Factory(),
                                           new TBinaryProtocol.Factory(), 
                                           options);
    System.out.println("Starting the hadoop thrift server on port [" + serverPort + "]...");
    HadoopThriftHandler.LOG.info("Starting the hadoop thrift server on port [" +serverPort + "]...");
    System.out.flush();

  } catch (Exception x) {
    x.printStackTrace();
  }
}
项目:hanoi-hadoop-2.0.0-cdh    文件:HadoopThriftServer.java   
/**
 * Constrcts a server object
 */
public HadoopThriftServer(String [] args) {

  if (args.length > 0) {
    serverPort = new Integer(args[0]);
  }
  try {
    ServerSocket ssock = createServerSocket(serverPort);
    TServerTransport serverTransport = new TServerSocket(ssock);
    Iface handler = new HadoopThriftHandler("hdfs-thrift-dhruba");
    ThriftHadoopFileSystem.Processor processor = new ThriftHadoopFileSystem.Processor(handler);
    TThreadPoolServer.Options options = new TThreadPoolServer.Options();
    options.minWorkerThreads = 10;
    server = new TThreadPoolServer(processor, serverTransport,
                                           new TTransportFactory(),
                                           new TTransportFactory(),
                                           new TBinaryProtocol.Factory(),
                                           new TBinaryProtocol.Factory(), 
                                           options);
    System.out.println("Starting the hadoop thrift server on port [" + serverPort + "]...");
    HadoopThriftHandler.LOG.info("Starting the hadoop thrift server on port [" +serverPort + "]...");
    System.out.flush();

  } catch (Exception x) {
    x.printStackTrace();
  }
}
项目:buck    文件:ReconnectingEdenClient.java   
/** @param socketFile to connect to when creating a Thrift client. */
ReconnectingEdenClient(final Path socketFile, Clock clock) {
  this(
      () -> {
        // Creates a new EdenService.Client by creating a new connection via the socketFile.
        UnixDomainSocket socket = UnixDomainSocket.createSocketWithPath(socketFile);
        TTransport transport = new TSocket(socket);
        // No need to invoke transport.open() because the UnixDomainSocket is already connected.
        TProtocol protocol = new TBinaryProtocol(transport);
        return new EdenService.Client(protocol);
      },
      clock);
}
项目:hortonworks-extension    文件:HadoopThriftServer.java   
/**
 * Constrcts a server object
 */
public HadoopThriftServer(String [] args) {

  if (args.length > 0) {
    serverPort = new Integer(args[0]);
  }
  try {
    ServerSocket ssock = createServerSocket(serverPort);
    TServerTransport serverTransport = new TServerSocket(ssock);
    Iface handler = new HadoopThriftHandler("hdfs-thrift-dhruba");
    ThriftHadoopFileSystem.Processor processor = new ThriftHadoopFileSystem.Processor(handler);
    TThreadPoolServer.Options options = new TThreadPoolServer.Options();
    options.minWorkerThreads = 10;
    server = new TThreadPoolServer(processor, serverTransport,
                                           new TTransportFactory(),
                                           new TTransportFactory(),
                                           new TBinaryProtocol.Factory(),
                                           new TBinaryProtocol.Factory(), 
                                           options);
    System.out.println("Starting the hadoop thrift server on port [" + serverPort + "]...");
    HadoopThriftHandler.LOG.info("Starting the hadoop thrift server on port [" +serverPort + "]...");
    System.out.flush();

  } catch (Exception x) {
    x.printStackTrace();
  }
}
项目:hortonworks-extension    文件:HadoopThriftServer.java   
/**
 * Constrcts a server object
 */
public HadoopThriftServer(String [] args) {

  if (args.length > 0) {
    serverPort = new Integer(args[0]);
  }
  try {
    ServerSocket ssock = createServerSocket(serverPort);
    TServerTransport serverTransport = new TServerSocket(ssock);
    Iface handler = new HadoopThriftHandler("hdfs-thrift-dhruba");
    ThriftHadoopFileSystem.Processor processor = new ThriftHadoopFileSystem.Processor(handler);
    TThreadPoolServer.Options options = new TThreadPoolServer.Options();
    options.minWorkerThreads = 10;
    server = new TThreadPoolServer(processor, serverTransport,
                                           new TTransportFactory(),
                                           new TTransportFactory(),
                                           new TBinaryProtocol.Factory(),
                                           new TBinaryProtocol.Factory(), 
                                           options);
    System.out.println("Starting the hadoop thrift server on port [" + serverPort + "]...");
    HadoopThriftHandler.LOG.info("Starting the hadoop thrift server on port [" +serverPort + "]...");
    System.out.flush();

  } catch (Exception x) {
    x.printStackTrace();
  }
}
项目:hadoop-gpu    文件:HadoopThriftServer.java   
/**
 * Constrcts a server object
 */
public HadoopThriftServer(String [] args) {

  if (args.length > 0) {
    serverPort = new Integer(args[0]);
  }
  try {
    ServerSocket ssock = createServerSocket(serverPort);
    TServerTransport serverTransport = new TServerSocket(ssock);
    Iface handler = new HadoopThriftHandler("hdfs-thrift-dhruba");
    ThriftHadoopFileSystem.Processor processor = new ThriftHadoopFileSystem.Processor(handler);
    TThreadPoolServer.Options options = new TThreadPoolServer.Options();
    options.minWorkerThreads = 10;
    server = new TThreadPoolServer(processor, serverTransport,
                                           new TTransportFactory(),
                                           new TTransportFactory(),
                                           new TBinaryProtocol.Factory(),
                                           new TBinaryProtocol.Factory(), 
                                           options);
    System.out.println("Starting the hadoop thrift server on port [" + serverPort + "]...");
    HadoopThriftHandler.LOG.info("Starting the hadoop thrift server on port [" +serverPort + "]...");
    System.out.flush();

  } catch (Exception x) {
    x.printStackTrace();
  }
}