/* (non-Javadoc)
* @see com.basho.riak.client.raw.RawClient#stats()
*/
public NodeStats stats() throws IOException {
HttpResponse r = client.stats();
if (!r.isSuccess()) {
throw new IOException("stats failed with status code: "
+ r.getStatusCode());
} else {
try {
NodeStats.UndefinedStatDeserializer usd = new NodeStats.UndefinedStatDeserializer();
SimpleModule module = new SimpleModule("UndefinedStatDeserializer",
new Version(1,0,0,null,null,null));
module.addDeserializer(BigInteger.class, usd);
return new ObjectMapper().registerModule(module).readValue(r.getBodyAsString(), NodeStats.class);
} catch (IOException e) {
throw new IOException("Could not parse stats JSON response, body: " + r.getBodyAsString(),e);
}
}
}