jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r1297454 - in /jackrabbit/sandbox/microkernel/src: main/java/org/apache/jackrabbit/mk/ main/java/org/apache/jackrabbit/mk/api/ main/java/org/apache/jackrabbit/mk/model/ test/java/org/apache/jackrabbit/mk/api/
Date Tue, 06 Mar 2012 12:52:30 GMT
Author: stefan
Date: Tue Mar  6 12:52:29 2012
New Revision: 1297454

URL: http://svn.apache.org/viewvc?rev=1297454&view=rev
Log:
cleaning up

Modified:
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelImpl.java
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/api/MicroKernel.java
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/model/AbstractNode.java
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntries.java
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntriesMap.java
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntriesTree.java
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/model/CommitBuilder.java
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/model/Node.java
    jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/api/MicroKernelTest.java

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelImpl.java?rev=1297454&r1=1297453&r2=1297454&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelImpl.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelImpl.java
Tue Mar  6 12:52:29 2012
@@ -505,7 +505,6 @@ public class MicroKernelImpl implements 
                         break;
                     }
                     case '>': {
-                        // TODO: support target position notation
                         pos = t.getLastPos();
                         String subPath = t.readString();
                         String srcPath = PathUtils.concat(path, subPath);
@@ -525,7 +524,6 @@ public class MicroKernelImpl implements 
                         break;
                     }
                     case '*': {
-                        // TODO: support target position notation
                         pos = t.getLastPos();
                         String subPath = t.readString();
                         String srcPath = PathUtils.concat(path, subPath);

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/api/MicroKernel.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/api/MicroKernel.java?rev=1297454&r1=1297453&r2=1297454&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/api/MicroKernel.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/api/MicroKernel.java
Tue Mar  6 12:52:29 2012
@@ -29,21 +29,20 @@ import java.io.InputStream;
  * <li>portable to C</li>
  * <li>efficient support for large number of child nodes</li>
  * <li>integrated API for storing/retrieving large binaries (similar to existing DataStore
API)</li>
- * <li>human-readable data serialization (e.g. JSON, YAML)</li>
+ * <li>human-readable data serialization (JSON)</li>
  * </ul>
  * <p/>
  * The MicroKernel <b>Data Model</b>:
  * <ul>
  * <li>simple JSON-inspired data model: just nodes and properties</li>
- * <li>a node is represented as an object, consisting of an unordered collection
- * of properties and an ordered mapping of names/child nodes</li>
+ * <li>a node consists of an unordered set of name -&gt; item mappings. each
+ * property and child node is uniquely named and a single name can only
+ * refer to a property or a child node, not both at the same time.
  * <li>properties are represented as name/value pairs</li>
  * <li>supported property types: string, number</li>
  * <li>other property types (weak/hard reference, date, etc) would need to be
  * encoded/mangled in name or value</li>
  * <li>no support for JCR/XML-like namespaces, "foo:bar" is just an ordinary name</li>
- * <li>properties and child nodes share the same namespace, i.e. a property and
- * a child node, sharing the same parent node, cannot have the same name</li>
  * </ul>
  * <p/>
  * <b>Architecture (overview)</b>:
@@ -52,14 +51,6 @@ import java.io.InputStream;
  * <li>SPI (node types, workspaces, namespaces, access control, search, locking, ...)</li>
  * <li><i>MicroKernel</i></li>
  * </ol>
- * <p/>
- * <p/>
- * <b>JSON/JSOP</b>:
- * <ul>
- * <li>do we need to specify a 'reorder' op in jsop? perhaps based on 'move'?
- * => check full JSOP spec and davex</li>
- * <li>consider YAML as an alternative to the JSON representation =>
- * supports ordered sequence of name:value pairs, richer set of data/collection types</li>
  * </ul>
  */
 public interface MicroKernel {
@@ -286,7 +277,6 @@ public interface MicroKernel {
      * @param blobId blob identifier
      * @return length of the specified blob
      * @throws MicroKernelException if an error occurs
-     * @todo encode length in id?
      */
     long getLength(String blobId) throws MicroKernelException;
 

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/model/AbstractNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/model/AbstractNode.java?rev=1297454&r1=1297453&r2=1297454&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/model/AbstractNode.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/model/AbstractNode.java
Tue Mar  6 12:52:29 2012
@@ -157,8 +157,6 @@ public abstract class AbstractNode imple
             }
         }
 
-        // todo determine copy/move and child-node reorder operations
-
         // compare child node entries
 
         if (other instanceof AbstractNode) {

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntries.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntries.java?rev=1297454&r1=1297453&r2=1297454&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntries.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntries.java
Tue Mar  6 12:52:29 2012
@@ -49,10 +49,6 @@ public interface ChildNodeEntries extend
 
     ChildNodeEntry rename(String oldName, String newName);
 
-    ChildNodeEntry moveAfter(String name, String sibling);
-
-    ChildNodeEntry moveBefore(String name, String sibling);
-
     //-------------------------------------------------------------< diff ops >
 
     /**

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntriesMap.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntriesMap.java?rev=1297454&r1=1297453&r2=1297454&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntriesMap.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntriesMap.java
Tue Mar  6 12:52:29 2012
@@ -171,56 +171,6 @@ public class ChildNodeEntriesMap impleme
         return oldCNE;
     }
 
-    @Override
-    public ChildNodeEntry moveAfter(String name, String sibling) {
-        ChildNodeEntry target = entries.remove(name);
-        if (target == null) {
-            return null;
-        }
-
-        if (sibling == null) {
-            // move to bottom (re-adding it will append it)
-            entries.put(target.getName(), target);
-            return target;
-        } else {
-            HashMap<String, ChildNodeEntry> clone =
-                    (HashMap<String, ChildNodeEntry>) entries.clone();
-            entries.clear();
-            for (Map.Entry<String, ChildNodeEntry> entry : clone.entrySet()) {
-                entries.put(entry.getKey(), entry.getValue());
-                if (entry.getKey().equals(sibling)) {
-                    entries.put(name, target);
-                }
-            }
-        }
-        return target;
-    }
-
-    @Override
-    public ChildNodeEntry moveBefore(String name, String sibling) {
-        ChildNodeEntry target = entries.remove(name);
-        if (target == null) {
-            return null;
-        }
-
-        HashMap<String, ChildNodeEntry> clone =
-                (HashMap<String, ChildNodeEntry>) entries.clone();
-        entries.clear();
-        if (sibling == null) {
-            // move to top
-            entries.put(target.getName(), target);
-            entries.putAll(clone);
-        } else {
-            for (Map.Entry<String, ChildNodeEntry> entry : clone.entrySet()) {
-                if (entry.getKey().equals(sibling)) {
-                    entries.put(name, target);
-                }
-                entries.put(entry.getKey(), entry.getValue());
-            }
-        }
-        return target;
-    }
-
     //-------------------------------------------------------------< diff ops >
 
     @Override

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntriesTree.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntriesTree.java?rev=1297454&r1=1297453&r2=1297454&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntriesTree.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntriesTree.java
Tue Mar  6 12:52:29 2012
@@ -285,18 +285,6 @@ public class ChildNodeEntriesTree implem
         return old;
     }
 
-    @Override
-    public ChildNodeEntry moveAfter(String name, String sibling) {
-        // not supported, silently ignore
-        return get(name);
-    }
-
-    @Override
-    public ChildNodeEntry moveBefore(String name, String sibling) {
-        // not supported, silently ignore
-        return get(name);
-    }
-
     //-------------------------------------------------------------< diff ops >
 
     @Override

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/model/CommitBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/model/CommitBuilder.java?rev=1297454&r1=1297453&r2=1297454&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/model/CommitBuilder.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/model/CommitBuilder.java
Tue Mar  6 12:52:29 2012
@@ -170,9 +170,6 @@ public class CommitBuilder {
         changeLog.add(new SetProperties(nodePath, properties));
     }
 
-    //final static AtomicLong commitCount = new AtomicLong();
-    //final static AtomicLong mergeCount = new AtomicLong();
-
     public String /* new revId */ doCommit() throws Exception {
         if (staged.isEmpty()) {
             // nothing to commit
@@ -207,8 +204,6 @@ public class CommitBuilder {
 
                 rootNodeId = mergeTree(baseRoot, ourRoot, theirRoot);
 
-                //mergeCount.getAndIncrement();
-
                 baseRevId = currentHead;
             }
 
@@ -225,13 +220,6 @@ public class CommitBuilder {
             newRevId = store.putCommit(newCommit);
 
             store.setHeadCommitId(newRevId);
-/*
-            long commits = commitCount.incrementAndGet();
-            if (commits % 100 == 0) {
-                long merges = mergeCount.get();
-                System.out.println("#commits: " + commits + ", #merges: " + merges + " ("
+ ((int)(100*(1.0*merges/commits))) + "%)");
-            }
-*/
         } finally {
             store.unlockHead();
         }

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/model/Node.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/model/Node.java?rev=1297454&r1=1297453&r2=1297454&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/model/Node.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/model/Node.java
Tue Mar  6 12:52:29 2012
@@ -34,9 +34,6 @@ public interface Node {
     Iterator<String> getChildNodeNames(int offset, int count);
     int getChildNodeCount();
     
-    /**
-     * @deprecated use getChildNodes(int, int, RevisionProvider) instead
-     */
     Iterator<ChildNodeEntry> getChildNodeEntries(int offset, int count);
 
     Iterator<ChildNode> getChildNodes(int offset, int count) throws Exception;

Modified: jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/api/MicroKernelTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/api/MicroKernelTest.java?rev=1297454&r1=1297453&r2=1297454&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/api/MicroKernelTest.java
(original)
+++ jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/api/MicroKernelTest.java
Tue Mar  6 12:52:29 2012
@@ -248,7 +248,6 @@ public class MicroKernelTest extends Mul
     @Test
     public void reorderNode() {
         if (!isSimpleKernel(mk)) {
-            // todo provide node reorder-support (MicroKernelImpl)
             return;
         }
         String head = mk.getHeadRevision();



Mime
View raw message