Project

General

Profile

Actions

Idea #10996

closed

[SDK] Writable file-like interface for collections in Go SDK

Added by Peter Amstutz about 7 years ago. Updated over 6 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
-
Target version:
-
Start date:
Due date:
Story points:
2.0

Description

Background

In sdk/go/keepclient, (*keepclient.KeepClient)CollectionFileReader(collection map[string]interface{}, filename string) returns a keepclient.Reader, which implements io.Reader, io.Seeker, and io.Closer but not io.Writer.

In services/crunch-run, (*CollectionWriter).Open(path string) returns an io.WriteCloser, i.e., it can write but not read or seek.

Improvement

In sdk/go/arvados, a Collection should have Open, Create, and OpenFile methods that correspond to os.Open, os.Create, and os.OpenFile.

Open returns a read-only file, so it can be implemented by calling CollectionFileReader.

For now, Create and OpenFile can be implemented by refactoring the CollectionWriter bits into the SDK, but the returned object would not be readable or seekable. See #11249.

Optimization ideas

Presumably not implemented at the same time, but can be kept in mind so we don't burn too many bridges:
  • BlockCache could use AsyncStream, e.g. 10990-keep-web-ranges-pa
  • Could cache smaller portions of blocks

Related issues

Blocks Arvados - Bug #11249: [SDKs] Writable collection files returned by Go SDK should be seekableResolvedTom CleggActions
Blocks Arvados - Idea #12308: [FUSE] Golang-based fuse driverResolvedTom CleggActions
Actions #1

Updated by Peter Amstutz about 7 years ago

  • Description updated (diff)
Actions #2

Updated by Tom Clegg about 7 years ago

  • Description updated (diff)
Actions #3

Updated by Tom Morris about 7 years ago

  • Target version set to Arvados Future Sprints
Actions #4

Updated by Tom Clegg about 7 years ago

  • Subject changed from [SDK] Improve caching & data pipelining in Go SDK to [SDK] Writable file-like interface for collections in Go SDK
  • Description updated (diff)
Actions #5

Updated by Tom Clegg about 7 years ago

  • Description updated (diff)
Actions #6

Updated by Tom Clegg about 7 years ago

  • Description updated (diff)
  • Story points set to 2.0
Actions #7

Updated by Tom Clegg over 6 years ago

  • Status changed from New to Resolved
  • Assigned To set to Tom Clegg
  • Target version deleted (Arvados Future Sprints)

Done in #12483

Actions

Also available in: Atom PDF