dtclReg = null;
if (!idIntsListener.hasTriggered()) {
- final RpcError error = RpcResultBuilder.newError(
- ErrorType.APPLICATION, "No notification received.", "id-ints listener has not received"
- + "any notifications.");
+ final RpcError error = RpcResultBuilder.newError(ErrorType.APPLICATION, "operation-failed",
+ "id-ints listener has not received any notifications.");
return Futures.immediateFuture(RpcResultBuilder.<UnsubscribeDtclOutput>failed()
.withRpcError(error).build());
}
if (!readResult.isPresent()) {
final RpcError error = RpcResultBuilder.newError(
- ErrorType.APPLICATION, "Final read empty.", "No data read from id-ints list.");
+ ErrorType.APPLICATION, "data-missing", "No data read from id-ints list.");
return Futures.immediateFuture(RpcResultBuilder.<UnsubscribeDtclOutput>failed()
.withRpcError(error).build());
}
+ final boolean nodesEqual = idIntsListener.checkEqual(readResult.get());
+ if (!nodesEqual) {
+ LOG.error("Final read of id-int does not match IdIntsListener's copy. {}",
+ idIntsListener.diffWithLocalCopy(readResult.get()));
+ }
+
return Futures.immediateFuture(
- RpcResultBuilder.success(new UnsubscribeDtclOutputBuilder()
- .setCopyMatches(idIntsListener.checkEqual(readResult.get()))).build());
+ RpcResultBuilder.success(new UnsubscribeDtclOutputBuilder().setCopyMatches(nodesEqual)).build());
} catch (final InterruptedException | ExecutionException e) {
final RpcError error = RpcResultBuilder.newError(
- ErrorType.APPLICATION, "Read failed.", "Final read from id-ints failed.");
+ ErrorType.APPLICATION, "operation-failed", "Final read from id-ints failed.", null, null, e);
return Futures.immediateFuture(RpcResultBuilder.<UnsubscribeDtclOutput>failed()
.withRpcError(error).build());
context.findLocalShardAsync(shardName).onComplete(new OnComplete<ActorRef>() {
@Override
- public void onComplete(final Throwable throwable, final ActorRef actorRef) throws Throwable {
+ public void onComplete(final Throwable throwable, final ActorRef actorRef) {
if (throwable != null) {
shutdownShardAsk.failure(throwable);
} else {
shutdownShardAsk.future().onComplete(new OnComplete<Boolean>() {
@Override
- public void onComplete(final Throwable throwable, final Boolean gracefulStopResult) throws Throwable {
+ public void onComplete(final Throwable throwable, final Boolean gracefulStopResult) {
if (throwable != null) {
final RpcResult<T> failedResult = RpcResultBuilder.<T>failed()
.withError(ErrorType.APPLICATION, "Failed to gracefully shutdown shard", throwable).build();
final ClientLocalHistory localHistory = distributedDataStoreClient.createLocalHistory();
final ClientTransaction tx = localHistory.createTransaction();
- final ListenableFuture<Optional<NormalizedNode<?, ?>>> read =
+ final ListenableFuture<java.util.Optional<NormalizedNode<?, ?>>> read =
tx.read(YangInstanceIdentifier.of(ProduceTransactionsHandler.ID_INT));
tx.abort();
localHistory.close();
try {
- final Optional<NormalizedNode<?, ?>> optional = read.get();
+ final java.util.Optional<NormalizedNode<?, ?>> optional = read.get();
if (!optional.isPresent()) {
LOG.warn("Final read from client is empty.");
final RpcError error = RpcResultBuilder.newError(