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/28 08:15:29 UTC

svn commit: r1762615 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java

Author: mreutegg
Date: Wed Sep 28 08:15:29 2016
New Revision: 1762615

URL: http://svn.apache.org/viewvc?rev=1762615&view=rev
Log:
OAK-4858: Use Integer.getInteger() to read system property

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java?rev=1762615&r1=1762614&r2=1762615&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncIndexUpdate.java Wed Sep 28 08:15:29 2016
@@ -102,18 +102,8 @@ public class AsyncIndexUpdate implements
      * timed out. Another node in cluster would wait for timeout before
      * taking over a running job
      */
-    private static final long DEFAULT_ASYNC_TIMEOUT;
-
-    static {
-        int value = 15;
-        try {
-            value = Integer.parseInt(System.getProperty(
-                    "oak.async.lease.timeout", "15"));
-        } catch (NumberFormatException e) {
-            // use default
-        }
-        DEFAULT_ASYNC_TIMEOUT = TimeUnit.MINUTES.toMillis(value);
-    }
+    private static final long DEFAULT_ASYNC_TIMEOUT = TimeUnit.MINUTES.toMillis(
+            Integer.getInteger("oak.async.lease.timeout", 15));
 
     private final String name;
 
@@ -180,18 +170,8 @@ public class AsyncIndexUpdate implements
      * The checkpoint cleanup interval in minutes. Defaults to 5 minutes.
      * Setting it to a negative value disables automatic cleanup. See OAK-4826.
      */
-    private final int cleanupIntervalMinutes = getCleanupIntervalMinutes();
-
-    private static int getCleanupIntervalMinutes() {
-        int value = 5;
-        try {
-            value = Integer.parseInt(System.getProperty(
-                    "oak.async.checkpointCleanupIntervalMinutes", String.valueOf(value)));
-        } catch (NumberFormatException e) {
-            // use default
-        }
-        return value;
-    }
+    private final int cleanupIntervalMinutes
+            = Integer.getInteger("oak.async.checkpointCleanupIntervalMinutes", 5);
 
     /**
      * The time in minutes since the epoch when the last checkpoint cleanup ran.