Documentation ¶
Overview ¶
Package disk provides a disk-based Data packet store.
Index ¶
- Variables
- type Alloc
- type SizeCalc
- type Store
- func (store *Store) Close() error
- func (store *Store) Counters() (cnt StoreCounters)
- func (store *Store) GetData(slotID uint64, interest *ndni.Packet, dataBuf *pktmbuf.Packet, ...) (data *ndni.Packet)
- func (store *Store) Ptr() unsafe.Pointer
- func (store *Store) PutData(slotID uint64, data *ndni.Packet) (sp bdev.StoredPacket, e error)
- func (store *Store) SlotRange() (min, max uint64)
- type StoreCounters
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // StoreGetDataCallback is a C function type for store.GetData callback. StoreGetDataCallback = cptr.FunctionType{"Packet"} // StoreGetDataGo is a StoreGetDataCallback implementation for receiving the Data in Go code. StoreGetDataGo = StoreGetDataCallback.C(unsafe.Pointer(C.go_getDataCallback), uintptr(0)) )
View Source
var GqlStoreCountersType = graphql.NewObject(graphql.ObjectConfig{ Name: "DiskStoreCounters", Fields: gqlserver.BindFields[StoreCounters](nil), })
GqlStoreCountersType is the GraphQL type for StoreCounters.
Functions ¶
This section is empty.
Types ¶
type Alloc ¶
Alloc is a disk slot allocator.
func NewAlloc ¶
func NewAlloc(min, max uint64, socket eal.NumaSocket) *Alloc
NewAlloc creates an Alloc.
func NewAllocIn ¶
func NewAllocIn(store *Store, i, nThreads int, socket eal.NumaSocket) *Alloc
NewAllocIn creates an Alloc from Store slot range.
type SizeCalc ¶
type SizeCalc struct { // NThreads is number of threads. NThreads int // NPackets is number of packets (capacity) per thread. NPackets int // PacketSize is size of each packet. PacketSize int }
SizeCalc calculates Store and Alloc sizes.
func (SizeCalc) BlocksPerSlot ¶
BlocksPerSlot returns number of blocks per packet slot.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store represents a disk-backed Data Store.
func NewStore ¶
func NewStore(device bdev.Device, th *spdkenv.Thread, nBlocksPerSlot int, getDataCb cptr.Function) (store *Store, e error)
NewStore creates a Store.
func (*Store) Counters ¶
func (store *Store) Counters() (cnt StoreCounters)
Counters retrieves disk store counters.
func (*Store) GetData ¶
func (store *Store) GetData(slotID uint64, interest *ndni.Packet, dataBuf *pktmbuf.Packet, sp bdev.StoredPacket) (data *ndni.Packet)
GetData retrieves a Data packet from specified slot and waits for completion. This can be used only if the Store was created with StoreGetDataGo.
type StoreCounters ¶
type StoreCounters struct { NPutDataBegin uint64 `json:"nPutDataBegin"` NPutDataSuccess uint64 `json:"nPutDataSuccess"` NPutDataFailure uint64 `json:"nPutDataFailure"` NGetDataBegin uint64 `json:"nGetDataBegin"` NGetDataReuse uint64 `json:"nGetDataReuse"` NGetDataSuccess uint64 `json:"nGetDataSuccess"` NGetDataFailure uint64 `json:"nGetDataFailure"` }
StoreCounters contains disk store counters.
Click to show internal directories.
Click to hide internal directories.