@Test public void testDescribeTopicResourceNameChanged() throws Exception { LOG.info("[testDescribeTopicResourceNameChanged] start"); GetDescribeInfoResponse getDescribeInfoResponse = new GetDescribeInfoResponse( talosResourceName, partitionNum); GetDescribeInfoResponse getDescribeInfoResponse2 = new GetDescribeInfoResponse( talosResourceName2, partitionNum); when(talosAdminMock.getDescribeInfo(any(GetDescribeInfoRequest.class))).thenReturn( getDescribeInfoResponse).thenReturn(getDescribeInfoResponse2); LockWorkerResponse lockWorkerResponse = new LockWorkerResponse(true); when(consumerClientMock.lockWorker(any(LockWorkerRequest.class))) .thenReturn(lockWorkerResponse); when(consumerClientMock.renew(any(RenewRequest.class))) .thenReturn(new RenewResponse(true, new ArrayList<Integer>())); Map<String, List<Integer>> workerInfo = new HashMap<String, List<Integer>>(); workerInfo.put(workerId, new ArrayList<Integer>()); when(consumerClientMock.queryWorker(any(QueryWorkerRequest.class))) .thenReturn(new QueryWorkerResponse(workerInfo)); TalosConsumer consumer = new TalosConsumer(consumerGroup, consumerConfig, talosResourceName, workerId, new SimpleTopicAbnormalCallback(), consumerClientMock, talosAdminMock, fetcherMap); Thread.sleep(400); consumer.shutDown(); LOG.info("[testDescribeTopicResourceNameChanged] done"); }
public void shutDown() { LOG.info("Worker: " + workerId + " is shutting down..."); shutDownAllFetcher(); partitionScheduledExecutor.shutdownNow(); workerScheduleExecutor.shutdownNow(); renewScheduleExecutor.shutdownNow(); reBalanceExecutor.shutdownNow(); consumerMonitorThread.shutdownNow(); scheduleInfoCache.shutDown(topicTalosResourceName); LOG.info("Worker: " + workerId + " shutdown."); }
TalosConsumer { public void shutDown() { LOG.info("Worker: " + workerId + " is shutting down..."); shutDownAllFetcher(); partitionScheduledExecutor.shutdownNow(); workerScheduleExecutor.shutdownNow(); renewScheduleExecutor.shutdownNow(); reBalanceExecutor.shutdownNow(); consumerMonitorThread.shutdownNow(); scheduleInfoCache.shutDown(topicTalosResourceName); LOG.info("Worker: " + workerId + " shutdown."); } }
TalosConsumer { public void shutDown() { LOG.info("Worker: " + workerId + " is shutting down..."); shutDownAllFetcher(); partitionScheduledExecutor.shutdownNow(); workerScheduleExecutor.shutdownNow(); renewScheduleExecutor.shutdownNow(); reBalanceExecutor.shutdownNow(); consumerMonitorThread.shutdownNow(); scheduleInfoCache.shutDown(topicTalosResourceName); LOG.info("Worker: " + workerId + " shutdown."); } private  TalosConsumer(String consumerGroupName, TalosConsumerConfig consumerConfig,
      Credential credential, String topicName,
      MessageReaderFactory messageReaderFactory,
      MessageProcessorFactory messageProcessorFactory, String clientIdPrefix,
      TopicAbnormalCallback abnormalCallback, Map<Integer, Long> partitionCheckPoint); @Deprecated private  TalosConsumer(String consumerGroupName, TalosConsumerConfig consumerConfig,
      Credential credential, TopicTalosResourceName topicTalosResourceName,
      MessageReaderFactory messageReaderFactory,
      MessageProcessorFactory messageProcessorFactory, String clientIdPrefix,
      TopicAbnormalCallback abnormalCallback, Map<Integer, Long> partitionCheckPoint);  TalosConsumer(String consumerGroupName, TalosConsumerConfig consumerConfig,
      Credential credential, String topicName,
      MessageProcessorFactory messageProcessorFactory, String clientIdPrefix,
      TopicAbnormalCallback abnormalCallback); @Deprecated  TalosConsumer(String consumerGroupName, TalosConsumerConfig consumerConfig,
      Credential credential, TopicTalosResourceName topicTalosResourceName,
      MessageProcessorFactory messageProcessorFactory, String clientIdPrefix,
      TopicAbnormalCallback abnormalCallback);  TalosConsumer(String consumerGroupName, TalosConsumerConfig consumerConfig,
      Credential credential, TopicTalosResourceName topicTalosResourceName,
      MessageProcessorFactory messageProcessorFactory, String clientIdPrefix,
      TopicAbnormalCallback abnormalCallback, Map<Integer, Long> checkPointMap);  TalosConsumer(String consumerGroup, TalosConsumerConfig consumerConfig,
      TopicTalosResourceName topicTalosResourceName,
      MessageProcessorFactory messageProcessorFactory,
      TopicAbnormalCallback topicAbnormalCallback);  TalosConsumer(String consumerGroup, TalosConsumerConfig consumerConfig,
      Credential credential, TopicTalosResourceName topicTalosResourceName,
      MessageProcessorFactory messageProcessorFactory,
      TopicAbnormalCallback topicAbnormalCallback);  TalosConsumer(String consumerGroupName, TalosConsumerConfig consumerConfig,
      TopicTalosResourceName topicTalosResourceName, String workerId,
      TopicAbnormalCallback abnormalCallback,
      ConsumerService.Iface consumerClientMock, TalosAdmin talosAdminMock,
      Map<Integer, PartitionFetcher> fetcherMap); }
