Package com.facebook.presto.hive.shaded.org.apache.thrift.protocol

Examples of com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TTupleProtocol


  private static class ThriftTestObjTupleScheme extends TupleScheme<ThriftTestObj> {

    @Override
    public void write(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocol prot, ThriftTestObj struct) throws com.facebook.presto.hive.shaded.org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetField1()) {
        optionals.set(0);
      }
      if (struct.isSetField2()) {
        optionals.set(1);
      }
      if (struct.isSetField3()) {
        optionals.set(2);
      }
      oprot.writeBitSet(optionals, 3);
      if (struct.isSetField1()) {
        oprot.writeI32(struct.field1);
      }
      if (struct.isSetField2()) {
        oprot.writeString(struct.field2);
      }
      if (struct.isSetField3()) {
        {
          oprot.writeI32(struct.field3.size());
          for (InnerStruct _iter4 : struct.field3)
          {
            _iter4.write(oprot);
          }
        }
View Full Code Here


      }
    }

    @Override
    public void read(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocol prot, ThriftTestObj struct) throws com.facebook.presto.hive.shaded.org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(3);
      if (incoming.get(0)) {
        struct.field1 = iprot.readI32();
        struct.setField1IsSet(true);
      }
      if (incoming.get(1)) {
        struct.field2 = iprot.readString();
        struct.setField2IsSet(true);
      }
      if (incoming.get(2)) {
        {
          com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TList _list5 = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TList(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.field3 = new ArrayList<InnerStruct>(_list5.size);
          for (int _i6 = 0; _i6 < _list5.size; ++_i6)
          {
            InnerStruct _elem7; // required
            _elem7 = new InnerStruct();
View Full Code Here

  private static class InnerStructTupleScheme extends TupleScheme<InnerStruct> {

    @Override
    public void write(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocol prot, InnerStruct struct) throws com.facebook.presto.hive.shaded.org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetField0()) {
        optionals.set(0);
      }
      oprot.writeBitSet(optionals, 1);
      if (struct.isSetField0()) {
        oprot.writeI32(struct.field0);
      }
    }
View Full Code Here

      }
    }

    @Override
    public void read(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocol prot, InnerStruct struct) throws com.facebook.presto.hive.shaded.org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(1);
      if (incoming.get(0)) {
        struct.field0 = iprot.readI32();
        struct.setField0IsSet(true);
      }
    }
View Full Code Here

  private static class AdjacencyTupleScheme extends TupleScheme<Adjacency> {

    @Override
    public void write(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocol prot, Adjacency struct) throws com.facebook.presto.hive.shaded.org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetNode()) {
        optionals.set(0);
      }
      if (struct.isSetChildren()) {
        optionals.set(1);
      }
      if (struct.isSetAdjacencyType()) {
        optionals.set(2);
      }
      oprot.writeBitSet(optionals, 3);
      if (struct.isSetNode()) {
        oprot.writeString(struct.node);
      }
      if (struct.isSetChildren()) {
        {
          oprot.writeI32(struct.children.size());
          for (String _iter4 : struct.children)
          {
            oprot.writeString(_iter4);
          }
        }
      }
      if (struct.isSetAdjacencyType()) {
        oprot.writeI32(struct.adjacencyType.getValue());
      }
    }
View Full Code Here

      }
    }

    @Override
    public void read(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocol prot, Adjacency struct) throws com.facebook.presto.hive.shaded.org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(3);
      if (incoming.get(0)) {
        struct.node = iprot.readString();
        struct.setNodeIsSet(true);
      }
      if (incoming.get(1)) {
        {
          com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TList _list5 = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TList(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.children = new ArrayList<String>(_list5.size);
          for (int _i6 = 0; _i6 < _list5.size; ++_i6)
          {
            String _elem7; // required
            _elem7 = iprot.readString();
            struct.children.add(_elem7);
          }
        }
        struct.setChildrenIsSet(true);
      }
      if (incoming.get(2)) {
        struct.adjacencyType = AdjacencyType.findByValue(iprot.readI32());
        struct.setAdjacencyTypeIsSet(true);
      }
    }
