Exemplo n.º 1
0
 @Override
 protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID)
     throws org.apache.thrift.TException {
   _Fields setField = _Fields.findByThriftId(fieldID);
   if (setField != null) {
     switch (setField) {
       case FIELDS:
         List<String> fields;
         {
           org.apache.thrift.protocol.TList _list12 = iprot.readListBegin();
           fields = new ArrayList<String>(_list12.size);
           String _elem13;
           for (int _i14 = 0; _i14 < _list12.size; ++_i14) {
             _elem13 = iprot.readString();
             fields.add(_elem13);
           }
           iprot.readListEnd();
         }
         return fields;
       case SHUFFLE:
         NullStruct shuffle;
         shuffle = new NullStruct();
         shuffle.read(iprot);
         return shuffle;
       case ALL:
         NullStruct all;
         all = new NullStruct();
         all.read(iprot);
         return all;
       case NONE:
         NullStruct none;
         none = new NullStruct();
         none.read(iprot);
         return none;
       case DIRECT:
         NullStruct direct;
         direct = new NullStruct();
         direct.read(iprot);
         return direct;
       case CUSTOM_OBJECT:
         JavaObject custom_object;
         custom_object = new JavaObject();
         custom_object.read(iprot);
         return custom_object;
       case CUSTOM_SERIALIZED:
         ByteBuffer custom_serialized;
         custom_serialized = iprot.readBinary();
         return custom_serialized;
       case LOCAL_OR_SHUFFLE:
         NullStruct local_or_shuffle;
         local_or_shuffle = new NullStruct();
         local_or_shuffle.read(iprot);
         return local_or_shuffle;
       default:
         throw new IllegalStateException(
             "setField wasn't null, but didn't match any of the case statements!");
     }
   } else {
     throw new TProtocolException("Couldn't find a field with field id " + fieldID);
   }
 }
Exemplo n.º 2
0
 @Override
 protected Object standardSchemeReadValue(
     org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field)
     throws org.apache.thrift.TException {
   _Fields setField = _Fields.findByThriftId(field.id);
   if (setField != null) {
     switch (setField) {
       case FIELDS:
         if (field.type == FIELDS_FIELD_DESC.type) {
           List<String> fields;
           {
             org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
             fields = new ArrayList<String>(_list8.size);
             String _elem9;
             for (int _i10 = 0; _i10 < _list8.size; ++_i10) {
               _elem9 = iprot.readString();
               fields.add(_elem9);
             }
             iprot.readListEnd();
           }
           return fields;
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
           return null;
         }
       case SHUFFLE:
         if (field.type == SHUFFLE_FIELD_DESC.type) {
           NullStruct shuffle;
           shuffle = new NullStruct();
           shuffle.read(iprot);
           return shuffle;
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
           return null;
         }
       case ALL:
         if (field.type == ALL_FIELD_DESC.type) {
           NullStruct all;
           all = new NullStruct();
           all.read(iprot);
           return all;
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
           return null;
         }
       case NONE:
         if (field.type == NONE_FIELD_DESC.type) {
           NullStruct none;
           none = new NullStruct();
           none.read(iprot);
           return none;
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
           return null;
         }
       case DIRECT:
         if (field.type == DIRECT_FIELD_DESC.type) {
           NullStruct direct;
           direct = new NullStruct();
           direct.read(iprot);
           return direct;
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
           return null;
         }
       case CUSTOM_OBJECT:
         if (field.type == CUSTOM_OBJECT_FIELD_DESC.type) {
           JavaObject custom_object;
           custom_object = new JavaObject();
           custom_object.read(iprot);
           return custom_object;
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
           return null;
         }
       case CUSTOM_SERIALIZED:
         if (field.type == CUSTOM_SERIALIZED_FIELD_DESC.type) {
           ByteBuffer custom_serialized;
           custom_serialized = iprot.readBinary();
           return custom_serialized;
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
           return null;
         }
       case LOCAL_OR_SHUFFLE:
         if (field.type == LOCAL_OR_SHUFFLE_FIELD_DESC.type) {
           NullStruct local_or_shuffle;
           local_or_shuffle = new NullStruct();
           local_or_shuffle.read(iprot);
           return local_or_shuffle;
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
           return null;
         }
       default:
         throw new IllegalStateException(
             "setField wasn't null, but didn't match any of the case statements!");
     }
   } else {
     org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
     return null;
   }
 }