Author: thomasm
Date: Mon Oct  6 13:01:05 2014
New Revision: 1629635

URL: http://svn.apache.org/r1629635
Log:
OAK-2163 Oak-run "checkpoint" and "backup" don't use memory mapped files

Modified:
    
jackrabbit/oak/branches/1.0/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java

Modified: 
jackrabbit/oak/branches/1.0/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.0/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java?rev=1629635&r1=1629634&r2=1629635&view=diff
==============================================================================
--- 
jackrabbit/oak/branches/1.0/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java
 (original)
+++ 
jackrabbit/oak/branches/1.0/oak-run/src/main/java/org/apache/jackrabbit/oak/run/Main.java
 Mon Oct  6 13:01:05 2014
@@ -85,6 +85,8 @@ public class Main {
 
     private static final int MB = 1024 * 1024;
 
+    public static final boolean TAR_STORAGE_MEMORY_MAPPED = 
Boolean.getBoolean("tar.memoryMapped");
+
     private Main() {
     }
 
@@ -158,7 +160,7 @@ public class Main {
     private static void backup(String[] args) throws IOException {
         if (args.length == 2) {
             // TODO: enable backup for other node store implementations
-            FileStore store = new FileStore(new File(args[0]), 256, false);
+            FileStore store = new FileStore(new File(args[0]), 256, 
TAR_STORAGE_MEMORY_MAPPED);
             FileStoreBackup.backup(new SegmentNodeStore(store), new 
File(args[1]));
             store.close();
         } else {
@@ -180,7 +182,7 @@ public class Main {
             System.out.println("    before " + 
Arrays.toString(directory.list()));
 
             System.out.println("    -> compacting");
-            FileStore store = new FileStore(directory, 256, false);
+            FileStore store = new FileStore(directory, 256, 
TAR_STORAGE_MEMORY_MAPPED);
             try {
                 store.compact();
             } finally {
@@ -188,7 +190,7 @@ public class Main {
             }
 
             System.out.println("    -> cleaning up");
-            store = new FileStore(directory, 256, false);
+            store = new FileStore(directory, 256, TAR_STORAGE_MEMORY_MAPPED);
             try {
                 store.cleanup();
             } finally {
@@ -220,7 +222,7 @@ public class Main {
             }
         }
         System.out.println("Checkpoints " + path);
-        FileStore store = new FileStore(new File(path), 256, false);
+        FileStore store = new FileStore(new File(path), 256, 
TAR_STORAGE_MEMORY_MAPPED);
         try {
             if ("list".equals(op)) {
                 NodeState ns = store.getHead().getChildNode("checkpoints");
@@ -335,7 +337,7 @@ public class Main {
             // TODO: enable debug information for other node store 
implementations
             System.out.println("Debug " + args[0]);
             File file = new File(args[0]);
-            FileStore store = new FileStore(file, 256, false);
+            FileStore store = new FileStore(file, 256, 
TAR_STORAGE_MEMORY_MAPPED);
             try {
                 if (args.length == 1) {
                     Map<SegmentId, List<SegmentId>> idmap = Maps.newHashMap();


Reply via email to