Esempio n. 1
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, ClusterData struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetClusterName()) {
     optionals.set(0);
   }
   if (struct.isSetGroups()) {
     optionals.set(1);
   }
   oprot.writeBitSet(optionals, 2);
   if (struct.isSetClusterName()) {
     oprot.writeString(struct.clusterName);
   }
   if (struct.isSetGroups()) {
     {
       oprot.writeI32(struct.groups.size());
       for (Map.Entry<String, GroupData> _iter13 : struct.groups.entrySet()) {
         oprot.writeString(_iter13.getKey());
         _iter13.getValue().write(oprot);
       }
     }
   }
 }
Esempio n. 2
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, ClusterData struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(2);
   if (incoming.get(0)) {
     struct.clusterName = iprot.readString();
     struct.setClusterNameIsSet(true);
   }
   if (incoming.get(1)) {
     {
       org.apache.thrift.protocol.TMap _map14 =
           new org.apache.thrift.protocol.TMap(
               org.apache.thrift.protocol.TType.STRING,
               org.apache.thrift.protocol.TType.STRUCT,
               iprot.readI32());
       struct.groups = new HashMap<String, GroupData>(2 * _map14.size);
       for (int _i15 = 0; _i15 < _map14.size; ++_i15) {
         String _key16; // required
         GroupData _val17; // required
         _key16 = iprot.readString();
         _val17 = new GroupData();
         _val17.read(iprot);
         struct.groups.put(_key16, _val17);
       }
     }
     struct.setGroupsIsSet(true);
   }
 }
Esempio n. 3
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, ClusterData struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.clusterName != null) {
        if (struct.isSetClusterName()) {
          oprot.writeFieldBegin(CLUSTER_NAME_FIELD_DESC);
          oprot.writeString(struct.clusterName);
          oprot.writeFieldEnd();
        }
      }
      if (struct.groups != null) {
        if (struct.isSetGroups()) {
          oprot.writeFieldBegin(GROUPS_FIELD_DESC);
          {
            oprot.writeMapBegin(
                new org.apache.thrift.protocol.TMap(
                    org.apache.thrift.protocol.TType.STRING,
                    org.apache.thrift.protocol.TType.STRUCT,
                    struct.groups.size()));
            for (Map.Entry<String, GroupData> _iter12 : struct.groups.entrySet()) {
              oprot.writeString(_iter12.getKey());
              _iter12.getValue().write(oprot);
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
Esempio n. 4
0
  public int compareTo(ClusterData other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;
    ClusterData typedOther = (ClusterData) other;

    lastComparison = Boolean.valueOf(isSetClusterName()).compareTo(typedOther.isSetClusterName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetClusterName()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.clusterName, typedOther.clusterName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetGroups()).compareTo(typedOther.isSetGroups());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetGroups()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.groups, typedOther.groups);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
Esempio n. 5
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, ClusterData 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: // CLUSTER_NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.clusterName = iprot.readString();
              struct.setClusterNameIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // GROUPS
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map8 = iprot.readMapBegin();
                struct.groups = new HashMap<String, GroupData>(2 * _map8.size);
                for (int _i9 = 0; _i9 < _map8.size; ++_i9) {
                  String _key10; // required
                  GroupData _val11; // required
                  _key10 = iprot.readString();
                  _val11 = new GroupData();
                  _val11.read(iprot);
                  struct.groups.put(_key10, _val11);
                }
                iprot.readMapEnd();
              }
              struct.setGroupsIsSet(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();
    }
Esempio n. 6
0
  public boolean equals(ClusterData that) {
    if (that == null) return false;

    boolean this_present_clusterName = true && this.isSetClusterName();
    boolean that_present_clusterName = true && that.isSetClusterName();
    if (this_present_clusterName || that_present_clusterName) {
      if (!(this_present_clusterName && that_present_clusterName)) return false;
      if (!this.clusterName.equals(that.clusterName)) return false;
    }

    boolean this_present_groups = true && this.isSetGroups();
    boolean that_present_groups = true && that.isSetGroups();
    if (this_present_groups || that_present_groups) {
      if (!(this_present_groups && that_present_groups)) return false;
      if (!this.groups.equals(that.groups)) return false;
    }

    return true;
  }
Esempio n. 7
0
  /** Performs a deep copy on <i>other</i>. */
  public ClusterData(ClusterData other) {
    if (other.isSetClusterName()) {
      this.clusterName = other.clusterName;
    }
    if (other.isSetGroups()) {
      Map<String, GroupData> __this__groups = new HashMap<String, GroupData>();
      for (Map.Entry<String, GroupData> other_element : other.groups.entrySet()) {

        String other_element_key = other_element.getKey();
        GroupData other_element_value = other_element.getValue();

        String __this__groups_copy_key = other_element_key;

        GroupData __this__groups_copy_value = new GroupData(other_element_value);

        __this__groups.put(__this__groups_copy_key, __this__groups_copy_value);
      }
      this.groups = __this__groups;
    }
  }