class HubRegistry implements PartitionListener {

   protected void timeout() {
      logger.info("Checking for expired hubs");
      long expirationTime = clock.millis() - offlineTimeoutMs;
      for(HubState state: hubs.values()) {
         if(state.lastHeartbeat < expirationTime) {
            if(hubs.remove(state.getHubId(), state)) {
               try {
                  onTimeout(state.getHubId());
               }
               catch(Exception e) {
                  logger.warn("Error sending timeout for [{}]", state.getHubId(), e);
               }
            }
         }
      }
   }

   @Inject public  HubRegistry(
         Clock clock,
         HubDAO hubDao,
         Partitioner partitioner,
         PlatformMessageBus platformBus,
         HubRegistryConfig config,
         PlacePopulationCacheManager populationCacheMgr
   );

}