是否有"S3范围读取功能"?允许从AWS-S3文件读取分配的字节范围? [英] Is there "S3 range read function" that allows to read assigned byte range from AWS-S3 file?

查看:292
本文介绍了是否有"S3范围读取功能"?允许从AWS-S3文件读取分配的字节范围?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在AWS Lamba中处理大型文件并跳过整个文件似乎有点浪费. 是否存在范围读取"功能,该功能仅允许从S3文件中读取预定义的字节范围?

Trying to process large file in AWS Lamba and skipping through the whole file seems a bit wasteful. Is there a "range read" function that allows to read only predefined byte range from S3 file?

推荐答案

是的,这是可能的.根据REST API中 GET对象的S3文档,它支持使用HTTP Range标头.

Yes, this is possible. According to S3 documentation of GET Object in the REST API, it supports use of the HTTP Range header.

范围

下载对象的指定范围字节.有关HTTP Range标头的更多信息,请访问 http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35 .

Downloads the specified range bytes of an object. For more information about the HTTP Range header, go to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.

在示例语法中:

GET /ObjectName HTTP/1.1
Host: BucketName.s3.amazonaws.com
Date: date
Authorization: authorization string (see Authenticating Requests (AWS Signature Version 4))
Range:bytes=byte_range

流行的S3客户端库,例如适用于Java的AWS开发工具包提供了方便的客户端端API,用于指定范围信息.

Popular S3 client libraries, such as the AWS SDK for Java provide convenient client-side APIs for specifying the range information.

这篇关于是否有"S3范围读取功能"?允许从AWS-S3文件读取分配的字节范围?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