Documentation ¶
Overview ¶
Package ndt implements the Name Dispatch Table.
Index ¶
- Constants
- Variables
- type Config
- type Entry
- type Ndt
- func (ndt *Ndt) Close() error
- func (ndt *Ndt) ComputeHash(name ndn.Name) uint64
- func (ndt *Ndt) Config() Config
- func (ndt *Ndt) Get(index uint64) (entry Entry)
- func (ndt *Ndt) IndexOfHash(hash uint64) uint64
- func (ndt *Ndt) IndexOfName(name ndn.Name) uint64
- func (ndt *Ndt) List() (list []Entry)
- func (ndt *Ndt) Lookup(name ndn.Name) (index uint64, value uint8)
- func (ndt *Ndt) Randomize(max int)
- func (ndt *Ndt) Threads() (list []*Thread)
- func (ndt *Ndt) Update(index uint64, value uint8)
- type Thread
Constants ¶
View Source
const ( MinPrefixLen = 1 MaxPrefixLen = ndni.PNameCachedComponents DefaultPrefixLen = 2 MinCapacity = 1 << 4 MaxCapacity = 1 << 60 DefaultCapacity = 1 << 16 MinSampleInterval = 1 << 0 MaxSampleInterval = 1 << 30 DefaultSampleInterval = 1 << 10 )
Limits and defaults.
Variables ¶
View Source
var ( GqlConfigType *graphql.Object GqlEntryType *graphql.Object )
GraphQL types.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // PrefixLen is the number of name components considered in NDT lookup. // // If this value is zero, it defaults to DefaultPrefixLen. // Otherwise, it is clamped between MinPrefixLen and MaxPrefixLen. PrefixLen int `json:"prefixLen,omitempty"` // Capacity is the number of NDT entries. // // If this value is zero, it defaults to DefaultCapacity. // Otherwise, it is clamped between MinCapacity and MaxCapacity, and adjusted up to the next power of 2. Capacity int `json:"capacity,omitempty"` // SampleInterval indicates how often per-entry counters are incremented within a lookup thread. // // If this value is zero, it defaults to DefaultSampleInterval. // Otherwise, it is clamped between MinSampleInterval and MaxSampleInterval, and adjusted up to the next power of 2. SampleInterval int `json:"sampleInterval,omitempty"` }
Config contains NDT configuration.
type Ndt ¶
type Ndt struct {
// contains filtered or unexported fields
}
Ndt represents a Name Dispatch Table (NDT).
var ( // GqlNdt is the NDT instance accessible via GraphQL. GqlNdt *Ndt )
func New ¶
func New(cfg Config, sockets []eal.NumaSocket) (ndt *Ndt)
New creates an Ndt. sockets indicates NUMA sockets of lookup threads.
func (*Ndt) ComputeHash ¶
ComputeHash computes the hash used for a name.
func (*Ndt) IndexOfHash ¶
IndexOfHash returns table index used for a hash.
func (*Ndt) IndexOfName ¶
IndexOfName returns table index used for a name.
Click to show internal directories.
Click to hide internal directories.