aerospike / aerospike-client-csharp

Aerospike C# Client Library
70 stars 48 forks source link

Listing namespaces / sets #11

Closed Caldas closed 9 years ago

Caldas commented 9 years ago

How can I list namespaces and sets inside namespaces using C# client?

manigandham commented 9 years ago

Do a 'Info' request. Aerospike has a info service that returns a name/value string of config and status information.

For example to get information about namespaces, get the list of nodes and use a node to send a request for info and select the term that you're interested in.

var nodes = aerospikeClient.Nodes;
var namespacesRaw = Info.Request(nodes[0].GetConnection(1000), "namespaces");
var namespaces = namespacesRaw.Split(';').ToList();
Caldas commented 9 years ago

@manigandham list namespace Ok, thanks ...

Do you know how to list set into a specific namespace?

manigandham commented 9 years ago

https://docs.aerospike.com/display/V3/asinfo+-+Read+Parameters

Better reference: http://www.aerospike.com/docs/reference/info/

Filter by sets/namespaceYouWant and look through the key/values.

Caldas commented 9 years ago

It was possible to know more about sets using

var nodes = aerospikeClient.Nodes;
var namespacesRaw = Info.Request(nodes[0].GetConnection(1000), "sets");
var namespaces = namespacesRaw.Split(';').ToList();
Caldas commented 9 years ago

Others possibles commands are avaliable at http://www.aerospike.com/docs/reference/info/

Caldas commented 9 years ago

Thanks a lot @manigandham :+1: