use of alluxio.exception.UfsBlockAccessTokenUnavailableException in project alluxio by Alluxio.
the class RetryHandlingBlockWorkerClient method lockUfsBlock.
@Override
public LockBlockResource lockUfsBlock(final long blockId, final LockBlockOptions options) throws IOException, AlluxioException {
int retryInterval = Constants.SECOND_MS;
RetryPolicy retryPolicy = new TimeoutRetry(Configuration.getLong(PropertyKey.USER_UFS_BLOCK_OPEN_TIMEOUT_MS), retryInterval);
do {
LockBlockResource resource = lockBlock(blockId, options);
if (resource.getResult().getLockBlockStatus().ufsTokenNotAcquired()) {
LOG.debug("Failed to acquire a UFS read token because of contention for block {} with " + "LockBlockOptions {}", blockId, options);
} else {
return resource;
}
} while (retryPolicy.attemptRetry());
throw new UfsBlockAccessTokenUnavailableException(ExceptionMessage.UFS_BLOCK_ACCESS_TOKEN_UNAVAILABLE, blockId, options.getUfsPath());
}
Aggregations