storj/pkg/datarepair/irreparable/irreparable.go
aligeti d27bcddaab
Merge the irreparable DB into the master database (#777)
* initial refactoring to merge irreparabledb to master db

* refactor

* code review comment updates
2018-12-10 14:08:45 -05:00

28 lines
861 B
Go

// Copyright (C) 2018 Storj Labs, Inc.
// See LICENSE for copying information.
package irreparable
import (
"context"
)
// DB interface for database operations
type DB interface {
// IncrementRepairAttempts increments the repair attempt
IncrementRepairAttempts(ctx context.Context, segmentInfo *RemoteSegmentInfo) error
// Get a irreparable's segment info from the db
Get(ctx context.Context, segmentPath []byte) (*RemoteSegmentInfo, error)
// Delete a irreparable's segment info from the db
Delete(ctx context.Context, segmentPath []byte) error
}
// RemoteSegmentInfo is info about a single entry stored in the irreparable
type RemoteSegmentInfo struct {
EncryptedSegmentPath []byte
EncryptedSegmentDetail []byte //contains marshaled info of pb.Pointer
LostPiecesCount int64
RepairUnixSec int64
RepairAttemptCount int64
}