예제 #1
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, BlockLocation struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetWorkerId()) {
     optionals.set(0);
   }
   if (struct.isSetWorkerAddress()) {
     optionals.set(1);
   }
   if (struct.isSetTierAlias()) {
     optionals.set(2);
   }
   oprot.writeBitSet(optionals, 3);
   if (struct.isSetWorkerId()) {
     oprot.writeI64(struct.workerId);
   }
   if (struct.isSetWorkerAddress()) {
     struct.workerAddress.write(oprot);
   }
   if (struct.isSetTierAlias()) {
     oprot.writeString(struct.tierAlias);
   }
 }
예제 #2
0
  public boolean equals(BlockLocation that) {
    if (that == null) return false;

    boolean this_present_workerId = true;
    boolean that_present_workerId = true;
    if (this_present_workerId || that_present_workerId) {
      if (!(this_present_workerId && that_present_workerId)) return false;
      if (this.workerId != that.workerId) return false;
    }

    boolean this_present_workerAddress = true && this.isSetWorkerAddress();
    boolean that_present_workerAddress = true && that.isSetWorkerAddress();
    if (this_present_workerAddress || that_present_workerAddress) {
      if (!(this_present_workerAddress && that_present_workerAddress)) return false;
      if (!this.workerAddress.equals(that.workerAddress)) return false;
    }

    boolean this_present_tierAlias = true && this.isSetTierAlias();
    boolean that_present_tierAlias = true && that.isSetTierAlias();
    if (this_present_tierAlias || that_present_tierAlias) {
      if (!(this_present_tierAlias && that_present_tierAlias)) return false;
      if (!this.tierAlias.equals(that.tierAlias)) return false;
    }

    return true;
  }
예제 #3
0
 /** Performs a deep copy on <i>other</i>. */
 public BlockLocation(BlockLocation other) {
   __isset_bitfield = other.__isset_bitfield;
   this.workerId = other.workerId;
   if (other.isSetWorkerAddress()) {
     this.workerAddress = other.workerAddress;
   }
   if (other.isSetTierAlias()) {
     this.tierAlias = other.tierAlias;
   }
 }
예제 #4
0
  @Override
  public int compareTo(BlockLocation other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetWorkerId()).compareTo(other.isSetWorkerId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetWorkerId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workerId, other.workerId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetWorkerAddress()).compareTo(other.isSetWorkerAddress());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetWorkerAddress()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.workerAddress, other.workerAddress);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTierAlias()).compareTo(other.isSetTierAlias());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTierAlias()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tierAlias, other.tierAlias);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }