本文整理汇总了Java中com.amazonaws.services.kinesis.clientlibrary.exceptions.ThrottlingException类的典型用法代码示例。如果您正苦于以下问题:Java ThrottlingException类的具体用法?Java ThrottlingException怎么用?Java ThrottlingException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ThrottlingException类属于com.amazonaws.services.kinesis.clientlibrary.exceptions包,在下文中一共展示了ThrottlingException类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processRecords
import com.amazonaws.services.kinesis.clientlibrary.exceptions.ThrottlingException; //导入依赖的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.exceptions.ThrottlingException; //导入依赖的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;
}
示例3: processRecords
import com.amazonaws.services.kinesis.clientlibrary.exceptions.ThrottlingException; //导入依赖的package包/类
@Override
public void processRecords(List<Record> list, IRecordProcessorCheckpointer irpc) {
_logger.info("Processing {} records", list.size());
for(Record r: list){
String data = new String(r.getData().array());
long seq = _buffer.next();
KinesisEvent evt = _buffer.get(seq);
evt.setData(data);
_buffer.publish(seq);
}
try{
irpc.checkpoint();
}
catch(InvalidStateException | KinesisClientLibDependencyException | ShutdownException | ThrottlingException ex){
_logger.warn("Exception while checkpointing", ex);
}
}