Java 类org.apache.thrift7.transport.TTransportException 实例源码

项目:jstorm-0.9.6.3-    文件:NimbusServer.java   
private void initThrift(Map conf) throws TTransportException {
    Integer thrift_port = JStormUtils.parseInt(conf
            .get(Config.NIMBUS_THRIFT_PORT));
    TNonblockingServerSocket socket = new TNonblockingServerSocket(
            thrift_port);

    Integer maxReadBufSize = JStormUtils.parseInt(conf
            .get(Config.NIMBUS_THRIFT_MAX_BUFFER_SIZE));

    THsHaServer.Args args = new THsHaServer.Args(socket);
    args.workerThreads(ServiceHandler.THREAD_NUM);
    args.protocolFactory(new TBinaryProtocol.Factory(false, true,
            maxReadBufSize));

    args.processor(new Nimbus.Processor<Iface>(serviceHandler));
    args.maxReadBufferBytes = maxReadBufSize;

    thriftServer = new THsHaServer(args);

    LOG.info("Successfully started nimbus: started Thrift server...");
    thriftServer.serve();
}
项目:jstorm-0.9.6.3-    文件:SaslTransportPlugin.java   
@Override
public TServer getServer(int port, TProcessor processor)
        throws IOException, TTransportException {
    TTransportFactory serverTransportFactory = getServerTransportFactory();

    // define THsHaServer args
    // original: THsHaServer + TNonblockingServerSocket
    // option: TThreadPoolServer + TServerSocket
    TServerSocket serverTransport = new TServerSocket(port);
    TThreadPoolServer.Args server_args = new TThreadPoolServer.Args(
            serverTransport).processor(new TUGIWrapProcessor(processor))
            .minWorkerThreads(64).maxWorkerThreads(64)
            .protocolFactory(new TBinaryProtocol.Factory());
    if (serverTransportFactory != null)
        server_args.transportFactory(serverTransportFactory);

    // construct THsHaServer
    return new TThreadPoolServer(server_args);
}
项目:jstorm-0.9.6.3-    文件:MasterClient.java   
public static MasterClient getConfiguredClient(Map conf) throws Exception {

        try {
            String masterHost = (String) conf.get(Config.MASTER_HOST);
//            String zookeeper = conf.get(Config.)
            LOG.info("masterHost is:" + masterHost);

            int masterPort = Utils.getInt(conf.get(Config.MASTER_THRIFT_PORT));
            LOG.info("masterPort is" + masterPort);
            System.out.println("masterPort is" + masterPort);
            try {
                Integer timeout = Utils.getInt(conf.get(Config.MASTER_TIMEOUT_SECS));
                return new MasterClient(conf, masterHost, masterPort, timeout);
            } catch (IllegalArgumentException e) {
                return new MasterClient(conf, masterHost, masterPort, null);
            }

        } catch (TTransportException ex) {
            throw new RuntimeException(ex);
        }
    }
