com.aerospike.client
Class Info

java.lang.Object
  extended by com.aerospike.client.Info

public final class Info
extends Object

Access server's info monitoring protocol.

The info protocol is a name/value pair based system, where an individual database server node is queried to determine its configuration and status. The list of supported names can be found at:

https://docs.aerospike.com/display/AS2/Config+Parameters+Reference


Nested Class Summary
 class Info.NameValueParser
          Parser for responses in name/value pair format:
 
Constructor Summary
Info(com.aerospike.client.cluster.Connection conn)
          Send default empty command to server and store results.
Info(com.aerospike.client.cluster.Connection conn, String... commands)
          Send multiple commands to server and store results.
Info(com.aerospike.client.cluster.Connection conn, String command)
          Send single command to server and store results.
 
Method Summary
 byte[] getBuffer()
          Get response buffer.
 int getLength()
          Get response length.
 Info.NameValueParser getNameValueParser()
          Parse response in name/value pair format:
 String getValue()
          Return single value from response buffer.
static HashMap<String,String> request(com.aerospike.client.cluster.Connection conn)
          Get all the default info from the specified database server node.
static HashMap<String,String> request(com.aerospike.client.cluster.Connection conn, String... names)
          Get many info values by name from the specified database server node.
static String request(com.aerospike.client.cluster.Connection conn, String name)
          Get one info value by name from the specified database server node.
static HashMap<String,String> request(InetSocketAddress socketAddress)
          Get all the default info from the specified database server node.
static HashMap<String,String> request(InetSocketAddress socketAddress, String... names)
          Get many info values by name from the specified database server node.
static String request(InetSocketAddress socketAddress, String name)
          Get one info value by name from the specified database server node.
static String request(Node node, String name)
          Get one info value by name from the specified database server node.
static HashMap<String,String> request(String hostname, int port)
          Get default info from the specified database server node, using host name and port.
static HashMap<String,String> request(String hostname, int port, String... names)
          Get many info values by name from the specified database server node, using host name and port.
static String request(String hostname, int port, String name)
          Get one info value by name from the specified database server node, using host name and port.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Info

public Info(com.aerospike.client.cluster.Connection conn,
            String command)
     throws AerospikeException
Send single command to server and store results. This constructor is used internally. The static request methods should be used instead.

Parameters:
conn - connection to server node
command - command sent to server
Throws:
AerospikeException

Info

public Info(com.aerospike.client.cluster.Connection conn,
            String... commands)
     throws AerospikeException
Send multiple commands to server and store results. This constructor is used internally. The static request methods should be used instead.

Parameters:
conn - connection to server node
commands - commands sent to server
Throws:
AerospikeException

Info

public Info(com.aerospike.client.cluster.Connection conn)
     throws AerospikeException
Send default empty command to server and store results. This constructor is used internally. The static request methods should be used instead.

Parameters:
conn - connection to server node
Throws:
AerospikeException
Method Detail

getNameValueParser

public Info.NameValueParser getNameValueParser()
Parse response in name/value pair format:

\t=;=;...\n

Returns:
parser for name/value pairs

getValue

public String getValue()
Return single value from response buffer.


request

public static String request(String hostname,
                             int port,
                             String name)
                      throws AerospikeException
Get one info value by name from the specified database server node, using host name and port.

Parameters:
hostname - host name
port - host port
name - name of value to retrieve
Returns:
info value
Throws:
AerospikeException

request

public static HashMap<String,String> request(String hostname,
                                             int port,
                                             String... names)
                                      throws AerospikeException
Get many info values by name from the specified database server node, using host name and port.

Parameters:
hostname - host name
port - host port
names - names of values to retrieve
Returns:
info name/value pairs
Throws:
AerospikeException

request

public static HashMap<String,String> request(String hostname,
                                             int port)
                                      throws AerospikeException
Get default info from the specified database server node, using host name and port.

Parameters:
hostname - host name
port - host port
Returns:
info name/value pairs
Throws:
AerospikeException

request

public static String request(InetSocketAddress socketAddress,
                             String name)
                      throws AerospikeException
Get one info value by name from the specified database server node.

Parameters:
socketAddress - InetSocketAddress of server node
name - name of value to retrieve
Returns:
info value
Throws:
AerospikeException

request

public static HashMap<String,String> request(InetSocketAddress socketAddress,
                                             String... names)
                                      throws AerospikeException
Get many info values by name from the specified database server node.

Parameters:
socketAddress - InetSocketAddress of server node
names - names of values to retrieve
Returns:
info name/value pairs
Throws:
AerospikeException

request

public static HashMap<String,String> request(InetSocketAddress socketAddress)
                                      throws AerospikeException
Get all the default info from the specified database server node.

Parameters:
socketAddress - InetSocketAddress of server node
Returns:
info name/value pairs
Throws:
AerospikeException

request

public static String request(Node node,
                             String name)
                      throws AerospikeException
Get one info value by name from the specified database server node.

Parameters:
node - server node
name - name of value to retrieve
Returns:
info value
Throws:
AerospikeException

request

public static String request(com.aerospike.client.cluster.Connection conn,
                             String name)
                      throws AerospikeException
Get one info value by name from the specified database server node.

Parameters:
conn - socket connection to server node
name - name of value to retrieve
Returns:
info value
Throws:
AerospikeException

request

public static HashMap<String,String> request(com.aerospike.client.cluster.Connection conn,
                                             String... names)
                                      throws AerospikeException
Get many info values by name from the specified database server node.

Parameters:
conn - socket connection to server node
names - names of values to retrieve
Returns:
info name/value pairs
Throws:
AerospikeException

request

public static HashMap<String,String> request(com.aerospike.client.cluster.Connection conn)
                                      throws AerospikeException
Get all the default info from the specified database server node.

Parameters:
conn - socket connection to server node
Returns:
info name/value pairs
Throws:
AerospikeException

getBuffer

public byte[] getBuffer()
Get response buffer. For internal use only.


getLength

public int getLength()
Get response length. For internal use only.



Copyright © 2012–2014 Aerospike, Inc. All rights reserved.