table

package
v0.0.0-...-bd3bf0e Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2020 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TabMgrEnoNone = iota
	TabMgrEnoConfig
	TabMgrEnoParameter
	TabMgrEnoScheduler
	TabMgrEnoDatabase
	TabMgrEnoNotFound
	TabMgrEnoDuplicated
	TabMgrEnoInternal
	TabMgrEnoFindNodeFailed
	TabMgrEnoPingpongFailed
	TabMgrEnoTimeout
	TabMgrEnoUdp
	TabMgrEnoResource
	TabMgrEnoRemove
)

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 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

This section is empty.

Functions

func DecodeBytes

func DecodeBytes(blob []byte, node *Node) error

Added by yeeco to remove the reference to Ethereum's rlp

func EncodeToBytes

func EncodeToBytes(node *Node) ([]byte, error)

Added by yeeco to remove the reference to Ethereum's rlp

func NdbcProc

func NdbcProc(ptn interface{}, msg *sch.SchMessage) sch.SchErrno

NodeDb cleaner entry

func TabMgrProc

func TabMgrProc(ptn interface{}, msg *sch.SchMessage) sch.SchErrno

Table manager entry

Types

type Hash

type Hash [HashLength]byte

type Node

type Node struct {
	ycfg.Node // our Node type
	// contains filtered or unexported fields
}

func TabBuildNode

func TabBuildNode(pn *ycfg.Node) *Node

Build a table node for ycfg.Node

func TabClosest

func TabClosest(target NodeID, size int) []*Node

Fetch closest nodes for target Notice: inside the table manager task, this function MUST NOT be called, since we had obtain the lock at the entry of the task handler.

type NodeID

type NodeID ycfg.NodeID

Bucket entry

type TabMgrErrno

type TabMgrErrno int

func TabBucketAddNode

func TabBucketAddNode(n *um.Node, lastPing *time.Time, lastPong *time.Time) TabMgrErrno

Upate node for the bucket Notice: inside the table manager task, this function MUST NOT be called, since we had obtain the lock at the entry of the task handler.

func TabUpdateNode

func TabUpdateNode(umn *um.Node) TabMgrErrno

Upate a node for node database. Notice: inside the table manager task, this function MUST NOT be called, since we had obtain the lock at the entry of the task handler.

Jump to

Keyboard shortcuts

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