This post is more than 5 years old

13 Posts

1332

November 28th, 2013 03:00

Reading part of a file in Atmos cloud storage

To read part of a file, use the Read Object method with the Range request header. In the example below, the request is for 11 bytes (bytes 5-15).

Request

GET /rest/namespace/mydirectory/samplefile HTTP/1.1

accept: */*

date: Mon, 03 Aug 2009 13:35:11 GMT

content-type: application/octet-stream

x-emc-date: Mon, 03 Aug 2009 13:35:11 GMT

range: Bytes=5-15

host: 168.159.116.96

x-emc-uid: 33115732f3b7455d9d2344ddd235f4b9/user1

x-emc-signature: vv7reSLatse4u7WxoO7FPSjJCpY=

I wonder is it possible to read part of the file specifying multiple ranges, say something like:

Request

GET /rest/namespace/mydirectory/samplefile HTTP/1.1

accept: */*

date: Mon, 03 Aug 2009 13:35:11 GMT

content-type: application/octet-stream

x-emc-date: Mon, 03 Aug 2009 13:35:11 GMT

range: Bytes=5-15

range: Bytes=25-30

range: Bytes=40-50

range: Bytes=80-100

range: Bytes=245-300

range: Bytes=899-1000

range: Bytes=5000-6000

host: 168.159.116.96

x-emc-uid: 33115732f3b7455d9d2344ddd235f4b9/user1

x-emc-signature: vv7reSLatse4u7WxoO7FPSjJCpY=

281 Posts

December 2nd, 2013 12:00

Yes, you can specify multiple ranges with:

Range: bytes=5-15,25-30,40-50

However, the response will be encoded in multipart/byteranges encoding, so you will need to parse that.

13 Posts

December 3rd, 2013 02:00

Thanks a lot for your help Jason.

That is good news!

May I ask if there is a limitation in the length of line

Range: bytes=5-15,25-30,40-50

May I ask what is the meaning of "the response will be encoded in multipart/byteranges encoding"?

My intention is to use EMC Atmos storage cloud .NET API. May I ask if the API supports multiple ranges on reading from EMC Atmos objects, and if it does, is there an example in C# which shows how to partially restore an ECM Atmos cloud object giving a list of byte ranges?

Thanks.

P.S.

Am I right in thinking that the extent of Extent type below can be used to specify one range only?

public byte[] ReadObject(

    Identifier id,

    Extent extent,

    byte[] buffer

)

id (Identifier)

the identifier of the object whose content to read.

extent (Extent)

the portion of the object data to read. Optional. If null, the entire object will be read.

buffer (byte[])

the buffer to use to read the extent. Must be large enough to read the response or an error will be thrown. If null, a buffer will be allocated to hold the response data. If you pass a buffer that is larger than the extent, only extent.getSize() bytes will be valid.

P.P.S.

May I ask if ECM Atmos storage cloud and EMC Atmos storage cloud .NET API support IPv6? If they do, and if applicable, how it is decided if the connection is going to be IPv4 or IPv6?

Thanks.

281 Posts

December 3rd, 2013 07:00

The C# SDK for Atmos does not currently support multiple byte ranges.  The source code is available though, so you could add this support if needed.

Multipart/byteranges encoding is defined in section 19.2 of the HTTP spec:

http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html

The Atmos appliance does not currently support IPv6, but I believe this is coming in a future release.  The Atmos SDKs, however, are built upon the lower-level HTTP stacks in their respective environments (e.g. .NET's HttpWebRequest) and should support IPv6 if that environment is configured for IPv6.

13 Posts

December 3rd, 2013 07:00

Thanks for your help Jason.

No Events found!

Top