作者:灵小星星_364 | 来源:互联网 | 2023-07-21 14:49
本文整理了Java中com.amazonaws.services.kinesis.producer.KinesisProducer.flushSync()方法的一些代码
本文整理了Java中com.amazonaws.services.kinesis.producer.KinesisProducer.flushSync()
方法的一些代码示例,展示了KinesisProducer.flushSync()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。KinesisProducer.flushSync()
方法的具体详情如下:
包路径:com.amazonaws.services.kinesis.producer.KinesisProducer
类名称:KinesisProducer
方法名:flushSync
KinesisProducer.flushSync介绍
[英]Instructs the child process to flush all records and waits until all records are complete (either succeeding or failing).
The wait includes any retries that need to be performed. Depending on your configuration of record TTL and request timeout, this can potentially take a long time if the library is having trouble delivering records to the backend, for example due to network problems.
This is useful if you need to shutdown your application and want to make sure all records are delivered before doing so.
[中]指示子进程刷新所有记录,并等待所有记录完成(成功或失败)。
等待包括需要执行的任何重试。根据您对记录TTL和请求超时的配置,如果库无法将记录传送到后端(例如由于网络问题),这可能需要很长时间。
如果您需要关闭应用程序,并希望在关闭之前确保所有记录都已交付,则此功能非常有用。
代码示例
代码示例来源:origin: aws-samples/aws-big-data-blog
@Override
public void stop() {
super.stop();
kinesis.flushSync();
kinesis.destroy();
}
}
代码示例来源:origin: aws-samples/aws-big-data-blog
@Override
public void stop() {
super.stop();
kinesis.flushSync();
kinesis.destroy();
}
}
代码示例来源:origin: awslabs/kinesis-kafka-connector
@Override
public void flush(Map arg0) {
// TODO Auto-generated method stub
if (singleKinesisProducerPerPartition) {
producerMap.values().forEach(producer -> {
if (flushSync)
producer.flushSync();
else
producer.flush();
});
} else {
if (flushSync)
kinesisProducer.flushSync();
else
kinesisProducer.flush();
}
}
代码示例来源:origin: awslabs/kinesis-kafka-connector
@Override
public void stop() {
// destroying kinesis producers which were not closed as part of close
if (singleKinesisProducerPerPartition) {
for (KinesisProducer kp : producerMap.values()) {
kp.flushSync();
kp.destroy();
}
} else {
kinesisProducer.destroy();
}
}
代码示例来源:origin: aws-samples/flink-stream-processing-refarch
kinesisProducer.flushSync();
kinesisProducer.destroy();