项目:learn_jstorm    文件:NimbusServer.java   
@SuppressWarnings("rawtypes")
private void initThrift(Map conf) throws TTransportException {
    Integer thrift_port = JStormUtils.parseInt(conf.get(Config.NIMBUS_THRIFT_PORT));
    TNonblockingServerSocket socket = new TNonblockingServerSocket(thrift_port);

    Integer maxReadBufSize = JStormUtils.parseInt(conf.get(Config.NIMBUS_THRIFT_MAX_BUFFER_SIZE));

    THsHaServer.Args args = new THsHaServer.Args(socket);
    args.workerThreads(ServiceHandler.THREAD_NUM);
    args.protocolFactory(new TBinaryProtocol.Factory(false, true, maxReadBufSize));

    args.processor(new Nimbus.Processor<Iface>(serviceHandler));
    args.maxReadBufferBytes = maxReadBufSize;

    thriftServer = new THsHaServer(args);

    LOG.info("Successfully started nimbus: started Thrift server...");
    thriftServer.serve();
}
项目:learn_jstorm    文件:SaslTransportPlugin.java   
public TServer getServer(int port, TProcessor processor)
        throws IOException, TTransportException {
    TTransportFactory serverTransportFactory = getServerTransportFactory();

    // define THsHaServer args
    // original: THsHaServer + TNonblockingServerSocket
    // option: TThreadPoolServer + TServerSocket
    TServerSocket serverTransport = new TServerSocket(port);
    TThreadPoolServer.Args server_args = new TThreadPoolServer.Args(
            serverTransport).processor(new TUGIWrapProcessor(processor))
            .minWorkerThreads(64).maxWorkerThreads(64)
            .protocolFactory(new TBinaryProtocol.Factory());
    if (serverTransportFactory != null)
        server_args.transportFactory(serverTransportFactory);

    // construct THsHaServer
    return new TThreadPoolServer(server_args);
}
项目:learn_jstorm    文件:MasterClient.java   
public static MasterClient getConfiguredClient(Map conf) throws Exception {

        try {
            String masterHost = (String) conf.get(Config.MASTER_HOST);
//            String zookeeper = conf.get(Config.)
            LOG.info("masterHost is:" + masterHost);

            int masterPort = Utils.getInt(conf.get(Config.MASTER_THRIFT_PORT));
            LOG.info("masterPort is" + masterPort);
            System.out.println("masterPort is" + masterPort);
            try {
                Integer timeout = Utils.getInt(conf.get(Config.MASTER_TIMEOUT_SECS));
                return new MasterClient(conf, masterHost, masterPort, timeout);
            } catch (IllegalArgumentException e) {
                return new MasterClient(conf, masterHost, masterPort, null);
            }

        } catch (TTransportException ex) {
            throw new RuntimeException(ex);
        }
    }
项目:jstrom    文件:MasterClient.java   
public static MasterClient getConfiguredClient(Map conf) throws Exception {

        try {
            String masterHost = (String) conf.get(Config.MASTER_HOST);
//            String zookeeper = conf.get(Config.)
            LOG.info("masterHost is:" + masterHost);

            int masterPort = Utils.getInt(conf.get(Config.MASTER_THRIFT_PORT));
            LOG.info("masterPort is" + masterPort);
            System.out.println("masterPort is" + masterPort);
            try {
                Integer timeout = Utils.getInt(conf.get(Config.MASTER_TIMEOUT_SECS));
                return new MasterClient(conf, masterHost, masterPort, timeout);
            } catch (IllegalArgumentException e) {
                return new MasterClient(conf, masterHost, masterPort, null);
            }

        } catch (TTransportException ex) {
            throw new RuntimeException(ex);
        }
    }
项目:Tstream    文件:SaslTransportPlugin.java   
public TServer getServer(int port, TProcessor processor)
        throws IOException, TTransportException {
    TTransportFactory serverTransportFactory = getServerTransportFactory();

    // define THsHaServer args
    // original: THsHaServer + TNonblockingServerSocket
    // option: TThreadPoolServer + TServerSocket
    TServerSocket serverTransport = new TServerSocket(port);
    TThreadPoolServer.Args server_args = new TThreadPoolServer.Args(
            serverTransport).processor(new TUGIWrapProcessor(processor))
            .minWorkerThreads(64).maxWorkerThreads(64)
            .protocolFactory(new TBinaryProtocol.Factory());
    if (serverTransportFactory != null)
        server_args.transportFactory(serverTransportFactory);

    // construct THsHaServer
    return new TThreadPoolServer(server_args);
}
项目:Tstream    文件:NimbusServer.java   
@SuppressWarnings("rawtypes")
private void initThrift(Map conf) throws TTransportException {
    Integer thrift_port = JStormUtils.parseInt(conf
            .get(Config.NIMBUS_THRIFT_PORT));
    TNonblockingServerSocket socket = new TNonblockingServerSocket(
            thrift_port);

    Integer maxReadBufSize = JStormUtils.parseInt(conf
            .get(Config.NIMBUS_THRIFT_MAX_BUFFER_SIZE));

    THsHaServer.Args args = new THsHaServer.Args(socket);
    args.workerThreads(ServiceHandler.THREAD_NUM);
    args.protocolFactory(new TBinaryProtocol.Factory(false, true,
            maxReadBufSize));

    args.processor(new Nimbus.Processor<Iface>(serviceHandler));
    args.maxReadBufferBytes = maxReadBufSize;

    thriftServer = new THsHaServer(args);

    LOG.info("Successfully started nimbus: started Thrift server...");
    thriftServer.serve();
}
项目:storm-yarn    文件:MasterClient.java   
@SuppressWarnings("rawtypes")
public static MasterClient getConfiguredClient(Map conf) {
    try {
        String masterHost = (String) conf.get(Config.MASTER_HOST);
        int masterPort = Utils.getInt(conf.get(Config.MASTER_THRIFT_PORT));
        try {
            Integer timeout = Utils.getInt(conf.get(Config.MASTER_TIMEOUT_SECS));
            return new MasterClient(conf, masterHost, masterPort, timeout);
        } catch (IllegalArgumentException e) {
            return new MasterClient(conf, masterHost, masterPort, null);
        }

    } catch (TTransportException ex) {
        throw new RuntimeException(ex);
    }
}
项目:jstorm-0.9.6.3-    文件:UIUtils.java   
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;
}
项目:jstorm-0.9.6.3-    文件:DigestSaslTransportPlugin.java   
@Override
public TTransport connect(TTransport transport, String serverHost)
        throws TTransportException, IOException {
    ClientCallbackHandler client_callback_handler = new ClientCallbackHandler(
            login_conf);
    TSaslClientTransport wrapper_transport = new TSaslClientTransport(
            DIGEST, null, AuthUtils.SERVICE, serverHost, null,
            client_callback_handler, transport);

    wrapper_transport.open();
    LOG.debug("SASL DIGEST-MD5 client transport has been established");

    return wrapper_transport;
}
项目:jstorm-0.9.6.3-    文件:SimpleTransportPlugin.java   
/**
 * We will let Thrift to apply default transport factory
 */
