@Test public void getManagedShardsGetsCollectionFromManager() { HashSet<Integer> managedShards = new HashSet<Integer>(); managedShards.add(0); managedShards.add(1); managedShards.add(2); doReturn(managedShards).when(shardStateManager).getManagedShards(); Collection<Integer> actual = service.getManagedShards(); assertEquals(managedShards.size(), actual.size()); assertTrue(actual.containsAll(managedShards)); verify(shardStateManager).getManagedShards(); verifyNoMoreInteractions(shardStateManager); }
public Collection<Integer> getManagedShards() { return new TreeSet<Integer>(shardStateManager.getManagedShards()); }
RollupService implements Runnable, RollupServiceMBean { public Collection<Integer> getManagedShards() { return new TreeSet<Integer>(shardStateManager.getManagedShards()); } }
RollupService implements Runnable, RollupServiceMBean { public Collection<Integer> getManagedShards() { return new TreeSet<Integer>(shardStateManager.getManagedShards()); } RollupService(ScheduleContext context); @VisibleForTesting  RollupService(ScheduleContext context,
                         ShardStateManager shardStateManager,
                         ThreadPoolExecutor locatorFetchExecutors,
                         ThreadPoolExecutor rollupReadExecutors,
                         ThreadPoolExecutor rollupWriteExecutors,
                         long rollupDelayMillis,
                         long rollupDelayForMetricsWithShortDelay,
                         long rollupWaitForMetricsWithLongDelay,
                         long pollerPeriod,
                         long configRefreshInterval); }
RollupService implements Runnable, RollupServiceMBean { public Collection<Integer> getManagedShards() { return new TreeSet<Integer>(shardStateManager.getManagedShards()); } RollupService(ScheduleContext context); @VisibleForTesting  RollupService(ScheduleContext context,
                         ShardStateManager shardStateManager,
                         ThreadPoolExecutor locatorFetchExecutors,
                         ThreadPoolExecutor rollupReadExecutors,
                         ThreadPoolExecutor rollupWriteExecutors,
                         long rollupDelayMillis,
                         long rollupDelayForMetricsWithShortDelay,
                         long rollupWaitForMetricsWithLongDelay,
                         long pollerPeriod,
                         long configRefreshInterval); void initializeGauges(); void forcePoll(); void run(); synchronized void setServerTime(long millis); synchronized long getServerTime(); synchronized void setKeepingServerTime(boolean b); synchronized boolean getKeepingServerTime(); synchronized void setPollerPeriod(long l); synchronized long getPollerPeriod(); synchronized int getScheduledSlotCheckCount(); synchronized int getSecondsSinceLastSlotCheck(); synchronized int getSlotCheckConcurrency(); synchronized void setSlotCheckConcurrency(int i); synchronized int getRollupConcurrency(); synchronized void setRollupConcurrency(int i); synchronized int getQueuedRollupCount(); synchronized int getInFlightRollupCount(); synchronized boolean getActive(); synchronized void setActive(boolean b); void addShard(Integer shard); void removeShard(Integer shard); Collection<Integer> getManagedShards(); synchronized Collection<Integer> getRecentlyScheduledShards(); synchronized Collection<String> getOldestUnrolledSlotPerGranularity(int shard); }
RollupService implements Runnable, RollupServiceMBean { public Collection<Integer> getManagedShards() { return new TreeSet<Integer>(shardStateManager.getManagedShards()); } RollupService(ScheduleContext context); @VisibleForTesting  RollupService(ScheduleContext context,
                         ShardStateManager shardStateManager,
                         ThreadPoolExecutor locatorFetchExecutors,
                         ThreadPoolExecutor rollupReadExecutors,
                         ThreadPoolExecutor rollupWriteExecutors,
                         long rollupDelayMillis,
                         long rollupDelayForMetricsWithShortDelay,
                         long rollupWaitForMetricsWithLongDelay,
                         long pollerPeriod,
                         long configRefreshInterval); void initializeGauges(); void forcePoll(); void run(); synchronized void setServerTime(long millis); synchronized long getServerTime(); synchronized void setKeepingServerTime(boolean b); synchronized boolean getKeepingServerTime(); synchronized void setPollerPeriod(long l); synchronized long getPollerPeriod(); synchronized int getScheduledSlotCheckCount(); synchronized int getSecondsSinceLastSlotCheck(); synchronized int getSlotCheckConcurrency(); synchronized void setSlotCheckConcurrency(int i); synchronized int getRollupConcurrency(); synchronized void setRollupConcurrency(int i); synchronized int getQueuedRollupCount(); synchronized int getInFlightRollupCount(); synchronized boolean getActive(); synchronized void setActive(boolean b); void addShard(Integer shard); void removeShard(Integer shard); Collection<Integer> getManagedShards(); synchronized Collection<Integer> getRecentlyScheduledShards(); synchronized Collection<String> getOldestUnrolledSlotPerGranularity(int shard);  }