Java 类com.facebook.thrift.transport.TServerSocket 实例源码

项目: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();
  }
}
项目: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();
  }
}