jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1584080 - /jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentFileWriteTest.java
Date Wed, 02 Apr 2014 16:12:06 GMT
Author: jukka
Date: Wed Apr  2 16:12:05 2014
New Revision: 1584080

URL: http://svn.apache.org/r1584080
Log:
OAK-1496: Benchmark for concurrent file writes

Avoid oak:Unstructured to make the test work also with Jackrabbit Classic

Modified:
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentFileWriteTest.java

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentFileWriteTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentFileWriteTest.java?rev=1584080&r1=1584079&r2=1584080&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentFileWriteTest.java
(original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentFileWriteTest.java
Wed Apr  2 16:12:05 2014
@@ -52,7 +52,7 @@ public class ConcurrentFileWriteTest ext
     @Override
     public void beforeSuite() throws RepositoryException {
         Session session = loginWriter();
-        session.getRootNode().addNode(ROOT_NODE_NAME, "oak:Unstructured");
+        session.getRootNode().addNode(ROOT_NODE_NAME);
         session.save();
 
         this.writer = new Writer(0);
@@ -101,13 +101,14 @@ public class ConcurrentFileWriteTest ext
 
         private final Node parent;
 
-        private final int id;
-
         private long counter = 0;
 
         Writer(int id) throws RepositoryException {
-            this.parent = loginWriter().getRootNode().getNode(ROOT_NODE_NAME);
-            this.id = id;
+            this.parent = loginWriter()
+                    .getRootNode()
+                    .getNode(ROOT_NODE_NAME)
+                    .addNode("writer-" + id);
+            parent.getSession().save();
         }
 
         @Override
@@ -115,7 +116,7 @@ public class ConcurrentFileWriteTest ext
             try {
                 parent.getSession().refresh(false);
                 Node file = JcrUtils.putFile(
-                        parent, "file" + id + "-" + counter++,
+                        parent, "file-" + counter++,
                         "application/octet-stream",
                         new TestInputStream(FILE_SIZE * 1024));
                 parent.getSession().save();



Mime
View raw message