Documentation ¶
Index ¶
- type SlowBlobs
- func (slow *SlowBlobs) Create(ctx context.Context, ref storage.BlobRef, size int64) (storage.BlobWriter, error)
- func (slow *SlowBlobs) Delete(ctx context.Context, ref storage.BlobRef) error
- func (slow *SlowBlobs) FreeSpace() (int64, error)
- func (slow *SlowBlobs) Open(ctx context.Context, ref storage.BlobRef) (storage.BlobReader, error)
- func (slow *SlowBlobs) SetLatency(delay time.Duration)
- type SlowDB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SlowBlobs ¶
type SlowBlobs struct {
// contains filtered or unexported fields
}
SlowBlobs implements a slow blob store.
func NewSlowBlobs ¶
NewSlowBlobs creates a new slow blob store wrapping the provided blobs. Use SetLatency to dynamically configure the latency of all operations.
func (*SlowBlobs) Create ¶
func (slow *SlowBlobs) Create(ctx context.Context, ref storage.BlobRef, size int64) (storage.BlobWriter, error)
Create creates a new blob that can be written optionally takes a size argument for performance improvements, -1 is unknown size.
func (*SlowBlobs) SetLatency ¶
SetLatency configures the blob store to sleep for delay duration for all operations. A zero or negative delay means no sleep.
type SlowDB ¶
type SlowDB struct { storagenode.DB // contains filtered or unexported fields }
SlowDB implements slow storage node DB.
func NewSlowDB ¶
func NewSlowDB(log *zap.Logger, db storagenode.DB) *SlowDB
NewSlowDB creates a new slow storage node DB wrapping the provided db. Use SetLatency to dynamically configure the latency of all piece operations.
func (*SlowDB) SetLatency ¶
SetLatency enables a sleep for delay duration for all piece operations. A zero or negative delay means no sleep.