Package org.apache.thrift.protocol

Examples of org.apache.thrift.protocol.TProtocol


    TTransport transport = new TSocket(thriftAddress.getHostName(),
        HBaseThriftServerClusterActionHandler.PORT);
    transport.open();
    LOG.info("Connected to thrift server.");
    LOG.info("Waiting for .META. table...");
    TProtocol protocol = new TBinaryProtocol(transport, true, true);
    Hbase.Client client = new Hbase.Client(protocol);
    int scannerId = client.scannerOpen(ByteBuffer.wrap(HConstants.META_TABLE_NAME),
                                       ByteBuffer.wrap(Bytes.toBytes("")), null, null);
    client.scannerClose(scannerId);
    thriftClient = client;
View Full Code Here


      try {
        port = Integer.parseInt(hostport[1]);
      } catch (Exception e) {
      }
      transport = new TSocket(host, port);
      TProtocol protocol = new TBinaryProtocol(transport);
      client = new HiveClient(protocol);
      try {
        transport.open();
      } catch (TTransportException e) {
        throw new SQLException("Could not establish connecton to "
View Full Code Here

            try{
           
                //Input
                TMemoryBuffer inbuffer = new TMemoryBuffer(input.length);          
                inbuffer.write(input);             
                TProtocol  inprotocol   = new TJSONProtocol(inbuffer);                  
               
                //Output
                TMemoryBuffer outbuffer = new TMemoryBuffer(100);          
                TProtocol outprotocol   = new TJSONProtocol(outbuffer);
               
                TProcessor processor = new ThriftTest.Processor(new TestHandler());     
                processor.process(inprotocol, outprotocol);
               
                byte[] output = new byte[outbuffer.length()];
View Full Code Here

     * @throws TTransportException
     */
    private Cassandra.Client getClient() throws TTransportException
    {
        TTransport tr = new TFramedTransport(new TSocket("localhost", DatabaseDescriptor.getRpcPort()));
        TProtocol proto = new TBinaryProtocol(tr);
        Cassandra.Client client = new Cassandra.Client(proto);
        tr.open();
        return client;
    }
View Full Code Here

            try{
           
                //Input
                TMemoryBuffer inbuffer = new TMemoryBuffer(input.length);          
                inbuffer.write(input);             
                TProtocol  inprotocol   = new TJSONProtocol(inbuffer);                  
               
                //Output
                TMemoryBuffer outbuffer = new TMemoryBuffer(100);          
                TProtocol outprotocol   = new TJSONProtocol(outbuffer);
               
                TProcessor processor = new ThriftTest.Processor(new TestHandler());     
                processor.process(inprotocol, outprotocol);
               
                byte[] output = new byte[outbuffer.length()];
View Full Code Here

public class JavaClient {
  public static void main(String [] args) {
    try {

      TTransport transport = new TSocket("localhost", 9090);
      TProtocol protocol = new TBinaryProtocol(transport);
      Calculator.Client client = new Calculator.Client(protocol);

      transport.open();

      client.ping();
View Full Code Here

    private void connect() throws TTransportException {
        if (transport != null) {
            transport.close();
        }
        transport = new TFramedTransport(new TSocket(hostName, port, timeOut));
        final TProtocol protocol = new TBinaryProtocol(transport);
        client = new ZipkinCollector.Client(protocol);
        try {
            transport.open();
            sinkCounter.incrementConnectionCreatedCount();
        } catch (final TTransportException e) {
View Full Code Here

    String host = this.currentServer.substring(0, splitIndex);
    int port = Integer.parseInt(this.currentServer.substring(splitIndex + 1));

    TSocket sock = new TSocket(host, port);
    this.transport = new TFramedTransport(sock);
    TProtocol protocol = new TBinaryProtocol(transport);
    this.client = new Cassandra.Client(protocol);

    try {
      this.transport.open();
      this.client.set_keyspace(this.keyspace);
View Full Code Here

        private static Cassandra.Client createThriftClient(String host, int port) throws TTransportException
        {
            TSocket socket = new TSocket(host, port);
            TTransport trans = new TFramedTransport(socket);
            trans.open();
            TProtocol protocol = new TBinaryProtocol(trans);
            return new Cassandra.Client(protocol);
        }
View Full Code Here

        DocumentMetadata docMeta = new DocumentMetadata();

        byte[] decompressedData = CassandraUtils.decompress(ByteBufferUtil.getArray(data));

        TTransport trans = new TMemoryInputTransport(decompressedData);
        TProtocol deser = protocolFactory.getProtocol(trans);

        try
        {
            docMeta.read(deser);
        }
View Full Code Here

TOP

Related Classes of org.apache.thrift.protocol.TProtocol

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.