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-01-02 17:53:27 +00:00
|
|
|
// DB stores information about repairs that have failed.
|
2018-12-10 19:08:45 +00:00
|
|
|
type DB interface {
|
2019-01-02 17:53:27 +00:00
|
|
|
// IncrementRepairAttempts increments the repair attempts.
|
2018-12-10 19:08:45 +00:00
|
|
|
IncrementRepairAttempts(ctx context.Context, segmentInfo *RemoteSegmentInfo) error
|
2019-01-02 17:53:27 +00:00
|
|
|
// Get returns irreparable segment info based on segmentPath.
|
2018-12-10 19:08:45 +00:00
|
|
|
Get(ctx context.Context, segmentPath []byte) (*RemoteSegmentInfo, error)
|
2019-01-02 17:53:27 +00:00
|
|
|
// Delete removes irreparable segment info based on segmentPath.
|
2018-12-10 19:08:45 +00:00
|
|
|
Delete(ctx context.Context, segmentPath []byte) error
|
|
|
|
}
|
|
|
|
|
2019-01-02 17:53:27 +00:00
|
|
|
// RemoteSegmentInfo is information about failed repairs.
|
2018-12-10 19:08:45 +00:00
|
|
|
type RemoteSegmentInfo struct {
|
|
|
|
EncryptedSegmentPath []byte
|
|
|
|
EncryptedSegmentDetail []byte //contains marshaled info of pb.Pointer
|
|
|
|
LostPiecesCount int64
|
|
|
|
RepairUnixSec int64
|
|
|
|
RepairAttemptCount int64
|
|
|
|
}
|