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 am...@apache.org on 2015/06/10 07:10:09 UTC

svn commit: r1684561 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java

Author: amitj
Date: Wed Jun 10 05:10:08 2015
New Revision: 1684561

URL: http://svn.apache.org/r1684561
Log:
OAK-2970: DocumentNodeStoreService doesn't fully implement a @Modified method

Removed the @Modified method

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java?rev=1684561&r1=1684560&r2=1684561&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java Wed Jun 10 05:10:08 2015
@@ -274,14 +274,13 @@ public class DocumentNodeStoreService {
                     "considered for GC. This also applies how older revision of live document are GC."
     )
     public static final String PROP_VER_GC_MAX_AGE = "versionGcMaxAgeInSecs";
-    private long versionGcMaxAgeInSecs = DEFAULT_VER_GC_MAX_AGE;
 
     public static final String PROP_REV_RECOVERY_INTERVAL = "lastRevRecoveryJobIntervalInSecs";
 
     /**
      * Blob modified before this time duration would be considered for Blob GC
      */
-    private static final long DEFAULT_BLOB_GC_MAX_AGE = 24 * 60 * 60; //TimeUnit.HOURS.toSeconds(24);
+    private static final long DEFAULT_BLOB_GC_MAX_AGE = 24 * 60 * 60;
     @Property (longValue = DEFAULT_BLOB_GC_MAX_AGE,
             label = "Blob GC Max Age (in secs)",
             description = "Blob Garbage Collector (GC) logic will only consider those blobs for GC which " +
@@ -290,9 +289,8 @@ public class DocumentNodeStoreService {
                     "considered for GC"
     )
     public static final String PROP_BLOB_GC_MAX_AGE = "blobGcMaxAgeInSecs";
-    private long blobGcMaxAgeInSecs = DEFAULT_BLOB_GC_MAX_AGE;
 
-    private static final long DEFAULT_MAX_REPLICATION_LAG = 6 * 60 * 60; //TimeUnit.HOURS.toSeconds(6);
+    private static final long DEFAULT_MAX_REPLICATION_LAG = 6 * 60 * 60;
     @Property(longValue = DEFAULT_MAX_REPLICATION_LAG,
             label = "Max Replication Lag (in secs)",
             description = "Value in seconds. Determines the duration beyond which it can be safely assumed " +
@@ -326,7 +324,6 @@ public class DocumentNodeStoreService {
         customBlobDataSource = toBoolean(prop(CUSTOM_BLOB_DATA_SOURCE), false);
         documentStoreType = DocumentStoreType.fromString(PropertiesUtil.toString(config.get(PROP_DS_TYPE), "MONGO"));
 
-        modified(config);
         registerNodeStoreIfPossible();
     }
 
@@ -449,15 +446,6 @@ public class DocumentNodeStoreService {
         reg = context.getBundleContext().registerService(NodeStore.class.getName(), store, props);
     }
 
-    /**
-     * At runtime DocumentNodeStore only pickup modification of certain properties
-     */
-    @Modified
-    protected void modified(Map<String, ?> config){
-        versionGcMaxAgeInSecs = toLong(config.get(PROP_VER_GC_MAX_AGE), DEFAULT_VER_GC_MAX_AGE);
-        blobGcMaxAgeInSecs = toLong(config.get(PROP_BLOB_GC_MAX_AGE), DEFAULT_BLOB_GC_MAX_AGE);
-    }
-
     @Deactivate
     protected void deactivate() {
         if (observerTracker != null) {
@@ -577,6 +565,9 @@ public class DocumentNodeStoreService {
                         "Document node store management")
         );
 
+        final long versionGcMaxAgeInSecs = toLong(prop(PROP_VER_GC_MAX_AGE), DEFAULT_VER_GC_MAX_AGE);
+        final long blobGcMaxAgeInSecs = toLong(prop(PROP_BLOB_GC_MAX_AGE), DEFAULT_BLOB_GC_MAX_AGE);
+
         if (store.getBlobStore() instanceof GarbageCollectableBlobStore) {
             BlobGarbageCollector gc = new BlobGarbageCollector() {
                 @Override