コード例 #1
0
ファイル: TKey.java プロジェクト: matthew-dailey/accumulo
    public void read(org.apache.thrift.protocol.TProtocol iprot, TKey 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: // ROW
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.row = iprot.readBinary();
              struct.setRowIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // COL_FAMILY
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.colFamily = iprot.readBinary();
              struct.setColFamilyIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // COL_QUALIFIER
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.colQualifier = iprot.readBinary();
              struct.setColQualifierIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // COL_VISIBILITY
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.colVisibility = iprot.readBinary();
              struct.setColVisibilityIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // TIMESTAMP
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.timestamp = iprot.readI64();
              struct.setTimestampIsSet(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();
    }
コード例 #2
0
ファイル: SliceRange.java プロジェクト: Colex/cassandra-mv
    public void read(org.apache.thrift.protocol.TProtocol iprot, SliceRange 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: // START
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.start = iprot.readBinary();
              struct.setStartIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // FINISH
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.finish = iprot.readBinary();
              struct.setFinishIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // REVERSED
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.reversed = iprot.readBool();
              struct.setReversedIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // COUNT
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.count = iprot.readI32();
              struct.setCountIsSet(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
      if (!struct.isSetReversed()) {
        throw new org.apache.thrift.protocol.TProtocolException(
            "Required field 'reversed' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetCount()) {
        throw new org.apache.thrift.protocol.TProtocolException(
            "Required field 'count' was not found in serialized data! Struct: " + toString());
      }
      struct.validate();
    }
コード例 #3
0
ファイル: SliceRange.java プロジェクト: thanodnl/libcassandra
  public void read(TProtocol iprot) throws TException {
    TField field;
    iprot.readStructBegin();
    while (true) {
      field = iprot.readFieldBegin();
      if (field.type == TType.STOP) {
        break;
      }
      switch (field.id) {
        case 1: // START
          if (field.type == TType.STRING) {
            this.start = iprot.readBinary();
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 2: // FINISH
          if (field.type == TType.STRING) {
            this.finish = iprot.readBinary();
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 3: // REVERSED
          if (field.type == TType.BOOL) {
            this.reversed = iprot.readBool();
            setReversedIsSet(true);
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 4: // COUNT
          if (field.type == TType.I32) {
            this.count = iprot.readI32();
            setCountIsSet(true);
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        default:
          TProtocolUtil.skip(iprot, field.type);
      }
      iprot.readFieldEnd();
    }
    iprot.readStructEnd();

    // check for required fields of primitive type, which can't be checked in the validate method
    if (!isSetReversed()) {
      throw new TProtocolException(
          "Required field 'reversed' was not found in serialized data! Struct: " + toString());
    }
    if (!isSetCount()) {
      throw new TProtocolException(
          "Required field 'count' was not found in serialized data! Struct: " + toString());
    }
    validate();
  }
コード例 #4
0
  public void read(TProtocol iprot) throws TException {
    TField field;
    iprot.readStructBegin();
    while (true) {
      field = iprot.readFieldBegin();
      if (field.type == TType.STOP) {
        break;
      }
      _Fields fieldId = _Fields.findByThriftId(field.id);
      if (fieldId == null) {
        TProtocolUtil.skip(iprot, field.type);
      } else {
        switch (fieldId) {
          case ROW:
            if (field.type == TType.STRING) {
              this.row = iprot.readBinary();
            } else {
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case COLUMNS:
            if (field.type == TType.MAP) {
              {
                TMap _map4 = iprot.readMapBegin();
                this.columns = new HashMap<byte[], TCell>(2 * _map4.size);
                for (int _i5 = 0; _i5 < _map4.size; ++_i5) {
                  byte[] _key6;
                  TCell _val7;
                  _key6 = iprot.readBinary();
                  _val7 = new TCell();
                  _val7.read(iprot);
                  this.columns.put(_key6, _val7);
                }
                iprot.readMapEnd();
              }
            } else {
              TProtocolUtil.skip(iprot, field.type);
            }
            break;
        }
        iprot.readFieldEnd();
      }
    }
    iprot.readStructEnd();

    // check for required fields of primitive type, which can't be checked in the validate method
    validate();
  }
コード例 #5
0
 public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
   org.apache.thrift.protocol.TField field;
   iprot.readStructBegin();
   while (true) {
     field = iprot.readFieldBegin();
     if (field.type == org.apache.thrift.protocol.TType.STOP) {
       break;
     }
     switch (field.id) {
       case 1: // KEY
         if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
           this.key = new Key();
           this.key.read(iprot);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 2: // DATA
         if (field.type == org.apache.thrift.protocol.TType.STRING) {
           this.data = iprot.readBinary();
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
         }
         break;
       default:
         org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
     }
     iprot.readFieldEnd();
   }
   iprot.readStructEnd();
   validate();
 }
コード例 #6
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 SERIALIZED_JAVA:
         ByteBuffer serialized_java;
         serialized_java = iprot.readBinary();
         return serialized_java;
       case SHELL:
         ShellComponent shell;
         shell = new ShellComponent();
         shell.read(iprot);
         return shell;
       case JAVA_OBJECT:
         JavaObject java_object;
         java_object = new JavaObject();
         java_object.read(iprot);
         return java_object;
       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);
   }
 }
コード例 #7
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, ClientRawTableInfo 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: // ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.id = iprot.readI32();
              struct.setIdIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.name = iprot.readString();
              struct.setNameIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // PATH
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.path = iprot.readString();
              struct.setPathIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // COLUMNS
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.columns = iprot.readI32();
              struct.setColumnsIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // METADATA
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.metadata = iprot.readBinary();
              struct.setMetadataIsSet(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();
    }
コード例 #8
0
  public void read(TProtocol iprot) throws TException {
    TField field;
    iprot.readStructBegin();
    while (true) {
      field = iprot.readFieldBegin();
      if (field.type == TType.STOP) {
        break;
      }
      switch (field.id) {
        case 1: // VALUES
          if (field.type == TType.LIST) {
            {
              TList _list0 = iprot.readListBegin();
              this.values = new ArrayList<ByteBuffer>(_list0.size);
              for (int _i1 = 0; _i1 < _list0.size; ++_i1) {
                ByteBuffer _elem2;
                _elem2 = iprot.readBinary();
                this.values.add(_elem2);
              }
              iprot.readListEnd();
            }
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        default:
          TProtocolUtil.skip(iprot, field.type);
      }
      iprot.readFieldEnd();
    }
    iprot.readStructEnd();

    // check for required fields of primitive type, which can't be checked in the validate method
    validate();
  }
コード例 #9
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, IndexExpression 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: // COLUMN_NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.column_name = iprot.readBinary();
              struct.setColumn_nameIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // OP
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.op = IndexOperator.findByValue(iprot.readI32());
              struct.setOpIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // VALUE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.value = iprot.readBinary();
              struct.setValueIsSet(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();
    }
コード例 #10
0
ファイル: TCredentials.java プロジェクト: mjseakan/accumulo
    public void read(org.apache.thrift.protocol.TProtocol iprot, TCredentials 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: // PRINCIPAL
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.principal = iprot.readString();
              struct.setPrincipalIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // TOKEN_CLASS_NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.tokenClassName = iprot.readString();
              struct.setTokenClassNameIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // TOKEN
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.token = iprot.readBinary();
              struct.setTokenIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // INSTANCE_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.instanceId = iprot.readString();
              struct.setInstanceIdIsSet(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();
    }
コード例 #11
0
 public void read(org.apache.thrift.protocol.TProtocol iprot, InsertEventRequestData 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: // FILES_ADDED
         if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
           {
             org.apache.thrift.protocol.TList _list558 = iprot.readListBegin();
             struct.filesAdded = new ArrayList<String>(_list558.size);
             String _elem559;
             for (int _i560 = 0; _i560 < _list558.size; ++_i560) {
               _elem559 = iprot.readString();
               struct.filesAdded.add(_elem559);
             }
             iprot.readListEnd();
           }
           struct.setFilesAddedIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 2: // FILES_ADDED_CHECKSUM
         if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
           {
             org.apache.thrift.protocol.TList _list561 = iprot.readListBegin();
             struct.filesAddedChecksum = new ArrayList<ByteBuffer>(_list561.size);
             ByteBuffer _elem562;
             for (int _i563 = 0; _i563 < _list561.size; ++_i563) {
               _elem562 = iprot.readBinary();
               struct.filesAddedChecksum.add(_elem562);
             }
             iprot.readListEnd();
           }
           struct.setFilesAddedChecksumIsSet(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();
   struct.validate();
 }
コード例 #12
0
 public void read(org.apache.thrift.protocol.TProtocol iprot, TCommandTransfer 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: // APPLICATION_NAME
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.applicationName = iprot.readString();
           struct.setApplicationNameIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 2: // AGENT_ID
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.agentId = iprot.readString();
           struct.setAgentIdIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 3: // START_TIME
         if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
           struct.startTime = iprot.readI64();
           struct.setStartTimeIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 4: // PAYLOAD
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.payload = iprot.readBinary();
           struct.setPayloadIsSet(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();
   struct.validate();
 }
コード例 #13
0
ファイル: Deletion.java プロジェクト: pologood/Solandra
  public void read(TProtocol iprot) throws TException {
    TField field;
    iprot.readStructBegin();
    while (true) {
      field = iprot.readFieldBegin();
      if (field.type == TType.STOP) {
        break;
      }
      switch (field.id) {
        case 1: // TIMESTAMP
          if (field.type == TType.I64) {
            this.timestamp = iprot.readI64();
            setTimestampIsSet(true);
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 2: // SUPER_COLUMN
          if (field.type == TType.STRING) {
            this.super_column = iprot.readBinary();
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 3: // PREDICATE
          if (field.type == TType.STRUCT) {
            this.predicate = new SlicePredicate();
            this.predicate.read(iprot);
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        default:
          TProtocolUtil.skip(iprot, field.type);
      }
      iprot.readFieldEnd();
    }
    iprot.readStructEnd();

    // check for required fields of primitive type, which can't be checked in the validate method
    if (!isSetTimestamp()) {
      throw new TProtocolException(
          "Required field 'timestamp' was not found in serialized data! Struct: " + toString());
    }
    validate();
  }
コード例 #14
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 SERIALIZED_JAVA:
         if (field.type == SERIALIZED_JAVA_FIELD_DESC.type) {
           ByteBuffer serialized_java;
           serialized_java = iprot.readBinary();
           return serialized_java;
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
           return null;
         }
       case SHELL:
         if (field.type == SHELL_FIELD_DESC.type) {
           ShellComponent shell;
           shell = new ShellComponent();
           shell.read(iprot);
           return shell;
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
           return null;
         }
       case JAVA_OBJECT:
         if (field.type == JAVA_OBJECT_FIELD_DESC.type) {
           JavaObject java_object;
           java_object = new JavaObject();
           java_object.read(iprot);
           return java_object;
         } 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;
   }
 }
コード例 #15
0
ファイル: TI16Column.java プロジェクト: pozypakya/impala-jdbc
    public void read(org.apache.thrift.protocol.TProtocol iprot, TI16Column 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: // VALUES
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list70 = iprot.readListBegin();
                struct.values = new ArrayList<Short>(_list70.size);
                for (int _i71 = 0; _i71 < _list70.size; ++_i71) {
                  short _elem72;
                  _elem72 = iprot.readI16();
                  struct.values.add(_elem72);
                }
                iprot.readListEnd();
              }
              struct.setValuesIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // NULLS
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.nulls = iprot.readBinary();
              struct.setNullsIsSet(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();
    }
コード例 #16
0
ファイル: Response.java プロジェクト: uVe88/thrift_test
    public void read(org.apache.thrift.protocol.TProtocol iprot, Response struct)
        throws 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: // RESULT_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.ResultType = iprot.readString();
              struct.setResultTypeIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // RESULT
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.Result = iprot.readBinary();
              struct.setResultIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // OPERATION_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.OperationId = iprot.readString();
              struct.setOperationIdIsSet(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();
    }
コード例 #17
0
  public void read(TProtocol iprot) throws TException {
    TField field;
    iprot.readStructBegin();
    while (true) {
      field = iprot.readFieldBegin();
      if (field.type == TType.STOP) {
        break;
      }
      switch (field.id) {
        case 1: // NAME
          if (field.type == TType.STRING) {
            this.name = iprot.readBinary();
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 2: // COLUMNS
          if (field.type == TType.LIST) {
            {
              TList _list0 = iprot.readListBegin();
              this.columns = new ArrayList<Column>(_list0.size);
              for (int _i1 = 0; _i1 < _list0.size; ++_i1) {
                Column _elem2;
                _elem2 = new Column();
                _elem2.read(iprot);
                this.columns.add(_elem2);
              }
              iprot.readListEnd();
            }
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        default:
          TProtocolUtil.skip(iprot, field.type);
      }
      iprot.readFieldEnd();
    }
    iprot.readStructEnd();

    // check for required fields of primitive type, which can't be checked in the validate method
    validate();
  }
コード例 #18
0
ファイル: TCell.java プロジェクト: ChenHaoyang/hbase
    public void read(org.apache.thrift.protocol.TProtocol iprot, TCell 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: // VALUE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.value = iprot.readBinary();
              struct.setValueIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // TIMESTAMP
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.timestamp = iprot.readI64();
              struct.setTimestampIsSet(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();
    }
コード例 #19
0
ファイル: TIncrement.java プロジェクト: haoyuan/hbase
    public void read(org.apache.thrift.protocol.TProtocol iprot, TIncrement 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: // ROW
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.row = iprot.readBinary();
              struct.setRowIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // COLUMNS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list70 = iprot.readListBegin();
                struct.columns = new ArrayList<TColumnIncrement>(_list70.size);
                for (int _i71 = 0; _i71 < _list70.size; ++_i71) {
                  TColumnIncrement _elem72; // required
                  _elem72 = new TColumnIncrement();
                  _elem72.read(iprot);
                  struct.columns.add(_elem72);
                }
                iprot.readListEnd();
              }
              struct.setColumnsIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // ATTRIBUTES
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map73 = iprot.readMapBegin();
                struct.attributes = new HashMap<ByteBuffer, ByteBuffer>(2 * _map73.size);
                for (int _i74 = 0; _i74 < _map73.size; ++_i74) {
                  ByteBuffer _key75; // required
                  ByteBuffer _val76; // required
                  _key75 = iprot.readBinary();
                  _val76 = iprot.readBinary();
                  struct.attributes.put(_key75, _val76);
                }
                iprot.readMapEnd();
              }
              struct.setAttributesIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // DURABILITY
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.durability = TDurability.findByValue(iprot.readI32());
              struct.setDurabilityIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // CELL_VISIBILITY
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.cellVisibility = new TCellVisibility();
              struct.cellVisibility.read(iprot);
              struct.setCellVisibilityIsSet(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();
    }
コード例 #20
0
 @Override
 public ByteBuffer read(TProtocol protocol) throws Exception {
   Preconditions.checkNotNull(protocol, "protocol is null");
   return protocol.readBinary();
 }
コード例 #21
0
ファイル: TRowSet.java プロジェクト: hadoop-zuiwanyuan/hive
 public void read(org.apache.thrift.protocol.TProtocol iprot, TRowSet 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: // START_ROW_OFFSET
         if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
           struct.startRowOffset = iprot.readI64();
           struct.setStartRowOffsetIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 2: // ROWS
         if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
           {
             org.apache.thrift.protocol.TList _list118 = iprot.readListBegin();
             struct.rows = new ArrayList<TRow>(_list118.size);
             TRow _elem119;
             for (int _i120 = 0; _i120 < _list118.size; ++_i120) {
               _elem119 = new TRow();
               _elem119.read(iprot);
               struct.rows.add(_elem119);
             }
             iprot.readListEnd();
           }
           struct.setRowsIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 3: // COLUMNS
         if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
           {
             org.apache.thrift.protocol.TList _list121 = iprot.readListBegin();
             struct.columns = new ArrayList<TColumn>(_list121.size);
             TColumn _elem122;
             for (int _i123 = 0; _i123 < _list121.size; ++_i123) {
               _elem122 = new TColumn();
               _elem122.read(iprot);
               struct.columns.add(_elem122);
             }
             iprot.readListEnd();
           }
           struct.setColumnsIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 4: // BINARY_COLUMNS
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.binaryColumns = iprot.readBinary();
           struct.setBinaryColumnsIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 5: // COLUMN_COUNT
         if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
           struct.columnCount = iprot.readI32();
           struct.setColumnCountIsSet(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();
   struct.validate();
 }
コード例 #22
0
ファイル: Grouping.java プロジェクト: abolibibelot/storm
 @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);
   }
 }
コード例 #23
0
ファイル: Grouping.java プロジェクト: abolibibelot/storm
 @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;
   }
 }
コード例 #24
0
 public void read(org.apache.thrift.protocol.TProtocol iprot, DadoTransporteThrift 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: // UUID_DADO_SERIALIZADO
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.uuidDadoSerializado = iprot.readString();
           struct.setUuidDadoSerializadoIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 2: // TIPO_DADO_SERIALIZADO
         if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
           struct.tipoDadoSerializado = iprot.readI64();
           struct.setTipoDadoSerializadoIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 3: // CNES_DADO_SERIALIZADO
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.cnesDadoSerializado = iprot.readString();
           struct.setCnesDadoSerializadoIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 4: // COD_IBGE
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.codIbge = iprot.readString();
           struct.setCodIbgeIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 5: // INE_DADO_SERIALIZADO
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.ineDadoSerializado = iprot.readString();
           struct.setIneDadoSerializadoIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 6: // NUM_LOTE
         if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
           struct.numLote = iprot.readI64();
           struct.setNumLoteIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 7: // DADO_SERIALIZADO
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.dadoSerializado = iprot.readBinary();
           struct.setDadoSerializadoIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 8: // REMETENTE
         if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
           struct.remetente = new DadoInstalacaoThrift();
           struct.remetente.read(iprot);
           struct.setRemetenteIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 9: // ORIGINADORA
         if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
           struct.originadora = new DadoInstalacaoThrift();
           struct.originadora.read(iprot);
           struct.setOriginadoraIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 10: // VERSAO
         if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
           struct.versao =
               new br.gov.saude.esus.transport.common.api.configuracaodestino.VersaoThrift();
           struct.versao.read(iprot);
           struct.setVersaoIsSet(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();
   struct.validate();
 }
コード例 #25
0
ファイル: TGet.java プロジェクト: luochen01/tongji_thesis
    public void read(org.apache.thrift.protocol.TProtocol iprot, TGet 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: // ROW
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.row = iprot.readBinary();
              struct.setRowIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // COLUMNS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
                struct.columns = new ArrayList<TColumn>(_list8.size);
                for (int _i9 = 0; _i9 < _list8.size; ++_i9) {
                  TColumn _elem10; // optional
                  _elem10 = new TColumn();
                  _elem10.read(iprot);
                  struct.columns.add(_elem10);
                }
                iprot.readListEnd();
              }
              struct.setColumnsIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // TIMESTAMP
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.timestamp = iprot.readI64();
              struct.setTimestampIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // TIME_RANGE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.timeRange = new TTimeRange();
              struct.timeRange.read(iprot);
              struct.setTimeRangeIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // MAX_VERSIONS
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.maxVersions = iprot.readI32();
              struct.setMaxVersionsIsSet(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();
    }
コード例 #26
0
ファイル: TDelete.java プロジェクト: JichengSong/hbase
    public void read(org.apache.thrift.protocol.TProtocol iprot, TDelete 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: // ROW
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.row = iprot.readBinary();
              struct.setRowIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // COLUMNS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list44 = iprot.readListBegin();
                struct.columns = new ArrayList<TColumn>(_list44.size);
                for (int _i45 = 0; _i45 < _list44.size; ++_i45) {
                  TColumn _elem46; // required
                  _elem46 = new TColumn();
                  _elem46.read(iprot);
                  struct.columns.add(_elem46);
                }
                iprot.readListEnd();
              }
              struct.setColumnsIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // TIMESTAMP
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.timestamp = iprot.readI64();
              struct.setTimestampIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // DELETE_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.deleteType = TDeleteType.findByValue(iprot.readI32());
              struct.setDeleteTypeIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // WRITE_TO_WAL
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.writeToWal = iprot.readBool();
              struct.setWriteToWalIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // ATTRIBUTES
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map47 = iprot.readMapBegin();
                struct.attributes = new HashMap<ByteBuffer, ByteBuffer>(2 * _map47.size);
                for (int _i48 = 0; _i48 < _map47.size; ++_i48) {
                  ByteBuffer _key49; // required
                  ByteBuffer _val50; // optional
                  _key49 = iprot.readBinary();
                  _val50 = iprot.readBinary();
                  struct.attributes.put(_key49, _val50);
                }
                iprot.readMapEnd();
              }
              struct.setAttributesIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // DURABILITY
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.durability = TDurability.findByValue(iprot.readI32());
              struct.setDurabilityIsSet(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();
    }
コード例 #27
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, DomainVersionMetadata 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: // PROPERTIES
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.properties = iprot.readBinary();
              struct.set_properties_isSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // PARTITIONS
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map8 = iprot.readMapBegin();
                struct.partitions = new HashMap<Integer, PartitionMetadata>(2 * _map8.size);
                for (int _i9 = 0; _i9 < _map8.size; ++_i9) {
                  int _key10; // required
                  PartitionMetadata _val11; // optional
                  _key10 = iprot.readI32();
                  _val11 = new PartitionMetadata();
                  _val11.read(iprot);
                  struct.partitions.put(_key10, _val11);
                }
                iprot.readMapEnd();
              }
              struct.set_partitions_isSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // DEFUNCT
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.defunct = iprot.readBool();
              struct.set_defunct_isSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // CLOSED_AT
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.closed_at = iprot.readI64();
              struct.set_closed_at_isSet(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
      if (!struct.is_set_defunct()) {
        throw new org.apache.thrift.protocol.TProtocolException(
            "Required field 'defunct' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.is_set_closed_at()) {
        throw new org.apache.thrift.protocol.TProtocolException(
            "Required field 'closed_at' was not found in serialized data! Struct: " + toString());
      }
      struct.validate();
    }
コード例 #28
0
ファイル: Offset.java プロジェクト: joy-xu/KBA2013
    public void read(org.apache.thrift.protocol.TProtocol iprot, Offset 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: // TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.type = OffsetType.findByValue(iprot.readI32());
              struct.setTypeIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // FIRST
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.first = iprot.readI64();
              struct.setFirstIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // LENGTH
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.length = iprot.readI32();
              struct.setLengthIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // XPATH
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.xpath = iprot.readString();
              struct.setXpathIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // CONTENT_FORM
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.content_form = iprot.readString();
              struct.setContent_formIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // VALUE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.value = iprot.readBinary();
              struct.setValueIsSet(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();
    }
コード例 #29
0
 public ByteBuffer readBinary() throws TException {
   return delegate.readBinary();
 }