Exemplo n.º 1
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, UserCrawlState struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetUid()) {
     optionals.set(0);
   }
   if (struct.isSetSinceID()) {
     optionals.set(1);
   }
   if (struct.isSetLastCrawlTime()) {
     optionals.set(2);
   }
   if (struct.isSetLastCrawlNum()) {
     optionals.set(3);
   }
   oprot.writeBitSet(optionals, 4);
   if (struct.isSetUid()) {
     oprot.writeString(struct.uid);
   }
   if (struct.isSetSinceID()) {
     oprot.writeI64(struct.sinceID);
   }
   if (struct.isSetLastCrawlTime()) {
     oprot.writeI64(struct.lastCrawlTime);
   }
   if (struct.isSetLastCrawlNum()) {
     oprot.writeI16(struct.lastCrawlNum);
   }
 }
Exemplo n.º 2
0
  public boolean equals(UserCrawlState that) {
    if (that == null) return false;

    boolean this_present_uid = true && this.isSetUid();
    boolean that_present_uid = true && that.isSetUid();
    if (this_present_uid || that_present_uid) {
      if (!(this_present_uid && that_present_uid)) return false;
      if (!this.uid.equals(that.uid)) return false;
    }

    boolean this_present_sinceID = true;
    boolean that_present_sinceID = true;
    if (this_present_sinceID || that_present_sinceID) {
      if (!(this_present_sinceID && that_present_sinceID)) return false;
      if (this.sinceID != that.sinceID) return false;
    }

    boolean this_present_lastCrawlTime = true;
    boolean that_present_lastCrawlTime = true;
    if (this_present_lastCrawlTime || that_present_lastCrawlTime) {
      if (!(this_present_lastCrawlTime && that_present_lastCrawlTime)) return false;
      if (this.lastCrawlTime != that.lastCrawlTime) return false;
    }

    boolean this_present_lastCrawlNum = true;
    boolean that_present_lastCrawlNum = true;
    if (this_present_lastCrawlNum || that_present_lastCrawlNum) {
      if (!(this_present_lastCrawlNum && that_present_lastCrawlNum)) return false;
      if (this.lastCrawlNum != that.lastCrawlNum) return false;
    }

    return true;
  }
Exemplo n.º 3
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, UserCrawlState 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: // UID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.uid = iprot.readString();
              struct.setUidIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // SINCE_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.sinceID = iprot.readI64();
              struct.setSinceIDIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // LAST_CRAWL_TIME
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.lastCrawlTime = iprot.readI64();
              struct.setLastCrawlTimeIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // LAST_CRAWL_NUM
            if (schemeField.type == org.apache.thrift.protocol.TType.I16) {
              struct.lastCrawlNum = iprot.readI16();
              struct.setLastCrawlNumIsSet(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();
    }
Exemplo n.º 4
0
 /** Performs a deep copy on <i>other</i>. */
 public UserCrawlState(UserCrawlState other) {
   __isset_bitfield = other.__isset_bitfield;
   if (other.isSetUid()) {
     this.uid = other.uid;
   }
   this.sinceID = other.sinceID;
   this.lastCrawlTime = other.lastCrawlTime;
   this.lastCrawlNum = other.lastCrawlNum;
 }
Exemplo n.º 5
0
  @Override
  public int compareTo(UserCrawlState other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetUid()).compareTo(other.isSetUid());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUid()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uid, other.uid);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSinceID()).compareTo(other.isSetSinceID());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSinceID()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sinceID, other.sinceID);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetLastCrawlTime()).compareTo(other.isSetLastCrawlTime());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLastCrawlTime()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.lastCrawlTime, other.lastCrawlTime);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetLastCrawlNum()).compareTo(other.isSetLastCrawlNum());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLastCrawlNum()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.lastCrawlNum, other.lastCrawlNum);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
Exemplo n.º 6
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, UserCrawlState struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(4);
   if (incoming.get(0)) {
     struct.uid = iprot.readString();
     struct.setUidIsSet(true);
   }
   if (incoming.get(1)) {
     struct.sinceID = iprot.readI64();
     struct.setSinceIDIsSet(true);
   }
   if (incoming.get(2)) {
     struct.lastCrawlTime = iprot.readI64();
     struct.setLastCrawlTimeIsSet(true);
   }
   if (incoming.get(3)) {
     struct.lastCrawlNum = iprot.readI16();
     struct.setLastCrawlNumIsSet(true);
   }
 }
Exemplo n.º 7
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, UserCrawlState struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.uid != null) {
        oprot.writeFieldBegin(UID_FIELD_DESC);
        oprot.writeString(struct.uid);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(SINCE_ID_FIELD_DESC);
      oprot.writeI64(struct.sinceID);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(LAST_CRAWL_TIME_FIELD_DESC);
      oprot.writeI64(struct.lastCrawlTime);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(LAST_CRAWL_NUM_FIELD_DESC);
      oprot.writeI16(struct.lastCrawlNum);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }