@Test public void testUpdate() { BlockingReservoir reservoir = new BlockingReservoir(); Record record = new RecordEvent("TEST"); reservoir.update(record); assertEquals(0, reservoir.size()); reservoir.start(); reservoir.update(record); assertEquals(1, reservoir.size()); reservoir.stop(); assertEquals(0, reservoir.size()); }
public void update(Record record) { if (!isReady) { logger.info("Current reservoir is not ready for update record"); return; } try { recordsQueue.put(record); } catch (InterruptedException e) { logger.warn("Thread is interrupted during putting value to blocking queue.", e); } catch (IllegalArgumentException e) { logger.warn("The record queue may be full"); } }
BlockingReservoir extends AbstractActiveReservoir { public void update(Record record) { if (!isReady) { logger.info("Current reservoir is not ready for update record"); return; } try { recordsQueue.put(record); } catch (InterruptedException e) { logger.warn("Thread is interrupted during putting value to blocking queue.", e); } catch (IllegalArgumentException e) { logger.warn("The record queue may be full"); } } }
BlockingReservoir extends AbstractActiveReservoir { public void update(Record record) { if (!isReady) { logger.info("Current reservoir is not ready for update record"); return; } try { recordsQueue.put(record); } catch (InterruptedException e) { logger.warn("Thread is interrupted during putting value to blocking queue.", e); } catch (IllegalArgumentException e) { logger.warn("The record queue may be full"); } } BlockingReservoir();  BlockingReservoir(int minReportSize, int maxReportSize);  BlockingReservoir(int minReportSize, int maxReportSize, int maxReportTime);  BlockingReservoir(int minReportSize, int maxReportSize, int maxReportTime, int maxQueueSize); }
BlockingReservoir extends AbstractActiveReservoir { public void update(Record record) { if (!isReady) { logger.info("Current reservoir is not ready for update record"); return; } try { recordsQueue.put(record); } catch (InterruptedException e) { logger.warn("Thread is interrupted during putting value to blocking queue.", e); } catch (IllegalArgumentException e) { logger.warn("The record queue may be full"); } } BlockingReservoir();  BlockingReservoir(int minReportSize, int maxReportSize);  BlockingReservoir(int minReportSize, int maxReportSize, int maxReportTime);  BlockingReservoir(int minReportSize, int maxReportSize, int maxReportTime, int maxQueueSize); void update(Record record); int size(); void start(); @Override void stop(); }
BlockingReservoir extends AbstractActiveReservoir { public void update(Record record) { if (!isReady) { logger.info("Current reservoir is not ready for update record"); return; } try { recordsQueue.put(record); } catch (InterruptedException e) { logger.warn("Thread is interrupted during putting value to blocking queue.", e); } catch (IllegalArgumentException e) { logger.warn("The record queue may be full"); } } BlockingReservoir();  BlockingReservoir(int minReportSize, int maxReportSize);  BlockingReservoir(int minReportSize, int maxReportSize, int maxReportTime);  BlockingReservoir(int minReportSize, int maxReportSize, int maxReportTime, int maxQueueSize); void update(Record record); int size(); void start(); @Override void stop();  }