Beispiel #1
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, WorkerInfo struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetId()) {
     optionals.set(0);
   }
   if (struct.isSetAddress()) {
     optionals.set(1);
   }
   if (struct.isSetLastContactSec()) {
     optionals.set(2);
   }
   if (struct.isSetState()) {
     optionals.set(3);
   }
   if (struct.isSetCapacityBytes()) {
     optionals.set(4);
   }
   if (struct.isSetUsedBytes()) {
     optionals.set(5);
   }
   if (struct.isSetStartTimeMs()) {
     optionals.set(6);
   }
   oprot.writeBitSet(optionals, 7);
   if (struct.isSetId()) {
     oprot.writeI64(struct.id);
   }
   if (struct.isSetAddress()) {
     struct.address.write(oprot);
   }
   if (struct.isSetLastContactSec()) {
     oprot.writeI32(struct.lastContactSec);
   }
   if (struct.isSetState()) {
     oprot.writeString(struct.state);
   }
   if (struct.isSetCapacityBytes()) {
     oprot.writeI64(struct.capacityBytes);
   }
   if (struct.isSetUsedBytes()) {
     oprot.writeI64(struct.usedBytes);
   }
   if (struct.isSetStartTimeMs()) {
     oprot.writeI64(struct.startTimeMs);
   }
 }
Beispiel #2
0
  @Override
  public int compareTo(WorkerInfo other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAddress()).compareTo(other.isSetAddress());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAddress()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.address, other.address);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetLastContactSec()).compareTo(other.isSetLastContactSec());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLastContactSec()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.lastContactSec, other.lastContactSec);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetState()).compareTo(other.isSetState());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetState()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.state, other.state);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCapacityBytes()).compareTo(other.isSetCapacityBytes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCapacityBytes()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.capacityBytes, other.capacityBytes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetUsedBytes()).compareTo(other.isSetUsedBytes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUsedBytes()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.usedBytes, other.usedBytes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetStartTimeMs()).compareTo(other.isSetStartTimeMs());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStartTimeMs()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startTimeMs, other.startTimeMs);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }