cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Cassandra Wiki] Update of "ThriftExamples" by AlexanderAltanis
Date Thu, 14 Oct 2010 14:54:10 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Cassandra Wiki" for change notification.

The "ThriftExamples" page has been changed by AlexanderAltanis.
The comment on this change is: updated Java example to use TFramedTransport .
http://wiki.apache.org/cassandra/ThriftExamples?action=diff&rev1=82&rev2=83

--------------------------------------------------

  import java.io.UnsupportedEncodingException;
  
  import org.apache.thrift.transport.TTransport;
+ import org.apache.thrift.transport.TFramedTransport;
  import org.apache.thrift.transport.TSocket;
  import org.apache.thrift.protocol.TProtocol;
  import org.apache.thrift.protocol.TBinaryProtocol;
@@ -154, +155 @@

      public static void main(String[] args)
      throws TException, InvalidRequestException, UnavailableException, UnsupportedEncodingException,
NotFoundException
      {
-         TTransport tr = new TSocket("localhost", 9160);
+         TTransport tr = new TFramedTransport(new TSocket("localhost", 9160));
          TProtocol proto = new TBinaryProtocol(tr);
          Cassandra.Client client = new Cassandra.Client(proto);
          tr.open();

Mime
View raw message