当前位置: 首页>>代码示例>>Java>>正文


Java ShutdownReason类代码示例

本文整理汇总了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);
	}
}
 
开发者ID:awslabs,项目名称:aws-kinesis-beanstalk-workers,代码行数:19,代码来源:MyRecordProcessor.java

示例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();
		}
	}
}
 
开发者ID:awslabs,项目名称:aws-kinesis-beanstalk-workers,代码行数:19,代码来源:ManagedClientProcessor.java

示例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;
}
 
开发者ID:SumoLogic,项目名称:sumologic-kinesis-connector,代码行数:25,代码来源:KinesisConnectorRecordProcessor.java

示例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);
	}
}
 
开发者ID:awslabs,项目名称:amazon-kinesis-aggregators,代码行数:25,代码来源:AggregatorProcessor.java

示例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();
}
 
开发者ID:capside,项目名称:aws-kinesis-zombies,代码行数:9,代码来源:ZombieRecordProcessor.java

示例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);
    }
}
 
开发者ID:SaschaMoellering,项目名称:ingestion-service,代码行数:14,代码来源:RecordProcessor.java

示例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);
    }
}
 
开发者ID:lenards,项目名称:spark-cstar-canaries,代码行数:12,代码来源:EventRecordProcessor.java

示例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);
    }
}
 
开发者ID:DevOps-TangoMe,项目名称:flume-kinesis,代码行数:12,代码来源:FlumeSourceRecordProcessor.java

示例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);
    }
}
 
开发者ID:awslabs,项目名称:aws-big-data-blog,代码行数:11,代码来源:KinesisRecordProcessor.java

示例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);
	}
}
 
开发者ID:awslabs,项目名称:aws-big-data-blog,代码行数:10,代码来源:StreamsRecordProcessor.java

示例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);
    }
}
 
开发者ID:shagwood,项目名称:micro-genie,代码行数:12,代码来源:KinesisRawEventRecordProcessor.java

示例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();
        }
    }
}
 
开发者ID:awslabs,项目名称:aws-dynamodb-examples,代码行数:12,代码来源:StreamsRecordProcessor.java

示例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);
    }
}
 
开发者ID:dselman,项目名称:tweetamo,代码行数:12,代码来源:TweetamoRecordProcessor.java

示例15: shutdown

import com.amazonaws.services.kinesis.clientlibrary.types.ShutdownReason; //导入依赖的package包/类
@Override
public void shutdown(IRecordProcessorCheckpointer arg0, ShutdownReason arg1) {
}
 
开发者ID:tyagihas,项目名称:awsbigdata,代码行数:4,代码来源:Processor.java


注:本文中的com.amazonaws.services.kinesis.clientlibrary.types.ShutdownReason类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。