@Test public void testGetScheduleInfoCache() throws Exception { ScheduleInfoCache scheduleInfoCache1 = ScheduleInfoCache.getScheduleInfoCache(new TopicTalosResourceName(resourceName), talosClientConfig, messageClientMock, talosClientFactoryMock); ScheduleInfoCache scheduleInfoCache2 = ScheduleInfoCache.getScheduleInfoCache(new TopicTalosResourceName(resourceName), talosClientConfig, messageClientMock, talosClientFactoryMock); assertNotNull(scheduleInfoCache1); assertEquals(scheduleInfoCache1, scheduleInfoCache2); }
public static synchronized ScheduleInfoCache getScheduleInfoCache(TopicTalosResourceName topicTalosResourceName, TalosClientConfig talosClientConfig, MessageService.Iface messageClient, TalosClientFactory talosClientFactory) { if (scheduleInfoCacheMap.get(topicTalosResourceName) == null) { if (talosClientFactory == null) { scheduleInfoCacheMap.put(topicTalosResourceName, new ScheduleInfoCache(topicTalosResourceName, talosClientConfig, messageClient)); } else { scheduleInfoCacheMap.put(topicTalosResourceName, new ScheduleInfoCache(topicTalosResourceName, talosClientConfig, messageClient, talosClientFactory)); } } scheduleInfoCacheMap.get(topicTalosResourceName).clientNum.incrementAndGet(); LOG.info("there were " + scheduleInfoCacheMap.get(topicTalosResourceName).clientNum.get() + " partitions of " + topicTalosResourceName + " use same scheduleInfoCache together."); return scheduleInfoCacheMap.get(topicTalosResourceName); }
ScheduleInfoCache { public static synchronized ScheduleInfoCache getScheduleInfoCache(TopicTalosResourceName topicTalosResourceName, TalosClientConfig talosClientConfig, MessageService.Iface messageClient, TalosClientFactory talosClientFactory) { if (scheduleInfoCacheMap.get(topicTalosResourceName) == null) { if (talosClientFactory == null) { scheduleInfoCacheMap.put(topicTalosResourceName, new ScheduleInfoCache(topicTalosResourceName, talosClientConfig, messageClient)); } else { scheduleInfoCacheMap.put(topicTalosResourceName, new ScheduleInfoCache(topicTalosResourceName, talosClientConfig, messageClient, talosClientFactory)); } } scheduleInfoCacheMap.get(topicTalosResourceName).clientNum.incrementAndGet(); LOG.info("there were " + scheduleInfoCacheMap.get(topicTalosResourceName).clientNum.get() + " partitions of " + topicTalosResourceName + " use same scheduleInfoCache together."); return scheduleInfoCacheMap.get(topicTalosResourceName); } }
ScheduleInfoCache { public static synchronized ScheduleInfoCache getScheduleInfoCache(TopicTalosResourceName topicTalosResourceName, TalosClientConfig talosClientConfig, MessageService.Iface messageClient, TalosClientFactory talosClientFactory) { if (scheduleInfoCacheMap.get(topicTalosResourceName) == null) { if (talosClientFactory == null) { scheduleInfoCacheMap.put(topicTalosResourceName, new ScheduleInfoCache(topicTalosResourceName, talosClientConfig, messageClient)); } else { scheduleInfoCacheMap.put(topicTalosResourceName, new ScheduleInfoCache(topicTalosResourceName, talosClientConfig, messageClient, talosClientFactory)); } } scheduleInfoCacheMap.get(topicTalosResourceName).clientNum.incrementAndGet(); LOG.info("there were " + scheduleInfoCacheMap.get(topicTalosResourceName).clientNum.get() + " partitions of " + topicTalosResourceName + " use same scheduleInfoCache together."); return scheduleInfoCacheMap.get(topicTalosResourceName); } private  ScheduleInfoCache(TopicTalosResourceName topicTalosResourceName,
      TalosClientConfig talosClientConfig, MessageService.Iface messageClient,
      TalosClientFactory talosClientFactory); private  ScheduleInfoCache(TopicTalosResourceName topicTalosResourceName,
      TalosClientConfig talosClientConfig, MessageService.Iface messageClient); }