TalosConsumer { public void shutDown() { LOG.info("Worker: " + workerId + " is shutting down..."); shutDownAllFetcher(); partitionScheduledExecutor.shutdownNow(); workerScheduleExecutor.shutdownNow(); renewScheduleExecutor.shutdownNow(); reBalanceExecutor.shutdownNow(); consumerMonitorThread.shutdownNow(); scheduleInfoCache.shutDown(topicTalosResourceName); LOG.info("Worker: " + workerId + " shutdown."); } private  TalosConsumer(String consumerGroupName, TalosConsumerConfig consumerConfig,
      Credential credential, String topicName,
      MessageReaderFactory messageReaderFactory,
      MessageProcessorFactory messageProcessorFactory, String clientIdPrefix,
      TopicAbnormalCallback abnormalCallback, Map<Integer, Long> partitionCheckPoint); @Deprecated private  TalosConsumer(String consumerGroupName, TalosConsumerConfig consumerConfig,
      Credential credential, TopicTalosResourceName topicTalosResourceName,
      MessageReaderFactory messageReaderFactory,
      MessageProcessorFactory messageProcessorFactory, String clientIdPrefix,
      TopicAbnormalCallback abnormalCallback, Map<Integer, Long> partitionCheckPoint);  TalosConsumer(String consumerGroupName, TalosConsumerConfig consumerConfig,
      Credential credential, String topicName,
      MessageProcessorFactory messageProcessorFactory, String clientIdPrefix,
      TopicAbnormalCallback abnormalCallback); @Deprecated  TalosConsumer(String consumerGroupName, TalosConsumerConfig consumerConfig,
      Credential credential, TopicTalosResourceName topicTalosResourceName,
      MessageProcessorFactory messageProcessorFactory, String clientIdPrefix,
      TopicAbnormalCallback abnormalCallback);  TalosConsumer(String consumerGroupName, TalosConsumerConfig consumerConfig,
      Credential credential, TopicTalosResourceName topicTalosResourceName,
      MessageProcessorFactory messageProcessorFactory, String clientIdPrefix,
      TopicAbnormalCallback abnormalCallback, Map<Integer, Long> checkPointMap);  TalosConsumer(String consumerGroup, TalosConsumerConfig consumerConfig,
      TopicTalosResourceName topicTalosResourceName,
      MessageProcessorFactory messageProcessorFactory,
      TopicAbnormalCallback topicAbnormalCallback);  TalosConsumer(String consumerGroup, TalosConsumerConfig consumerConfig,
      Credential credential, TopicTalosResourceName topicTalosResourceName,
      MessageProcessorFactory messageProcessorFactory,
      TopicAbnormalCallback topicAbnormalCallback);  TalosConsumer(String consumerGroupName, TalosConsumerConfig consumerConfig,
      TopicTalosResourceName topicTalosResourceName, String workerId,
      TopicAbnormalCallback abnormalCallback,
      ConsumerService.Iface consumerClientMock, TalosAdmin talosAdminMock,
      Map<Integer, PartitionFetcher> fetcherMap); Map<Integer, Long> getCurCheckPoint(); void shutDown(); }
