第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何將 Kinesis Firehose 數(shù)據(jù)傳遞到 dynamodb 表?

如何將 Kinesis Firehose 數(shù)據(jù)傳遞到 dynamodb 表?

料青山看我應如是 2023-10-19 18:22:16
Kinesis Firehose 流接收消息。有一個選項可以持久保存到 S3 中,但我的用例是插入到 dynamodb 表中。Firehose 有一個啟用 Lambda 函數(shù)的選項。我應該使用 Lambda 將插入邏輯寫入 dynamodb 表嗎?這是正確的方法嗎?如果是這樣,那么如何使用用 Java 編寫的 Lambda 將記錄插入到 DynamoDB 中。
查看完整描述

1 回答

?
ibeautiful

TA貢獻1993條經驗 獲得超6個贊

沒有將 Firehose 流數(shù)據(jù)插入 DynamoDB(例如 S3 或 Redshift)的標準方法。推薦的方法是執(zhí)行 Lambda 并將記錄插入到 DynamoDB 中。

使用dynamoDB.batchWriteItemdynamoDB.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";

}


查看完整回答
反對 回復 2023-10-19
  • 1 回答
  • 0 關注
  • 115 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號