com.amazonaws.services.kinesis.clientlibrary.lib.worker.Worker.shutdown()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(225)

本文整理了Java中com.amazonaws.services.kinesis.clientlibrary.lib.worker.Worker.shutdown()方法的一些代码示例,展示了Worker.shutdown()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Worker.shutdown()方法的具体详情如下:
包路径:com.amazonaws.services.kinesis.clientlibrary.lib.worker.Worker
类名称:Worker
方法名:shutdown

Worker.shutdown介绍

[英]Signals worker to shutdown. Worker will try initiating shutdown of all record processors. Note that if executor services were passed to the worker by the user, worker will not attempt to shutdown those resources. Shutdown Process When called this will start shutdown of the record processor, and eventually shutdown the worker itself.

  1. Call to start shutdown invoked
  2. Lease coordinator told to stop taking leases, and to drop existing leases.
  3. Worker discovers record processors that no longer have leases.
  4. Worker triggers shutdown with state ShutdownReason#ZOMBIE.
  5. Once all record processors are shutdown, worker terminates owned resources.
  6. Shutdown complete.
    [中]向工人发出关闭的信号。工作人员将尝试关闭所有记录处理器。请注意,如果用户将executor服务传递给worker,worker将不会尝试关闭这些资源。Shutdown进程调用时,这将启动记录处理器的关闭,并最终关闭工作进程本身。
    1.调用启动关机
    1.租赁协调员被告知停止租赁,并放弃现有租赁。
    1.工作人员发现不再有租约的记录处理器。
    1.工人触发关机,状态为关机原因#僵尸。
    1.关闭所有记录处理器后,工作人员终止拥有的资源。
    1.关闭完成。

代码示例

代码示例来源:origin: io.zipkin.aws/zipkin-collector-kinesis

@Override
public void close() {
 // The executor is a single thread that is tied to this worker. Once the worker shuts down
 // the executor will stop.
 worker.shutdown();
}

代码示例来源:origin: scopely/kinesis-vcr

public void stop() {
  worker.shutdown();
}

代码示例来源:origin: io.macgyver.rx-aws/rx-aws

public void stop() {
  worker.shutdown();
}

代码示例来源:origin: harishreedharan/usingflumecode

@Override
protected void doStop() throws FlumeException {
 worker.shutdown();
 executor.shutdownNow();
}

代码示例来源:origin: awslabs/amazon-kinesis-aggregators

public void shutdown() throws Exception {
  this.aggGroup.shutdown(true);
  worker.shutdown();
}

代码示例来源:origin: com.amazonaws/amazon-kinesis-client

/**
 * Start consuming data from the stream, and pass it to the application record processors.
 */
public void run() {
  if (shutdown) {
    return;
  }
  try {
    initialize();
    LOG.info("Initialization complete. Starting worker loop.");
  } catch (RuntimeException e1) {
    LOG.error("Unable to initialize after " + MAX_INITIALIZATION_ATTEMPTS + " attempts. Shutting down.", e1);
    shutdown();
  }
  while (!shouldShutdown()) {
    runProcessLoop();
  }
  finalShutdown();
  LOG.info("Worker loop is complete. Exiting from worker.");
}

代码示例来源:origin: com.amazonaws/amazon-kinesis-client

this.shutdown();
return GracefulShutdownContext.SHUTDOWN_ALREADY_COMPLETED;

代码示例来源:origin: com.amazonaws/amazon-kinesis-client

context.getWorker().shutdown();

代码示例来源:origin: aws-samples/aws-dynamodb-examples

worker.shutdown();
t.join();

相关文章