@Test public void testIPartiallyRepairedINegative() throws UnknownHostException { long repair_end = CLOCK_TIME - 5000; long repair_start = repair_end - 5; long iterate_start = repair_start - 5; long iterate_end = CLOCK_TIME; insertRecord(KEYSPACE, TABLE, Sets.newHashSet(InetAddress.getLocalHost()), new LongTokenRange(0, 1), repair_start, repair_end, RepairStatus.UNKNOWN); insertRecord(KEYSPACE, TABLE, Sets.newHashSet(InetAddress.getLocalHost()), new LongTokenRange(0, 1), repair_start, repair_end, RepairStatus.FAILED); insertRecord(KEYSPACE, TABLE, Sets.newHashSet(InetAddress.getLocalHost()), new LongTokenRange(0, 1), repair_start, repair_end, RepairStatus.STARTED); Map<LongTokenRange, Collection<Host>> tokenToHostMap = new HashMap<>(); Iterator<RepairEntry> repairEntryIterator = repairHistoryProvider.iterate(myTableReference, iterate_end, iterate_start, new FullyRepairedRepairEntryPredicate(tokenToHostMap)); assertThat(repairEntryIterator.hasNext()).isFalse(); }
@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);  }