Project

General

Profile

Actions

Feature #6280

closed

[SDKs] Go SDK can return an io.Reader for a given collection record and filename

Added by Tom Clegg over 9 years ago. Updated over 7 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
SDKs
Target version:
-
Story points:
2.0

Description

Given a collection (as retrieved from the API server via "list" or "get"), the new method (CollectionFileReader?) should return an object that implements the io.Reader interface.

Factors to consider:
  • Handle fragmented files correctly ("bar" in "./foo" is the same file as "foo/bar" in ".")
  • Fetch data from proxy, disk, or gateway service as appropriate

The returned object should also have a Len() method that returns the size of the file in bytes.

The reader should use the (*KeepClient)Get() method so its Read() method can start returning data before an entire block is retrieved.

If the reader detects a hash mismatch while reading from Keep, it should (of course) return an error, and should make sure to return less than Len() bytes in total. (This makes it possible for a web client, for example, to detect that an error occurred while downloading.) This should be taken care of already by (*KeepClient)Get().

For an initial implementation, it's acceptable to have a delay at each block boundary ("reached end of current block, so get a reader for the next block"). Ideally, though, this part of the reader will also work asynchronously: e.g., worker goroutine calls (*KeepClient)Get(), reads <=1MiB byte slices from the reader, and sends them to a channel with size 8, while the Read() just returns the next chunk from the channel. If this is as simple as it sounds even with proper error handling, it would be Nice To Have.


Subtasks 1 (0 open1 closed)

Task #6299: ReviewResolvedPeter Amstutz06/10/2015Actions

Related issues

Blocks Arvados - Idea #5824: [Workbench] [Keep] collection browse/download serverResolvedTom Clegg05/21/2015Actions
Actions #1

Updated by Tom Clegg over 9 years ago

  • Description updated (diff)
  • Project changed from 35 to Arvados
  • Category set to SDKs
Actions #2

Updated by Tom Clegg over 9 years ago

  • Target version changed from Arvados Future Sprints to 2015-07-08 sprint
Actions #3

Updated by Radhika Chippada over 9 years ago

  • Assigned To set to Radhika Chippada
Actions #4

Updated by Tom Clegg over 9 years ago

5824-keepdl at e3d48bb has a stub method in source:sdk/go/arvadosclient/collectionreader.go@e3d48bb (along with a keepdl file downloader service that uses it, and integration tests for keepdl which pass if CollectionFileReader returns either ErrNotImplemented or real data). Use 5824-keepdl branch on arvados-dev to run its tests (--only services/keepdl).

Actions #5

Updated by Tom Clegg over 9 years ago

  • Description updated (diff)
Actions #6

Updated by Brett Smith over 9 years ago

  • Assigned To changed from Radhika Chippada to Tom Clegg

Radhika is shifting to focus on #6219. Tom is taking this as a sort of personal interest project. The current expectation is that this can be workable because support load on #6266 has been light. However, it's still the lowest priority in this sprint.

Actions #7

Updated by Tom Clegg over 9 years ago

  • Status changed from New to In Progress
Actions #8

Updated by Brett Smith over 9 years ago

  • Target version deleted (2015-07-08 sprint)

Because development on this story is done in spare time, I'm kicking it out of the sprint cycle. It should not be budgeted as part of that.

Actions #9

Updated by Tom Clegg about 9 years ago

  • Status changed from In Progress to Resolved
Actions

Also available in: Atom PDF