AccumuloEventStorageBolt extends AccumuloBaseBolt { void cleanupEventWriter() { try { if (eventWriter != null) { eventWriter.flush(); eventWriter.close(); } } catch (MutationsRejectedException e) { logger.error("Failed committing mutation batch mutation", e); } }  @Override void cleanup(); static final String EVENT_TABLE; static final String UUID_PREFIX; static final String UUID_PREFIX_DEFAULT; static final String VISIBILITY; static final String VISIBILITY_BY_FIELD; static final String SPLITS; static final int SPLITS_DEFAULT; }
@Test public void testCleanupEventWriter(@Injectable BatchWriter eventWriter) throws Exception { bolt.eventWriter = eventWriter; new Expectations() {{ eventWriter.flush(); eventWriter.close(); }}; bolt.cleanupEventWriter(); }
@Test public void testCleanupEventWriterWithoutCleanup() throws Exception { bolt.eventWriter = null; bolt.cleanupEventWriter(); }
@Test public void testCleanupEventWriterException( @Injectable BatchWriter eventWriter, @Injectable MutationsRejectedException e) throws Exception { bolt.eventWriter = eventWriter; new Expectations() {{ eventWriter.flush(); result = e; }}; bolt.cleanupEventWriter(); }