jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1579238 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: RepositoryManager.java api/jmx/RepositoryManagementMBean.java plugins/backup/FileStoreBackupRestore.java plugins/backup/FileStoreBackupRestoreMBean.java
Date Wed, 19 Mar 2014 14:20:55 GMT
Author: alexparvulescu
Date: Wed Mar 19 14:20:54 2014
New Revision: 1579238

URL: http://svn.apache.org/r1579238
Log:
OAK-1572 Add checkpoint operation to the filestore jmx api

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/RepositoryManager.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/jmx/RepositoryManagementMBean.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/backup/FileStoreBackupRestore.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/backup/FileStoreBackupRestoreMBean.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/RepositoryManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/RepositoryManager.java?rev=1579238&r1=1579237&r2=1579238&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/RepositoryManager.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/RepositoryManager.java
Wed Mar 19 14:20:54 2014
@@ -158,4 +158,15 @@ public class RepositoryManager implement
         });
     }
 
+    @Override
+    public String checkpoint(long lifetime) {
+        return execute(FileStoreBackupRestoreMBean.class, new Function<FileStoreBackupRestoreMBean,
String>() {
+            @Nullable
+            @Override
+            public String apply(FileStoreBackupRestoreMBean backupService) {
+                return backupService.getRestoreStatus();
+            }
+        });
+    }
+
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/jmx/RepositoryManagementMBean.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/jmx/RepositoryManagementMBean.java?rev=1579238&r1=1579237&r2=1579238&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/jmx/RepositoryManagementMBean.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/jmx/RepositoryManagementMBean.java
Wed Mar 19 14:20:54 2014
@@ -117,4 +117,18 @@ public interface RepositoryManagementMBe
      */
     @Nonnull
     String getRevisionGCStatus();
+
+    /**
+     * Creates a new checkpoint of the latest root of the tree. The checkpoint
+     * remains valid for at least as long as requested and allows that state
+     * of the repository to be retrieved using the returned opaque string
+     * reference.
+     *
+     * @param lifetime time (in milliseconds, &gt; 0) that the checkpoint
+     *                 should remain available
+     * @return string reference of this checkpoint
+     */
+    @Nonnull
+    String checkpoint(long lifetime);
+
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/backup/FileStoreBackupRestore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/backup/FileStoreBackupRestore.java?rev=1579238&r1=1579237&r2=1579238&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/backup/FileStoreBackupRestore.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/backup/FileStoreBackupRestore.java
Wed Mar 19 14:20:54 2014
@@ -38,6 +38,7 @@ import org.slf4j.LoggerFactory;
  * Default implementation of {@link FileStoreBackupRestoreMBean} based on a file.
  */
 public class FileStoreBackupRestore implements FileStoreBackupRestoreMBean {
+
     private static final Logger log = LoggerFactory.getLogger(FileStoreBackupRestore.class);
 
     private final NodeStore store;
@@ -143,4 +144,9 @@ public class FileStoreBackupRestore impl
     private static String formatTime(long nanos) {
         return TimeUnit.MINUTES.convert(nanos, TimeUnit.NANOSECONDS) + " minutes";
     }
+
+    @Override
+    public String checkpoint(long lifetime) {
+        return store.checkpoint(lifetime);
+    }
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/backup/FileStoreBackupRestoreMBean.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/backup/FileStoreBackupRestoreMBean.java?rev=1579238&r1=1579237&r2=1579238&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/backup/FileStoreBackupRestoreMBean.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/backup/FileStoreBackupRestoreMBean.java
Wed Mar 19 14:20:54 2014
@@ -61,4 +61,18 @@ public interface FileStoreBackupRestoreM
      */
     @Nonnull
     String getRestoreStatus();
+
+    /**
+     * Creates a new checkpoint of the latest root of the tree. The checkpoint
+     * remains valid for at least as long as requested and allows that state
+     * of the repository to be retrieved using the returned opaque string
+     * reference.
+     *
+     * @param lifetime time (in milliseconds, &gt; 0) that the checkpoint
+     *                 should remain available
+     * @return string reference of this checkpoint
+     */
+    @Nonnull
+    String checkpoint(long lifetime);
+
 }



Mime
View raw message