コード例 #1
0
ファイル: TabletSplit.java プロジェクト: Sciumo/Accumulo
  public int compareTo(TabletSplit other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

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

    lastComparison = Boolean.valueOf(isSetOldTablet()).compareTo(typedOther.isSetOldTablet());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOldTablet()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.oldTablet, typedOther.oldTablet);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetNewTablets()).compareTo(typedOther.isSetNewTablets());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetNewTablets()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.newTablets, typedOther.newTablets);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
コード例 #2
0
ファイル: TabletSplit.java プロジェクト: Sciumo/Accumulo
 /** Performs a deep copy on <i>other</i>. */
 public TabletSplit(TabletSplit other) {
   if (other.isSetOldTablet()) {
     this.oldTablet = new org.apache.accumulo.core.data.thrift.TKeyExtent(other.oldTablet);
   }
   if (other.isSetNewTablets()) {
     List<org.apache.accumulo.core.data.thrift.TKeyExtent> __this__newTablets =
         new ArrayList<org.apache.accumulo.core.data.thrift.TKeyExtent>();
     for (org.apache.accumulo.core.data.thrift.TKeyExtent other_element : other.newTablets) {
       __this__newTablets.add(new org.apache.accumulo.core.data.thrift.TKeyExtent(other_element));
     }
     this.newTablets = __this__newTablets;
   }
 }
コード例 #3
0
ファイル: TabletSplit.java プロジェクト: ekohlwey/accumulo
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, TabletSplit struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetOldTablet()) {
     optionals.set(0);
   }
   if (struct.isSetNewTablets()) {
     optionals.set(1);
   }
   oprot.writeBitSet(optionals, 2);
   if (struct.isSetOldTablet()) {
     struct.oldTablet.write(oprot);
   }
   if (struct.isSetNewTablets()) {
     {
       oprot.writeI32(struct.newTablets.size());
       for (org.apache.accumulo.core.data.thrift.TKeyExtent _iter66 : struct.newTablets) {
         _iter66.write(oprot);
       }
     }
   }
 }
コード例 #4
0
ファイル: TabletSplit.java プロジェクト: Sciumo/Accumulo
  public boolean equals(TabletSplit that) {
    if (that == null) return false;

    boolean this_present_oldTablet = true && this.isSetOldTablet();
    boolean that_present_oldTablet = true && that.isSetOldTablet();
    if (this_present_oldTablet || that_present_oldTablet) {
      if (!(this_present_oldTablet && that_present_oldTablet)) return false;
      if (!this.oldTablet.equals(that.oldTablet)) return false;
    }

    boolean this_present_newTablets = true && this.isSetNewTablets();
    boolean that_present_newTablets = true && that.isSetNewTablets();
    if (this_present_newTablets || that_present_newTablets) {
      if (!(this_present_newTablets && that_present_newTablets)) return false;
      if (!this.newTablets.equals(that.newTablets)) return false;
    }

    return true;
  }