@Test public void testIsAvailable() throws Exception { latencyFaultTolerance.updateFaultItem(brokerName, 3000, 50); assertThat(latencyFaultTolerance.isAvailable(brokerName)).isFalse(); TimeUnit.MILLISECONDS.sleep(70); assertThat(latencyFaultTolerance.isAvailable(brokerName)).isTrue(); }
@Override public boolean isAvailable(final String name) { final FaultItem faultItem = this.faultItemTable.get(name); if (faultItem != null) { return faultItem.isAvailable(); } return true; }
LatencyFaultToleranceImpl implements LatencyFaultTolerance<String> { @Override public boolean isAvailable(final String name) { final FaultItem faultItem = this.faultItemTable.get(name); if (faultItem != null) { return faultItem.isAvailable(); } return true; } }
LatencyFaultToleranceImpl implements LatencyFaultTolerance<String> { @Override public boolean isAvailable(final String name) { final FaultItem faultItem = this.faultItemTable.get(name); if (faultItem != null) { return faultItem.isAvailable(); } return true; }  }
LatencyFaultToleranceImpl implements LatencyFaultTolerance<String> { @Override public boolean isAvailable(final String name) { final FaultItem faultItem = this.faultItemTable.get(name); if (faultItem != null) { return faultItem.isAvailable(); } return true; }  @Override void updateFaultItem(final String name, final long currentLatency, final long notAvailableDuration); @Override boolean isAvailable(final String name); @Override void remove(final String name); @Override String pickOneAtLeast(); @Override String toString(); }
LatencyFaultToleranceImpl implements LatencyFaultTolerance<String> { @Override public boolean isAvailable(final String name) { final FaultItem faultItem = this.faultItemTable.get(name); if (faultItem != null) { return faultItem.isAvailable(); } return true; }  @Override void updateFaultItem(final String name, final long currentLatency, final long notAvailableDuration); @Override boolean isAvailable(final String name); @Override void remove(final String name); @Override String pickOneAtLeast(); @Override String toString();  }