@Override
public TServer getServer(int port, TProcessor processor)
        throws IOException, TTransportException {
    TNonblockingServerSocket serverTransport = new TNonblockingServerSocket(
            port);
    THsHaServer.Args server_args = new THsHaServer.Args(serverTransport)
            .processor(new SimpleWrapProcessor(processor))
            .workerThreads(64)
            .protocolFactory(new TBinaryProtocol.Factory());

    // construct THsHaServer
    return new THsHaServer(server_args);
}
项目:jstorm-0.9.6.3-    文件:SimpleTransportPlugin.java   
/**
 * Connect to the specified server via framed transport
 * 
 * @param transport
 *            The underlying Thrift transport.
 */
@Override
public TTransport connect(TTransport transport, String serverHost)
        throws TTransportException {
    // create a framed transport
    TTransport conn = new TFramedTransport(transport);

    // connect
    conn.open();
    LOG.debug("Simple client transport has been established");

    return conn;
}
项目:jstorm-0.9.6.3-    文件:SimpleTransportPlugin.java   
/**
 * We will let Thrift to apply default transport factory
 */
public TServer getServer(int port, TProcessor processor) throws IOException, TTransportException {
    TNonblockingServerSocket serverTransport = new TNonblockingServerSocket(port);
    THsHaServer.Args server_args = new THsHaServer.Args(serverTransport).
            processor(new SimpleWrapProcessor(processor)).
            workerThreads(64).
            protocolFactory(new TBinaryProtocol.Factory());            

    //construct THsHaServer
    return new THsHaServer(server_args);
}
项目:jstorm-0.9.6.3-    文件:SimpleTransportPlugin.java   
/**
 * Connect to the specified server via framed transport 
 * @param transport The underlying Thrift transport.
 */
public TTransport connect(TTransport transport, String serverHost) throws TTransportException {
    //create a framed transport
    TTransport conn = new TFramedTransport(transport);

    //connect
    conn.open();
    LOG.debug("Simple client transport has been established");

    return conn;
}
项目:learn_jstorm    文件:UIUtils.java   
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;
}
项目:learn_jstorm    文件:DigestSaslTransportPlugin.java   
public TTransport connect(TTransport transport, String serverHost)
        throws TTransportException, IOException {
    ClientCallbackHandler client_callback_handler = new ClientCallbackHandler(
            login_conf);
    TSaslClientTransport wrapper_transport = new TSaslClientTransport(
            DIGEST, null, AuthUtils.SERVICE, serverHost, null,
            client_callback_handler, transport);

    wrapper_transport.open();
    LOG.debug("SASL DIGEST-MD5 client transport has been established");

    return wrapper_transport;
}
项目:learn_jstorm    文件:SimpleTransportPlugin.java   
/**
 * We will let Thrift to apply default transport factory
 */
