chore: remove unused MarkInvalid in daemon (#2101)
Signed-off-by: Jim Ma <majinjing3@gmail.com>
This commit is contained in:
parent
3352deff39
commit
d7a7e69916
|
|
@ -505,10 +505,6 @@ func (t *localTaskStore) CanReclaim() bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *localTaskStore) MarkInvalid() {
|
|
||||||
t.invalid.Store(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
// MarkReclaim will try to invoke gcCallback (normal leave peer task)
|
// MarkReclaim will try to invoke gcCallback (normal leave peer task)
|
||||||
func (t *localTaskStore) MarkReclaim() {
|
func (t *localTaskStore) MarkReclaim() {
|
||||||
if t.reclaimMarked.Load() {
|
if t.reclaimMarked.Load() {
|
||||||
|
|
|
||||||
|
|
@ -391,20 +391,16 @@ func (t *localSubTaskStore) CanReclaim() bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *localSubTaskStore) MarkInvalid() {
|
|
||||||
if t.parent.Done || t.invalid.Load() {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
t.parent.MarkInvalid()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (t *localSubTaskStore) MarkReclaim() {
|
func (t *localSubTaskStore) MarkReclaim() {
|
||||||
|
// gc this subtask with gcCallback from parent
|
||||||
t.parent.gcCallback(CommonTaskRequest{
|
t.parent.gcCallback(CommonTaskRequest{
|
||||||
PeerID: t.PeerID,
|
PeerID: t.PeerID,
|
||||||
TaskID: t.TaskID,
|
TaskID: t.TaskID,
|
||||||
})
|
})
|
||||||
t.Infof("sub task %s/%s will be reclaimed, marked", t.TaskID, t.PeerID)
|
t.Infof("sub task %s/%s will be reclaimed, marked", t.TaskID, t.PeerID)
|
||||||
|
|
||||||
t.parent.Lock()
|
t.parent.Lock()
|
||||||
|
// remove subtask from parent
|
||||||
delete(t.parent.subtasks, PeerTaskMetadata{
|
delete(t.parent.subtasks, PeerTaskMetadata{
|
||||||
PeerID: t.PeerID,
|
PeerID: t.PeerID,
|
||||||
TaskID: t.TaskID,
|
TaskID: t.TaskID,
|
||||||
|
|
|
||||||
|
|
@ -224,18 +224,6 @@ func (mr *MockReclaimerMockRecorder) CanReclaim() *gomock.Call {
|
||||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CanReclaim", reflect.TypeOf((*MockReclaimer)(nil).CanReclaim))
|
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.
|
// MarkReclaim mocks base method.
|
||||||
func (m *MockReclaimer) MarkReclaim() {
|
func (m *MockReclaimer) MarkReclaim() {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
|
|
|
||||||
|
|
@ -83,9 +83,6 @@ type Reclaimer interface {
|
||||||
// MarkReclaim marks the storage which will be reclaimed
|
// MarkReclaim marks the storage which will be reclaimed
|
||||||
MarkReclaim()
|
MarkReclaim()
|
||||||
|
|
||||||
// marks the special storage invalid, that will reclaim next gc round
|
|
||||||
MarkInvalid()
|
|
||||||
|
|
||||||
// Reclaim reclaims the storage
|
// Reclaim reclaims the storage
|
||||||
Reclaim() error
|
Reclaim() error
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue