@Test public void testIterateWithHistory() throws UnknownHostException { long repair_end = 10; long repair_start = repair_end - 5; long iterate_start = repair_start - 5; long iterate_end = repair_end + 5; RepairEntry expectedRepairEntry = new RepairEntry(new LongTokenRange(0, 1), repair_start, Sets.newHashSet(InetAddress.getLocalHost()), "SUCCESS"); insertRecord(KEYSPACE, TABLE, expectedRepairEntry); Iterator<RepairEntry> repairEntryIterator = repairHistoryProvider.iterate(myTableReference, iterate_end, iterate_start, new SuccessfulRepairEntryPredicate(InetAddress.getLocalHost())); assertThat(repairEntryIterator.hasNext()).isTrue(); assertThat(repairEntryIterator.next()).isEqualTo(expectedRepairEntry); }
@Override public Iterator<RepairEntry> iterate(TableReference tableReference, long to, Predicate<RepairEntry> predicate) { long from = myClock.millis() - myLookbackTime; return iterate(tableReference, to, from, predicate); }
RepairHistoryProviderImpl implements RepairHistoryProvider { @Override public Iterator<RepairEntry> iterate(TableReference tableReference, long to, Predicate<RepairEntry> predicate) { long from = myClock.millis() - myLookbackTime; return iterate(tableReference, to, from, predicate); } }
RepairHistoryProviderImpl implements RepairHistoryProvider { @Override public Iterator<RepairEntry> iterate(TableReference tableReference, long to, Predicate<RepairEntry> predicate) { long from = myClock.millis() - myLookbackTime; return iterate(tableReference, to, from, predicate); } RepairHistoryProviderImpl(Session session, StatementDecorator statementDecorator, long lookbackTime); @VisibleForTesting  RepairHistoryProviderImpl(Session session, StatementDecorator statementDecorator, long lookbackTime, Clock clock); }
RepairHistoryProviderImpl implements RepairHistoryProvider { @Override public Iterator<RepairEntry> iterate(TableReference tableReference, long to, Predicate<RepairEntry> predicate) { long from = myClock.millis() - myLookbackTime; return iterate(tableReference, to, from, predicate); } RepairHistoryProviderImpl(Session session, StatementDecorator statementDecorator, long lookbackTime); @VisibleForTesting  RepairHistoryProviderImpl(Session session, StatementDecorator statementDecorator, long lookbackTime, Clock clock); @Override Iterator<RepairEntry> iterate(TableReference tableReference, long to, Predicate<RepairEntry> predicate); @Override Iterator<RepairEntry> iterate(TableReference tableReference, long to, long from, Predicate<RepairEntry> predicate); }
RepairHistoryProviderImpl implements RepairHistoryProvider { @Override public Iterator<RepairEntry> iterate(TableReference tableReference, long to, Predicate<RepairEntry> predicate) { long from = myClock.millis() - myLookbackTime; return iterate(tableReference, to, from, predicate); } RepairHistoryProviderImpl(Session session, StatementDecorator statementDecorator, long lookbackTime); @VisibleForTesting  RepairHistoryProviderImpl(Session session, StatementDecorator statementDecorator, long lookbackTime, Clock clock); @Override Iterator<RepairEntry> iterate(TableReference tableReference, long to, Predicate<RepairEntry> predicate); @Override Iterator<RepairEntry> iterate(TableReference tableReference, long to, long from, Predicate<RepairEntry> predicate);  }