Package org.apache.thrift7

Examples of org.apache.thrift7.TException


                throw new IllegalArgumentException("host is not set");
            }
            if(port<=0) {
                throw new IllegalArgumentException("invalid port: "+port);
            }           
            TSocket socket = new TSocket(host, port);
            if(timeout!=null) {
                socket.setTimeout(timeout);
            }
            final TTransport underlyingTransport = socket;

            //establish client-server transport via plugin
            _transport =  transportPlugin.connect(underlyingTransport, host);
View Full Code Here


    return StatBuckets.getTimeKey(window);
  }

  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

     * 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;
    }
View Full Code Here

        public boolean process(final TProtocol inProt, final TProtocol outProt) throws TException {
            //populating request context
            ReqContext req_context = ReqContext.context();

            TTransport trans = inProt.getTransport();
            if (trans instanceof TMemoryInputTransport) {
                try {
                    req_context.setRemoteAddress(InetAddress.getLocalHost());
                } catch (UnknownHostException e) {
                    throw new RuntimeException(e);
View Full Code Here

            }           
            TSocket socket = new TSocket(host, port);
            if(timeout!=null) {
                socket.setTimeout(timeout);
            }
            final TTransport underlyingTransport = socket;

            //establish client-server transport via plugin
            _transport =  transportPlugin.connect(underlyingTransport, host);
        } catch (IOException ex) {
            throw new RuntimeException(ex);
View Full Code Here

        public boolean process(final TProtocol inProt, final TProtocol outProt) throws TException {
            //populating request context
            ReqContext req_context = ReqContext.context();

            TTransport trans = inProt.getTransport();
            //Sasl transport
            TSaslServerTransport saslTrans = (TSaslServerTransport)trans;

            //remote address
            TSocket tsocket = (TSocket)saslTrans.getUnderlyingTransport();
View Full Code Here

     * 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;
    }
View Full Code Here

        public boolean process(final TProtocol inProt, final TProtocol outProt) throws TException {
            //populating request context
            ReqContext req_context = ReqContext.context();

            TTransport trans = inProt.getTransport();
            if (trans instanceof TMemoryInputTransport) {
                try {
                    req_context.setRemoteAddress(InetAddress.getLocalHost());
                } catch (UnknownHostException e) {
                    throw new RuntimeException(e);
View Full Code Here

            }           
            TSocket socket = new TSocket(host, port);
            if(timeout!=null) {
                socket.setTimeout(timeout);
            }
            final TTransport underlyingTransport = socket;

            //establish client-server transport via plugin
            _transport =  transportPlugin.connect(underlyingTransport, host);
        } catch (IOException ex) {
            throw new RuntimeException(ex);
View Full Code Here

    public void prepare(Map storm_conf, Configuration login_conf) {       
        this.login_conf = login_conf;
    }

    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);
View Full Code Here

TOP

Related Classes of org.apache.thrift7.TException

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.