public List<LockWithMode> getLocks() { return ImmutableList.copyOf(Iterables.transform(lockMap.entries(), TO_LOCK_WITH_MODE_FUNCTION)); }
public List<LockWithMode> getLocksWithMode() { return ImmutableList.copyOf(Iterables.transform(lockMap.entries(), TO_LOCK_WITH_MODE_FUNCTION)); }
public List<LockWithMode> getLocks() { return ImmutableList.copyOf(Iterables.transform(lockMap.entries(), TO_LOCK_WITH_MODE_FUNCTION)); }
@Override public String toString() { return MoreObjects.toStringHelper(getClass().getSimpleName()) .omitNullValues() .add("lockCount", lockMap.size()) .add("firstLock", lockMap.entries().iterator().next()) .add("lockTimeout", lockTimeout) .add("lockGroupBehavior", lockGroupBehavior) .add("blockingMode", blockingMode) .add("blockingDuration", blockingDuration) .add("versionId", versionId) .toString(); }
@Override public String toString() { return "SortedLockCollection " + Iterables.toString(entries()); }
public String toString(long currentTimeMillis) { return MoreObjects.toStringHelper(getClass().getSimpleName()) .add("tokenId", tokenId.toString(Character.MAX_RADIX)) .add("client", client) .add("createdAt", SimpleTimeDuration.of(creationDateMs, TimeUnit.MILLISECONDS)) .add("expiresIn", SimpleTimeDuration.of(expirationDateMs - currentTimeMillis, TimeUnit.MILLISECONDS)) .add("lockCount", lockMap.size()) .add("firstLock", lockMap.entries().iterator().next()) .add("versionId", versionId) .add("requestingThread", requestingThread) .toString(); }
public String toString(long currentTimeMillis) { return MoreObjects.toStringHelper(getClass().getSimpleName()) .add("grantId", grantId.toString(Character.MAX_RADIX)) .add("createdAt", SimpleTimeDuration.of(creationDateMs, TimeUnit.MILLISECONDS)) .add("expiresIn", SimpleTimeDuration.of(expirationDateMs, TimeUnit.MILLISECONDS)) .add("lockCount", lockMap.size()) .add("firstLock", lockMap.entries().iterator().next()) .add("versionId", versionId) .toString(); }
try { previousThreadName = updateThreadName(request); for (Entry<LockDescriptor, LockMode> entry : request.getLockDescriptors().entries()) { if (blockingMode == BlockingMode.BLOCK_INDEFINITELY_THEN_RELEASE && !descriptorToLockMap.asMap().containsKey(entry.getKey())) {
static SanitizedLockRequestProgress create(LockServiceStateDebugger.LockRequestProgress progress, LockDescriptorMapper descriptorMapper, String clientId) { return ImmutableSanitizedLockRequestProgress.builder() .totalNumLocks(progress.getTotalNumLocks()) .numLocksAcquired(progress.getNumLocksAcquired()) .nextLock(progress.getNextLock().map(descriptorMapper::getDescriptorMapping) .orElse(UNKNOWN_NEXT_LOCK_MESSAGE)) .requests( StreamSupport.stream(progress.getRequest().getLockDescriptors().entries().spliterator(), false) .map(descriptor -> SimpleLockRequest.of( progress.getRequest(), descriptorMapper.getDescriptorMapping(descriptor.getKey()), descriptor.getValue(), clientId)) .collect(Collectors.toList())) .build(); } }
private LockRequestProgress getSuspectedLockProgress( LockClient client, LockRequest request) { int locksHeld = 0; for (Map.Entry<LockDescriptor, LockMode> entry : request.getLockDescriptors().entries()) { ClientAwareReadWriteLock clientAwareLock = descriptorToLockMap.get(entry.getKey()); KnownClientLock knownClientLock = clientAwareLock.get(client, entry.getValue()); if (!knownClientLock.isHeld()) { return ImmutableLockRequestProgress.builder() .request(request) .nextLock(entry.getKey()) .numLocksAcquired(locksHeld) .totalNumLocks(request.getLockDescriptors().size()) .build(); } locksHeld++; } // This means that it looks like we hold ALL of the locks return ImmutableLockRequestProgress.builder() .request(request) .numLocksAcquired(locksHeld) .totalNumLocks(request.getLockDescriptors().size()) .build(); }
public List<LockWithMode> getLocks() { return ImmutableList.copyOf(Iterables.transform(lockMap.entries(), TO_LOCK_WITH_MODE_FUNCTION)); }
public List<LockWithMode> getLocksWithMode() { return ImmutableList.copyOf(Iterables.transform(lockMap.entries(), TO_LOCK_WITH_MODE_FUNCTION)); }
public List<LockWithMode> getLocks() { return ImmutableList.copyOf(Iterables.transform(lockMap.entries(), TO_LOCK_WITH_MODE_FUNCTION)); }
@Override public String toString() { return MoreObjects.toStringHelper(getClass().getSimpleName()) .omitNullValues() .add("lockCount", lockMap.size()) .add("firstLock", lockMap.entries().iterator().next()) .add("lockTimeout", lockTimeout) .add("lockGroupBehavior", lockGroupBehavior) .add("blockingMode", blockingMode) .add("blockingDuration", blockingDuration) .add("versionId", versionId) .toString(); }
@Override public String toString() { return "SortedLockCollection " + Iterables.toString(entries()); }
public String toString(long currentTimeMillis) { return MoreObjects.toStringHelper(getClass().getSimpleName()) .add("grantId", grantId.toString(Character.MAX_RADIX)) .add("createdAt", SimpleTimeDuration.of(creationDateMs, TimeUnit.MILLISECONDS)) .add("expiresIn", SimpleTimeDuration.of(expirationDateMs, TimeUnit.MILLISECONDS)) .add("lockCount", lockMap.size()) .add("firstLock", lockMap.entries().iterator().next()) .add("versionId", versionId) .toString(); }
public String toString(long currentTimeMillis) { return MoreObjects.toStringHelper(getClass().getSimpleName()) .add("tokenId", tokenId.toString(Character.MAX_RADIX)) .add("client", client) .add("createdAt", SimpleTimeDuration.of(creationDateMs, TimeUnit.MILLISECONDS)) .add("expiresIn", SimpleTimeDuration.of(expirationDateMs - currentTimeMillis, TimeUnit.MILLISECONDS)) .add("lockCount", lockMap.size()) .add("firstLock", lockMap.entries().iterator().next()) .add("versionId", versionId) .add("requestingThread", requestingThread) .toString(); }