1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
12 "git.arvados.org/arvados.git/sdk/go/arvados"
13 "github.com/sirupsen/logrus"
16 // volume is the interface to a back-end storage device.
17 type volume interface {
18 BlockRead(ctx context.Context, hash string, writeTo io.Writer) (int, error)
19 BlockWrite(ctx context.Context, hash string, data []byte) error
21 BlockTouch(hash string) error
22 BlockTrash(hash string) error
23 BlockUntrash(hash string) error
24 Index(ctx context.Context, prefix string, writeTo io.Writer) error
25 Mtime(hash string) (time.Time, error)
29 type volumeDriver func(newVolumeParams) (volume, error)
31 type newVolumeParams struct {
33 Cluster *arvados.Cluster
34 ConfigVolume arvados.Volume
35 Logger logrus.FieldLogger
36 MetricsVecs *volumeMetricsVecs
37 BufferPool *bufferPool
40 // ioStats tracks I/O statistics for a volume or server
52 type InternalStatser interface {
53 InternalStats() interface{}