use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.GetNodeCountersOutput in project netvirt by opendaylight.
the class StatisticsImpl method getNodeCounters.
@Override
@SuppressWarnings("checkstyle:illegalCatch")
public Future<RpcResult<GetNodeCountersOutput>> getNodeCounters(GetNodeCountersInput input) {
BigInteger dpId = input.getNodeId();
LOG.trace("getting node counters for node {}", dpId);
GetNodeCountersOutputBuilder gncob = new GetNodeCountersOutputBuilder();
List<CounterResult> counterResults = new ArrayList<>();
try {
if (!getNodeResult(counterResults, dpId)) {
StatisticsPluginImplCounters.failed_getting_node_counters.inc();
return RpcResultBuilder.<GetNodeCountersOutput>failed().withError(ErrorType.APPLICATION, "failed to get node counters for node: " + dpId).buildFuture();
}
} catch (RuntimeException e) {
LOG.warn("failed to get counter result for node {}", dpId, e);
return RpcResultBuilder.<GetNodeCountersOutput>failed().withError(ErrorType.APPLICATION, "failed to get node counters for node: " + dpId).buildFuture();
}
gncob.setCounterResult(counterResults);
return RpcResultBuilder.success(gncob.build()).buildFuture();
}
Aggregations