TalosConsumer { public void shutDown() { LOG.info("Worker: " + workerId + " is shutting down..."); shutDownAllFetcher(); partitionScheduledExecutor.shutdownNow(); workerScheduleExecutor.shutdownNow(); renewScheduleExecutor.shutdownNow(); reBalanceExecutor.shutdownNow(); consumerMonitorThread.shutdownNow(); scheduleInfoCache.shutDown(topicTalosResourceName); LOG.info("Worker: " + workerId + " shutdown."); } private  TalosConsumer(String consumerGroupName, TalosConsumerConfig consumerConfig,
      Credential credential, String topicName,
      MessageReaderFactory messageReaderFactory,
      MessageProcessorFactory messageProcessorFactory, String clientIdPrefix,
      TopicAbnormalCallback abnormalCallback, Map<Integer, Long> partitionCheckPoint); @Deprecated private  TalosConsumer(String consumerGroupName, TalosConsumerConfig consumerConfig,
      Credential credential, TopicTalosResourceName topicTalosResourceName,
      MessageReaderFactory messageReaderFactory,
      MessageProcessorFactory messageProcessorFactory, String clientIdPrefix,
      TopicAbnormalCallback abnormalCallback, Map<Integer, Long> partitionCheckPoint);  TalosConsumer(String consumerGroupName, TalosConsumerConfig consumerConfig,
      Credential credential, String topicName,
      MessageProcessorFactory messageProcessorFactory, String clientIdPrefix,
      TopicAbnormalCallback abnormalCallback); @Deprecated  TalosConsumer(String consumerGroupName, TalosConsumerConfig consumerConfig,
      Credential credential, TopicTalosResourceName topicTalosResourceName,
      MessageProcessorFactory messageProcessorFactory, String clientIdPrefix,
      TopicAbnormalCallback abnormalCallback);  TalosConsumer(String consumerGroupName, TalosConsumerConfig consumerConfig,
      Credential credential, TopicTalosResourceName topicTalosResourceName,
      MessageProcessorFactory messageProcessorFactory, String clientIdPrefix,
      TopicAbnormalCallback abnormalCallback, Map<Integer, Long> checkPointMap);  TalosConsumer(String consumerGroup, TalosConsumerConfig consumerConfig,
      TopicTalosResourceName topicTalosResourceName,
      MessageProcessorFactory messageProcessorFactory,
      TopicAbnormalCallback topicAbnormalCallback);  TalosConsumer(String consumerGroup, TalosConsumerConfig consumerConfig,
      Credential credential, TopicTalosResourceName topicTalosResourceName,
      MessageProcessorFactory messageProcessorFactory,
      TopicAbnormalCallback topicAbnormalCallback);  TalosConsumer(String consumerGroupName, TalosConsumerConfig consumerConfig,
      TopicTalosResourceName topicTalosResourceName, String workerId,
      TopicAbnormalCallback abnormalCallback,
      ConsumerService.Iface consumerClientMock, TalosAdmin talosAdminMock,
      Map<Integer, PartitionFetcher> fetcherMap); Map<Integer, Long> getCurCheckPoint(); void shutDown();  }