Ejemplo n.º 1
0
 /** Performs a deep copy on <i>other</i>. */
 public THdfsFileDesc(THdfsFileDesc other) {
   __isset_bitfield = other.__isset_bitfield;
   if (other.isSetFile_name()) {
     this.file_name = other.file_name;
   }
   this.length = other.length;
   if (other.isSetCompression()) {
     this.compression = other.compression;
   }
   this.last_modification_time = other.last_modification_time;
   if (other.isSetFile_blocks()) {
     List<THdfsFileBlock> __this__file_blocks = new ArrayList<THdfsFileBlock>();
     for (THdfsFileBlock other_element : other.file_blocks) {
       __this__file_blocks.add(new THdfsFileBlock(other_element));
     }
     this.file_blocks = __this__file_blocks;
   }
 }
Ejemplo n.º 2
0
  public boolean equals(THdfsFileDesc that) {
    if (that == null) return false;

    boolean this_present_file_name = true && this.isSetFile_name();
    boolean that_present_file_name = true && that.isSetFile_name();
    if (this_present_file_name || that_present_file_name) {
      if (!(this_present_file_name && that_present_file_name)) return false;
      if (!this.file_name.equals(that.file_name)) return false;
    }

    boolean this_present_length = true;
    boolean that_present_length = true;
    if (this_present_length || that_present_length) {
      if (!(this_present_length && that_present_length)) return false;
      if (this.length != that.length) return false;
    }

    boolean this_present_compression = true && this.isSetCompression();
    boolean that_present_compression = true && that.isSetCompression();
    if (this_present_compression || that_present_compression) {
      if (!(this_present_compression && that_present_compression)) return false;
      if (!this.compression.equals(that.compression)) return false;
    }

    boolean this_present_last_modification_time = true;
    boolean that_present_last_modification_time = true;
    if (this_present_last_modification_time || that_present_last_modification_time) {
      if (!(this_present_last_modification_time && that_present_last_modification_time))
        return false;
      if (this.last_modification_time != that.last_modification_time) return false;
    }

    boolean this_present_file_blocks = true && this.isSetFile_blocks();
    boolean that_present_file_blocks = true && that.isSetFile_blocks();
    if (this_present_file_blocks || that_present_file_blocks) {
      if (!(this_present_file_blocks && that_present_file_blocks)) return false;
      if (!this.file_blocks.equals(that.file_blocks)) return false;
    }

    return true;
  }
Ejemplo n.º 3
0
  public int compareTo(THdfsFileDesc other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;
    THdfsFileDesc typedOther = (THdfsFileDesc) other;

    lastComparison = Boolean.valueOf(isSetFile_name()).compareTo(typedOther.isSetFile_name());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFile_name()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.file_name, typedOther.file_name);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetLength()).compareTo(typedOther.isSetLength());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLength()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.length, typedOther.length);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCompression()).compareTo(typedOther.isSetCompression());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCompression()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.compression, typedOther.compression);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetLast_modification_time())
            .compareTo(typedOther.isSetLast_modification_time());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLast_modification_time()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(
              this.last_modification_time, typedOther.last_modification_time);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetFile_blocks()).compareTo(typedOther.isSetFile_blocks());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFile_blocks()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.file_blocks, typedOther.file_blocks);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }