2019-01-24 20:15:10 +00:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
2018-12-10 19:08:45 +00:00
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
package irreparable
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2019-03-15 20:21:52 +00:00
|
|
|
|
2020-10-30 11:12:01 +00:00
|
|
|
"storj.io/storj/satellite/internalpb"
|
2020-09-08 11:13:18 +01:00
|
|
|
"storj.io/storj/satellite/metainfo/metabase"
|
2018-12-10 19:08:45 +00:00
|
|
|
)
|
|
|
|
|
2019-01-02 17:53:27 +00:00
|
|
|
// DB stores information about repairs that have failed.
|
2019-09-10 14:24:16 +01:00
|
|
|
//
|
|
|
|
// architecture: Database
|
2018-12-10 19:08:45 +00:00
|
|
|
type DB interface {
|
2019-01-02 17:53:27 +00:00
|
|
|
// IncrementRepairAttempts increments the repair attempts.
|
2020-10-30 11:12:01 +00:00
|
|
|
IncrementRepairAttempts(ctx context.Context, segmentInfo *internalpb.IrreparableSegment) error
|
2020-09-08 11:13:18 +01:00
|
|
|
// Get returns irreparable segment info based on segmentKey.
|
2020-10-30 11:12:01 +00:00
|
|
|
Get(ctx context.Context, segmentKey metabase.SegmentKey) (*internalpb.IrreparableSegment, error)
|
2019-07-18 17:21:21 +01:00
|
|
|
// GetLimited returns a list of irreparable segment info starting after the last segment info we retrieved
|
2020-10-30 11:12:01 +00:00
|
|
|
GetLimited(ctx context.Context, limit int, lastSeenSegmentKey metabase.SegmentKey) ([]*internalpb.IrreparableSegment, error)
|
2020-09-08 11:13:18 +01:00
|
|
|
// Delete removes irreparable segment info based on segmentKey.
|
|
|
|
Delete(ctx context.Context, segmentKey metabase.SegmentKey) error
|
2018-12-10 19:08:45 +00:00
|
|
|
}
|