You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by mr...@apache.org on 2016/09/13 09:33:14 UTC
svn commit: r1760505 -
/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterNodeInfo.java
Author: mreutegg
Date: Tue Sep 13 09:33:14 2016
New Revision: 1760505
URL: http://svn.apache.org/viewvc?rev=1760505&view=rev
Log:
OAK-4799: Unnecessary unboxing in ClusterNodeInfo
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterNodeInfo.java
Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterNodeInfo.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterNodeInfo.java?rev=1760505&r1=1760504&r2=1760505&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterNodeInfo.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterNodeInfo.java Tue Sep 13 09:33:14 2016
@@ -35,7 +35,6 @@ import java.util.concurrent.TimeUnit;
import com.google.common.base.Stopwatch;
import org.apache.jackrabbit.oak.commons.StringUtils;
-import org.apache.jackrabbit.oak.plugins.document.util.Utils;
import org.apache.jackrabbit.oak.stats.Clock;
import org.apache.jackrabbit.oak.util.OakVersion;
import org.slf4j.Logger;
@@ -527,7 +526,7 @@ public class ClusterNodeInfo {
// case something is very very wrong anyway)
if (waitForLease && (leaseEnd - now) < (DEFAULT_LEASE_DURATION_MILLIS + 5000) && mId.equals(machineId)
&& iId.equals(instanceId)) {
- boolean worthRetrying = waitForLeaseExpiry(store, doc, leaseEnd.longValue(), machineId, instanceId);
+ boolean worthRetrying = waitForLeaseExpiry(store, doc, leaseEnd, machineId, instanceId);
if (worthRetrying) {
return createInstance(store, machineId, instanceId, configuredClusterId, false);
}
@@ -540,8 +539,7 @@ public class ClusterNodeInfo {
// remove entries with "random:" keys if not in use (no lease at all)
if (mId.startsWith(RANDOM_PREFIX) && leaseEnd == null) {
store.remove(Collection.CLUSTER_NODES, key);
- LOG.debug("Cleaned up cluster node info for clusterNodeId {} [machineId: {}, leaseEnd: {}]", id, mId,
- leaseEnd == null ? "n/a" : Utils.timestampToString(leaseEnd));
+ LOG.debug("Cleaned up cluster node info for clusterNodeId {} [machineId: {}, leaseEnd: n/a]", id, mId);
if (alreadyExistingConfigured == doc) {
// we removed it, so we can't re-use it after all
alreadyExistingConfigured = null;
@@ -617,7 +615,7 @@ public class ClusterNodeInfo {
LOG.info("Cluster node " + key + ": lease end information missing, aborting.");
return false;
} else {
- if (newLeaseEnd.longValue() != leaseEnd) {
+ if (newLeaseEnd != leaseEnd) {
LOG.info("Cluster node " + key + " seems to be still active (lease end changed from " + leaseEnd
+ " to " + newLeaseEnd + ", will not try to use it.");
return false;