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


Java ITransformer类代码示例

本文整理汇总了Java中com.amazonaws.services.kinesis.connectors.interfaces.ITransformer的典型用法代码示例。如果您正苦于以下问题:Java ITransformer类的具体用法?Java ITransformer怎么用?Java ITransformer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ITransformer类属于com.amazonaws.services.kinesis.connectors.interfaces包,在下文中一共展示了ITransformer类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processRecords

import com.amazonaws.services.kinesis.connectors.interfaces.ITransformer; //导入依赖的package包/类
@Override
public void processRecords(List<Record> records, IRecordProcessorCheckpointer checkpointer) {
    // Note: This method will be called even for empty record lists. This is needed for checking the buffer time
    // threshold.
    if (isShutdown) {
        LOG.warn("processRecords called on shutdown record processor for shardId: " + shardId);
        return;
    }
    if (shardId == null) {
        throw new IllegalStateException("Record processor not initialized");
    }

    // Transform each Amazon Kinesis Record and add the result to the buffer
    for (Record record : records) {
        try {
            if (transformer instanceof ITransformer) {
                ITransformer<T, U> singleTransformer = (ITransformer<T, U>) transformer;
                filterAndBufferRecord(singleTransformer.toClass(record), record);
            } else if (transformer instanceof ICollectionTransformer) {
                ICollectionTransformer<T, U> listTransformer = (ICollectionTransformer<T, U>) transformer;
                Collection<T> transformedRecords = listTransformer.toClass(record);
                for (T transformedRecord : transformedRecords) {
                    filterAndBufferRecord(transformedRecord, record);
                }
            } else {
                throw new RuntimeException("Transformer must implement ITransformer or ICollectionTransformer");
            }
        } catch (IOException e) {
            LOG.error(e);
        }
    }

    if (buffer.shouldFlush()) {
        List<U> emitItems = transformToOutput(buffer.getRecords());
        emit(checkpointer, emitItems);
    }
}
 
开发者ID:SumoLogic,项目名称:sumologic-kinesis-connector,代码行数:38,代码来源:KinesisConnectorRecordProcessor.java

示例2: getTransformer

import com.amazonaws.services.kinesis.connectors.interfaces.ITransformer; //导入依赖的package包/类
@Override
public ITransformer<byte[], byte[]> getTransformer(KinesisConnectorConfiguration configuration) {
    return new ByteArrayNoopTransformer();
}
 
开发者ID:codeflows,项目名称:kinesis-to-s3,代码行数:5,代码来源:S3Pipeline.java

示例3: getTransformer

import com.amazonaws.services.kinesis.connectors.interfaces.ITransformer; //导入依赖的package包/类
@Override
public ITransformer<KinesisMessageModel, Map<String,String>> getTransformer(KinesisConnectorConfiguration configuration) {
    return new KinesisMessageModelHBaseTransformer();
}
 
开发者ID:awslabs,项目名称:aws-big-data-blog,代码行数:5,代码来源:HBasePipeline.java


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