Exemple #1
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, TabletSplit struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(2);
   if (incoming.get(0)) {
     struct.oldTablet = new org.apache.accumulo.core.data.thrift.TKeyExtent();
     struct.oldTablet.read(iprot);
     struct.setOldTabletIsSet(true);
   }
   if (incoming.get(1)) {
     {
       org.apache.thrift.protocol.TList _list67 =
           new org.apache.thrift.protocol.TList(
               org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
       struct.newTablets =
           new ArrayList<org.apache.accumulo.core.data.thrift.TKeyExtent>(_list67.size);
       for (int _i68 = 0; _i68 < _list67.size; ++_i68) {
         org.apache.accumulo.core.data.thrift.TKeyExtent _elem69; // required
         _elem69 = new org.apache.accumulo.core.data.thrift.TKeyExtent();
         _elem69.read(iprot);
         struct.newTablets.add(_elem69);
       }
     }
     struct.setNewTabletsIsSet(true);
   }
 }
Exemple #2
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, TabletSplit struct)
        throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true) {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
          break;
        }
        switch (schemeField.id) {
          case 1: // OLD_TABLET
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.oldTablet = new org.apache.accumulo.core.data.thrift.TKeyExtent();
              struct.oldTablet.read(iprot);
              struct.setOldTabletIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // NEW_TABLETS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list62 = iprot.readListBegin();
                struct.newTablets =
                    new ArrayList<org.apache.accumulo.core.data.thrift.TKeyExtent>(_list62.size);
                for (int _i63 = 0; _i63 < _list62.size; ++_i63) {
                  org.apache.accumulo.core.data.thrift.TKeyExtent _elem64; // required
                  _elem64 = new org.apache.accumulo.core.data.thrift.TKeyExtent();
                  _elem64.read(iprot);
                  struct.newTablets.add(_elem64);
                }
                iprot.readListEnd();
              }
              struct.setNewTabletsIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }