Examples of TCompactProtocol


Examples of org.apache.thrift.protocol.TCompactProtocol

      Mutation spanMutation = new Mutation(new Text(idString));
      Mutation indexMutation = new Mutation(new Text("idx:" + s.svc + ":" + startString));
      long diff = s.stop - s.start;
      indexMutation.put(new Text(s.description), new Text(s.sender), new Value((idString + ":" + Long.toHexString(diff)).getBytes()));
      ByteArrayTransport transport = new ByteArrayTransport();
      TCompactProtocol protocol = new TCompactProtocol(transport);
      s.write(protocol);
      String parentString = Long.toHexString(s.parentId);
      if (s.parentId == Span.ROOT_SPAN_ID)
        parentString = "";
      put(spanMutation, "span", parentString + ":" + Long.toHexString(s.spanId), transport.get(), transport.len());
View Full Code Here

Examples of org.apache.thrift.protocol.TCompactProtocol

      Mutation spanMutation = new Mutation(new Text(idString));
      Mutation indexMutation = new Mutation(new Text("idx:" + s.svc + ":" + startString));
      long diff = s.stop - s.start;
      indexMutation.put(new Text(s.description), new Text(s.sender), new Value((idString + ":" + Long.toHexString(diff)).getBytes()));
      ByteArrayTransport transport = new ByteArrayTransport();
      TCompactProtocol protocol = new TCompactProtocol(transport);
      s.write(protocol);
      String parentString = Long.toHexString(s.parentId);
      if (s.parentId == Span.ROOT_SPAN_ID)
        parentString = "";
      put(spanMutation, "span", parentString + ":" + Long.toHexString(s.spanId), transport.get(), transport.len());
View Full Code Here

Examples of org.apache.thrift.protocol.TCompactProtocol

  private Iterator<Entry<Key,Value>> scanner;
  private boolean printTimeStamps;
 
  public static RemoteSpan getRemoteSpan(Entry<Key,Value> entry) {
    TMemoryInputTransport transport = new TMemoryInputTransport(entry.getValue().get());
    TCompactProtocol protocol = new TCompactProtocol(transport);
    RemoteSpan span = new RemoteSpan();
    try {
      span.read(protocol);
    } catch (TException ex) {
      throw new RuntimeException(ex);
View Full Code Here

Examples of org.apache.thrift.protocol.TCompactProtocol

    sock.open();
    try {
      TProtocol prot;
      if (specifyCompact) {
        prot = new TCompactProtocol(transport);
      } else {
        prot = new TBinaryProtocol(transport);
      }
      Hbase.Client client = new Hbase.Client(prot);
      if (!tableCreated){
View Full Code Here

Examples of org.apache.thrift.protocol.TCompactProtocol

        ThriftCatalog writeCatalog = writeCodecManager.getCatalog();
        ThriftStructMetadata<T> writeMetadata = writeCatalog.getThriftStructMetadata(structClass);
        assertNotNull(writeMetadata);

        TMemoryBuffer transport = new TMemoryBuffer(10 * 1024);
        TCompactProtocol protocol = new TCompactProtocol(transport);
        writeCodec.write(structInstance, protocol);

        T copy = readCodec.read(protocol);
        assertNotNull(copy);
        assertEquals(copy, structInstance);
View Full Code Here

Examples of org.apache.thrift.protocol.TCompactProtocol

    private <T> void testRoundTripSerialize(T value)
            throws Exception
    {
        // write value
        TMemoryBuffer transport = new TMemoryBuffer(10 * 1024);
        TCompactProtocol protocol = new TCompactProtocol(transport);
        codecManager.write((Class<T>) value.getClass(), value, protocol);

        // read value back
        T copy = codecManager.read((Class<T>) value.getClass(), protocol);
        assertNotNull(copy);
View Full Code Here

Examples of org.apache.thrift.protocol.TCompactProtocol

    private <T> void testRoundTripSerialize(ThriftType type, T value)
            throws Exception
    {
        // write value
        TMemoryBuffer transport = new TMemoryBuffer(10 * 1024);
        TCompactProtocol protocol = new TCompactProtocol(transport);
        codecManager.write(type, value, protocol);

        // read value back
        T copy = (T) codecManager.read(type, protocol);
        assertNotNull(copy);
View Full Code Here

Examples of org.apache.thrift.protocol.TCompactProtocol

    private final int hashCode;

    public ClientWrapper() throws Exception{
      transport = new TFastFramedTransport(new TSocket(hostname, port));
      transport.open();
      client = new ThriftSourceProtocol.Client(new TCompactProtocol
        (transport));
      // Not a great hash code, but since this class is immutable and there
      // is at most one instance of the components of this class,
      // this works fine [If the objects are equal, hash code is the same]
      hashCode = random.nextInt();
View Full Code Here

Examples of org.apache.thrift.protocol.TCompactProtocol

    sock.open();
    try {
      TProtocol prot;
      if (specifyCompact) {
        prot = new TCompactProtocol(transport);
      } else {
        prot = new TBinaryProtocol(transport);
      }
      Hbase.Client client = new Hbase.Client(prot);
      if (!tableCreated){
View Full Code Here

Examples of org.apache.thrift.protocol.TCompactProtocol

    sock.open();
    try {
      TProtocol prot;
      if (specifyCompact) {
        prot = new TCompactProtocol(transport);
      } else {
        prot = new TBinaryProtocol(transport);
      }
      Hbase.Client client = new Hbase.Client(prot);
      if (!tableCreated){
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.