Exemple #1
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, SettableBlobMeta struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.acl != null) {
        oprot.writeFieldBegin(ACL_FIELD_DESC);
        {
          oprot.writeListBegin(
              new org.apache.thrift.protocol.TList(
                  org.apache.thrift.protocol.TType.STRUCT, struct.acl.size()));
          for (AccessControl _iter561 : struct.acl) {
            _iter561.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.is_set_replication_factor()) {
        oprot.writeFieldBegin(REPLICATION_FACTOR_FIELD_DESC);
        oprot.writeI32(struct.replication_factor);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
Exemple #2
0
 public void read(org.apache.thrift.protocol.TProtocol iprot, SettableBlobMeta 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: // ACL
         if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
           {
             org.apache.thrift.protocol.TList _list558 = iprot.readListBegin();
             struct.acl = new ArrayList<AccessControl>(_list558.size);
             AccessControl _elem559;
             for (int _i560 = 0; _i560 < _list558.size; ++_i560) {
               _elem559 = new AccessControl();
               _elem559.read(iprot);
               struct.acl.add(_elem559);
             }
             iprot.readListEnd();
           }
           struct.set_acl_isSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 2: // REPLICATION_FACTOR
         if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
           struct.replication_factor = iprot.readI32();
           struct.set_replication_factor_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();
   struct.validate();
 }