store

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KVWatchOp

type KVWatchOp int64

KVWatchOp is the operation as detected by the KV watcher.

const (
	// KVPut indicates an element has been put/added into the KV store.
	KVPut KVWatchOp = iota
	// KVDelete represents a delete.
	KVDelete
	// KVPurge is when the kv bucket is purged.
	// This value is only for JetStream.
	KVPurge
)

func (KVWatchOp) String

func (kvOp KVWatchOp) String() string

type WatermarkKVEntry

type WatermarkKVEntry interface {
	// Key is the key that was retrieved.
	Key() string
	// Value is the retrieved value.
	Value() []byte
	// Operation returns `KVWatchOp`.
	Operation() KVWatchOp
}

WatermarkKVEntry defines what can be read on the Watch stream.

type WatermarkKVStorer

type WatermarkKVStorer interface {
	// GetAllKeys the keys from KV store.
	GetAllKeys(context.Context) ([]string, error)
	// DeleteKey deletes the key from KV store.
	DeleteKey(context.Context, string) error
	// PutKV inserts a key-value pair into the KV store.
	PutKV(context.Context, string, []byte) error
	// GetValue gets the value of the given key.
	GetValue(context.Context, string) ([]byte, error)
	// GetStoreName returns the bucket name of the KV store.
	GetStoreName() string
	// Close closes the backend connection
	Close()
}

WatermarkKVStorer defines the storage for publishing the watermark.

type WatermarkKVWatcher

type WatermarkKVWatcher interface {
	// Watch starts the watermark kv watcher and returns a kv updates channel and a watcher stopped channel.
	Watch(context.Context) (<-chan WatermarkKVEntry, <-chan struct{})
	GetKVName() string
	Close()
}

WatermarkKVWatcher watches the KV bucket for watermark progression.

type WatermarkStoreWatcher added in v0.5.6

type WatermarkStoreWatcher interface {
	HeartbeatWatcher() WatermarkKVWatcher
	OffsetTimelineWatcher() WatermarkKVWatcher
}

WatermarkStoreWatcher defines a pair of heartbeat KV watcher and offset timeline KV watcher

func BuildWatermarkStoreWatcher added in v0.5.6

func BuildWatermarkStoreWatcher(hbStoreWatcher, otStoreWatcher WatermarkKVWatcher) WatermarkStoreWatcher

BuildWatermarkStoreWatcher returns a WatermarkStoreWatcher instance

type WatermarkStorer added in v0.5.6

type WatermarkStorer interface {
	HeartbeatStore() WatermarkKVStorer
	OffsetTimelineStore() WatermarkKVStorer
}

WatermarkStorer defines a pair of heartbeat KV store and offset timeline KV store

func BuildWatermarkStore added in v0.5.6

func BuildWatermarkStore(hbStore, otStore WatermarkKVStorer) WatermarkStorer

BuildWatermarkStore returns a WatermarkStorer instance

Directories

Path Synopsis
Package inmem package implements the watermark progression using in mem store as the KV store.
Package inmem package implements the watermark progression using in mem store as the KV store.
Package jetstream package implements the watermark progression using Jetstream as the KV store.
Package jetstream package implements the watermark progression using Jetstream as the KV store.

Jump to

Keyboard shortcuts

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