@Test public void refreshLockLeasesDelegatesToLockService() { Set<LockToken> tokens = ImmutableSet.of(LOCK_TOKEN_V2); timelock.refreshLockLeases(tokens); verify(lockService).refreshLockRefreshTokens(ImmutableSet.of(LOCK_REFRESH_TOKEN)); }
@Override public Set<LockToken> refreshLockLeases(Set<LockToken> tokens) { Set<LockRefreshToken> refreshTokens = tokens.stream() .map(LockTokenConverter::toLegacyToken) .collect(Collectors.toSet()); return lockService.refreshLockRefreshTokens(refreshTokens).stream() .map(LockTokenConverter::toTokenV2) .collect(Collectors.toSet()); }
LegacyTimelockService implements TimelockService { @Override public Set<LockToken> refreshLockLeases(Set<LockToken> tokens) { Set<LockRefreshToken> refreshTokens = tokens.stream() .map(LockTokenConverter::toLegacyToken) .collect(Collectors.toSet()); return lockService.refreshLockRefreshTokens(refreshTokens).stream() .map(LockTokenConverter::toTokenV2) .collect(Collectors.toSet()); } }
LegacyTimelockService implements TimelockService { @Override public Set<LockToken> refreshLockLeases(Set<LockToken> tokens) { Set<LockRefreshToken> refreshTokens = tokens.stream() .map(LockTokenConverter::toLegacyToken) .collect(Collectors.toSet()); return lockService.refreshLockRefreshTokens(refreshTokens).stream() .map(LockTokenConverter::toTokenV2) .collect(Collectors.toSet()); } LegacyTimelockService(TimestampService timestampService, LockService lockService,
            LockClient immutableTsLockClient); }
LegacyTimelockService implements TimelockService { @Override public Set<LockToken> refreshLockLeases(Set<LockToken> tokens) { Set<LockRefreshToken> refreshTokens = tokens.stream() .map(LockTokenConverter::toLegacyToken) .collect(Collectors.toSet()); return lockService.refreshLockRefreshTokens(refreshTokens).stream() .map(LockTokenConverter::toTokenV2) .collect(Collectors.toSet()); } LegacyTimelockService(TimestampService timestampService, LockService lockService,
            LockClient immutableTsLockClient); @Override boolean isInitialized(); @Override long getFreshTimestamp(); @Override long getCommitTimestamp(long startTs, LockToken commitLocksToken); @Override TimestampRange getFreshTimestamps(int numTimestampsRequested); @Override LockImmutableTimestampResponse lockImmutableTimestamp(); @Override List<StartIdentifiedAtlasDbTransactionResponse> startIdentifiedAtlasDbTransactionBatch(int count); @Override long getImmutableTimestamp(); @Override LockResponse lock(LockRequest request); @Override WaitForLocksResponse waitForLocks(WaitForLocksRequest request); @Override Set<LockToken> refreshLockLeases(Set<LockToken> tokens); @Override Set<LockToken> unlock(Set<LockToken> tokens); @Override void tryUnlock(Set<LockToken> tokens); @Override long currentTimeMillis(); }
LegacyTimelockService implements TimelockService { @Override public Set<LockToken> refreshLockLeases(Set<LockToken> tokens) { Set<LockRefreshToken> refreshTokens = tokens.stream() .map(LockTokenConverter::toLegacyToken) .collect(Collectors.toSet()); return lockService.refreshLockRefreshTokens(refreshTokens).stream() .map(LockTokenConverter::toTokenV2) .collect(Collectors.toSet()); } LegacyTimelockService(TimestampService timestampService, LockService lockService,
            LockClient immutableTsLockClient); @Override boolean isInitialized(); @Override long getFreshTimestamp(); @Override long getCommitTimestamp(long startTs, LockToken commitLocksToken); @Override TimestampRange getFreshTimestamps(int numTimestampsRequested); @Override LockImmutableTimestampResponse lockImmutableTimestamp(); @Override List<StartIdentifiedAtlasDbTransactionResponse> startIdentifiedAtlasDbTransactionBatch(int count); @Override long getImmutableTimestamp(); @Override LockResponse lock(LockRequest request); @Override WaitForLocksResponse waitForLocks(WaitForLocksRequest request); @Override Set<LockToken> refreshLockLeases(Set<LockToken> tokens); @Override Set<LockToken> unlock(Set<LockToken> tokens); @Override void tryUnlock(Set<LockToken> tokens); @Override long currentTimeMillis();  }