[#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:
Alex Vanin 2021-06-02 13:39:00 +03:00 committed by Alex Vanin
parent db2b1be746
commit 8b1c8eb689
2 changed files with 8 additions and 1 deletions

View file

@ -1,5 +1,5 @@
name: "NeoFS Netmap" name: "NeoFS Netmap"
safemethods: ["innerRingList", "epoch", "netmap", "snapshot", "snapshotByEpoch", "config", "listConfig", "version"] safemethods: ["innerRingList", "epoch", "netmap", "netmapCandidates", "snapshot", "snapshotByEpoch", "config", "listConfig", "version"]
events: events:
- name: AddPeer - name: AddPeer
parameters: parameters:

View file

@ -351,6 +351,13 @@ func Netmap() []storageNode {
return getSnapshot(ctx, snapshot0Key) 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 { func Snapshot(diff int) []storageNode {
var key string var key string