BackOffFailOverSink extends EventSink.Base { @Override public void open() throws IOException, InterruptedException { IOException priEx = tryOpenPrimary(); try { backup.open(); backupOpen = true; } catch (IOException ex) { backupOpen = false; if (priEx != null) { IOException mioe = MultipleIOException.createIOException(Arrays.asList( priEx, ex)); throw mioe; } } } BackOffFailOverSink(EventSink primary, EventSink backup,
      BackoffPolicy backoff);  BackOffFailOverSink(EventSink primary, EventSink backup);  BackOffFailOverSink(EventSink primary, EventSink backup,
      long initialBackoff, long maxBackoff); @Override void append(Event e); @Override void close(); @Override void open(); EventSink getPrimary(); EventSink getBackup(); @Override String getName(); @Deprecated @Override ReportEvent getReport(); @Deprecated @Override void getReports(String namePrefix, Map<String, ReportEvent> reports); @Override ReportEvent getMetrics(); @Override Map<String, Reportable> getSubMetrics(); long getFails(); static SinkBuilder builder(); static final String A_PRIMARY; static final String A_FAILS; static final String A_BACKUPS; }
@Test public void testOpenInterruption() throws IOException, InterruptedException { EventSink snk = new BackOffFailOverSink(InterruptSinks.openSink(), new NullSink()); try { snk.open(); } catch (InterruptedException ie) { return; } fail("expected interruption!"); }