public TServer getServer(int port, TProcessor processor)
        throws IOException, TTransportException {
    TNonblockingServerSocket serverTransport = new TNonblockingServerSocket(
            port);
    THsHaServer.Args server_args = new THsHaServer.Args(serverTransport)
            .processor(new SimpleWrapProcessor(processor))
            .workerThreads(64)
            .protocolFactory(new TBinaryProtocol.Factory());

    // construct THsHaServer
    return new THsHaServer(server_args);
}
项目:learn_jstorm    文件:SimpleTransportPlugin.java   
/**
 * Connect to the specified server via framed transport
 * 
 * @param transport
 *            The underlying Thrift transport.
 */
public TTransport connect(TTransport transport, String serverHost)
        throws TTransportException {
    // create a framed transport
    TTransport conn = new TFramedTransport(transport);

    // connect
    conn.open();
    LOG.debug("Simple client transport has been established");

    return conn;
}
项目:learn_jstorm    文件:SimpleTransportPlugin.java   
/**
 * We will let Thrift to apply default transport factory
 */
public TServer getServer(int port, TProcessor processor) throws IOException, TTransportException {
    TNonblockingServerSocket serverTransport = new TNonblockingServerSocket(port);
    THsHaServer.Args server_args = new THsHaServer.Args(serverTransport).
            processor(new SimpleWrapProcessor(processor)).
            workerThreads(64).
            protocolFactory(new TBinaryProtocol.Factory());            

    //construct THsHaServer
    return new THsHaServer(server_args);
}
项目:learn_jstorm    文件:SimpleTransportPlugin.java   
/**
 * Connect to the specified server via framed transport 
 * @param transport The underlying Thrift transport.
 */
public TTransport connect(TTransport transport, String serverHost) throws TTransportException {
    //create a framed transport
    TTransport conn = new TFramedTransport(transport);

    //connect
    conn.open();
    LOG.debug("Simple client transport has been established");

    return conn;
}
项目:jstrom    文件:SimpleTransportPlugin.java   
/**
 * We will let Thrift to apply default transport factory
 */
public TServer getServer(int port, TProcessor processor) throws IOException, TTransportException {
    TNonblockingServerSocket serverTransport = new TNonblockingServerSocket(port);
    THsHaServer.Args server_args = new THsHaServer.Args(serverTransport).
            processor(new SimpleWrapProcessor(processor)).
            workerThreads(64).
            protocolFactory(new TBinaryProtocol.Factory());            

    //construct THsHaServer
    return new THsHaServer(server_args);
}
项目:jstrom    文件:SimpleTransportPlugin.java   
/**
 * Connect to the specified server via framed transport 
 * @param transport The underlying Thrift transport.
 */
public TTransport connect(TTransport transport, String serverHost) throws TTransportException {
    //create a framed transport
    TTransport conn = new TFramedTransport(transport);

    //connect
    conn.open();
    LOG.debug("Simple client transport has been established");

    return conn;
}
项目:Tstream    文件:DigestSaslTransportPlugin.java   
public TTransport connect(TTransport transport, String serverHost)
        throws TTransportException, IOException {
    ClientCallbackHandler client_callback_handler = new ClientCallbackHandler(
            login_conf);
    TSaslClientTransport wrapper_transport = new TSaslClientTransport(
            DIGEST, null, AuthUtils.SERVICE, serverHost, null,
            client_callback_handler, transport);

    wrapper_transport.open();
    LOG.debug("SASL DIGEST-MD5 client transport has been established");

    return wrapper_transport;
}
项目:Tstream    文件:SimpleTransportPlugin.java   
/**
 * We will let Thrift to apply default transport factory
 */
