Documentation
¶
Index ¶
- func EscapeForFileName(s string) string
- func WalkDumpFile(dumpFile string, fn func(node DumpNode) error) error
- type DumpNode
- type DumpNodeString
- type Keeper
- func (k *Keeper) ChildCount(prefix, nodePath string) (int, error)
- func (k *Keeper) Children(nodePath string) ([]string, error)
- func (k *Keeper) Close()
- func (k *Keeper) Connect(ctx context.Context, ch *clickhouse.ClickHouse) error
- func (k *Keeper) Create(nodePath string, value []byte) (bool, error)
- func (k *Keeper) Delete(nodePath string) error
- func (k *Keeper) Dump(prefix, dumpFile string) (int, error)
- func (k *Keeper) DumpTree(prefix string) ([]DumpNode, error)
- func (k *Keeper) EnsureNode(nodePath string) error
- func (k *Keeper) Exists(nodePath string) (bool, error)
- func (k *Keeper) Get(nodePath string) ([]byte, bool, error)
- func (k *Keeper) GetReplicatedAccessPath(userDirectory string) (string, error)
- func (k *Keeper) ResolvePath(nodePath string) string
- func (k *Keeper) Restore(dumpFile, prefix string, skipNode func(node DumpNode) bool) error
- func (k *Keeper) Upsert(nodePath string, value []byte) error
- func (k *Keeper) Walk(prefix, relativePath string, recursive bool, callback WalkCallBack) error
- type LogKeeperToApexLogAdapter
- type WalkCallBack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EscapeForFileName ¶ added in v2.8.1
EscapeForFileName - Go port of ClickHouse src/Common/escapeForFileName.cpp, used to build the `<zookeeper_path>/<type char>/<name>` znode name for RBAC objects stored in a `replicated` user directory
Types ¶
type DumpNodeString ¶ added in v2.6.35
old format used during restore
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func (*Keeper) ChildCount ¶ added in v2.5.0
func (*Keeper) Children ¶ added in v2.8.2
Children - list znode children, empty list when znode doesn't exist, nodePath shall be already resolved via ResolvePath
func (*Keeper) Connect ¶
func (k *Keeper) Connect(ctx context.Context, ch *clickhouse.ClickHouse) error
Connect - connect to any zookeeper server from /var/lib/clickhouse/preprocessed_configs/config.xml
func (*Keeper) Create ¶ added in v2.8.2
Create - create persistent znode with value, return false when znode already exists, parent shall exist, nodePath shall be already resolved via ResolvePath
func (*Keeper) Delete ¶ added in v2.5.0
Delete - remove znode, already removed znode is not an error, look https://github.com/Altinity/clickhouse-backup/issues/1048
func (*Keeper) DumpTree ¶ added in v2.8.2
DumpTree - return persistent znodes under prefix in pre-order with paths relative to prefix, prefix itself has empty path, ephemeral znodes are skipped together with their subtrees, znodes removed by a concurrent writer during the walk are skipped, returns zk.ErrNoNode when prefix doesn't exist, look https://github.com/Altinity/clickhouse-backup/issues/1120
func (*Keeper) EnsureNode ¶ added in v2.8.1
EnsureNode - create znode with empty value when it doesn't exist yet, nodePath shall be already resolved via ResolvePath
func (*Keeper) Exists ¶ added in v2.8.2
Exists - check znode existence, nodePath shall be already resolved via ResolvePath
func (*Keeper) Get ¶ added in v2.8.2
Get - return znode value and existence flag, nodePath shall be already resolved via ResolvePath
func (*Keeper) GetReplicatedAccessPath ¶
func (*Keeper) ResolvePath ¶ added in v2.8.1
ResolvePath - apply <zookeeper><root> chroot to the passed znode path
func (*Keeper) Restore ¶
Restore - restore keeper nodes from dumpFile under prefix, skipNode allow skip node restore, receives node with relative path from the dump, could be nil
func (*Keeper) Upsert ¶ added in v2.8.1
Upsert - create znode with value or overwrite value when znode already exists, several concurrent writers of the same znode are allowed, parent znodes are not created, use EnsureNode for that, nodePath shall be already resolved via ResolvePath, look https://github.com/Altinity/clickhouse-backup/issues/1048
type LogKeeperToApexLogAdapter ¶
type LogKeeperToApexLogAdapter struct {
// contains filtered or unexported fields
}
func (LogKeeperToApexLogAdapter) Printf ¶
func (KeeperLogToApexLogAdapter LogKeeperToApexLogAdapter) Printf(msg string, args ...interface{})