virajjasani commented on PR #5837:
URL: https://github.com/apache/hbase/pull/5837#issuecomment-2146022254
@Apache9, I looked into this with Divneet today. It seems that we could make
this a bit simpler at ReadOnlyZkClient layer. For instance, we can introduce
getWithTimeout (that uses get() internally):
```
public CompletableFuture<byte[]> getWithTimeout(String path, int timeout) {
CompletableFuture<byte[]> future = get(path);
while (timeout > 0) {
if (future.isCancelled() || future.isDone() ||
future.isCompletedExceptionally()) {
return future;
}
--timeout;
}
future.completeExceptionally(new
KeeperException.OperationTimeoutException());
return future;
}
```
At ZKConnectionRegistry, we can use TimerTask (similar to the current state
of the PR) and let it call zk#getWithTimeout rather than zk#get. WDYT?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]