@Test public void testNonTableRepairJob() { ScheduledJob testJob = mock(ScheduledJob.class); assertThat(myRunPolicy.validate(testJob)).isEqualTo(-1L); }
@Override public long validate(ScheduledJob job) { if (job instanceof TableRepairJob) { TableRepairJob repairJob = (TableRepairJob) job; return getRejectionsForTable(repairJob.getTableReference()); } return -1; }
TimeBasedRunPolicy implements TableRepairPolicy, RunPolicy, Closeable { @Override public long validate(ScheduledJob job) { if (job instanceof TableRepairJob) { TableRepairJob repairJob = (TableRepairJob) job; return getRejectionsForTable(repairJob.getTableReference()); } return -1; } }
TimeBasedRunPolicy implements TableRepairPolicy, RunPolicy, Closeable { @Override public long validate(ScheduledJob job) { if (job instanceof TableRepairJob) { TableRepairJob repairJob = (TableRepairJob) job; return getRejectionsForTable(repairJob.getTableReference()); } return -1; } TimeBasedRunPolicy(Builder builder); }
TimeBasedRunPolicy implements TableRepairPolicy, RunPolicy, Closeable { @Override public long validate(ScheduledJob job) { if (job instanceof TableRepairJob) { TableRepairJob repairJob = (TableRepairJob) job; return getRejectionsForTable(repairJob.getTableReference()); } return -1; } TimeBasedRunPolicy(Builder builder); @Override long validate(ScheduledJob job); @Override boolean shouldRun(TableReference tableReference); @Override void close(); static Builder builder(); }
TimeBasedRunPolicy implements TableRepairPolicy, RunPolicy, Closeable { @Override public long validate(ScheduledJob job) { if (job instanceof TableRepairJob) { TableRepairJob repairJob = (TableRepairJob) job; return getRejectionsForTable(repairJob.getTableReference()); } return -1; } TimeBasedRunPolicy(Builder builder); @Override long validate(ScheduledJob job); @Override boolean shouldRun(TableReference tableReference); @Override void close(); static Builder builder();  }