jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1036356 - in /jackrabbit/trunk/jackrabbit-core/src: main/java/org/apache/jackrabbit/core/persistence/bundle/ main/java/org/apache/jackrabbit/core/persistence/pool/ main/resources/org/apache/jackrabbit/core/config/ test/java/org/apache/jack...
Date Thu, 18 Nov 2010 08:57:56 GMT
Author: jukka
Date: Thu Nov 18 08:57:56 2010
New Revision: 1036356

URL: http://svn.apache.org/viewvc?rev=1036356&view=rev
Log:
JCR-2803: Deprecate non-pooled bundle DB persistence managers

Merge the duplicate AbstractBundlePersistenceManager classes.
Remove/deprecate the odd "pooled" bundle *fs* persistence manager.

Removed:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/pool/AbstractBundlePersistenceManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/pool/BundleFsPersistenceManager.java
Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/pool/BundleDbPersistenceManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/config/deprecated-classes.properties
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/PersistenceManagerIteratorTest.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java?rev=1036356&r1=1036355&r2=1036356&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java
Thu Nov 18 08:57:56 2010
@@ -20,39 +20,39 @@ import static org.apache.jackrabbit.spi.
 import static org.apache.jackrabbit.spi.commons.name.NameConstants.JCR_PRIMARYTYPE;
 import static org.apache.jackrabbit.spi.commons.name.NameConstants.JCR_UUID;
 
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.jcr.PropertyType;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.jackrabbit.core.cache.ConcurrentCache;
 import org.apache.jackrabbit.core.fs.FileSystemResource;
 import org.apache.jackrabbit.core.fs.FileSystem;
-import org.apache.jackrabbit.core.state.ItemState;
-import org.apache.jackrabbit.core.state.ChangeLog;
-import org.apache.jackrabbit.core.state.ItemStateException;
-import org.apache.jackrabbit.core.state.NodeReferences;
-import org.apache.jackrabbit.core.state.NoSuchItemStateException;
-import org.apache.jackrabbit.core.state.PropertyState;
-import org.apache.jackrabbit.core.state.NodeState;
 import org.apache.jackrabbit.core.id.ItemId;
 import org.apache.jackrabbit.core.id.NodeId;
 import org.apache.jackrabbit.core.id.PropertyId;
-import org.apache.jackrabbit.core.value.InternalValue;
 import org.apache.jackrabbit.core.persistence.CachingPersistenceManager;
 import org.apache.jackrabbit.core.persistence.IterablePersistenceManager;
 import org.apache.jackrabbit.core.persistence.PMContext;
 import org.apache.jackrabbit.core.persistence.PersistenceManager;
-import org.apache.jackrabbit.core.util.StringIndex;
 import org.apache.jackrabbit.core.persistence.util.BLOBStore;
 import org.apache.jackrabbit.core.persistence.util.FileBasedIndex;
 import org.apache.jackrabbit.core.persistence.util.NodePropBundle;
 import org.apache.jackrabbit.core.persistence.util.NodePropBundle.PropertyEntry;
