@Test(expected = NullPointerException.class) public void storeNull() throws Exception { store.store(null); }
void store(TSDRRecord record) { checkNotNull(record); checkState(isRunning(), "The service is not running"); batchLock.lock(); try { if (batch.remainingCapacity() == 0) { sync(); } batch.add(record); } finally { batchLock.unlock(); } }
ElasticSearchStore extends AbstractScheduledService implements AutoCloseable { void store(TSDRRecord record) { checkNotNull(record); checkState(isRunning(), "The service is not running"); batchLock.lock(); try { if (batch.remainingCapacity() == 0) { sync(); } batch.add(record); } finally { batchLock.unlock(); } } }
ElasticSearchStore extends AbstractScheduledService implements AutoCloseable { void store(TSDRRecord record) { checkNotNull(record); checkState(isRunning(), "The service is not running"); batchLock.lock(); try { if (batch.remainingCapacity() == 0) { sync(); } batch.add(record); } finally { batchLock.unlock(); } } @Inject  ElasticSearchStore(); @VisibleForTesting  ElasticSearchStore(Map<String, String> properties, JestClient client); }
ElasticSearchStore extends AbstractScheduledService implements AutoCloseable { void store(TSDRRecord record) { checkNotNull(record); checkState(isRunning(), "The service is not running"); batchLock.lock(); try { if (batch.remainingCapacity() == 0) { sync(); } batch.add(record); } finally { batchLock.unlock(); } } @Inject  ElasticSearchStore(); @VisibleForTesting  ElasticSearchStore(Map<String, String> properties, JestClient client); @PostConstruct void init(); @Override @PreDestroy void close(); }
ElasticSearchStore extends AbstractScheduledService implements AutoCloseable { void store(TSDRRecord record) { checkNotNull(record); checkState(isRunning(), "The service is not running"); batchLock.lock(); try { if (batch.remainingCapacity() == 0) { sync(); } batch.add(record); } finally { batchLock.unlock(); } } @Inject  ElasticSearchStore(); @VisibleForTesting  ElasticSearchStore(Map<String, String> properties, JestClient client); @PostConstruct void init(); @Override @PreDestroy void close();  }