[#86] netmap: Add netmap candidate list getter
With `NetmapCandidate` storage nodes can monitor if they are expected to be in the netmap at next epoch or not. This is also important for monitoring when some nodes does not bootstrap immediately. Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
db2b1be746
commit
8b1c8eb689
2 changed files with 8 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
name: "NeoFS Netmap"
|
||||
safemethods: ["innerRingList", "epoch", "netmap", "snapshot", "snapshotByEpoch", "config", "listConfig", "version"]
|
||||
safemethods: ["innerRingList", "epoch", "netmap", "netmapCandidates", "snapshot", "snapshotByEpoch", "config", "listConfig", "version"]
|
||||
events:
|
||||
- name: AddPeer
|
||||
parameters:
|
||||
|
|
|
@ -351,6 +351,13 @@ func Netmap() []storageNode {
|
|||
return getSnapshot(ctx, snapshot0Key)
|
||||
}
|
||||
|
||||
// NetmapCandidates returns all node candidates for next epoch and their
|
||||
// status codes.
|
||||
func NetmapCandidates() []netmapNode {
|
||||
ctx := storage.GetReadOnlyContext()
|
||||
return getNetmapNodes(ctx)
|
||||
}
|
||||
|
||||
func Snapshot(diff int) []storageNode {
|
||||
var key string
|
||||
|
||||
|
|
Loading…
Reference in a new issue