The encapsulation of the data returned by the Riak
/stats
operation.
By implementing the {@link Iterable} interface it contains N setsof data where N is the number of connections the current client holds.
Worth noting is that integer values are returned as {@link BigInteger} objects. This is done to match the unconstrained size provided by Riak.
For example, using the HTTPClusterClient you can retrieve stats from all of your nodes:
HTTPClusterConfig c = new HTTPClusterConfig(10); HTTPClientConfig cc HTTPClientConfig.defaults(); c.addHosts(cc,"192.168.1.5:8098","192.168.1.6:8098","192.168.1.7:8098"); IRiakClient riakClient = RiakFactory.newClient(c); for (NodeStats ns : riakClient.stats()) { System.out.println(ns.nodename()); Syste.out.println(ns.vnodeGets()); }
|
/* (non-Javadoc)
* @see com.basho.riak.client.raw.RawClient#fetchIndex(com.basho.riak.client.raw.RawClient#stats()
*/
public NodeStats stats() throws IOException {
NodeStats nodeStats = null;
for(RawClient rc : cluster) {
if (nodeStats == null)
nodeStats = rc.stats();
else
nodeStats.add(rc.stats());
}
return nodeStats;
}
|
|
/* (non-Javadoc)
* @see com.basho.riak.client.raw.RawClient#fetchIndex(com.basho.riak.client.raw.RawClient#stats()
*/
public NodeStats stats() throws IOException {
NodeStats nodeStats = null;
for(RawClient rc : cluster) {
if (nodeStats == null)
nodeStats = rc.stats();
else
nodeStats.add(rc.stats());
}
return nodeStats;
}
|
|
/* (non-Javadoc)
* @see com.basho.riak.client.raw.RawClient#fetchIndex(com.basho.riak.client.raw.RawClient#stats()
*/
public NodeStats stats() throws IOException {
NodeStats nodeStats = null;
for(RawClient rc : cluster) {
if (nodeStats == null)
nodeStats = rc.stats();
else
nodeStats.add(rc.stats());
}
return nodeStats;
}
|
Related Classes of com.basho.riak.client.query.NodeStats$NodeStatsIterator
Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact
coftware#gmail.com.