View Full Code Here

  private static class StageTupleScheme extends TupleScheme<Stage> {

    @Override
    public void write(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocol prot, Stage struct) throws com.facebook.presto.hive.shaded.org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetStageId()) {
        optionals.set(0);
      }
      if (struct.isSetStageType()) {
        optionals.set(1);
      }
      if (struct.isSetStageAttributes()) {
        optionals.set(2);
      }
      if (struct.isSetStageCounters()) {
        optionals.set(3);
      }
      if (struct.isSetTaskList()) {
        optionals.set(4);
      }
      if (struct.isSetDone()) {
        optionals.set(5);
      }
      if (struct.isSetStarted()) {
        optionals.set(6);
      }
      oprot.writeBitSet(optionals, 7);
      if (struct.isSetStageId()) {
        oprot.writeString(struct.stageId);
      }
      if (struct.isSetStageType()) {
        oprot.writeI32(struct.stageType.getValue());
      }
      if (struct.isSetStageAttributes()) {
        {
          oprot.writeI32(struct.stageAttributes.size());
          for (Map.Entry<String, String> _iter86 : struct.stageAttributes.entrySet())
          {
            oprot.writeString(_iter86.getKey());
            oprot.writeString(_iter86.getValue());
          }
        }
      }
      if (struct.isSetStageCounters()) {
        {
          oprot.writeI32(struct.stageCounters.size());
          for (Map.Entry<String, Long> _iter87 : struct.stageCounters.entrySet())
          {
            oprot.writeString(_iter87.getKey());
            oprot.writeI64(_iter87.getValue());
          }
        }
      }
      if (struct.isSetTaskList()) {
        {
          oprot.writeI32(struct.taskList.size());
          for (Task _iter88 : struct.taskList)
          {
            _iter88.write(oprot);
          }
        }
      }
      if (struct.isSetDone()) {
        oprot.writeBool(struct.done);
      }
      if (struct.isSetStarted()) {
        oprot.writeBool(struct.started);
      }
    }
View Full Code Here

      }
    }

    @Override
    public void read(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocol prot, Stage struct) throws com.facebook.presto.hive.shaded.org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(7);
      if (incoming.get(0)) {
        struct.stageId = iprot.readString();
        struct.setStageIdIsSet(true);
      }
      if (incoming.get(1)) {
        struct.stageType = StageType.findByValue(iprot.readI32());
        struct.setStageTypeIsSet(true);
      }
      if (incoming.get(2)) {
        {
          com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TMap _map89 = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TMap(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRING, com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.stageAttributes = new HashMap<String,String>(2*_map89.size);
          for (int _i90 = 0; _i90 < _map89.size; ++_i90)
          {
            String _key91; // required
            String _val92; // required
            _key91 = iprot.readString();
            _val92 = iprot.readString();
            struct.stageAttributes.put(_key91, _val92);
          }
        }
        struct.setStageAttributesIsSet(true);
      }
      if (incoming.get(3)) {
        {
          com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TMap _map93 = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TMap(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRING, com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.I64, iprot.readI32());
          struct.stageCounters = new HashMap<String,Long>(2*_map93.size);
          for (int _i94 = 0; _i94 < _map93.size; ++_i94)
          {
            String _key95; // required
            long _val96; // required
            _key95 = iprot.readString();
            _val96 = iprot.readI64();
            struct.stageCounters.put(_key95, _val96);
          }
        }
        struct.setStageCountersIsSet(true);
      }
      if (incoming.get(4)) {
        {
          com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TList _list97 = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TList(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.taskList = new ArrayList<Task>(_list97.size);
          for (int _i98 = 0; _i98 < _list97.size; ++_i98)
          {
            Task _elem99; // required
            _elem99 = new Task();
            _elem99.read(iprot);
            struct.taskList.add(_elem99);
          }
        }
        struct.setTaskListIsSet(true);
      }
      if (incoming.get(5)) {
        struct.done = iprot.readBool();
        struct.setDoneIsSet(true);
      }
      if (incoming.get(6)) {
        struct.started = iprot.readBool();
        struct.setStartedIsSet(true);
      }
    }
View Full Code Here

  private static class QueryPlanTupleScheme extends TupleScheme<QueryPlan> {

    @Override
    public void write(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocol prot, QueryPlan struct) throws com.facebook.presto.hive.shaded.org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetQueries()) {
        optionals.set(0);
      }
      if (struct.isSetDone()) {
        optionals.set(1);
      }
      if (struct.isSetStarted()) {
        optionals.set(2);
      }
      oprot.writeBitSet(optionals, 3);
      if (struct.isSetQueries()) {
        {
          oprot.writeI32(struct.queries.size());
          for (Query _iter132 : struct.queries)
          {
            _iter132.write(oprot);
          }
        }
      }
      if (struct.isSetDone()) {
        oprot.writeBool(struct.done);
      }
      if (struct.isSetStarted()) {
        oprot.writeBool(struct.started);
      }
    }
View Full Code Here

      }
    }

    @Override
    public void read(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TProtocol prot, QueryPlan struct) throws com.facebook.presto.hive.shaded.org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(3);
      if (incoming.get(0)) {
        {
          com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TList _list133 = new com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TList(com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.queries = new ArrayList<Query>(_list133.size);
          for (int _i134 = 0; _i134 < _list133.size; ++_i134)
          {
            Query _elem135; // required
            _elem135 = new Query();
            _elem135.read(iprot);
            struct.queries.add(_elem135);
          }
        }
        struct.setQueriesIsSet(true);
      }
      if (incoming.get(1)) {
        struct.done = iprot.readBool();
        struct.setDoneIsSet(true);
      }
      if (incoming.get(2)) {
        struct.started = iprot.readBool();
        struct.setStartedIsSet(true);
      }
    }
View Full Code Here

TOP

Related Classes of com.facebook.presto.hive.shaded.org.apache.thrift.protocol.TTupleProtocol

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.