本文整理汇总了Java中com.amazonaws.services.kinesis.clientlibrary.types.ShutdownReason类的典型用法代码示例。如果您正苦于以下问题:Java ShutdownReason类的具体用法?Java ShutdownReason怎么用?Java ShutdownReason使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ShutdownReason类属于com.amazonaws.services.kinesis.clientlibrary.types包,在下文中一共展示了ShutdownReason类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processRecords
import com.amazonaws.services.kinesis.clientlibrary.types.ShutdownReason; //导入依赖的package包/类
@Override
public void processRecords(List<Record> records,
IRecordProcessorCheckpointer checkpointer) {
LOG.info(String.format("Received %s Records", records.size()));
// add a call to your business logic here!
//
// myLinkedClasses.doSomething(records)
//
//
try {
checkpointer.checkpoint();
} catch (KinesisClientLibDependencyException | InvalidStateException
| ThrottlingException | ShutdownException e) {
e.printStackTrace();
super.shutdown(checkpointer, ShutdownReason.ZOMBIE);
}
}
示例2: shutdown
import com.amazonaws.services.kinesis.clientlibrary.types.ShutdownReason; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void shutdown(IRecordProcessorCheckpointer checkpointer,
ShutdownReason reason) {
LOG.info("Shutting down record processor for shard: " + kinesisShardId);
// Important to checkpoint after reaching end of shard, so we can start
// processing data from child shards.
if (reason == ShutdownReason.TERMINATE) {
try {
checkpoint(checkpointer);
} catch (Exception e) {
e.printStackTrace();
}
}
}
示例3: shutdown
import com.amazonaws.services.kinesis.clientlibrary.types.ShutdownReason; //导入依赖的package包/类
@Override
public void shutdown(IRecordProcessorCheckpointer checkpointer, ShutdownReason reason) {
LOG.info("Shutting down record processor with shardId: " + shardId + " with reason " + reason);
if (isShutdown) {
LOG.warn("Record processor for shardId: " + shardId + " has been shutdown multiple times.");
return;
}
switch (reason) {
case TERMINATE:
emit(checkpointer, transformToOutput(buffer.getRecords()));
try {
checkpointer.checkpoint();
} catch (KinesisClientLibDependencyException | InvalidStateException | ThrottlingException | ShutdownException e) {
LOG.error(e);
}
break;
case ZOMBIE:
break;
default:
throw new IllegalStateException("invalid shutdown reason");
}
emitter.shutdown();
isShutdown = true;
}
示例4: processRecords
import com.amazonaws.services.kinesis.clientlibrary.types.ShutdownReason; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void processRecords(List<Record> records,
IRecordProcessorCheckpointer checkpointer) {
LOG.info("Aggregating " + records.size()
+ " records for Kinesis Shard " + kinesisShardId);
try {
// run data into the aggregator
agg.aggregate(records);
// checkpoint the aggregator and kcl
agg.checkpoint();
checkpointer.checkpoint(records.get(records.size() - 1));
LOG.debug("Kinesis Checkpoint for Shard " + kinesisShardId
+ " Complete");
} catch (Exception e) {
e.printStackTrace();
LOG.error(e);
shutdown(checkpointer, ShutdownReason.ZOMBIE);
}
}
示例5: shutdown
import com.amazonaws.services.kinesis.clientlibrary.types.ShutdownReason; //导入依赖的package包/类
@Override
@SneakyThrows
public void shutdown(ShutdownInput shutdownInput) {
IRecordProcessorCheckpointer checkpointer = shutdownInput.getCheckpointer();
ShutdownReason reason = shutdownInput.getShutdownReason();
log.info("Finalizado trabajo: {}.", reason);
checkpointer.checkpoint();
}
示例6: shutdown
import com.amazonaws.services.kinesis.clientlibrary.types.ShutdownReason; //导入依赖的package包/类
@Override
public void shutdown(IRecordProcessorCheckpointer iRecordProcessorCheckpointer, ShutdownReason shutdownReason) {
if (producer != null) {
producer.close();
}
logger.info("Shutting down record processor for shard: " + shardId);
// Important to checkpoint after reaching end of shard, so we can start processing data from child shards.
if (shutdownReason == ShutdownReason.TERMINATE) {
checkpoint(iRecordProcessorCheckpointer);
}
}
示例7: shutdown
import com.amazonaws.services.kinesis.clientlibrary.types.ShutdownReason; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void shutdown(IRecordProcessorCheckpointer checkpointer, ShutdownReason reason) {
// Important to checkpoint after reaching end of shard,
// so we can start processing data from child shards.
if (reason == ShutdownReason.TERMINATE) {
performCheckpoint(checkpointer);
}
}
示例8: shutdown
import com.amazonaws.services.kinesis.clientlibrary.types.ShutdownReason; //导入依赖的package包/类
@Override
public void shutdown(IRecordProcessorCheckpointer checkpointer, ShutdownReason reason) {
if(reason == ShutdownReason.TERMINATE) {
try {
checkpointer.checkpoint();
} catch (Exception e) {
e.printStackTrace();
}
}
}
开发者ID:gnethercutt,项目名称:dynamodb-streams-kafka,代码行数:11,代码来源:KafkaForwardingStreamsRecordProcessor.java
示例9: shutdown
import com.amazonaws.services.kinesis.clientlibrary.types.ShutdownReason; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void shutdown(IRecordProcessorCheckpointer checkpointer, ShutdownReason reason) {
logger.info("Shutting down record processor for shard: " + kinesisShardId);
// Important to checkpoint after reaching end of shard, so we can start processing data from child shards.
if (reason == ShutdownReason.TERMINATE) {
checkpoint(checkpointer);
}
}
示例10: shutdown
import com.amazonaws.services.kinesis.clientlibrary.types.ShutdownReason; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public void shutdown(IRecordProcessorCheckpointer checkpointer, ShutdownReason reason) {
LOG.info("Shutting down record processor for shard: " + kinesisShardId);
// Important to checkpoint after reaching end of shard, so we can start processing data from child shards.
if (reason == ShutdownReason.TERMINATE) {
checkpoint(checkpointer);
}
}
示例11: shutdown
import com.amazonaws.services.kinesis.clientlibrary.types.ShutdownReason; //导入依赖的package包/类
@Override
public void shutdown(IRecordProcessorCheckpointer checkpointer, ShutdownReason reason) {
LOG.info("Shutting down record processor for shard: " + kinesisShardId);
// Important to checkpoint after reaching end of shard, so we can start
// processing data from child shards.
if (reason == ShutdownReason.TERMINATE) {
checkpoint(checkpointer);
}
}
示例12: shutdown
import com.amazonaws.services.kinesis.clientlibrary.types.ShutdownReason; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void shutdown(IRecordProcessorCheckpointer checkpointer, ShutdownReason reason) {
LOGGER.info("Shutting down record processor for shard: " + kinesisShardId);
/** Important to checkpoint after reaching end of shard, so we can start processing data from child shards. **/
if (reason == ShutdownReason.TERMINATE) {
checkpoint(checkpointer);
}
}
示例13: shutdown
import com.amazonaws.services.kinesis.clientlibrary.types.ShutdownReason; //导入依赖的package包/类
@Override
public void shutdown(IRecordProcessorCheckpointer checkpointer,
ShutdownReason reason) {
if(reason == ShutdownReason.TERMINATE) {
try {
checkpointer.checkpoint();
} catch (Exception e) {
e.printStackTrace();
}
}
}
示例14: shutdown
import com.amazonaws.services.kinesis.clientlibrary.types.ShutdownReason; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void shutdown(IRecordProcessorCheckpointer checkpointer, ShutdownReason reason) {
LOG.info("Shutting down record processor for shard: " + kinesisShardId);
// Important to checkpoint after reaching end of shard, so we can start processing data from child shards.
if (reason == ShutdownReason.TERMINATE) {
checkpoint(checkpointer);
}
}
示例15: shutdown
import com.amazonaws.services.kinesis.clientlibrary.types.ShutdownReason; //导入依赖的package包/类
@Override
public void shutdown(IRecordProcessorCheckpointer arg0, ShutdownReason arg1) {
}