Documentation ¶
Overview ¶
Package cs implements the Content Store.
Index ¶
- Constants
- Variables
- type Counters
- type Cs
- func (cs *Cs) Capacity(list ListID) int
- func (cs *Cs) CountEntries(list ListID) int
- func (cs *Cs) Counters() (cnt Counters)
- func (cs *Cs) Erase(entry *Entry)
- func (cs *Cs) Insert(data *ndni.Packet, pitFound pitFindResult)
- func (cs *Cs) ReadDirectArcP() float64
- func (cs *Cs) SetDisk(store *disk.Store, alloc *disk.Alloc) error
- type Entry
- type EntryKind
- type ListID
Constants ¶
const ( MaxIndirects = 4 EvictBulk = 64 )
Defaults and limits.
Variables ¶
var GqlCountersType = graphql.NewObject(graphql.ObjectConfig{ Name: "CsCounters", Fields: gqlserver.BindFields[Counters](nil), })
GqlCountersType is the GraphQL type for Counters.
var ReadMissCounter func(pcct *pcct.Pcct) uint64
ReadMissCounter reads CS miss counters. This is assigned during package pit initialization.
Functions ¶
This section is empty.
Types ¶
type Counters ¶
type Counters struct { DirectEntries int `json:"directEntries" gqldesc:"Direct entries." subtract:"-"` DirectCapacity int `json:"directCapacity" gqldesc:"Direct capacity." subtract:"-"` IndirectEntries int `json:"indirectEntries" gqldesc:"Indirect entries." subtract:"-"` IndirectCapacity int `json:"indirectCapacity" gqldesc:"Indirect capacity." subtract:"-"` NHitMemory uint64 `json:"nHitMemory" gqldesc:"Lookup hits on memory entry."` NHitDisk uint64 `json:"nHitDisk" gqldesc:"Lookup hits on disk entry."` NHitIndirect uint64 `json:"nHitIndirect" gqldesc:"Lookup hits on indirect entry."` NMiss uint64 `json:"nMiss" gqldesc:"Lookup misses."` NDiskInsert uint64 `json:"nDiskInsert" gqldesc:"Packets written to disk."` NDiskDelete uint64 `json:"nDiskDelete" gqldesc:"Packets deleted from disk."` NDiskFull uint64 `json:"nDiskFull" gqldesc:"Packets not written to disk due to allocation error."` }
Counters contains CS counters.
type Cs ¶
Cs represents a Content Store (CS).
func (*Cs) CountEntries ¶
CountEntries returns number of entries in the specified list.
func (*Cs) ReadDirectArcP ¶
ReadDirectArcP returns direct entries ARC algorithm 'p' variable (for unit testing).
type Entry ¶
Entry represents a CS entry.
func EntryFromPtr ¶
EntryFromPtr converts *C.CsEntry to Entry.
func (*Entry) FreshUntil ¶
FreshUntil returns a timestamp when this entry would become non-fresh.
func (*Entry) ListIndirects ¶
ListIndirects returns a list of indirect entries associated with this direct entry. Panics if this is not a direct entry.