LockRequest request = LockRequest.builder(mapToAssertLockHeld) .doNotBlock() .lockAsManyAsPossible() .build(); LockRefreshToken lock = lockService.lock(LockClient.ANONYMOUS.getClientId(), request);
Assert.assertNull(token); requestAllLocks = LockRequest.builder(lockMap).doNotBlock() .lockAsManyAsPossible().build(); token = server.lockWithFullLockResponse(client2, requestAllLocks).getToken(); Assert.assertNotNull(token); .lockAsManyAsPossible().build(); token = server.lockWithFullLockResponse(client2, requestAllLocks).getToken(); Assert.assertNotNull(token);
LockRequest request = LockRequest.builder(mapToAssertLockHeld) .doNotBlock() .lockAsManyAsPossible() .build(); LockRefreshToken lock = lockService.lock(LockClient.ANONYMOUS.getClientId(), request);
Object readResolve() { Builder builder = new Builder(lockMap).timeoutAfter(lockTimeout); if (lockGroupBehavior == LockGroupBehavior.LOCK_AS_MANY_AS_POSSIBLE) { builder.lockAsManyAsPossible(); } if (blockingMode == BlockingMode.DO_NOT_BLOCK) { builder.doNotBlock(); } else if (blockingMode == BlockingMode.BLOCK_UNTIL_TIMEOUT) { builder.blockForAtMost(blockingDuration); } else if (blockingMode == BlockingMode.BLOCK_INDEFINITELY_THEN_RELEASE) { builder.lockAndRelease(); } if (versionId != null) { builder.withLockedInVersionId(versionId); } builder.withCreatingThreadName(creatingThreadName); return builder.build(); } }
LockRequest.builder(ImmutableSortedMap.of(lock1, LockMode.READ)).lockAsManyAsPossible() .lockAsManyAsPossible().build(); Assert.fail(); } catch (IllegalStateException expected) { LockRequest.builder(ImmutableSortedMap.of(lock1, LockMode.READ)).lockAsManyAsPossible() .build(); Assert.fail();
.lockAsManyAsPossible() .blockForAtMost(SimpleTimeDuration.of(50, TimeUnit.MILLISECONDS)).build(); response = server.lockWithFullLockResponse(LockClient.ANONYMOUS, request); .lockAsManyAsPossible() .blockForAtMost(SimpleTimeDuration.of(50, TimeUnit.MILLISECONDS)).build(); response = server.lockWithFullLockResponse(LockClient.ANONYMOUS, request); .lockAsManyAsPossible() .blockForAtMost(SimpleTimeDuration.of(50, TimeUnit.MILLISECONDS)).build(); response = server.lockWithFullLockResponse(LockClient.ANONYMOUS, request); .lockAsManyAsPossible() .blockForAtMost(SimpleTimeDuration.of(50, TimeUnit.MILLISECONDS)).build(); response = server.lockWithFullLockResponse(LockClient.ANONYMOUS, request);
.lockAsManyAsPossible() .blockForAtMost(SimpleTimeDuration.of(100, TimeUnit.MILLISECONDS)).build(); response = server.lockWithFullLockResponse(client, request3);
Object readResolve() { Builder builder = new Builder(lockMap).timeoutAfter(lockTimeout); if (lockGroupBehavior == LockGroupBehavior.LOCK_AS_MANY_AS_POSSIBLE) { builder.lockAsManyAsPossible(); } if (blockingMode == BlockingMode.DO_NOT_BLOCK) { builder.doNotBlock(); } else if (blockingMode == BlockingMode.BLOCK_UNTIL_TIMEOUT) { builder.blockForAtMost(blockingDuration); } else if (blockingMode == BlockingMode.BLOCK_INDEFINITELY_THEN_RELEASE) { builder.lockAndRelease(); } if (versionId != null) { builder.withLockedInVersionId(versionId); } builder.withCreatingThreadName(creatingThreadName); return builder.build(); } }