@Test(expected = NullPointerException.class) public void storeAllRecordListHasNullRecord() throws Exception { store.storeAll(Collections.singletonList(null)); }
void storeAll(List<? extends TSDRRecord> records) { checkNotNull(records); for (TSDRRecord record : records) { checkNotNull(record); } checkState(isRunning(), "The service is not running"); batchLock.lock(); try { if (batch.remainingCapacity() < records.size()) { sync(); } batch.addAll(records); } finally { batchLock.unlock(); } }
ElasticSearchStore extends AbstractScheduledService implements AutoCloseable { void storeAll(List<? extends TSDRRecord> records) { checkNotNull(records); for (TSDRRecord record : records) { checkNotNull(record); } checkState(isRunning(), "The service is not running"); batchLock.lock(); try { if (batch.remainingCapacity() < records.size()) { sync(); } batch.addAll(records); } finally { batchLock.unlock(); } } }
ElasticSearchStore extends AbstractScheduledService implements AutoCloseable { void storeAll(List<? extends TSDRRecord> records) { checkNotNull(records); for (TSDRRecord record : records) { checkNotNull(record); } checkState(isRunning(), "The service is not running"); batchLock.lock(); try { if (batch.remainingCapacity() < records.size()) { sync(); } batch.addAll(records); } finally { batchLock.unlock(); } } @Inject  ElasticSearchStore(); @VisibleForTesting  ElasticSearchStore(Map<String, String> properties, JestClient client); }
ElasticSearchStore extends AbstractScheduledService implements AutoCloseable { void storeAll(List<? extends TSDRRecord> records) { checkNotNull(records); for (TSDRRecord record : records) { checkNotNull(record); } checkState(isRunning(), "The service is not running"); batchLock.lock(); try { if (batch.remainingCapacity() < records.size()) { sync(); } batch.addAll(records); } 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 storeAll(List<? extends TSDRRecord> records) { checkNotNull(records); for (TSDRRecord record : records) { checkNotNull(record); } checkState(isRunning(), "The service is not running"); batchLock.lock(); try { if (batch.remainingCapacity() < records.size()) { sync(); } batch.addAll(records); } finally { batchLock.unlock(); } } @Inject  ElasticSearchStore(); @VisibleForTesting  ElasticSearchStore(Map<String, String> properties, JestClient client); @PostConstruct void init(); @Override @PreDestroy void close();  }