nodemanager

package
v0.0.0-...-37eefcc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// node has not yet been initalised
	ErrNotYetInitalised = errors.New("not yet initialised")

	// The jobstore corresponding to the key you are looking for does not exist on this node
	ErrNotSlotOwner = errors.New("not slot owner")

	// This means that this node is the owner of the slot and you are trying to access the remote connection to it
	ErrLocalSlotOwner = errors.New("local slot owner")

	// some other node handles the leader shard
	ErrNotShardLeader = errors.New("not shard leader")
)

Functions

This section is empty.

Types

type NodeManager

type NodeManager struct {
	// contains filtered or unexported fields
}

func CreateNodeManager

func CreateNodeManager(
	selfNodeID string,
	dsmgr *dsm.DataStoreManager,
	connMgr *connectionmanager.ConnectionManager,
	dhtMgr dht.DHT,
	cp consensus.Consensus,
	exe executor.Executor,
	log *zap.Logger,
) *NodeManager

func (*NodeManager) GetLocalShard

func (nm *NodeManager) GetLocalShard(shardID dht.ShardID) (js.JobStore, error)

func (*NodeManager) GetRemoteConnection

func (nm *NodeManager) GetRemoteConnection(nodeID dht.NodeID) (js.JobStoreWithReplicator, error)

func (*NodeManager) InitAppDHT

func (nm *NodeManager) InitAppDHT(shards, replicas int) error

Initialises the app DHT from the server list. It also publishes the slot and node map to other nodes via consensus module

func (*NodeManager) InitialiseNode

func (nm *NodeManager) InitialiseNode() error

InitialiseNode will be called once the dht is initialised. It will help setting up the connections and initialise the datastores

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL