chore: remove unused MarkInvalid in daemon (#2101)

Signed-off-by: Jim Ma <majinjing3@gmail.com>
This commit is contained in:
Jim Ma 2023-02-21 18:59:55 +08:00 committed by Gaius
parent 3352deff39
commit d7a7e69916
No known key found for this signature in database
GPG Key ID: 8B4E5D1290FA2FFB
4 changed files with 3 additions and 26 deletions

View File

@ -505,10 +505,6 @@ func (t *localTaskStore) CanReclaim() bool {
return false
}
func (t *localTaskStore) MarkInvalid() {
t.invalid.Store(true)
}
// MarkReclaim will try to invoke gcCallback (normal leave peer task)
func (t *localTaskStore) MarkReclaim() {
if t.reclaimMarked.Load() {

View File

@ -391,20 +391,16 @@ func (t *localSubTaskStore) CanReclaim() bool {
return false
}
func (t *localSubTaskStore) MarkInvalid() {
if t.parent.Done || t.invalid.Load() {
return
}
t.parent.MarkInvalid()
}
func (t *localSubTaskStore) MarkReclaim() {
// gc this subtask with gcCallback from parent
t.parent.gcCallback(CommonTaskRequest{
PeerID: t.PeerID,
TaskID: t.TaskID,
})
t.Infof("sub task %s/%s will be reclaimed, marked", t.TaskID, t.PeerID)
t.parent.Lock()
// remove subtask from parent
delete(t.parent.subtasks, PeerTaskMetadata{
PeerID: t.PeerID,
TaskID: t.TaskID,

View File

@ -224,18 +224,6 @@ func (mr *MockReclaimerMockRecorder) CanReclaim() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CanReclaim", reflect.TypeOf((*MockReclaimer)(nil).CanReclaim))
}
// MarkInvalid mocks base method.
func (m *MockReclaimer) MarkInvalid() {
m.ctrl.T.Helper()
m.ctrl.Call(m, "MarkInvalid")
}
// MarkInvalid indicates an expected call of MarkInvalid.
func (mr *MockReclaimerMockRecorder) MarkInvalid() *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarkInvalid", reflect.TypeOf((*MockReclaimer)(nil).MarkInvalid))
}
// MarkReclaim mocks base method.
func (m *MockReclaimer) MarkReclaim() {
m.ctrl.T.Helper()

View File

@ -83,9 +83,6 @@ type Reclaimer interface {
// MarkReclaim marks the storage which will be reclaimed
MarkReclaim()
// marks the special storage invalid, that will reclaim next gc round
MarkInvalid()
// Reclaim reclaims the storage
Reclaim() error
}