iface

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NODE_HEAD_SIZE  uint64 = 32
	NODE_ALLOC_SIZE uint64 = 256 * 1024
	NODE_DATA_SIZE         = NODE_ALLOC_SIZE - NODE_HEAD_SIZE
)

Functions

func AtomicCASRTState

func AtomicCASRTState(addr *NodeRTState, old, new NodeRTState) bool

func AtomicCASState

func AtomicCASState(addr *NodeState, old, new NodeState) bool

func AtomicStoreRTState

func AtomicStoreRTState(addr *NodeRTState, val NodeRTState)

func AtomicStoreState

func AtomicStoreState(addr *NodeState, val NodeState)

func NodeStateString

func NodeStateString(state NodeState) string

Types

type BufferType

type BufferType uint8
const (
	STATIC_SIZED BufferType = iota
	DYNAMIC_SIZED
)

type Cleaner

type Cleaner interface {
	Clean() error
}

type DefaultIOHandle

type DefaultIOHandle struct {
	Reader
	Writer
	Cleaner
}

type IBufferHandle

type IBufferHandle interface {
	io.Closer
	GetID() uint64
	GetHandle() INodeHandle
}

type INodeBuffer

type INodeBuffer interface {
	buf.IBuffer
	GetID() uint64
}

type INodeHandle

type INodeHandle interface {
	sync.Locker
	io.Closer
	GetID() uint64
	GetNodeCreator() buf.MemoryNodeConstructor
	Unload()
	// Loadable() bool
	Unloadable() bool
	// GetBuff() buf.IBuffer
	PrepareLoad() bool
	RollbackLoad()
	CommitLoad() error
	MakeHandle() IBufferHandle
	GetState() NodeState
	GetCapacity() uint64
	GetFile() common.IVFile
	IsCompress() bool
	// Size() uint64
	// IsDestroyable() bool
	IsClosed() bool
	Ref()
	// If the current RefCount is already 0, it returns false, else true
	UnRef() bool
	// If the current RefCount is not 0, it returns true, else false
	HasRef() bool
	SetBuffer(buffer buf.IBuffer) error
	Iteration() uint64
	IncIteration() uint64
	GetBuffer() buf.IBuffer
	IsSpillable() bool
	Clean() error
	String() string
}

type IOHandle

type IOHandle interface {
	Reader
	Writer
	Cleaner
}

type NodeRTState

type NodeRTState = uint32
const (
	NODE_RT_RUNNING NodeRTState = iota
	NODE_RT_CLOSED
)

func AtomicLoadRTState

func AtomicLoadRTState(addr *NodeRTState) NodeRTState

type NodeState

type NodeState = uint32
const (
	NODE_UNLOAD NodeState = iota
	NODE_LOADING
	NODE_ROOLBACK
	NODE_COMMIT
	NODE_UNLOADING
	NODE_LOADED
)

func AtomicLoadState

func AtomicLoadState(addr *NodeState) NodeState

type Reader

type Reader interface {
	Load() error
}

type Writer

type Writer interface {
	Flush() error
}

Jump to

Keyboard shortcuts

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