redis3

package
v0.0.0-...-45e1a9a Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DIR_LIST_MARKER = "\x00"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ItemList

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

func LoadItemList

func LoadItemList(data []byte, prefix string, client redis.UniversalClient, store skiplist.ListStore, batchSize int) *ItemList

func (*ItemList) DeleteName

func (nl *ItemList) DeleteName(name string) error

// case 1: exists in nextNode

if nextNode != nil && nextNode.Key == name {
	remove from nextNode, update nextNode
	// TODO: merge with prevNode if possible?
	return
}

if nextNode is nil

prevNode = list.Largestnode

if prevNode == nil and nextNode.Prev != nil

prevNode = load(nextNode.Prev)

// case 2: does not exist // case 2.1

if prevNode == nil {
	return
}

// case 2.2

if prevNameBatch does not contain name {
	return
}

// case 3 delete from prevNameBatch if prevNameBatch + nextNode < capacityList

// case 3.1
merge

else

// case 3.2
update prevNode

func (*ItemList) HasChanges

func (nl *ItemList) HasChanges() bool

func (*ItemList) ItemAdd

func (nl *ItemList) ItemAdd(lookupKey []byte, idIfKnown int64, names ...string) error

func (*ItemList) ListNames

func (nl *ItemList) ListNames(startFrom string, visitNamesFn func(name string) bool) error

func (*ItemList) NodeAddMember

func (nl *ItemList) NodeAddMember(node *skiplist.SkipListElementReference, names ...string) error

func (*ItemList) NodeContainsItem

func (nl *ItemList) NodeContainsItem(node *skiplist.SkipListElementReference, item string) bool

func (*ItemList) NodeDelete

func (nl *ItemList) NodeDelete(node *skiplist.SkipListElementReference) error

func (*ItemList) NodeDeleteAfterExclusive

func (nl *ItemList) NodeDeleteAfterExclusive(node *skiplist.SkipListElementReference, startFrom string) error

func (*ItemList) NodeDeleteBeforeExclusive

func (nl *ItemList) NodeDeleteBeforeExclusive(node *skiplist.SkipListElementReference, stopAt string) error

func (*ItemList) NodeDeleteMember

func (nl *ItemList) NodeDeleteMember(node *skiplist.SkipListElementReference, name string) error

func (*ItemList) NodeInnerPosition

func (nl *ItemList) NodeInnerPosition(node *skiplist.SkipListElementReference, name string) int

func (*ItemList) NodeMin

func (nl *ItemList) NodeMin(node *skiplist.SkipListElementReference) string

func (*ItemList) NodeRangeAfterExclusive

func (nl *ItemList) NodeRangeAfterExclusive(node *skiplist.SkipListElementReference, startFrom string) ([]string, error)

func (*ItemList) NodeRangeBeforeExclusive

func (nl *ItemList) NodeRangeBeforeExclusive(node *skiplist.SkipListElementReference, stopAt string) ([]string, error)

func (*ItemList) NodeScanInclusiveAfter

func (nl *ItemList) NodeScanInclusiveAfter(node *skiplist.SkipListElementReference, startFrom string, visitNamesFn func(name string) bool) bool

func (*ItemList) NodeSize

func (nl *ItemList) NodeSize(node *skiplist.SkipListElementReference) int

func (*ItemList) RemoteAllListElement

func (nl *ItemList) RemoteAllListElement() error

func (*ItemList) ToBytes

func (nl *ItemList) ToBytes() []byte

func (*ItemList) WriteName

func (nl *ItemList) WriteName(name string) error

type Redis3SentinelStore

type Redis3SentinelStore struct {
	UniversalRedis3Store
}

func (*Redis3SentinelStore) GetName

func (store *Redis3SentinelStore) GetName() string

func (*Redis3SentinelStore) Initialize

func (store *Redis3SentinelStore) Initialize(configuration util.Configuration, prefix string) (err error)

