forked from TrueCloudLab/frostfs-node
[#1613] morph: Add tracing for morph queries to neo-go
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
This commit is contained in:
parent
4de5fca547
commit
9b113c3156
120 changed files with 623 additions and 562 deletions
|
@ -1,6 +1,8 @@
|
|||
package netmap
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap"
|
||||
)
|
||||
|
||||
|
@ -16,7 +18,7 @@ type Source interface {
|
|||
//
|
||||
// Implementations must not retain the network map pointer and modify
|
||||
// the network map through it.
|
||||
GetNetMap(diff uint64) (*netmap.NetMap, error)
|
||||
GetNetMap(ctx context.Context, diff uint64) (*netmap.NetMap, error)
|
||||
|
||||
// GetNetMapByEpoch reads network map by the epoch number from the storage.
|
||||
// It returns the pointer to the requested network map and any error encountered.
|
||||
|
@ -25,21 +27,21 @@ type Source interface {
|
|||
//
|
||||
// Implementations must not retain the network map pointer and modify
|
||||
// the network map through it.
|
||||
GetNetMapByEpoch(epoch uint64) (*netmap.NetMap, error)
|
||||
GetNetMapByEpoch(ctx context.Context, epoch uint64) (*netmap.NetMap, error)
|
||||
|
||||
// Epoch reads the current epoch from the storage.
|
||||
// It returns thw number of the current epoch and any error encountered.
|
||||
//
|
||||
// Must return exactly one non-default value.
|
||||
Epoch() (uint64, error)
|
||||
Epoch(ctx context.Context) (uint64, error)
|
||||
}
|
||||
|
||||
// GetLatestNetworkMap requests and returns the latest network map from the storage.
|
||||
func GetLatestNetworkMap(src Source) (*netmap.NetMap, error) {
|
||||
return src.GetNetMap(0)
|
||||
func GetLatestNetworkMap(ctx context.Context, src Source) (*netmap.NetMap, error) {
|
||||
return src.GetNetMap(ctx, 0)
|
||||
}
|
||||
|
||||
// GetPreviousNetworkMap requests and returns previous from the latest network map from the storage.
|
||||
func GetPreviousNetworkMap(src Source) (*netmap.NetMap, error) {
|
||||
return src.GetNetMap(1)
|
||||
func GetPreviousNetworkMap(ctx context.Context, src Source) (*netmap.NetMap, error) {
|
||||
return src.GetNetMap(ctx, 1)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue