- public CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> readData(
- YangInstanceIdentifier path) {
- LOG.debug("Tx {} readData called path = {}", identifier, path);
- operationLimiter.release();
- return Futures.immediateFailedCheckedFuture(new ReadFailedException(
- "Error reading data for path " + path, failure));
+ public void readData(final YangInstanceIdentifier path, SettableFuture<Optional<NormalizedNode<?, ?>>> proxyFuture) {
+ LOG.debug("Tx {} readData called path = {}", getIdentifier(), path);
+
+ final Throwable t;
+ if (failure instanceof NoShardLeaderException) {
+ t = new DataStoreUnavailableException(failure.getMessage(), failure);
+ } else {
+ t = failure;
+ }
+ proxyFuture.setException(new ReadFailedException("Error reading data for path " + path, t));