-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathnode.go
More file actions
31 lines (23 loc) · 752 Bytes
/
Copy pathnode.go
File metadata and controls
31 lines (23 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package api
import (
"errors"
)
var ErrNotFound = errors.New("not found")
type Node interface {
// GetLoadInfo returns the LoadInfo for the given range.
// Implementations should return NotFound if (from their point of view) the
// range doesn't exist. This can happen when GetLoadInfo and Prepare and/or
// Drop are racing.
GetLoadInfo(rID RangeID) (LoadInfo, error)
// Prepare.
Prepare(m Meta, p []Parent) error
// Activate
Activate(rID RangeID) error
// Deactivate
Deactivate(rID RangeID) error
// Drop
// Range state will be set to NsDropping before calling this. If an error is
// returned, the range will be forgotten. If no error is returned, the range
// state will be set to NsDroppingError.
Drop(rID RangeID) error
}