Package org.apache.thrift.transport

Examples of org.apache.thrift.transport.TTransport


    } else {
      host = mConf.get(FLUME_MASTER_HOST_KEY, DEFAULT_FLUME_MASTER_HOST);
      port = mConf.getInt(FLUME_MASTER_PORT_KEY, DEFAULT_FLUME_MASTER_PORT);
    }
   
    TTransport masterTransport = new TSocket(host, port);
    TProtocol protocol = new TBinaryProtocol(masterTransport);
    masterTransport.open();
    mMasterClient = new Client(protocol);
  }
View Full Code Here


        AccumuloServerException {
      if (tabMuts.size() == 0) {
        return new MutationSet();
      }
     
      TTransport transport = null;
     
      try {
        TabletClientService.Iface client = ThriftUtil.getTServerClient(location, instance.getConfiguration());
        try {
          MutationSet allFailures = new MutationSet();
View Full Code Here

   
    return createNewTransport(cacheKey);
  }
 
  private TTransport createNewTransport(ThriftTransportKey cacheKey) throws TTransportException {
    TTransport transport;
    if (cacheKey.getTimeout() == 0) {
      transport = AddressUtil.createTSocket(cacheKey.getLocation(), cacheKey.getPort());
    } else {
      try {
        transport = TTimeoutTransport.create(AddressUtil.parseAddress(cacheKey.getLocation(), cacheKey.getPort()), cacheKey.getTimeout());
      } catch (IOException ex) {
        throw new TTransportException(ex);
      }
    }
    transport = ThriftUtil.transportFactory().getTransport(transport);
    transport.open();
   
    if (log.isTraceEnabled())
      log.trace("Creating new connection to connection to " + cacheKey.getLocation() + ":" + cacheKey.getPort());
   
    CachedTTransport tsc = new CachedTTransport(transport, cacheKey);
View Full Code Here

        ranges.add(new Range(range));
      }
      unscanned.put(new KeyExtent(entry.getKey()), ranges);
    }
   
    TTransport transport = null;
    try {
      TabletClientService.Iface client = ThriftUtil.getTServerClient(server, conf);
      try {
        OpTimer opTimer = new OpTimer(log, Level.TRACE).start("Starting multi scan, tserver=" + server + "  #tablets=" + requested.size() + "  #ranges="
            + sumSizes(requested.values()) + " ssil=" + options.serverSideIteratorList + " ssio=" + options.serverSideIteratorOptions);
View Full Code Here

                return;

            // create connection using thrift
            String location = getLocation();
            socket = new TSocket(location, ConfigHelper.getInputRpcPort(conf));
            TTransport transport = ConfigHelper.getInputTransportFactory(conf).openTransport(socket, conf);
            TBinaryProtocol binaryProtocol = new TBinaryProtocol(transport, ConfigHelper.getThriftMaxMessageLength(conf));
            client = new Cassandra.Client(binaryProtocol);

            // log in
            client.set_keyspace(keyspace);
View Full Code Here

    public TabletServerStatus getTableMap(boolean usePooledConnection) throws TException, ThriftSecurityException {
     
      if (usePooledConnection == true)
        throw new UnsupportedOperationException();
     
      TTransport transport = ThriftUtil.createTransport(address, ServerConfiguration.getSystemConfiguration());
     
      try {
        TabletClientService.Iface client = ThriftUtil.createClient(new TabletClientService.Client.Factory(), transport);
        return client.getTabletServerStatus(null, SecurityConstants.getSystemCredentials());
      } finally {
        if (transport != null)
          transport.close();
      }
    }
View Full Code Here

  }
 
  static public <T extends TServiceClient> T getClient(TServiceClientFactory<T> factory, String address, Property property, AccumuloConfiguration configuration)
      throws TTransportException {
    int port = configuration.getPort(property);
    TTransport transport = ThriftTransportPool.getInstance().getTransport(address, port);
    return createClient(factory, transport);
  }
View Full Code Here

  }
 
  static public <T extends TServiceClient> T getClient(TServiceClientFactory<T> factory, String address, Property property, Property timeoutProperty,
      AccumuloConfiguration configuration) throws TTransportException {
    int port = configuration.getPort(property);
    TTransport transport = ThriftTransportPool.getInstance().getTransport(address, port, configuration.getTimeInMillis(timeoutProperty));
    return createClient(factory, transport);
  }
View Full Code Here

 
  /**
   * create a transport that is not pooled
   */
  public static TTransport createTransport(String address, int port, AccumuloConfiguration conf) throws TException {
    TTransport transport = null;
   
    try {
      transport = TTimeoutTransport.create(org.apache.accumulo.core.util.AddressUtil.parseAddress(address, port),
          conf.getTimeInMillis(Property.GENERAL_RPC_TIMEOUT));
      transport = ThriftUtil.transportFactory().getTransport(transport);
      transport.open();
      TTransport tmp = transport;
      transport = null;
      return tmp;
    } catch (IOException ex) {
      throw new TTransportException(ex);
    } finally {
View Full Code Here

  }

  private void talkToThriftServer() throws Exception {
    TSocket sock = new TSocket(InetAddress.getLocalHost().getHostName(),
        port);
    TTransport transport = sock;
    if (specifyFramed || implType.isAlwaysFramed) {
      transport = new TFramedTransport(transport);
    }

    sock.open();
View Full Code Here

TOP

Related Classes of org.apache.thrift.transport.TTransport

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.