range.isStartRowInclusive() == false))) { if(Bytes.equals(range.stopRow, HConstants.EMPTY_BYTE_ARRAY)) { newRanges.add(new RowRange(lastStartRow, lastStartRowInclusive, range.stopRow,
public void assertRangesEqual(List<RowRange> expected, List<RowRange> actual) { assertEquals(expected.size(), actual.size()); for(int i = 0; i < expected.size(); i++) { Assert.assertTrue(Bytes.equals(expected.get(i).getStartRow(), actual.get(i).getStartRow())); Assert.assertTrue(expected.get(i).isStartRowInclusive() == actual.get(i).isStartRowInclusive()); Assert.assertTrue(Bytes.equals(expected.get(i).getStopRow(), actual.get(i).getStopRow())); Assert.assertTrue(expected.get(i).isStopRowInclusive() == actual.get(i).isStopRowInclusive()); } }
this.ranges = new ArrayList<>(); for(RowRange range : ((MultiRowRangeFilter)filter).getRowRanges()) { this.ranges.add(new RowRange(range.getStartRow(), range.isStartRowInclusive(), range.getStopRow(), range.isStopRowInclusive()));
range.isStartRowInclusive() == false))) { if(Bytes.equals(range.stopRow, HConstants.EMPTY_BYTE_ARRAY)) { newRanges.add(new RowRange(lastStartRow, lastStartRowInclusive, range.stopRow,
this.ranges = new ArrayList<>(); for(RowRange range : ((MultiRowRangeFilter)filter).getRowRanges()) { this.ranges.add(new RowRange(range.getStartRow(), range.isStartRowInclusive(), range.getStopRow(), range.isStopRowInclusive()));
this.ranges = new ArrayList<>(); for(RowRange range : ((MultiRowRangeFilter)filter).getRowRanges()) { this.ranges.add(new RowRange(range.getStartRow(), range.isStartRowInclusive(), range.getStopRow(), range.isStopRowInclusive()));
range.isStartRowInclusive() == false))) { if(Bytes.equals(range.stopRow, HConstants.EMPTY_BYTE_ARRAY)) { newRanges.add(new RowRange(lastStartRow, lastStartRowInclusive, range.stopRow,
private Range<RowKeyWrapper> rowRangeToRange(RowRange rowRange) { boolean startUnbounded = HConstants.EMPTY_BYTE_ARRAY.equals(rowRange.getStartRow()); RowKeyWrapper start = new RowKeyWrapper(ByteString.copyFrom(rowRange.getStartRow())); BoundType startboundType = rowRange.isStartRowInclusive() ? BoundType.CLOSED : BoundType.OPEN; boolean stopUnbounded = HConstants.EMPTY_BYTE_ARRAY.equals(rowRange.getStopRow()); RowKeyWrapper stop = new RowKeyWrapper(ByteString.copyFrom(rowRange.getStopRow())); BoundType stopboundType = rowRange.isStopRowInclusive() ? BoundType.CLOSED : BoundType.OPEN; if (startUnbounded && stopUnbounded) { return Range.all(); } else if (startUnbounded) { return Range.upTo(stop, stopboundType); } else if (stopUnbounded) { return Range.downTo(start, startboundType); } else { return Range.range(start, startboundType, stop, stopboundType); } } }
private Range<RowKeyWrapper> rowRangeToRange(RowRange rowRange) { boolean startUnbounded = HConstants.EMPTY_BYTE_ARRAY.equals(rowRange.getStartRow()); RowKeyWrapper start = new RowKeyWrapper(ByteString.copyFrom(rowRange.getStartRow())); BoundType startboundType = rowRange.isStartRowInclusive() ? BoundType.CLOSED : BoundType.OPEN; boolean stopUnbounded = HConstants.EMPTY_BYTE_ARRAY.equals(rowRange.getStopRow()); RowKeyWrapper stop = new RowKeyWrapper(ByteString.copyFrom(rowRange.getStopRow())); BoundType stopboundType = rowRange.isStopRowInclusive() ? BoundType.CLOSED : BoundType.OPEN; if (startUnbounded && stopUnbounded) { return Range.all(); } else if (startUnbounded) { return Range.upTo(stop, stopboundType); } else if (stopUnbounded) { return Range.downTo(start, startboundType); } else { return Range.range(start, startboundType, stop, stopboundType); } } }
public void assertRangesEqual(List<RowRange> expected, List<RowRange> actual) { assertEquals(expected.size(), actual.size()); for(int i = 0; i < expected.size(); i++) { Assert.assertTrue(Bytes.equals(expected.get(i).getStartRow(), actual.get(i).getStartRow())); Assert.assertTrue(expected.get(i).isStartRowInclusive() == actual.get(i).isStartRowInclusive()); Assert.assertTrue(Bytes.equals(expected.get(i).getStopRow(), actual.get(i).getStopRow())); Assert.assertTrue(expected.get(i).isStopRowInclusive() == actual.get(i).isStopRowInclusive()); } }
range.isStartRowInclusive() == false))) { if(Bytes.equals(range.stopRow, HConstants.EMPTY_BYTE_ARRAY)) { newRanges.add(new RowRange(lastStartRow, lastStartRowInclusive, range.stopRow,
@Override public boolean equals(Object obj){ if (!(obj instanceof RowRange)) { return false; } if (this == obj) { return true; } RowRange rr = (RowRange) obj; return Bytes.equals(this.stopRow, rr.getStopRow()) && Bytes.equals(this.startRow, this.getStartRow()) && this.startRowInclusive == rr.isStartRowInclusive() && this.stopRowInclusive == rr.isStopRowInclusive(); }