@Test public void testGetOldestTimestamp() { LocalTable localTable = new LocalTable(null); List<Cell> cellList1 = getCellList(new KeyValue(ROW, 5L), new KeyValue(ROW, 4L)); assertEquals(4L, localTable.getOldestTimestamp(Collections.singletonList(cellList1))); List<Cell> cellList2 = getCellList(new KeyValue(ROW, 5L), new KeyValue(ROW, 2L)); List<List<Cell>> set1 = new ArrayList<>(Arrays.asList(cellList1, cellList2)); assertEquals(2L, localTable.getOldestTimestamp(set1)); List<Cell> cellList3 = getCellList(new KeyValue(ROW, 1L)); set1.add(cellList3); assertEquals(1L, localTable.getOldestTimestamp(set1)); List<Cell> cellList4 = getCellList(new KeyValue(ROW, 3L), new KeyValue(ROW, 1L), new KeyValue(ROW, 0L)); set1.add(cellList4); assertEquals(0L, localTable.getOldestTimestamp(set1)); }
protected long getOldestTimestamp(Collection<List<Cell>> cellLists) { Ordering<List<Cell>> cellListOrdering = new Ordering<List<Cell>>() { @Override public int compare(List<Cell> left, List<Cell> right) { return Longs.compare(Iterables.getLast(left).getTimestamp(), Iterables.getLast(right).getTimestamp()); } }; List<Cell> minList = cellListOrdering.min(cellLists); return Iterables.getLast(minList).getTimestamp(); }
LocalTable implements LocalHBaseState { protected long getOldestTimestamp(Collection<List<Cell>> cellLists) { Ordering<List<Cell>> cellListOrdering = new Ordering<List<Cell>>() { @Override public int compare(List<Cell> left, List<Cell> right) { return Longs.compare(Iterables.getLast(left).getTimestamp(), Iterables.getLast(right).getTimestamp()); } }; List<Cell> minList = cellListOrdering.min(cellLists); return Iterables.getLast(minList).getTimestamp(); } }
LocalTable implements LocalHBaseState { protected long getOldestTimestamp(Collection<List<Cell>> cellLists) { Ordering<List<Cell>> cellListOrdering = new Ordering<List<Cell>>() { @Override public int compare(List<Cell> left, List<Cell> right) { return Longs.compare(Iterables.getLast(left).getTimestamp(), Iterables.getLast(right).getTimestamp()); } }; List<Cell> minList = cellListOrdering.min(cellLists); return Iterables.getLast(minList).getTimestamp(); } LocalTable(RegionCoprocessorEnvironment env); }
LocalTable implements LocalHBaseState { protected long getOldestTimestamp(Collection<List<Cell>> cellLists) { Ordering<List<Cell>> cellListOrdering = new Ordering<List<Cell>>() { @Override public int compare(List<Cell> left, List<Cell> right) { return Longs.compare(Iterables.getLast(left).getTimestamp(), Iterables.getLast(right).getTimestamp()); } }; List<Cell> minList = cellListOrdering.min(cellLists); return Iterables.getLast(minList).getTimestamp(); } LocalTable(RegionCoprocessorEnvironment env); @Override Result getCurrentRowState(Mutation m, Collection<? extends ColumnReference> columns, boolean ignoreNewerMutations); }
LocalTable implements LocalHBaseState { protected long getOldestTimestamp(Collection<List<Cell>> cellLists) { Ordering<List<Cell>> cellListOrdering = new Ordering<List<Cell>>() { @Override public int compare(List<Cell> left, List<Cell> right) { return Longs.compare(Iterables.getLast(left).getTimestamp(), Iterables.getLast(right).getTimestamp()); } }; List<Cell> minList = cellListOrdering.min(cellLists); return Iterables.getLast(minList).getTimestamp(); } LocalTable(RegionCoprocessorEnvironment env); @Override Result getCurrentRowState(Mutation m, Collection<? extends ColumnReference> columns, boolean ignoreNewerMutations);  }