Esempio n. 1
0
  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;
  }
Esempio n. 2
0
 /** 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;
   }
 }
Esempio n. 3
0
 @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);
       }
     }
   }
 }
Esempio n. 4
0
  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;
  }