jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1522515 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/blob/gridfs/ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mo...
Date Thu, 12 Sep 2013 10:35:05 GMT
Author: thomasm
Date: Thu Sep 12 10:35:04 2013
New Revision: 1522515

URL: http://svn.apache.org/r1522515
Log:
OAK-98 Source code formatting, code conventions, Javadocs

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/ClusterNodeInfoDocument.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Collection.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Commit.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/DocumentStore.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MemoryDocumentStore.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoDocumentStore.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMK.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Node.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/NodeDocument.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/RevisionContext.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/blob/gridfs/CommandExecutor.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/util/LoggingDocumentStoreWrapper.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/util/TimingDocumentStoreWrapper.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/DocumentSplitTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/IsolationTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMKBranchTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/impl/MongoMKConcurrentAddTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/impl/MongoMKLimitsTest.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/QueryObjectModelImpl.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/ClusterNodeInfoDocument.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/ClusterNodeInfoDocument.java?rev=1522515&r1=1522514&r2=1522515&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/ClusterNodeInfoDocument.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/ClusterNodeInfoDocument.java
Thu Sep 12 10:35:04 2013
@@ -20,5 +20,7 @@ package org.apache.jackrabbit.oak.plugin
  * A document storing cluster node info. See also {@link ClusterNodeInfo}.
  */
 public class ClusterNodeInfoDocument extends Document {
+    
+    // marker interface
 
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Collection.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Collection.java?rev=1522515&r1=1522514&r2=1522515&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Collection.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Collection.java
Thu Sep 12 10:35:04 2013
@@ -20,6 +20,8 @@ import javax.annotation.Nonnull;
 
 /**
  * The collection types.
+ * 
+ * @param <T> the document type
  */
 public abstract class Collection<T extends Document> {
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Commit.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Commit.java?rev=1522515&r1=1522514&r2=1522515&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Commit.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Commit.java
Thu Sep 12 10:35:04 2013
@@ -20,7 +20,6 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
-import java.util.Map;
 import java.util.concurrent.atomic.AtomicReference;
 
 import javax.annotation.CheckForNull;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/DocumentStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/DocumentStore.java?rev=1522515&r1=1522514&r2=1522515&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/DocumentStore.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/DocumentStore.java
Thu Sep 12 10:35:04 2013
@@ -33,6 +33,7 @@ public interface DocumentStore {
      * <p>
      * The returned document is immutable.
      * 
+     * @param <T> the document type
      * @param collection the collection
      * @param key the key
      * @return the document, or null if not found
@@ -46,6 +47,7 @@ public interface DocumentStore {
      * <p>
      * The returned document is immutable.
      * 
+     * @param <T> the document type
      * @param collection the collection
      * @param key the key
      * @param maxCacheAge the maximum age of the cached document
@@ -58,6 +60,7 @@ public interface DocumentStore {
      * Get a list of documents where the key is greater than a start value and
      * less than an end value. The returned documents are immutable.
      * 
+     * @param <T> the document type
      * @param collection the collection
      * @param fromKey the start value (excluding)
      * @param toKey the end value (excluding)
@@ -74,6 +77,7 @@ public interface DocumentStore {
      * Get a list of documents where the key is greater than a start value and
      * less than an end value. The returned documents are immutable.
      * 
+     * @param <T> the document type
      * @param collection the collection
      * @param fromKey the start value (excluding)
      * @param toKey the end value (excluding)
@@ -93,6 +97,7 @@ public interface DocumentStore {
     /**
      * Remove a document.
      *
+     * @param <T> the document type
      * @param collection the collection
      * @param key the key
      */
@@ -101,6 +106,7 @@ public interface DocumentStore {
     /**
      * Try to create a list of documents.
      * 
+     * @param <T> the document type
      * @param collection the collection
      * @param updateOps the list of documents to add
      * @return true if this worked (if none of the documents already existed)
@@ -111,6 +117,7 @@ public interface DocumentStore {
      * Create or update a document. For MongoDb, this is using "findAndModify" with
      * the "upsert" flag (insert or update). The returned document is immutable.
      *
+     * @param <T> the document type
      * @param collection the collection
      * @param update the update operation
      * @return the old document or <code>null</code> if it didn't exist before.
@@ -126,6 +133,7 @@ public interface DocumentStore {
      * document if the condition is <code>true</code>. The returned document
is
      * immutable.
      *
+     * @param <T> the document type
      * @param collection the collection
      * @param update the update operation with the condition
      * @return the old document or <code>null</code> if the condition is not
met.
@@ -143,6 +151,7 @@ public interface DocumentStore {
     /**
      * Invalidate the document cache for the given key.
      * 
+     * @param <T> the document type
      * @param collection the collection
      * @param key the key
      */
@@ -156,6 +165,7 @@ public interface DocumentStore {
     /**
      * Check whether the given document is in the cache.
      * 
+     * @param <T> the document type
      * @param collection the collection
      * @param key the key
      * @return true if yes

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MemoryDocumentStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MemoryDocumentStore.java?rev=1522515&r1=1522514&r2=1522515&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MemoryDocumentStore.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MemoryDocumentStore.java
Thu Sep 12 10:35:04 2013
@@ -112,7 +112,7 @@ public class MemoryDocumentStore impleme
     }
 
     @Override
-    public void remove(Collection collection, String path) {
+    public <T extends Document> void remove(Collection<T> collection, String
path) {
         Lock lock = rwLock.writeLock();
         lock.lock();
         try {
@@ -341,12 +341,12 @@ public class MemoryDocumentStore impleme
     }
 
     @Override
-    public boolean isCached(Collection collection, String key) {
+    public <T extends Document> boolean isCached(Collection<T> collection, String
key) {
         return false;
     }
 
     @Override
-    public void invalidateCache(Collection collection, String key) {
+    public <T extends Document> void invalidateCache(Collection<T> collection,
String key) {
         // ignore
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoDocumentStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoDocumentStore.java?rev=1522515&r1=1522514&r2=1522515&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoDocumentStore.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoDocumentStore.java
Thu Sep 12 10:35:04 2013
@@ -113,7 +113,7 @@ public class MongoDocumentStore implemen
     }
     
     @Override
-    public void invalidateCache(Collection collection, String key) {
+    public <T extends Document> void invalidateCache(Collection<T> collection,
String key) {
         if (collection == Collection.NODES) {
             nodesCache.invalidate(key);
         }
@@ -159,8 +159,9 @@ public class MongoDocumentStore implemen
             if (doc == NodeDocument.NULL) {
                 return null;
             } else {
-                //noinspection unchecked
-                return (T) doc;
+                @SuppressWarnings("unchecked")
+                T result = (T) doc;
+                return result;
             }
         } catch (ExecutionException e) {
             throw new IllegalStateException("Failed to load document with " + key, e);
@@ -233,7 +234,7 @@ public class MongoDocumentStore implemen
     }
 
     @Override
-    public void remove(Collection collection, String key) {
+    public <T extends Document> void remove(Collection<T> collection, String
key) {
         log("remove", key);        
         DBCollection dbCollection = getDBCollection(collection);
         long start = start();
@@ -447,7 +448,7 @@ public class MongoDocumentStore implemen
         return copy;
     }
 
-    private DBCollection getDBCollection(Collection collection) {
+    private <T extends Document> DBCollection getDBCollection(Collection<T> collection)
{
         if (collection == Collection.NODES) {
             return nodes;
         } else if (collection == Collection.CLUSTER_NODES) {
@@ -485,7 +486,7 @@ public class MongoDocumentStore implemen
     }
     
     @Override
-    public boolean isCached(Collection collection, String key) {
+    public <T extends Document> boolean isCached(Collection<T> collection, String
key) {
         if (collection != Collection.NODES) {
             return false;
         }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMK.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMK.java?rev=1522515&r1=1522514&r2=1522515&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMK.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMK.java
Thu Sep 12 10:35:04 2013
@@ -382,7 +382,7 @@ public class MongoMK implements MicroKer
     }
 
     private void backgroundSplit() {
-        for (Iterator<String> it = splitCandidates.keySet().iterator(); it.hasNext();
) {
+        for (Iterator<String> it = splitCandidates.keySet().iterator(); it.hasNext();)
{
             String id = it.next();
             NodeDocument doc = store.find(Collection.NODES, id);
             if (doc == null) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Node.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Node.java?rev=1522515&r1=1522514&r2=1522515&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Node.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Node.java
Thu Sep 12 10:35:04 2013
@@ -122,7 +122,7 @@ public class Node implements CacheValue 
     static class Children implements CacheValue {
 
         final ArrayList<String> children = new ArrayList<String>();
-        boolean hasMore = false;
+        boolean hasMore;
 
         @Override
         public int getMemory() {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/NodeDocument.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/NodeDocument.java?rev=1522515&r1=1522514&r2=1522515&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/NodeDocument.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/NodeDocument.java
Thu Sep 12 10:35:04 2013
@@ -55,11 +55,13 @@ import static com.google.common.base.Pre
  */
 public class NodeDocument extends Document {
 
-    private static final Logger log = LoggerFactory.getLogger(NodeDocument.class);
-
-    private static final SortedMap<Revision, Range> EMPTY_RANGE_MAP
-            = Collections.unmodifiableSortedMap(new TreeMap<Revision, Range>());
+    /**
+     * Marker document, which indicates the document does not exist.
+     */
+    public static final NodeDocument NULL = new NodeDocument(new MemoryDocumentStore());
 
+    static final Logger LOG = LoggerFactory.getLogger(NodeDocument.class);
+    
     /**
      * A size threshold after which to consider a document a split candidate.
      * TODO: check which value is the best one
@@ -72,9 +74,19 @@ public class NodeDocument extends Docume
     static final int REVISIONS_SPLIT_OFF_SIZE = 1000;
 
     /**
-     * Marker document, which indicates the document does not exist.
+     * Revision collision markers set by commits with modifications, which
+     * overlap with un-merged branch commits.
+     * Key: revision, value:
      */
-    public static final NodeDocument NULL = new NodeDocument(new MemoryDocumentStore());
+    static final String COLLISIONS = "_collisions";
+
+    /**
+     * The modified time (5 second resolution).
+     */
+    static final String MODIFIED = "_modified";
+
+    private static final SortedMap<Revision, Range> EMPTY_RANGE_MAP = 
+            Collections.unmodifiableSortedMap(new TreeMap<Revision, Range>());
 
     /**
      * The list of revision to root commit depth mappings to find out if a
@@ -96,18 +108,6 @@ public class NodeDocument extends Docume
     private static final String DELETED = "_deleted";
 
     /**
-     * Revision collision markers set by commits with modifications, which
-     * overlap with un-merged branch commits.
-     * Key: revision, value:
-     */
-    static final String COLLISIONS = "_collisions";
-
-    /**
-     * The modified time (5 second resolution).
-     */
-    static final String MODIFIED = "_modified";
-
-    /**
      * The list of recent revisions for this node, where this node is the
      * root of the commit. Key: revision, value: true or the base revision of an
      * un-merged branch commit.
@@ -119,9 +119,9 @@ public class NodeDocument extends Docume
      */
     private static final String LAST_REV = "_lastRev";
 
-    private final long time = System.currentTimeMillis();
+    final DocumentStore store;
 
-    private final DocumentStore store;
+    private final long time = System.currentTimeMillis();
 
     NodeDocument(@Nonnull DocumentStore store) {
         this.store = checkNotNull(store);
@@ -261,6 +261,7 @@ public class NodeDocument extends Docume
     /**
      * Get the revision of the latest change made to this node.
      *
+     * @param context the revision context
      * @param changeRev the revision of the current change
      * @param handler the conflict handler, which is called for concurrent changes
      *                preceding <code>before</code>.
@@ -276,7 +277,7 @@ public class NodeDocument extends Docume
         if (data.containsKey(COMMIT_ROOT)) {
             revisions.addAll(((Map<String, Integer>) get(COMMIT_ROOT)).keySet());
         }
-        Map<String, String> deletedMap = (Map<String, String>)get(DELETED);
+        Map<String, String> deletedMap = (Map<String, String>) get(DELETED);
         if (deletedMap != null) {
             revisions.addAll(deletedMap.keySet());
         }
@@ -475,7 +476,8 @@ public class NodeDocument extends Docume
     /**
      * Get the earliest (oldest) revision where the node was alive at or before
      * the provided revision, if the node was alive at the given revision.
-     *
+     * 
+     * @param context the revision context
      * @param maxRev the maximum revision to return
      * @param validRevisions the set of revisions already checked against maxRev
      *            and considered valid.
@@ -756,7 +758,7 @@ public class NodeDocument extends Docume
         if (commitRootPath == null) {
             // shouldn't happen, either node is commit root for a revision
             // or has a reference to the commit root
-            log.warn("Node {} does not have commit root reference for revision {}",
+            LOG.warn("Node {} does not have commit root reference for revision {}",
                     getId(), rev);
             return null;
         }
@@ -883,7 +885,7 @@ public class NodeDocument extends Docume
      * @return the value, or null if not found
      */
     @CheckForNull
-    private String getLatestValue(@Nonnull RevisionContext context,
+    private static String getLatestValue(@Nonnull RevisionContext context,
                                   @Nonnull Map<String, String> valueMap,
                                   @Nullable Revision min,
                                   @Nonnull Revision max) {
@@ -905,7 +907,7 @@ public class NodeDocument extends Docume
         return value;
     }
 
-    private Map<String, String> getRevisions() {
+    Map<String, String> getRevisions() {
         final Map<String, String> map = getRevisionsMap();
         if (!data.containsKey(PREVIOUS)) {
             return map;
@@ -1003,7 +1005,7 @@ public class NodeDocument extends Docume
      * @param revision the revision to match or <code>null</code>.
      * @return previous documents.
      */
-    private Iterable<NodeDocument> getPreviousDocs(final @Nullable Revision revision)
{
+    Iterable<NodeDocument> getPreviousDocs(@Nullable final Revision revision) {
         Iterable<NodeDocument> docs = Iterables.transform(
                 Iterables.filter(getPreviousRanges().entrySet(),
                 new Predicate<Map.Entry<Revision, Range>>() {
@@ -1019,7 +1021,7 @@ public class NodeDocument extends Docume
                 String prevId = Utils.getPreviousIdFor(getId(), r);
                 NodeDocument prev = store.find(Collection.NODES, prevId);
                 if (prev == null) {
-                    log.warn("Document with previous revisions not found: " + prevId);
+                    LOG.warn("Document with previous revisions not found: " + prevId);
                 }
                 return prev;
             }
@@ -1052,6 +1054,9 @@ public class NodeDocument extends Docume
         return previous;
     }
 
+    /**
+     * A range of revisions.
+     */
     private static final class Range {
 
         final Revision high;
@@ -1088,5 +1093,7 @@ public class NodeDocument extends Docume
         public String toString() {
             return low.toString();
         }
+        
     }
+    
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/RevisionContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/RevisionContext.java?rev=1522515&r1=1522514&r2=1522515&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/RevisionContext.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/RevisionContext.java
Thu Sep 12 10:35:04 2013
@@ -27,17 +27,17 @@ public interface RevisionContext {
      * @return the branches of the local MongoMK instance, which are not yet
      *         merged.
      */
-    public UnmergedBranches getBranches();
+    UnmergedBranches getBranches();
 
     /**
      * @return the pending modifications.
      */
-    public UnsavedModifications getPendingModifications();
+    UnsavedModifications getPendingModifications();
 
     /**
      * @return the revision comparator.
      */
-    public Comparator<Revision> getRevisionComparator();
+    Comparator<Revision> getRevisionComparator();
 
     /**
      * Ensure the revision visible from now on, possibly by updating the head
@@ -46,10 +46,11 @@ public interface RevisionContext {
      * @param foreignRevision the revision from another cluster node
      * @param changeRevision the local revision that is sorted after the foreign revision
      */
-    public void publishRevision(Revision foreignRevision, Revision changeRevision);
+    void publishRevision(Revision foreignRevision, Revision changeRevision);
 
     /**
      * @return the cluster id of the local MongoMK instance.
      */
-    public int getClusterId();
+    int getClusterId();
+    
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/blob/gridfs/CommandExecutor.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/blob/gridfs/CommandExecutor.java?rev=1522515&r1=1522514&r2=1522515&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/blob/gridfs/CommandExecutor.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/blob/gridfs/CommandExecutor.java
Thu Sep 12 10:35:04 2013
@@ -35,6 +35,7 @@ public interface CommandExecutor {
      * If an retry behavior is specified this will be taken care of by the implementation
as well.
      * </p>
      *
+     * @param <T> the command type
      * @param command
      * @return The result of the execution.
      * @throws Exception If an error occurred while executing.

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/util/LoggingDocumentStoreWrapper.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/util/LoggingDocumentStoreWrapper.java?rev=1522515&r1=1522514&r2=1522515&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/util/LoggingDocumentStoreWrapper.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/util/LoggingDocumentStoreWrapper.java
Thu Sep 12 10:35:04 2013
@@ -99,7 +99,7 @@ public class LoggingDocumentStoreWrapper
     }
 
     @Override
-    public void remove(Collection collection, String key) {
+    public <T extends Document> void remove(Collection<T> collection, String
key) {
         try {
             logMethod("remove", collection, key);
             store.remove(collection, key);
@@ -157,7 +157,7 @@ public class LoggingDocumentStoreWrapper
     }
     
     @Override
-    public void invalidateCache(Collection collection, String key) {
+    public <T extends Document> void invalidateCache(Collection<T> collection,
String key) {
         try {
             logMethod("invalidateCache", collection, key);
             store.invalidateCache(collection, key);
@@ -179,7 +179,7 @@ public class LoggingDocumentStoreWrapper
     }
 
     @Override
-    public boolean isCached(Collection collection, String key) {
+    public <T extends Document> boolean isCached(Collection<T> collection, String
key) {
         try {
             logMethod("isCached", collection, key);
             return logResult(store.isCached(collection, key));

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/util/TimingDocumentStoreWrapper.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/util/TimingDocumentStoreWrapper.java?rev=1522515&r1=1522514&r2=1522515&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/util/TimingDocumentStoreWrapper.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/util/TimingDocumentStoreWrapper.java
Thu Sep 12 10:35:04 2013
@@ -135,7 +135,7 @@ public class TimingDocumentStoreWrapper 
     }
 
     @Override
-    public void remove(Collection collection, String key) {
+    public <T extends Document> void remove(Collection<T> collection, String
key) {
         try {
             long start = now();
             base.remove(collection, key);
@@ -197,7 +197,7 @@ public class TimingDocumentStoreWrapper 
     }
 
     @Override
-    public void invalidateCache(Collection collection, String key) {
+    public <T extends Document> void invalidateCache(Collection<T> collection,
String key) {
         try {
             long start = now();
             base.invalidateCache(collection, key);
@@ -219,7 +219,7 @@ public class TimingDocumentStoreWrapper 
     }
 
     @Override
-    public boolean isCached(Collection collection, String key) {
+    public <T extends Document> boolean isCached(Collection<T> collection, String
key) {
         try {
             long start = now();
             boolean result = base.isCached(collection, key);

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/DocumentSplitTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/DocumentSplitTest.java?rev=1522515&r1=1522514&r2=1522515&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/DocumentSplitTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/DocumentSplitTest.java
Thu Sep 12 10:35:04 2013
@@ -20,7 +20,6 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.jackrabbit.oak.plugins.mongomk.util.Utils;
-import org.junit.Ignore;
 import org.junit.Test;
 
 import com.google.common.collect.Sets;
@@ -41,7 +40,10 @@ public class DocumentSplitTest extends B
         NodeDocument doc = store.find(Collection.NODES, Utils.getIdFromPath("/"));
         assertNotNull(doc);
         revisions.addAll(doc.getRevisionsMap().keySet());
-        int numRevs = 1; // MongoMK initializes with a root node with a single revision
+        
+        // MongoMK initializes with a root node with a single revision
+        int numRevs = 1; 
+        
         revisions.add(mk.commit("/", "+\"foo\":{}+\"bar\":{}", null, null));
         numRevs++;
         // create nodes

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/IsolationTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/IsolationTest.java?rev=1522515&r1=1522514&r2=1522515&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/IsolationTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/IsolationTest.java
Thu Sep 12 10:35:04 2013
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.oak.plugins.mongomk;
 
-import org.junit.Ignore;
 import org.junit.Test;
 
 /**

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMKBranchTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMKBranchTest.java?rev=1522515&r1=1522514&r2=1522515&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMKBranchTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/MongoMKBranchTest.java
Thu Sep 12 10:35:04 2013
@@ -18,6 +18,7 @@ package org.apache.jackrabbit.oak.plugin
 
 import org.json.simple.JSONObject;
 import org.json.simple.parser.JSONParser;
+import org.json.simple.parser.ParseException;
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
@@ -44,9 +45,11 @@ public class MongoMKBranchTest extends B
      * </pre>
      * The test reads /child from <code>branchRev2</code> and expects
      * the version from the first commit.
+     * 
+     * @throws ParseException 
      */
     @Test
-    public void isolatedBranches() throws Exception {
+    public void isolatedBranches() throws ParseException {
         String rev1 = mk.commit("", "+\"/child1\":{}", null, "");
 
         String branchRev1 = mk.branch(rev1);
@@ -86,7 +89,7 @@ public class MongoMKBranchTest extends B
         String branchRev1 = mk.commit("/test/node", "+\"branch-node\":{}", branchRev, null);
 
         // trunk commit under /test/node
-        String rev1 = mk.commit("/test/node", "+\"trunk-node\":{}", null, null);
+        mk.commit("/test/node", "+\"trunk-node\":{}", null, null);
 
         // branch commit on /
         String branchRev2 = mk.commit("/", "+\"other\":{}", branchRev1, null);
@@ -111,7 +114,7 @@ public class MongoMKBranchTest extends B
         String rev1 = mk.commit("/test/node", "+\"trunk-node\":{}", null, null);
 
         // branch commit under /test/node
-        String branchRev1 = mk.commit("/test/node", "+\"branch-node\":{}", branchRev, null);
+        mk.commit("/test/node", "+\"branch-node\":{}", branchRev, null);
 
         // trunk commit on /
         String rev2 = mk.commit("/", "+\"other\":{}", null, null);

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/impl/MongoMKConcurrentAddTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/impl/MongoMKConcurrentAddTest.java?rev=1522515&r1=1522514&r2=1522515&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/impl/MongoMKConcurrentAddTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/impl/MongoMKConcurrentAddTest.java
Thu Sep 12 10:35:04 2013
@@ -63,6 +63,8 @@ public class MongoMKConcurrentAddTest ex
      * Creates NB_THREADS microkernels, each commiting two nodes (one parent,
      * one child) in its own thread. The nodes being committed by separate
      * threads do not overlap / conflict.
+     * 
+     * @throws Exception 
      */
     @Test
     public void testConcurrentAdd() throws Exception {

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/impl/MongoMKLimitsTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/impl/MongoMKLimitsTest.java?rev=1522515&r1=1522514&r2=1522515&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/impl/MongoMKLimitsTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/impl/MongoMKLimitsTest.java
Thu Sep 12 10:35:04 2013
@@ -37,7 +37,7 @@ public class MongoMKLimitsTest extends A
      */
     @Test
     @Ignore
-    public void pathLimit() throws Exception {
+    public void pathLimit() {
         String path = "/";
         String baseNodeName = "testingtestingtesting";
         int numberOfCommits = 100;
@@ -61,7 +61,7 @@ public class MongoMKLimitsTest extends A
      */
     @Test
     @Ignore
-    public void overMaxBSONLimit() throws Exception {
+    public void overMaxBSONLimit() {
         String path = "/";
         String baseNodeName = "N";
         StringBuilder jsonDiff = new StringBuilder();

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/QueryObjectModelImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/QueryObjectModelImpl.java?rev=1522515&r1=1522514&r2=1522515&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/QueryObjectModelImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/QueryObjectModelImpl.java
Thu Sep 12 10:35:04 2013
@@ -192,6 +192,7 @@ public class QueryObjectModelImpl implem
         this.bindVariableMap.put(var.getBindVariableName(), null);
     }
 
+    @Override
     public String toString() {
         return getStatement();
     }



Mime
View raw message