コード例 #1
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;
  }
コード例 #2
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;
 }
コード例 #3
0
ファイル: WorkerInfo.java プロジェクト: shmilywork/tachyon
    public void write(org.apache.thrift.protocol.TProtocol oprot, WorkerInfo struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ID_FIELD_DESC);
      oprot.writeI64(struct.id);
      oprot.writeFieldEnd();
      if (struct.address != null) {
        oprot.writeFieldBegin(ADDRESS_FIELD_DESC);
        struct.address.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(LAST_CONTACT_SEC_FIELD_DESC);
      oprot.writeI32(struct.lastContactSec);
      oprot.writeFieldEnd();
      if (struct.state != null) {
        oprot.writeFieldBegin(STATE_FIELD_DESC);
        oprot.writeString(struct.state);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(CAPACITY_BYTES_FIELD_DESC);
      oprot.writeI64(struct.capacityBytes);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(USED_BYTES_FIELD_DESC);
      oprot.writeI64(struct.usedBytes);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(START_TIME_MS_FIELD_DESC);
      oprot.writeI64(struct.startTimeMs);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
コード例 #4
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);
   }
 }
コード例 #5
0
ファイル: WorkerInfo.java プロジェクト: shmilywork/tachyon
    public void read(org.apache.thrift.protocol.TProtocol iprot, WorkerInfo 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: // ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.id = iprot.readI64();
              struct.setIdIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // ADDRESS
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.address = new tachyon.thrift.NetAddress();
              struct.address.read(iprot);
              struct.setAddressIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // LAST_CONTACT_SEC
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.lastContactSec = iprot.readI32();
              struct.setLastContactSecIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // STATE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.state = iprot.readString();
              struct.setStateIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // CAPACITY_BYTES
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.capacityBytes = iprot.readI64();
              struct.setCapacityBytesIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // USED_BYTES
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.usedBytes = iprot.readI64();
              struct.setUsedBytesIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // START_TIME_MS
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.startTimeMs = iprot.readI64();
              struct.setStartTimeMsIsSet(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();
    }
コード例 #6
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;
  }
コード例 #7
0
ファイル: WorkerInfo.java プロジェクト: shmilywork/tachyon
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, WorkerInfo struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(7);
   if (incoming.get(0)) {
     struct.id = iprot.readI64();
     struct.setIdIsSet(true);
   }
   if (incoming.get(1)) {
     struct.address = new tachyon.thrift.NetAddress();
     struct.address.read(iprot);
     struct.setAddressIsSet(true);
   }
   if (incoming.get(2)) {
     struct.lastContactSec = iprot.readI32();
     struct.setLastContactSecIsSet(true);
   }
   if (incoming.get(3)) {
     struct.state = iprot.readString();
     struct.setStateIsSet(true);
   }
   if (incoming.get(4)) {
     struct.capacityBytes = iprot.readI64();
     struct.setCapacityBytesIsSet(true);
   }
   if (incoming.get(5)) {
     struct.usedBytes = iprot.readI64();
     struct.setUsedBytesIsSet(true);
   }
   if (incoming.get(6)) {
     struct.startTimeMs = iprot.readI64();
     struct.setStartTimeMsIsSet(true);
   }
 }