ScheduleInfoCache { public static synchronized ScheduleInfoCache getScheduleInfoCache(TopicTalosResourceName topicTalosResourceName, TalosClientConfig talosClientConfig, MessageService.Iface messageClient, TalosClientFactory talosClientFactory) { if (scheduleInfoCacheMap.get(topicTalosResourceName) == null) { if (talosClientFactory == null) { scheduleInfoCacheMap.put(topicTalosResourceName, new ScheduleInfoCache(topicTalosResourceName, talosClientConfig, messageClient)); } else { scheduleInfoCacheMap.put(topicTalosResourceName, new ScheduleInfoCache(topicTalosResourceName, talosClientConfig, messageClient, talosClientFactory)); } } scheduleInfoCacheMap.get(topicTalosResourceName).clientNum.incrementAndGet(); LOG.info("there were " + scheduleInfoCacheMap.get(topicTalosResourceName).clientNum.get() + " partitions of " + topicTalosResourceName + " use same scheduleInfoCache together."); return scheduleInfoCacheMap.get(topicTalosResourceName); } private  ScheduleInfoCache(TopicTalosResourceName topicTalosResourceName,
      TalosClientConfig talosClientConfig, MessageService.Iface messageClient,
      TalosClientFactory talosClientFactory); private  ScheduleInfoCache(TopicTalosResourceName topicTalosResourceName,
      TalosClientConfig talosClientConfig, MessageService.Iface messageClient); static synchronized ScheduleInfoCache getScheduleInfoCache(TopicTalosResourceName
      topicTalosResourceName, TalosClientConfig talosClientConfig,
      MessageService.Iface messageClient, TalosClientFactory talosClientFactory); MessageService.Iface getOrCreateMessageClient(TopicAndPartition topicAndPartition); void updatescheduleInfoCache(); boolean getIsAutoLocation(); synchronized void shutDown(TopicTalosResourceName topicTalosResourceName); void shutDownAll(); }
ScheduleInfoCache { public static synchronized ScheduleInfoCache getScheduleInfoCache(TopicTalosResourceName topicTalosResourceName, TalosClientConfig talosClientConfig, MessageService.Iface messageClient, TalosClientFactory talosClientFactory) { if (scheduleInfoCacheMap.get(topicTalosResourceName) == null) { if (talosClientFactory == null) { scheduleInfoCacheMap.put(topicTalosResourceName, new ScheduleInfoCache(topicTalosResourceName, talosClientConfig, messageClient)); } else { scheduleInfoCacheMap.put(topicTalosResourceName, new ScheduleInfoCache(topicTalosResourceName, talosClientConfig, messageClient, talosClientFactory)); } } scheduleInfoCacheMap.get(topicTalosResourceName).clientNum.incrementAndGet(); LOG.info("there were " + scheduleInfoCacheMap.get(topicTalosResourceName).clientNum.get() + " partitions of " + topicTalosResourceName + " use same scheduleInfoCache together."); return scheduleInfoCacheMap.get(topicTalosResourceName); } private  ScheduleInfoCache(TopicTalosResourceName topicTalosResourceName,
      TalosClientConfig talosClientConfig, MessageService.Iface messageClient,
      TalosClientFactory talosClientFactory); private  ScheduleInfoCache(TopicTalosResourceName topicTalosResourceName,
      TalosClientConfig talosClientConfig, MessageService.Iface messageClient); static synchronized ScheduleInfoCache getScheduleInfoCache(TopicTalosResourceName
      topicTalosResourceName, TalosClientConfig talosClientConfig,
      MessageService.Iface messageClient, TalosClientFactory talosClientFactory); MessageService.Iface getOrCreateMessageClient(TopicAndPartition topicAndPartition); void updatescheduleInfoCache(); boolean getIsAutoLocation(); synchronized void shutDown(TopicTalosResourceName topicTalosResourceName); void shutDownAll();  }