简体   繁体   English

通过cli查询aws kinesis put-record

[英]query on aws kinesis put-record through cli

This is regarding aws kinesis put-record command through AWS CLI.这是关于通过 AWS CLI 执行的 aws kinesis put-record 命令。

I am able to input text data using kinesis cli.我可以使用 kinesis cli 输入文本数据。

aws kinesis put-record --cli-binary-format raw-in-base64-out --stream-name NagaTZeusTestStream --partition-key 1 --data 2 --region  us-west-2

Here the data is 2这里的数据是 2

But how can i put a csv file in place of 2 as data.但是我怎样才能把 csv 文件代替 2 作为数据。

And how can i put a csv file which is in s3我怎么能把一个 csv 文件放在 s3

For example:例如:

aws kinesis put-record --cli-binary-format raw-in-base64-out --stream-name NagaTZeusStream --partition-key 1 --data s3://cona-sample-salesforce-data/testdata/ --region  us-west

In this case the file csv file in the s3 bucket should be uploaded as a data record, but kinesis is considering the s3 path itself as a data string.在这种情况下,s3 存储桶中的文件 csv 文件应作为数据记录上传,但 kinesis 将 s3 路径本身视为数据字符串。

Any help would be apprecieated.任何帮助将不胜感激。 Thanks in advance提前致谢

Kinesis Streams lets you write opaque blobs of data. Kinesis Streams 允许您编写不透明的数据块。 The Kinesis PutRecord API (which is what the AWS CLI kinesis put-record command calls) expects you to give it a blob of data. Kinesis PutRecord API (这是 AWS CLI kinesis put-record命令调用的内容)希望您为其提供数据块。 If the data is stored in S3, it is your responsibility to load that data to send to Kinesis.如果数据存储在 S3 中,则您有责任加载该数据以发送到 Kinesis。

A common Kinesis pattern when working with "large" data is to put actual data into some other storage system (S3 being a great example) and then writing the "location" of that data (in this case, an S3 path) to Kinesis.处理“大”数据时的常见 Kinesis 模式是将实际数据放入其他存储系统(S3 就是一个很好的例子),然后将该数据的“位置”(在本例中为 S3 路径)写入 Kinesis。 With Kinesis Streams, your throughput (and costs) to/from Kinesis are directly affected by the amount of data you read/write.使用 Kinesis Streams,您进出 Kinesis 的吞吐量(和成本)直接受到您读取/写入的数据量的影响。 This of course requires coordination between the publisher and consumer, on the exact format (and semantics) of messages.这当然需要发布者和消费者之间就消息的确切格式(和语义)进行协调。 If this is the case, you should look at what your consumers are expecting the format of your message to be.如果是这种情况,您应该查看您的消费者期望您的消息格式是什么。

But the moral of the story here is that Kinesis (and the CLI's put-record ) are going to put/write exactly what you give it.但是这里故事的寓意是 Kinesis(和 CLI 的put-record )将准确地放置/写入您提供的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM