@Test public void testPrevalidateNotRepairableThenRepairable() { doReturn(false).doReturn(true).when(myRepairStateSnapshot).canRepair(); assertThat(myRepairJob.runnable()).isFalse(); assertThat(myRepairJob.runnable()).isTrue(); verify(myRepairState, times(2)).update(); verify(myRepairStateSnapshot, times(2)).canRepair(); }
@Override public boolean runnable() { if (super.runnable()) { try { myRepairState.update(); } catch (Exception e) { LOG.warn("Unable to check repair history, {}", this, e); } } RepairStateSnapshot repairStateSnapshot = myRepairState.getSnapshot(); long lastRepaired = repairStateSnapshot.lastRepairedAt(); if (lastRepaired != VnodeRepairState.UNREPAIRED) { sendOrCeaseAlarm(lastRepaired); } return repairStateSnapshot.canRepair() && super.runnable(); }
TableRepairJob extends ScheduledJob { @Override public boolean runnable() { if (super.runnable()) { try { myRepairState.update(); } catch (Exception e) { LOG.warn("Unable to check repair history, {}", this, e); } } RepairStateSnapshot repairStateSnapshot = myRepairState.getSnapshot(); long lastRepaired = repairStateSnapshot.lastRepairedAt(); if (lastRepaired != VnodeRepairState.UNREPAIRED) { sendOrCeaseAlarm(lastRepaired); } return repairStateSnapshot.canRepair() && super.runnable(); } }
TableRepairJob extends ScheduledJob { @Override public boolean runnable() { if (super.runnable()) { try { myRepairState.update(); } catch (Exception e) { LOG.warn("Unable to check repair history, {}", this, e); } } RepairStateSnapshot repairStateSnapshot = myRepairState.getSnapshot(); long lastRepaired = repairStateSnapshot.lastRepairedAt(); if (lastRepaired != VnodeRepairState.UNREPAIRED) { sendOrCeaseAlarm(lastRepaired); } return repairStateSnapshot.canRepair() && super.runnable(); } TableRepairJob(Builder builder); }
TableRepairJob extends ScheduledJob { @Override public boolean runnable() { if (super.runnable()) { try { myRepairState.update(); } catch (Exception e) { LOG.warn("Unable to check repair history, {}", this, e); } } RepairStateSnapshot repairStateSnapshot = myRepairState.getSnapshot(); long lastRepaired = repairStateSnapshot.lastRepairedAt(); if (lastRepaired != VnodeRepairState.UNREPAIRED) { sendOrCeaseAlarm(lastRepaired); } return repairStateSnapshot.canRepair() && super.runnable(); } TableRepairJob(Builder builder); TableReference getTableReference(); RepairConfiguration getRepairConfiguration(); @Override Iterator<ScheduledTask> iterator(); @Override void postExecute(boolean successful); @Override long getLastSuccessfulRun(); @Override boolean runnable(); @Override String toString(); }
TableRepairJob extends ScheduledJob { @Override public boolean runnable() { if (super.runnable()) { try { myRepairState.update(); } catch (Exception e) { LOG.warn("Unable to check repair history, {}", this, e); } } RepairStateSnapshot repairStateSnapshot = myRepairState.getSnapshot(); long lastRepaired = repairStateSnapshot.lastRepairedAt(); if (lastRepaired != VnodeRepairState.UNREPAIRED) { sendOrCeaseAlarm(lastRepaired); } return repairStateSnapshot.canRepair() && super.runnable(); } TableRepairJob(Builder builder); TableReference getTableReference(); RepairConfiguration getRepairConfiguration(); @Override Iterator<ScheduledTask> iterator(); @Override void postExecute(boolean successful); @Override long getLastSuccessfulRun(); @Override boolean runnable(); @Override String toString();  }