+import org.apache.jackrabbit.core.state.ItemState;
+import org.apache.jackrabbit.core.state.ChangeLog;
+import org.apache.jackrabbit.core.state.ItemStateException;
+import org.apache.jackrabbit.core.state.NodeReferences;
+import org.apache.jackrabbit.core.state.NoSuchItemStateException;
+import org.apache.jackrabbit.core.state.PropertyState;
+import org.apache.jackrabbit.core.state.NodeState;
+import org.apache.jackrabbit.core.util.StringIndex;
+import org.apache.jackrabbit.core.value.InternalValue;
 import org.apache.jackrabbit.spi.Name;
 
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.jcr.PropertyType;
-
 /**
  * The <code>AbstractBundlePersistenceManager</code> acts as base for all
  * persistence managers that store the state in a {@link NodePropBundle}.
@@ -380,11 +380,11 @@ public abstract class AbstractBundlePers
         bundles = new ConcurrentCache<NodeId, NodePropBundle>();
         bundles.setMaxMemorySize(bundleCacheSize);
     }
-    
+
     /**
      * {@inheritDoc}
-     *  
-     *  Closes the persistence manager, release acquired resourecs.
+     *
+     *  Closes the persistence manager, release acquired resources.
      */
     public void close() throws Exception {
         // clear caches
@@ -396,8 +396,7 @@ public abstract class AbstractBundlePers
      *
      * Loads the state via the appropriate NodePropBundle.
      */
-    public NodeState load(NodeId id)
-            throws NoSuchItemStateException, ItemStateException {
+    public NodeState load(NodeId id) throws NoSuchItemStateException, ItemStateException
{
         NodePropBundle bundle = getBundle(id);
         if (bundle == null) {
             throw new NoSuchItemStateException(id.toString());
@@ -410,8 +409,7 @@ public abstract class AbstractBundlePers
      *
      * Loads the state via the appropriate NodePropBundle.
      */
-    public PropertyState load(PropertyId id)
-            throws NoSuchItemStateException, ItemStateException {
+    public PropertyState load(PropertyId id) throws NoSuchItemStateException, ItemStateException
{
         NodePropBundle bundle = getBundle(id.getParentId());
         if (bundle != null) {
             PropertyState state = createNew(id);
@@ -513,7 +511,7 @@ public abstract class AbstractBundlePers
 
     /**
      * Stores the given changelog and updates the bundle cache.
-     * 
+     *
      * @param changeLog the changelog to store
      * @throws ItemStateException on failure
      */
@@ -543,7 +541,7 @@ public abstract class AbstractBundlePers
         for (ItemState state : changeLog.modifiedStates()) {
             if (state.isNode()) {
                 NodeId nodeId = (NodeId) state.getId();
-                NodePropBundle bundle = (NodePropBundle) modified.get(nodeId);
+                NodePropBundle bundle = modified.get(nodeId);
                 if (bundle == null) {
                     bundle = getBundle(nodeId);
                     if (bundle == null) {
@@ -561,7 +559,7 @@ public abstract class AbstractBundlePers
                     continue;
                 }
                 NodeId nodeId = id.getParentId();
-                NodePropBundle bundle = (NodePropBundle) modified.get(nodeId);
+                NodePropBundle bundle = modified.get(nodeId);
                 if (bundle == null) {
                     bundle = getBundle(nodeId);
                     if (bundle == null) {
@@ -584,7 +582,7 @@ public abstract class AbstractBundlePers
                 PropertyId id = (PropertyId) state.getId();
                 NodeId nodeId = id.getParentId();
                 if (!deleted.contains(nodeId)) {
-                    NodePropBundle bundle = (NodePropBundle) modified.get(nodeId);
+                    NodePropBundle bundle = modified.get(nodeId);
                     if (bundle == null) {
                         // should actually not happen
                         log.warn("deleted property state's parent not modified!");
@@ -609,7 +607,7 @@ public abstract class AbstractBundlePers
                     continue;
                 }
                 NodeId nodeId = id.getParentId();
-                NodePropBundle bundle = (NodePropBundle) modified.get(nodeId);
+                NodePropBundle bundle = modified.get(nodeId);
                 if (bundle == null) {
                     // should actually not happen
                     log.warn("added property state's parent not modified!");
@@ -687,8 +685,8 @@ public abstract class AbstractBundlePers
         bundle.markOld();
         log.debug("stored bundle {}", bundle.getId());
 
-        // only put to cache if already exists. this is to ensure proper overwrite
-        // and not creating big contention during bulk loads
+        // only put to cache if already exists. this is to ensure proper
+        // overwrite and not creating big contention during bulk loads
         if (bundles.containsKey(bundle.getId())) {
             bundles.put(bundle.getId(), bundle, bundle.getSize());
         }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/pool/BundleDbPersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/pool/BundleDbPersistenceManager.java?rev=1036356&r1=1036355&r2=1036356&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/pool/BundleDbPersistenceManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/pool/BundleDbPersistenceManager.java
Thu Nov 18 08:57:56 2010
@@ -40,6 +40,7 @@ import org.apache.jackrabbit.core.fs.loc
 import org.apache.jackrabbit.core.id.NodeId;
 import org.apache.jackrabbit.core.id.PropertyId;
 import org.apache.jackrabbit.core.persistence.PMContext;
+import org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager;
 import org.apache.jackrabbit.core.persistence.util.BundleBinding;
 import org.apache.jackrabbit.core.persistence.util.ErrorHandling;
 import org.apache.jackrabbit.core.persistence.util.NodePropBundle;
@@ -81,7 +82,8 @@ import org.slf4j.LoggerFactory;
  * <li>&lt;param name="{@link #setSchemaCheckEnabled(String) schemaCheckEnabled}"
value="true"/>
  * </ul>
  */
-public class BundleDbPersistenceManager extends AbstractBundlePersistenceManager implements
DatabaseAware {
+public class BundleDbPersistenceManager
+        extends AbstractBundlePersistenceManager implements DatabaseAware {
 
     /** the default logger */
     private static Logger log = LoggerFactory.getLogger(BundleDbPersistenceManager.class);

Modified: jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/config/deprecated-classes.properties
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/config/deprecated-classes.properties?rev=1036356&r1=1036355&r2=1036356&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/config/deprecated-classes.properties
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/config/deprecated-classes.properties
Thu Nov 18 08:57:56 2010
@@ -35,3 +35,6 @@ org.apache.jackrabbit.core.state.obj.Obj
 
 # XML persistence manager
 org.apache.jackrabbit.core.state.xml.XMLPersistenceManager=org.apache.jackrabbit.core.persistence.xml.XMLPersistenceManager
+
+# "Pooled" bundle fs persistence manager
+org.apache.jackrabbit.core.persistence.pool.BundleFsPersistenceManager=org.apache.jackrabbit.core.persistence.bundle.BundleFsPersistenceManager

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/PersistenceManagerIteratorTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/PersistenceManagerIteratorTest.java?rev=1036356&r1=1036355&r2=1036356&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/PersistenceManagerIteratorTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/PersistenceManagerIteratorTest.java
Thu Nov 18 08:57:56 2010
@@ -21,7 +21,7 @@ import org.apache.jackrabbit.core.Reposi
 import org.apache.jackrabbit.core.config.RepositoryConfig;
 import org.apache.jackrabbit.core.config.WorkspaceConfig;
 import org.apache.jackrabbit.core.persistence.PersistenceManager;
-import org.apache.jackrabbit.core.persistence.pool.AbstractBundlePersistenceManager;
+import org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager;
 import org.apache.jackrabbit.test.AbstractJCRTest;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;



Mime
View raw message