我是编程的新手...希望您能帮助我... 我的要求是,如果数据的到达时间少于3分钟,则编写Java条件,然后将其发送到s3,否则不要发送...
我的代码示例如下
public class KinesisFirehoseTransformer implements RequestHandler<KinesisFirehoseEvent, KinesisFirehoseResponse> {
@Override
public KinesisFirehoseResponse handleRequest(KinesisFirehoseEvent event, Context context) {
context.getLogger().log("Input: " + event);
List<KinesisFirehoseOutputRecord> results = event.getRecords().stream().map(record -> {
KinesisFirehoseOutputRecord outRec = new KinesisFirehoseOutputRecord();
outRec.setRecordId(record.getRecordId());
outRec.setData(record.getData());
outRec.result = KinesisFirehoseResponse.TRANSFORMED_STATE_DROPPED;
return outRec;
}).collect(Collectors.toList());
return new KinesisFirehoseResponse(results);
}
}