states

package
v0.0.0-...-7b16d43 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const CheckpointListKey = "checkpoints"

Variables

This section is empty.

Functions

func CreateStore

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

Types

type KVStore

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

The manager for checkpoint storage. * *** mapStore keys *** { "checkpoint1", "checkpoint2" ... "checkpointn" : The complete or incomplete snapshot

func (*KVStore) GetOpState

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

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) GetOpState

func (s *MemoryStore) GetOpState(opId 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