@Test public void testNeedsToBeChopped_DifferentTables() { expect(keyExtent.tableId()).andReturn(TableId.of("table1")); replay(keyExtent); KeyExtent keyExtent2 = createMock(KeyExtent.class); expect(keyExtent2.tableId()).andReturn(TableId.of("table2")); replay(keyExtent2); mi = new MergeInfo(keyExtent, MergeInfo.Operation.MERGE); assertFalse(mi.needsToBeChopped(keyExtent2)); }
public boolean needsToBeChopped(KeyExtent otherExtent) { if (!otherExtent.tableId().equals(extent.tableId())) return false; if (isDelete()) return otherExtent.prevEndRow() != null && otherExtent.prevEndRow().equals(extent.endRow()); else return this.extent.overlaps(otherExtent); }
MergeInfo implements Writable { public boolean needsToBeChopped(KeyExtent otherExtent) { if (!otherExtent.tableId().equals(extent.tableId())) return false; if (isDelete()) return otherExtent.prevEndRow() != null && otherExtent.prevEndRow().equals(extent.endRow()); else return this.extent.overlaps(otherExtent); } }
MergeInfo implements Writable { public boolean needsToBeChopped(KeyExtent otherExtent) { if (!otherExtent.tableId().equals(extent.tableId())) return false; if (isDelete()) return otherExtent.prevEndRow() != null && otherExtent.prevEndRow().equals(extent.endRow()); else return this.extent.overlaps(otherExtent); } MergeInfo();  MergeInfo(KeyExtent range, Operation op); }
MergeInfo implements Writable { public boolean needsToBeChopped(KeyExtent otherExtent) { if (!otherExtent.tableId().equals(extent.tableId())) return false; if (isDelete()) return otherExtent.prevEndRow() != null && otherExtent.prevEndRow().equals(extent.endRow()); else return this.extent.overlaps(otherExtent); } MergeInfo();  MergeInfo(KeyExtent range, Operation op); @Override void readFields(DataInput in); @Override void write(DataOutput out); MergeState getState(); KeyExtent getExtent(); Operation getOperation(); void setState(MergeState state); boolean isDelete(); boolean needsToBeChopped(KeyExtent otherExtent); boolean overlaps(KeyExtent otherExtent); @Override String toString(); }
MergeInfo implements Writable { public boolean needsToBeChopped(KeyExtent otherExtent) { if (!otherExtent.tableId().equals(extent.tableId())) return false; if (isDelete()) return otherExtent.prevEndRow() != null && otherExtent.prevEndRow().equals(extent.endRow()); else return this.extent.overlaps(otherExtent); } MergeInfo();  MergeInfo(KeyExtent range, Operation op); @Override void readFields(DataInput in); @Override void write(DataOutput out); MergeState getState(); KeyExtent getExtent(); Operation getOperation(); void setState(MergeState state); boolean isDelete(); boolean needsToBeChopped(KeyExtent otherExtent); boolean overlaps(KeyExtent otherExtent); @Override String toString();  }