當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。