@Override public String toString() { return MoreObjects.toStringHelper(getClass().getSimpleName()) .add("isStandaloneServer", isStandaloneServer()) .add("maxAllowedLockTimeout", getMaxAllowedLockTimeout()) .add("maxAllowedClockDrift", getMaxAllowedClockDrift()) .add("maxAllowedBlockingDuration", getMaxAllowedBlockingDuration()) .add("maxNormalLockAge", getMaxNormalLockAge()) .add("randomBitCount", getRandomBitCount()) .add("lockStateLoggerDir", getLockStateLoggerDir()) .add("slowLogTriggerMillis", slowLogTriggerMillis()) .toString(); }
@Override public boolean equals(@Nullable Object obj) { if (this == obj) { return true; } if (!(obj instanceof LockServerOptions)) { return false; } LockServerOptions other = (LockServerOptions) obj; return Objects.equal(isStandaloneServer(), other.isStandaloneServer()) && Objects.equal(getMaxAllowedLockTimeout(), other.getMaxAllowedLockTimeout()) && Objects.equal(getMaxAllowedClockDrift(), other.getMaxAllowedClockDrift()) && Objects.equal(getMaxAllowedBlockingDuration(), other.getMaxAllowedBlockingDuration()) && Objects.equal(getMaxNormalLockAge(), other.getMaxNormalLockAge()) && Objects.equal(getRandomBitCount(), other.getRandomBitCount()) && Objects.equal(getLockStateLoggerDir(), other.getLockStateLoggerDir()) && Objects.equal(slowLogTriggerMillis(), other.slowLogTriggerMillis()); }
private LockServiceImpl(LockServerOptions options, Runnable callOnClose) { Preconditions.checkNotNull(options); this.callOnClose = callOnClose; isStandaloneServer = options.isStandaloneServer(); maxAllowedLockTimeout = SimpleTimeDuration.of(options.getMaxAllowedLockTimeout()); maxAllowedClockDrift = SimpleTimeDuration.of(options.getMaxAllowedClockDrift()); maxNormalLockAge = SimpleTimeDuration.of(options.getMaxNormalLockAge()); lockStateLoggerDir = options.getLockStateLoggerDir(); slowLogTriggerMillis = options.slowLogTriggerMillis(); executor.execute(() -> { Thread.currentThread().setName("Held Locks Token Reaper"); reapLocks(lockTokenReaperQueue, heldLocksTokenMap); }); executor.execute(() -> { Thread.currentThread().setName("Held Locks Grant Reaper"); reapLocks(lockGrantReaperQueue, heldLocksGrantMap); }); }
@Override public int hashCode() { return Objects.hashCode(isStandaloneServer(), getMaxAllowedLockTimeout(), getMaxAllowedClockDrift(), getMaxAllowedBlockingDuration(), getMaxNormalLockAge(), getRandomBitCount(), getLockStateLoggerDir(), slowLogTriggerMillis()); }
SerializationProxy(LockServerOptions lockServerOptions) { isStandaloneServer = lockServerOptions.isStandaloneServer(); maxAllowedLockTimeout = SimpleTimeDuration.of( lockServerOptions.getMaxAllowedLockTimeout()); maxAllowedClockDrift = SimpleTimeDuration.of( lockServerOptions.getMaxAllowedClockDrift()); maxAllowedBlockingDuration = SimpleTimeDuration.of( lockServerOptions.getMaxAllowedBlockingDuration()); maxNormalLockAge = SimpleTimeDuration.of( lockServerOptions.getMaxNormalLockAge()); randomBitCount = lockServerOptions.getRandomBitCount(); lockStateLoggerDir = lockServerOptions.getLockStateLoggerDir(); slowLogTriggerMillis = lockServerOptions.slowLogTriggerMillis(); }
@Override public String toString() { return MoreObjects.toStringHelper(getClass().getSimpleName()) .add("isStandaloneServer", isStandaloneServer()) .add("maxAllowedLockTimeout", getMaxAllowedLockTimeout()) .add("maxAllowedClockDrift", getMaxAllowedClockDrift()) .add("maxAllowedBlockingDuration", getMaxAllowedBlockingDuration()) .add("maxNormalLockAge", getMaxNormalLockAge()) .add("randomBitCount", getRandomBitCount()) .add("lockStateLoggerDir", getLockStateLoggerDir()) .add("slowLogTriggerMillis", slowLogTriggerMillis()) .toString(); }
@Override public boolean equals(@Nullable Object obj) { if (this == obj) { return true; } if (!(obj instanceof LockServerOptions)) { return false; } LockServerOptions other = (LockServerOptions) obj; return Objects.equal(isStandaloneServer(), other.isStandaloneServer()) && Objects.equal(getMaxAllowedLockTimeout(), other.getMaxAllowedLockTimeout()) && Objects.equal(getMaxAllowedClockDrift(), other.getMaxAllowedClockDrift()) && Objects.equal(getMaxAllowedBlockingDuration(), other.getMaxAllowedBlockingDuration()) && Objects.equal(getMaxNormalLockAge(), other.getMaxNormalLockAge()) && Objects.equal(getRandomBitCount(), other.getRandomBitCount()) && Objects.equal(getLockStateLoggerDir(), other.getLockStateLoggerDir()) && Objects.equal(slowLogTriggerMillis(), other.slowLogTriggerMillis()); }
@Override public int hashCode() { return Objects.hashCode(isStandaloneServer(), getMaxAllowedLockTimeout(), getMaxAllowedClockDrift(), getMaxAllowedBlockingDuration(), getMaxNormalLockAge(), getRandomBitCount(), getLockStateLoggerDir(), slowLogTriggerMillis()); }
SerializationProxy(LockServerOptions lockServerOptions) { isStandaloneServer = lockServerOptions.isStandaloneServer(); maxAllowedLockTimeout = SimpleTimeDuration.of( lockServerOptions.getMaxAllowedLockTimeout()); maxAllowedClockDrift = SimpleTimeDuration.of( lockServerOptions.getMaxAllowedClockDrift()); maxAllowedBlockingDuration = SimpleTimeDuration.of( lockServerOptions.getMaxAllowedBlockingDuration()); maxNormalLockAge = SimpleTimeDuration.of( lockServerOptions.getMaxNormalLockAge()); randomBitCount = lockServerOptions.getRandomBitCount(); lockStateLoggerDir = lockServerOptions.getLockStateLoggerDir(); slowLogTriggerMillis = lockServerOptions.slowLogTriggerMillis(); }