@Test public void testLockLock() throws Exception { partitionFetcher.lock(); Thread.sleep(50); partitionFetcher.lock(); Thread.sleep(50); }
public void lock() { if (updateState(TASK_STATE.LOCKED)) { FetcherStateMachine fetcherStateMachine = new FetcherStateMachine( messageReader); fetcherFuture = singleExecutor.submit(fetcherStateMachine); LOG.info("Worker: " + workerId + " invoke partition: " + partitionId + " to 'LOCKED', try to serve it."); } }
PartitionFetcher { public void lock() { if (updateState(TASK_STATE.LOCKED)) { FetcherStateMachine fetcherStateMachine = new FetcherStateMachine( messageReader); fetcherFuture = singleExecutor.submit(fetcherStateMachine); LOG.info("Worker: " + workerId + " invoke partition: " + partitionId + " to 'LOCKED', try to serve it."); } } }
PartitionFetcher { public void lock() { if (updateState(TASK_STATE.LOCKED)) { FetcherStateMachine fetcherStateMachine = new FetcherStateMachine( messageReader); fetcherFuture = singleExecutor.submit(fetcherStateMachine); LOG.info("Worker: " + workerId + " invoke partition: " + partitionId + " to 'LOCKED', try to serve it."); } } PartitionFetcher(String consumerGroup, String topicName,
      TopicTalosResourceName topicTalosResourceName, int partitionId,
      TalosConsumerConfig talosConsumerConfig, String workerId,
      ConsumerService.Iface consumerClient, MessageService.Iface messageClient,
      MessageProcessor messageProcessor, MessageReader messageReader,
      Long outerCheckPoint);  PartitionFetcher(String consumerGroup, String topicName,
      TopicTalosResourceName topicTalosResourceName, int partitionId,
      String workerId, ConsumerService.Iface consumerClient,
      SimpleConsumer simpleConsumer,MessageReader messageReader); }
PartitionFetcher { public void lock() { if (updateState(TASK_STATE.LOCKED)) { FetcherStateMachine fetcherStateMachine = new FetcherStateMachine( messageReader); fetcherFuture = singleExecutor.submit(fetcherStateMachine); LOG.info("Worker: " + workerId + " invoke partition: " + partitionId + " to 'LOCKED', try to serve it."); } } PartitionFetcher(String consumerGroup, String topicName,
      TopicTalosResourceName topicTalosResourceName, int partitionId,
      TalosConsumerConfig talosConsumerConfig, String workerId,
      ConsumerService.Iface consumerClient, MessageService.Iface messageClient,
      MessageProcessor messageProcessor, MessageReader messageReader,
      Long outerCheckPoint);  PartitionFetcher(String consumerGroup, String topicName,
      TopicTalosResourceName topicTalosResourceName, int partitionId,
      String workerId, ConsumerService.Iface consumerClient,
      SimpleConsumer simpleConsumer,MessageReader messageReader); synchronized boolean isServing(); synchronized boolean isHoldingLock(); void lock(); void unlock(); synchronized long getCurCheckPoint(); void shutDown(); JsonArray getFalconData(); }
PartitionFetcher { public void lock() { if (updateState(TASK_STATE.LOCKED)) { FetcherStateMachine fetcherStateMachine = new FetcherStateMachine( messageReader); fetcherFuture = singleExecutor.submit(fetcherStateMachine); LOG.info("Worker: " + workerId + " invoke partition: " + partitionId + " to 'LOCKED', try to serve it."); } } PartitionFetcher(String consumerGroup, String topicName,
      TopicTalosResourceName topicTalosResourceName, int partitionId,
      TalosConsumerConfig talosConsumerConfig, String workerId,
      ConsumerService.Iface consumerClient, MessageService.Iface messageClient,
      MessageProcessor messageProcessor, MessageReader messageReader,
      Long outerCheckPoint);  PartitionFetcher(String consumerGroup, String topicName,
      TopicTalosResourceName topicTalosResourceName, int partitionId,
      String workerId, ConsumerService.Iface consumerClient,
      SimpleConsumer simpleConsumer,MessageReader messageReader); synchronized boolean isServing(); synchronized boolean isHoldingLock(); void lock(); void unlock(); synchronized long getCurCheckPoint(); void shutDown(); JsonArray getFalconData();  }