import org.opendaylight.yangtools.yang.common.RpcError;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
+import org.opendaylight.yangtools.yang.common.Uint64;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Override
public ListenableFuture<RpcResult<ReconcileOutput>> reconcile(ReconcileInput input) {
boolean reconcileAllNodes = input.isReconcileAllNodes();
- List<BigInteger> inputNodes = input.getNodes();
+ List<Uint64> inputNodes = input.getNodes();
if (inputNodes == null) {
inputNodes = new ArrayList<>();
}
SettableFuture<RpcResult<ReconcileOutput>> result = SettableFuture.create();
List<Long> nodeList = getAllNodes();
List<Long> nodesToReconcile = reconcileAllNodes ? nodeList :
- inputNodes.stream().distinct().map(BigInteger::longValue).collect(Collectors.toList());
+ inputNodes.stream().distinct().map(Uint64::longValue).collect(Collectors.toList());
if (nodesToReconcile.size() > 0) {
List<Long> unresolvedNodes =
nodesToReconcile.stream().filter(node -> !nodeList.contains(node)).collect(Collectors.toList());
return buildErrorResponse("Error executing command reconcile. "
+ "Node(s) not found: " + String.join(", ", unresolvedNodes.toString()));
}
- List<BigInteger> inprogressNodes = new ArrayList<>();
+ List<Uint64> inprogressNodes = new ArrayList<>();
nodesToReconcile.parallelStream().forEach(nodeId -> {
Optional<ReconciliationStateList> state = getReconciliationState(nodeId);
if (state.isPresent() && state.get().getState().equals(INPROGRESS)) {
- inprogressNodes.add(new BigInteger(String.valueOf(nodeId)));
+ inprogressNodes.add(Uint64.valueOf(nodeId));
} else {
alarmAgent.raiseNodeReconciliationAlarm(nodeId);
LOG.info("Executing reconciliation for node {}", nodeId);
if (isSuccess) {
if (count.isPresent()) {
- Long successCount = count.get().getSuccessCount();
+ long successCount = count.get().getSuccessCount().toJava();
counterBuilder.setSuccessCount(++successCount);
LOG.debug("Reconcile success count {} for the node: {} ", successCount, nodeId);
} else {
}
} else {
if (count.isPresent()) {
- Long failureCount = count.get().getFailureCount();
+ long failureCount = count.get().getFailureCount().toJava();
counterBuilder.setFailureCount(++failureCount);
LOG.debug("Reconcile failure count {} for the node: {} ", failureCount, nodeId);
} else {