コード例 #1
0
ファイル: WorkerInfo.java プロジェクト: shmilywork/tachyon
 @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);
   }
 }
コード例 #2
0
ファイル: WorkerInfo.java プロジェクト: shmilywork/tachyon
  public boolean equals(WorkerInfo that) {
    if (that == null) return false;

    boolean this_present_id = true;
    boolean that_present_id = true;
    if (this_present_id || that_present_id) {
      if (!(this_present_id && that_present_id)) return false;
      if (this.id != that.id) return false;
    }

    boolean this_present_address = true && this.isSetAddress();
    boolean that_present_address = true && that.isSetAddress();
    if (this_present_address || that_present_address) {
      if (!(this_present_address && that_present_address)) return false;
      if (!this.address.equals(that.address)) return false;
    }

    boolean this_present_lastContactSec = true;
    boolean that_present_lastContactSec = true;
    if (this_present_lastContactSec || that_present_lastContactSec) {
      if (!(this_present_lastContactSec && that_present_lastContactSec)) return false;
      if (this.lastContactSec != that.lastContactSec) return false;
    }

    boolean this_present_state = true && this.isSetState();
    boolean that_present_state = true && that.isSetState();
    if (this_present_state || that_present_state) {
      if (!(this_present_state && that_present_state)) return false;
      if (!this.state.equals(that.state)) return false;
    }

    boolean this_present_capacityBytes = true;
    boolean that_present_capacityBytes = true;
    if (this_present_capacityBytes || that_present_capacityBytes) {
      if (!(this_present_capacityBytes && that_present_capacityBytes)) return false;
      if (this.capacityBytes != that.capacityBytes) return false;
    }

    boolean this_present_usedBytes = true;
    boolean that_present_usedBytes = true;
    if (this_present_usedBytes || that_present_usedBytes) {
      if (!(this_present_usedBytes && that_present_usedBytes)) return false;
      if (this.usedBytes != that.usedBytes) return false;
    }

    boolean this_present_startTimeMs = true;
    boolean that_present_startTimeMs = true;
    if (this_present_startTimeMs || that_present_startTimeMs) {
      if (!(this_present_startTimeMs && that_present_startTimeMs)) return false;
      if (this.startTimeMs != that.startTimeMs) return false;
    }

    return true;
  }
コード例 #3
0
ファイル: WorkerInfo.java プロジェクト: shmilywork/tachyon
 /** Performs a deep copy on <i>other</i>. */
 public WorkerInfo(WorkerInfo other) {
   __isset_bitfield = other.__isset_bitfield;
   this.id = other.id;
   if (other.isSetAddress()) {
     this.address = new tachyon.thrift.NetAddress(other.address);
   }
   this.lastContactSec = other.lastContactSec;
   if (other.isSetState()) {
     this.state = other.state;
   }
   this.capacityBytes = other.capacityBytes;
   this.usedBytes = other.usedBytes;
   this.startTimeMs = other.startTimeMs;
 }
コード例 #4
0
ファイル: WorkerInfo.java プロジェクト: shmilywork/tachyon
  @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;
  }