Esempio n. 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();
    }
Esempio n. 2
0
  @Override
  public int compareTo(SettableBlobMeta other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(is_set_acl()).compareTo(other.is_set_acl());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (is_set_acl()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.acl, other.acl);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(is_set_replication_factor()).compareTo(other.is_set_replication_factor());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (is_set_replication_factor()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(
              this.replication_factor, other.replication_factor);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
Esempio n. 3
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();
 }
Esempio n. 4
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, SettableBlobMeta struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   {
     oprot.writeI32(struct.acl.size());
     for (AccessControl _iter562 : struct.acl) {
       _iter562.write(oprot);
     }
   }
   BitSet optionals = new BitSet();
   if (struct.is_set_replication_factor()) {
     optionals.set(0);
   }
   oprot.writeBitSet(optionals, 1);
   if (struct.is_set_replication_factor()) {
     oprot.writeI32(struct.replication_factor);
   }
 }
Esempio n. 5
0
  public boolean equals(SettableBlobMeta that) {
    if (that == null) return false;

    boolean this_present_acl = true && this.is_set_acl();
    boolean that_present_acl = true && that.is_set_acl();
    if (this_present_acl || that_present_acl) {
      if (!(this_present_acl && that_present_acl)) return false;
      if (!this.acl.equals(that.acl)) return false;
    }

    boolean this_present_replication_factor = true && this.is_set_replication_factor();
    boolean that_present_replication_factor = true && that.is_set_replication_factor();
    if (this_present_replication_factor || that_present_replication_factor) {
      if (!(this_present_replication_factor && that_present_replication_factor)) return false;
      if (this.replication_factor != that.replication_factor) return false;
    }

    return true;
  }
Esempio n. 6
0
 /** Performs a deep copy on <i>other</i>. */
 public SettableBlobMeta(SettableBlobMeta other) {
   __isset_bitfield = other.__isset_bitfield;
   if (other.is_set_acl()) {
     List<AccessControl> __this__acl = new ArrayList<AccessControl>(other.acl.size());
     for (AccessControl other_element : other.acl) {
       __this__acl.add(new AccessControl(other_element));
     }
     this.acl = __this__acl;
   }
   this.replication_factor = other.replication_factor;
 }
Esempio n. 7
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, SettableBlobMeta struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   {
     org.apache.thrift.protocol.TList _list563 =
         new org.apache.thrift.protocol.TList(
             org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
     struct.acl = new ArrayList<AccessControl>(_list563.size);
     AccessControl _elem564;
     for (int _i565 = 0; _i565 < _list563.size; ++_i565) {
       _elem564 = new AccessControl();
       _elem564.read(iprot);
       struct.acl.add(_elem564);
     }
   }
   struct.set_acl_isSet(true);
   BitSet incoming = iprot.readBitSet(1);
   if (incoming.get(0)) {
     struct.replication_factor = iprot.readI32();
     struct.set_replication_factor_isSet(true);
   }
 }