@Test public void testAccessCountTableManager() throws InterruptedException { MetaStore adapter = mock(MetaStore.class); AccessCountTableManager manager = new AccessCountTableManager(adapter); Long firstDayEnd = 24 * 60 * 60 * 1000L; AccessCountTable accessCountTable = new AccessCountTable(firstDayEnd - 5 * 1000, firstDayEnd); manager.addTable(accessCountTable); Thread.sleep(5000); Map<TimeGranularity, AccessCountTableDeque> map = manager.getTableDeques(); AccessCountTableDeque second = map.get(TimeGranularity.SECOND); Assert.assertTrue(second.size() == 1); Assert.assertEquals(second.peek(), accessCountTable); AccessCountTableDeque minute = map.get(TimeGranularity.MINUTE); AccessCountTable minuteTable = new AccessCountTable(firstDayEnd - 60 * 1000, firstDayEnd); Assert.assertTrue(minute.size() == 1); Assert.assertEquals(minute.peek(), minuteTable); AccessCountTableDeque hour = map.get(TimeGranularity.HOUR); AccessCountTable hourTable = new AccessCountTable(firstDayEnd - 60 * 60 * 1000, firstDayEnd); Assert.assertTrue(hour.size() == 1); Assert.assertEquals(hour.peek(), hourTable); AccessCountTableDeque day = map.get(TimeGranularity.DAY); AccessCountTable dayTable = new AccessCountTable(firstDayEnd - 24 * 60 * 60 * 1000, firstDayEnd); Assert.assertTrue(day.size() == 1); Assert.assertEquals(day.peek(), dayTable); }
public AccessCountTableManager(MetaStore adapter) { this(adapter, Executors.newFixedThreadPool(4)); }
AccessCountTableManager { public AccessCountTableManager(MetaStore adapter) { this(adapter, Executors.newFixedThreadPool(4)); } }
AccessCountTableManager { public AccessCountTableManager(MetaStore adapter) { this(adapter, Executors.newFixedThreadPool(4)); } AccessCountTableManager(MetaStore adapter);  AccessCountTableManager(MetaStore adapter, ExecutorService service); }
AccessCountTableManager { public AccessCountTableManager(MetaStore adapter) { this(adapter, Executors.newFixedThreadPool(4)); } AccessCountTableManager(MetaStore adapter);  AccessCountTableManager(MetaStore adapter, ExecutorService service); void addTable(AccessCountTable accessCountTable); void onAccessEventsArrived(List<FileAccessEvent> accessEvents); List<AccessCountTable> getTables(long lengthInMillis); static List<AccessCountTable> getTables(
      Map<TimeGranularity, AccessCountTableDeque> tableDeques,
      MetaStore metaStore,
      long lengthInMillis); }
AccessCountTableManager { public AccessCountTableManager(MetaStore adapter) { this(adapter, Executors.newFixedThreadPool(4)); } AccessCountTableManager(MetaStore adapter);  AccessCountTableManager(MetaStore adapter, ExecutorService service); void addTable(AccessCountTable accessCountTable); void onAccessEventsArrived(List<FileAccessEvent> accessEvents); List<AccessCountTable> getTables(long lengthInMillis); static List<AccessCountTable> getTables(
      Map<TimeGranularity, AccessCountTableDeque> tableDeques,
      MetaStore metaStore,
      long lengthInMillis); static final Logger LOG; }