asinfo

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AerospikeVersionSupportsSIndexContext = AerospikeVersion{6, 1, 0}
	AerospikeVersionSupportsBatchWrites   = AerospikeVersion{6, 0, 0}
	// AerospikeVersionRecentInfoCommands after this version, all commands should use
	// `namespace` parameter instead of `ns` or `id`.
	AerospikeVersionRecentInfoCommands = AerospikeVersion{8, 1, 0}
)
View Source
var (
	ErrReplicationFactorZero = errors.New("replication factor is zero")
)

Functions

This section is empty.

Types

type AerospikeVersion

type AerospikeVersion struct {
	Major int
	Minor int
	Patch int
}

func (AerospikeVersion) IsGreater

func (av AerospikeVersion) IsGreater(other AerospikeVersion) bool

func (AerospikeVersion) IsGreaterOrEqual

func (av AerospikeVersion) IsGreaterOrEqual(other AerospikeVersion) bool

func (AerospikeVersion) String

func (av AerospikeVersion) String() string

type Client

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

Client manages asinfo interactions with an Aerospike cluster, handling policies, retry logic, and command operations.

func NewClient

func NewClient(
	cluster NodeGetter,
	policy *a.InfoPolicy,
	retryPolicy *models.RetryPolicy,
) (*Client, error)

NewClient initializes and returns a new asinfo Client instance with the provided Aerospike client, policy, and retry policy.

func (*Client) BlockMRTWrites

func (ic *Client) BlockMRTWrites(nodeName, namespace string) error

BlockMRTWrites blocks MRT writes on cluster.

func (*Client) GetDCsList

func (ic *Client) GetDCsList() ([]string, error)

GetDCsList returns list of XDR DCs.

func (*Client) GetInfo

func (ic *Client) GetInfo(names ...string) (map[string]string, error)

func (*Client) GetNamespacesList

func (ic *Client) GetNamespacesList() ([]string, error)

GetNamespacesList returns list of namespaces.

func (*Client) GetNodesNames

func (ic *Client) GetNodesNames() []string

GetNodesNames return list of active nodes names.

func (*Client) GetRackNodes

func (ic *Client) GetRackNodes(rackID int) ([]string, error)

GetRackNodes returns list of nodes by rack id.

func (*Client) GetRecordCount

func (ic *Client) GetRecordCount(namespace string, sets []string) (uint64, error)

GetRecordCount counts number of records in given namespace and sets.

func (*Client) GetSIndexes

func (ic *Client) GetSIndexes(namespace string) ([]*models.SIndex, error)

func (*Client) GetService

func (ic *Client) GetService(node string) (string, error)

GetService returns service name by node name.

func (*Client) GetSetsList

func (ic *Client) GetSetsList(namespace string) ([]string, error)

func (*Client) GetStats

func (ic *Client) GetStats(nodeName, dc, namespace string) (Stats, error)

GetStats requests node statistics like recoveries, lag, etc. returns Stats struct.

func (*Client) GetStatus

func (ic *Client) GetStatus() (string, error)

GetStatus returns cluster status.

func (*Client) GetUDFs

func (ic *Client) GetUDFs() ([]*models.UDF, error)

func (*Client) GetVersion

func (ic *Client) GetVersion() (AerospikeVersion, error)

GetVersion returns lowest node version from cluster.

func (*Client) StartXDR

func (ic *Client) StartXDR(nodeName, dc, hostPort, namespace, rewind string, throughput int, forward bool) error

StartXDR creates xdr config and starts replication.

func (*Client) StopXDR

func (ic *Client) StopXDR(nodeName, dc string) error

StopXDR disable replication and remove xdr config.

func (*Client) SupportsBatchWrite

func (ic *Client) SupportsBatchWrite() (bool, error)

func (*Client) UnBlockMRTWrites

func (ic *Client) UnBlockMRTWrites(nodeName, namespace string) error

UnBlockMRTWrites unblocks MRT writes on cluster.

type NodeGetter

type NodeGetter interface {
	GetRandomNode() (*a.Node, a.Error)
	GetNodeByName(name string) (*a.Node, a.Error)
	GetNodes() []*a.Node
}

NodeGetter describes aerospike.Cluster object.

type Stats

type Stats struct {
	Lag               int64
	Recoveries        int64
	RecoveriesPending int64
}

Stats represent a result of get stats command. In the future, other fields can be added.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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