use of com.palantir.atlasdb.timelock.api.ConjureRefreshLocksResponse in project atlasdb by palantir.
the class LockLeaseService method refreshTokens.
private Set<LeasedLockToken> refreshTokens(Set<LeasedLockToken> leasedTokens) {
if (leasedTokens.isEmpty()) {
return leasedTokens;
}
ConjureRefreshLocksResponse refreshLockResponse = delegate.refreshLocks(ConjureRefreshLocksRequest.of(serverTokens(leasedTokens)));
Lease lease = refreshLockResponse.getLease();
Set<LeasedLockToken> refreshedTokens = leasedTokens.stream().filter(t -> refreshLockResponse.getRefreshedTokens().contains(t.serverToken())).collect(Collectors.toSet());
refreshedTokens.forEach(t -> t.updateLease(lease));
return refreshedTokens;
}
use of com.palantir.atlasdb.timelock.api.ConjureRefreshLocksResponse in project atlasdb by palantir.
the class LockDiagnosticConjureTimelockService method refreshLocks.
@Override
public ConjureRefreshLocksResponse refreshLocks(AuthHeader authHeader, String namespace, ConjureRefreshLocksRequest request) {
ConjureRefreshLocksResponse response = conjureDelegate.refreshLocks(authHeader, namespace, request);
localLockTracker.logRefreshResponse(request.getTokens(), response);
return response;
}
Aggregations