type Redis3Store

type Redis3Store struct {
	UniversalRedis3Store
}

func (*Redis3Store) GetName

func (store *Redis3Store) GetName() string

func (*Redis3Store) Initialize

func (store *Redis3Store) Initialize(configuration util.Configuration, prefix string) (err error)

type RedisCluster3Store

type RedisCluster3Store struct {
	UniversalRedis3Store
}

func (*RedisCluster3Store) GetName

func (store *RedisCluster3Store) GetName() string

func (*RedisCluster3Store) Initialize

func (store *RedisCluster3Store) Initialize(configuration util.Configuration, prefix string) (err error)

type SkipListElementStore

type SkipListElementStore struct {
	Prefix string
	// contains filtered or unexported fields
}

func (*SkipListElementStore) DeleteElement

func (m *SkipListElementStore) DeleteElement(id int64) error

func (*SkipListElementStore) LoadElement

func (m *SkipListElementStore) LoadElement(id int64) (*skiplist.SkipListElement, error)

func (*SkipListElementStore) SaveElement

func (m *SkipListElementStore) SaveElement(id int64, element *skiplist.SkipListElement) error

type UniversalRedis3Store

type UniversalRedis3Store struct {
	Client redis.UniversalClient
	// contains filtered or unexported fields
}

func (*UniversalRedis3Store) BeginTransaction

func (store *UniversalRedis3Store) BeginTransaction(ctx context.Context) (context.Context, error)

func (*UniversalRedis3Store) CommitTransaction

func (store *UniversalRedis3Store) CommitTransaction(ctx context.Context) error

func (*UniversalRedis3Store) DeleteEntry

func (store *UniversalRedis3Store) DeleteEntry(ctx context.Context, fullpath util.FullPath) (err error)

func (*UniversalRedis3Store) DeleteFolderChildren

func (store *UniversalRedis3Store) DeleteFolderChildren(ctx context.Context, fullpath util.FullPath) (err error)

func (*UniversalRedis3Store) FindEntry

func (store *UniversalRedis3Store) FindEntry(ctx context.Context, fullpath util.FullPath) (entry *filer.Entry, err error)

func (*UniversalRedis3Store) InsertEntry

func (store *UniversalRedis3Store) InsertEntry(ctx context.Context, entry *filer.Entry) (err error)

func (*UniversalRedis3Store) KvDelete

func (store *UniversalRedis3Store) KvDelete(ctx context.Context, key []byte) (err error)

func (*UniversalRedis3Store) KvGet

func (store *UniversalRedis3Store) KvGet(ctx context.Context, key []byte) (value []byte, err error)

func (*UniversalRedis3Store) KvPut

func (store *UniversalRedis3Store) KvPut(ctx context.Context, key []byte, value []byte) (err error)

func (*UniversalRedis3Store) ListDirectoryEntries

func (store *UniversalRedis3Store) ListDirectoryEntries(ctx context.Context, dirPath util.FullPath, startFileName string, includeStartFile bool, limit int64, eachEntryFunc filer.ListEachEntryFunc) (lastFileName string, err error)

func (*UniversalRedis3Store) ListDirectoryPrefixedEntries

func (store *UniversalRedis3Store) ListDirectoryPrefixedEntries(ctx context.Context, dirPath util.FullPath, startFileName string, includeStartFile bool, limit int64, prefix string, eachEntryFunc filer.ListEachEntryFunc) (lastFileName string, err error)

func (*UniversalRedis3Store) RollbackTransaction

func (store *UniversalRedis3Store) RollbackTransaction(ctx context.Context) error

func (*UniversalRedis3Store) Shutdown

func (store *UniversalRedis3Store) Shutdown()

func (*UniversalRedis3Store) UpdateEntry

func (store *UniversalRedis3Store) UpdateEntry(ctx context.Context, entry *filer.Entry) (err error)

Jump to

Keyboard shortcuts

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