1 回答

TA貢獻1993條經驗 獲得超6個贊
沒有將 Firehose 流數(shù)據(jù)插入 DynamoDB(例如 S3 或 Redshift)的標準方法。推薦的方法是執(zhí)行 Lambda 并將記錄插入到 DynamoDB 中。
使用dynamoDB.batchWriteItem
或dynamoDB.putItem
。
public String handleRequest(KinesisFirehoseEvent event, Context context)
? ? List<KinesisFirehoseEvent.Record> records = event.getRecords();
? ? for(KinesisFirehoseEvent.Record rec : records)
? ? {
? ? ? ? String recordId = rec.getRecordId();
? ? ? ? String data = StandardCharsets.UTF_8.decode(rec.getData()).toString();
? ? ? ? Item item = transformStringToItem(data);
? ? ? ? // Write the item to the table?
? ? ? ? table.putItem(item);
? ? }
? ? return "success";
}
添加回答
舉報