Beispiel #1
0
  @Override
  public int compareTo(CheckpointFile other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetFileId()).compareTo(other.isSetFileId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFileId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileId, other.fileId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetBlockIds()).compareTo(other.isSetBlockIds());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBlockIds()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.blockIds, other.blockIds);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
Beispiel #2
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, LineageCommand struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(2);
   if (incoming.get(0)) {
     struct.commandType = tachyon.thrift.CommandType.findByValue(iprot.readI32());
     struct.setCommandTypeIsSet(true);
   }
   if (incoming.get(1)) {
     {
       org.apache.thrift.protocol.TList _list13 =
           new org.apache.thrift.protocol.TList(
               org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
       struct.checkpointFiles = new ArrayList<CheckpointFile>(_list13.size);
       CheckpointFile _elem14;
       for (int _i15 = 0; _i15 < _list13.size; ++_i15) {
         _elem14 = new CheckpointFile();
         _elem14.read(iprot);
         struct.checkpointFiles.add(_elem14);
       }
     }
     struct.setCheckpointFilesIsSet(true);
   }
 }
Beispiel #3
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, LineageCommand struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.commandType != null) {
        oprot.writeFieldBegin(COMMAND_TYPE_FIELD_DESC);
        oprot.writeI32(struct.commandType.getValue());
        oprot.writeFieldEnd();
      }
      if (struct.checkpointFiles != null) {
        oprot.writeFieldBegin(CHECKPOINT_FILES_FIELD_DESC);
        {
          oprot.writeListBegin(
              new org.apache.thrift.protocol.TList(
                  org.apache.thrift.protocol.TType.STRUCT, struct.checkpointFiles.size()));
          for (CheckpointFile _iter11 : struct.checkpointFiles) {
            _iter11.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
Beispiel #4
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, LineageCommand 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: // COMMAND_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.commandType = tachyon.thrift.CommandType.findByValue(iprot.readI32());
              struct.setCommandTypeIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // CHECKPOINT_FILES
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
                struct.checkpointFiles = new ArrayList<CheckpointFile>(_list8.size);
                CheckpointFile _elem9;
                for (int _i10 = 0; _i10 < _list8.size; ++_i10) {
                  _elem9 = new CheckpointFile();
                  _elem9.read(iprot);
                  struct.checkpointFiles.add(_elem9);
                }
                iprot.readListEnd();
              }
              struct.setCheckpointFilesIsSet(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();
    }
Beispiel #5
0
 /** Performs a deep copy on <i>other</i>. */
 public CheckpointFile(CheckpointFile other) {
   __isset_bitfield = other.__isset_bitfield;
   this.fileId = other.fileId;
   if (other.isSetBlockIds()) {
     List<Long> __this__blockIds = new ArrayList<Long>(other.blockIds);
     this.blockIds = __this__blockIds;
   }
 }
Beispiel #6
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, CheckpointFile 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: // FILE_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.fileId = iprot.readI64();
              struct.setFileIdIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // BLOCK_IDS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
                struct.blockIds = new ArrayList<Long>(_list0.size);
                long _elem1;
                for (int _i2 = 0; _i2 < _list0.size; ++_i2) {
                  _elem1 = iprot.readI64();
                  struct.blockIds.add(_elem1);
                }
                iprot.readListEnd();
              }
              struct.setBlockIdsIsSet(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();
    }
Beispiel #7
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, LineageCommand struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetCommandType()) {
     optionals.set(0);
   }
   if (struct.isSetCheckpointFiles()) {
     optionals.set(1);
   }
   oprot.writeBitSet(optionals, 2);
   if (struct.isSetCommandType()) {
     oprot.writeI32(struct.commandType.getValue());
   }
   if (struct.isSetCheckpointFiles()) {
     {
       oprot.writeI32(struct.checkpointFiles.size());
       for (CheckpointFile _iter12 : struct.checkpointFiles) {
         _iter12.write(oprot);
       }
     }
   }
 }
Beispiel #8
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, CheckpointFile struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(2);
   if (incoming.get(0)) {
     struct.fileId = iprot.readI64();
     struct.setFileIdIsSet(true);
   }
   if (incoming.get(1)) {
     {
       org.apache.thrift.protocol.TList _list5 =
           new org.apache.thrift.protocol.TList(
               org.apache.thrift.protocol.TType.I64, iprot.readI32());
       struct.blockIds = new ArrayList<Long>(_list5.size);
       long _elem6;
       for (int _i7 = 0; _i7 < _list5.size; ++_i7) {
         _elem6 = iprot.readI64();
         struct.blockIds.add(_elem6);
       }
     }
     struct.setBlockIdsIsSet(true);
   }
 }
Beispiel #9
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, CheckpointFile struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetFileId()) {
     optionals.set(0);
   }
   if (struct.isSetBlockIds()) {
     optionals.set(1);
   }
   oprot.writeBitSet(optionals, 2);
   if (struct.isSetFileId()) {
     oprot.writeI64(struct.fileId);
   }
   if (struct.isSetBlockIds()) {
     {
       oprot.writeI32(struct.blockIds.size());
       for (long _iter4 : struct.blockIds) {
         oprot.writeI64(_iter4);
       }
     }
   }
 }
Beispiel #10
0
  public boolean equals(CheckpointFile that) {
    if (that == null) return false;

    boolean this_present_fileId = true;
    boolean that_present_fileId = true;
    if (this_present_fileId || that_present_fileId) {
      if (!(this_present_fileId && that_present_fileId)) return false;
      if (this.fileId != that.fileId) return false;
    }

    boolean this_present_blockIds = true && this.isSetBlockIds();
    boolean that_present_blockIds = true && that.isSetBlockIds();
    if (this_present_blockIds || that_present_blockIds) {
      if (!(this_present_blockIds && that_present_blockIds)) return false;
      if (!this.blockIds.equals(that.blockIds)) return false;
    }

    return true;
  }
Beispiel #11
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, CheckpointFile struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(FILE_ID_FIELD_DESC);
      oprot.writeI64(struct.fileId);
      oprot.writeFieldEnd();
      if (struct.blockIds != null) {
        oprot.writeFieldBegin(BLOCK_IDS_FIELD_DESC);
        {
          oprot.writeListBegin(
              new org.apache.thrift.protocol.TList(
                  org.apache.thrift.protocol.TType.I64, struct.blockIds.size()));
          for (long _iter3 : struct.blockIds) {
            oprot.writeI64(_iter3);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }