state

package
v2.0.0-dev.3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CheckpointListKey = "checkpoints"

Variables

This section is empty.

Functions

func CreateStore

func CreateStore(ruleId string, qos def.Qos) (api.Store, error)

Types

type KVStore

type KVStore struct {
	// contains filtered or unexported fields
}

KVStore The manager for checkpoint storage.

mapStore keys

{ "checkpoint1", "checkpoint2" ... "checkpointn" : The complete or incomplete snapshot

func (*KVStore) Clean

func (s *KVStore) Clean() error

func (*KVStore) GetOpState

func (s *KVStore) GetOpState(opId string) (*sync.Map, error)

GetOpState Only run in the initialization

func (*KVStore) SaveCheckpoint

func (s *KVStore) SaveCheckpoint(checkpointId int64) error

func (*KVStore) SaveState

func (s *KVStore) SaveState(checkpointId int64, opId string, state map[string]interface{}) error

type MemoryStore

type MemoryStore sync.Map // The current root store of a rule

func (*MemoryStore) Clean

func (s *MemoryStore) Clean() error

func (*MemoryStore) GetOpState

func (s *MemoryStore) GetOpState(_ string) (*sync.Map, error)

func (*MemoryStore) SaveCheckpoint

func (s *MemoryStore) SaveCheckpoint(_ int64) error

func (*MemoryStore) SaveState

func (s *MemoryStore) SaveState(_ int64, _ string, _ map[string]interface{}) error

Jump to

Keyboard shortcuts

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