Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeBytes(blob []byte, node *Node, snid *SubNetworkID) error
- func EncodeToBytes(snid SubNetworkID, node *Node) ([]byte, error)
- func GetSubnetIdentity(id config.NodeID, maskBits int) (config.SubNetworkID, error)
- func TabCheckPrivateIp(ip net.IP) bool
- type Hash
- type Node
- type NodeDbCleaner
- type NodeID
- type NodeIdEx
- type SubNetworkID
- type TabMgrErrno
- type TableManager
- func (tabMgr *TableManager) TabBucketAddNode(snid SubNetworkID, n *um.Node, lastQuery *time.Time, lastPing *time.Time, ...) TabMgrErrno
- func (tabMgr *TableManager) TabClosest(forWhat int, target NodeID, mbs int, size int) []*Node
- func (tabMgr *TableManager) TabGetInstAll() *map[SubNetworkID]*TableManager
- func (tabMgr *TableManager) TabGetInstBySubNetId(snid *SubNetworkID) *TableManager
- func (tabMgr *TableManager) TabGetSubNetId() *SubNetworkID
- func (tabMgr *TableManager) TabUpdateNode(snid SubNetworkID, umn *um.Node) TabMgrErrno
- func (tabMgr *TableManager) TaskProc4Scheduler(ptn interface{}, msg *sch.SchMessage) sch.SchErrno
Constants ¶
View Source
const ( TabMgrEnoNone = iota TabMgrEnoConfig TabMgrEnoParameter TabMgrEnoScheduler TabMgrEnoDatabase TabMgrEnoNotFound TabMgrEnoDuplicated TabMgrEnoMismatched TabMgrEnoInternal TabMgrEnoFindNodeFailed TabMgrEnoPingpongFailed TabMgrEnoTimeout TabMgrEnoUdp TabMgrEnoResource TabMgrEnoRemove TabMgrEnoBootstrap )
errno
View Source
const ( TabInstStateNull = iota // null instance state TabInstStateQuering // FindNode sent but had not been responsed yet TabInstStateBonding // Ping sent but hand not been responsed yet TabInstStateQTimeout // query timeout TabInstStateBTimeout // bound timeout )
Instance control block
View Source
const ( TabInstQPendingMax = 16 // max nodes in pending for quering TabInstBPendingMax = 128 // max nodes in pending for bounding TabInstQueringMax = 8 // max concurrency quering instances TabInstBondingMax = 64 // max concurrency bonding instances )
View Source
const Closest4Queried = 0
View Source
const Closest4Querying = 1
View Source
const HashBits = HashLength * 8 // bits number of hash
View Source
const HashLength = 32 // 32 bytes(256 bits) hash applied
Hash type
View Source
const NdbcName = "ndbCleaner"
Static task to keep the node database clean
View Source
const TabMgrName = sch.TabMgrName
Table manager
Variables ¶
View Source
var AnySubNet = config.AnySubNet
View Source
var ZeroSubNet = config.ZeroSubNet
Functions ¶
func DecodeBytes ¶
func DecodeBytes(blob []byte, node *Node, snid *SubNetworkID) error
func EncodeToBytes ¶
func EncodeToBytes(snid SubNetworkID, node *Node) ([]byte, error)
func GetSubnetIdentity ¶
func TabCheckPrivateIp ¶
Types ¶
type Node ¶
func TabBuildNode ¶
type NodeDbCleaner ¶
type NodeDbCleaner struct {
// contains filtered or unexported fields
}
func NewNdbCleaner ¶
func NewNdbCleaner() *NodeDbCleaner
func (*NodeDbCleaner) TaskProc4Scheduler ¶
func (ndbc *NodeDbCleaner) TaskProc4Scheduler(ptn interface{}, msg *sch.SchMessage) sch.SchErrno
type NodeIdEx ¶
type NodeIdEx [config.NodeIDBytes + config.SubNetIdBytes]byte
type SubNetworkID ¶
type SubNetworkID = config.SubNetworkID
type TabMgrErrno ¶
type TabMgrErrno int
type TableManager ¶
type TableManager struct {
// contains filtered or unexported fields
}
func NewTabMgr ¶
func NewTabMgr() *TableManager
func (*TableManager) TabBucketAddNode ¶
func (tabMgr *TableManager) TabBucketAddNode(snid SubNetworkID, n *um.Node, lastQuery *time.Time, lastPing *time.Time, lastPong *time.Time) TabMgrErrno
func (*TableManager) TabClosest ¶
func (*TableManager) TabGetInstAll ¶
func (tabMgr *TableManager) TabGetInstAll() *map[SubNetworkID]*TableManager
func (*TableManager) TabGetInstBySubNetId ¶
func (tabMgr *TableManager) TabGetInstBySubNetId(snid *SubNetworkID) *TableManager
func (*TableManager) TabGetSubNetId ¶
func (tabMgr *TableManager) TabGetSubNetId() *SubNetworkID
func (*TableManager) TabUpdateNode ¶
func (tabMgr *TableManager) TabUpdateNode(snid SubNetworkID, umn *um.Node) TabMgrErrno
func (*TableManager) TaskProc4Scheduler ¶
func (tabMgr *TableManager) TaskProc4Scheduler(ptn interface{}, msg *sch.SchMessage) sch.SchErrno
Click to show internal directories.
Click to hide internal directories.