public TServer getServer(int port, TProcessor processor)
        throws IOException, TTransportException {
    TNonblockingServerSocket serverTransport = new TNonblockingServerSocket(
            port);
    THsHaServer.Args server_args = new THsHaServer.Args(serverTransport)
            .processor(new SimpleWrapProcessor(processor))
            .workerThreads(64)
            .protocolFactory(new TBinaryProtocol.Factory());

    // construct THsHaServer
    return new THsHaServer(server_args);
}
项目:Tstream    文件:SimpleTransportPlugin.java   
/**
 * Connect to the specified server via framed transport
 * 
 * @param transport
 *            The underlying Thrift transport.
 */
public TTransport connect(TTransport transport, String serverHost)
        throws TTransportException {
    // create a framed transport
    TTransport conn = new TFramedTransport(transport);

    // connect
    conn.open();
    LOG.debug("Simple client transport has been established");

    return conn;
}
项目:Tstream    文件:UIUtils.java   
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;
}
项目:jstorm-0.9.6.3-    文件:ThriftClient.java   
public ThriftClient(Map storm_conf, String host, int port) throws TTransportException {
    this(storm_conf, host, port, null);
}
项目:learn_jstorm    文件:ThriftClient.java   
public ThriftClient(Map storm_conf, String host, int port) throws TTransportException {
    this(storm_conf, host, port, null);
}
项目:jstrom    文件:ThriftClient.java   
public ThriftClient(Map storm_conf, String host, int port) throws TTransportException {
    this(storm_conf, host, port, null);
}
项目:Infrastructure    文件:StormConnection.java   
/**
 * Performs a failover, e.g., when a network connection closed due to failures.
 * 
 * @param th the throwable causing the need for failover
 */
public void failover(Throwable th) {
    if ((th instanceof TTransportException) || (th instanceof SocketException)) { 
        close(); // hope that it silently closes and a reconnect happens in the next round
    }
}
项目:storm-yarn    文件:MasterClient.java   
@SuppressWarnings("rawtypes")
public MasterClient(Map conf, String host, int port, Integer timeout) throws TTransportException {
    super(conf, host, port, timeout);
    _client = new StormMaster.Client(_protocol);
}
项目:jstorm-0.9.6.3-    文件:ITransportPlugin.java   
/**
 * Create a server associated with a given port and service handler
 * 
 * @param port
 *            listening port
 * @param processor
 *            service handler
 * @return server to be binded
 */
public TServer getServer(int port, TProcessor processor)
        throws IOException, TTransportException;
项目:jstorm-0.9.6.3-    文件:ITransportPlugin.java   
/**
 * Connect to the specified server via framed transport
 * 
 * @param transport
 *            The underlying Thrift transport.
 * @param serverHost
 *            server host
 */
public TTransport connect(TTransport transport, String serverHost)
        throws IOException, TTransportException;
项目:jstorm-0.9.6.3-    文件:ITransportPlugin.java   
/**
 * Create a server associated with a given port and service handler
 * @param port listening port
 * @param processor service handler
 * @return server to be binded
 */
public TServer getServer(int port, TProcessor processor) throws IOException, TTransportException;
项目:jstorm-0.9.6.3-    文件:ITransportPlugin.java   
/**
 * Connect to the specified server via framed transport 
 * @param transport The underlying Thrift transport.
 * @param serverHost server host
 */
public TTransport connect(TTransport transport, String serverHost) throws IOException, TTransportException;
项目:learn_jstorm    文件:ITransportPlugin.java   
/**
 * Create a server associated with a given port and service handler
 * 
 * @param port
 *            listening port
 * @param processor
 *            service handler
 * @return server to be binded
 */
public TServer getServer(int port, TProcessor processor)
        throws IOException, TTransportException;
项目:learn_jstorm    文件:ITransportPlugin.java   
/**
 * Connect to the specified server via framed transport
 * 
 * @param transport
 *            The underlying Thrift transport.
 * @param serverHost
 *            server host
 */
public TTransport connect(TTransport transport, String serverHost)
        throws IOException, TTransportException;
项目:learn_jstorm    文件:ITransportPlugin.java   
/**
 * Create a server associated with a given port and service handler
 * @param port listening port
 * @param processor service handler
 * @return server to be binded
 */
public TServer getServer(int port, TProcessor processor) throws IOException, TTransportException;