[exo-jcr-commits] exo-jcr SVN: r5956 - in jcr/trunk: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene and 4 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Mar 26 03:48:11 EDT 2012


Author: dkuleshov
Date: 2012-03-26 03:48:10 -0400 (Mon, 26 Mar 2012)
New Revision: 5956

Added:
   jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/distributed-cache-configuration.xml
Modified:
   jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/CacheKey.java
   jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/ISPNCacheFactory.java
   jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/portal/cluster/infinispan-data.xml
   jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-infinispan-config.xml
   jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DocNumberCache.java
   jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/master.xml
   jcr/trunk/pom.xml
Log:
EXOJCR-1739: ported issues:
* EXOJCR-1715
* EXOJCR-1736
* EXOJCR-1789
* EXOJCR-1800

Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DocNumberCache.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DocNumberCache.java	2012-03-26 07:27:46 UTC (rev 5955)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DocNumberCache.java	2012-03-26 07:48:10 UTC (rev 5956)
@@ -150,7 +150,7 @@
       {
          entry = (Entry)cacheSegment.get(key);
       }
-      if (log.isInfoEnabled())
+      if (log.isDebugEnabled())
       {
          accesses++;
          if (entry == null)
@@ -165,7 +165,7 @@
             {
                ratio -= misses * 100L / accesses;
             }
-            StringBuffer statistics = new StringBuffer();
+            StringBuilder statistics = new StringBuilder();
             int inUse = 0;
             for (int i = 0; i < docNumbers.length; i++)
             {
@@ -177,7 +177,7 @@
             statistics.append(", #hits=").append((accesses - misses));
             statistics.append(", #misses=").append(misses);
             statistics.append(", cacheRatio=").append(ratio).append("%");
-            log.info(statistics.toString());
+            log.debug(statistics.toString());
             accesses = 0;
             misses = 0;
             lastLog = System.currentTimeMillis();

Modified: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/CacheKey.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/CacheKey.java	2012-03-26 07:27:46 UTC (rev 5955)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/CacheKey.java	2012-03-26 07:48:10 UTC (rev 5956)
@@ -45,21 +45,21 @@
     * the workspace is not distributed the value of this variable will be
     * null to avoid consuming more memory for nothing 
     */
-   protected String ownerId;
+   private String ownerId;
    
-   protected String id;
+   private String id;
 
-   protected int hash;
+   private int hash;
 
    /**
     * The value used in case, the grouping is enabled
     */
-   protected String group;
+   private String group;
    
    /**
     * The full name of the group
     */
-   protected String fullGroupName;
+   private String fullGroupName;
    
    public CacheKey()
    {
@@ -74,7 +74,11 @@
    {
       this.ownerId = ownerId;
       this.id = id;
-      this.hash = id.hashCode();
+      final int prime = 31;
+      int result = 1;
+      result = prime * result + ((id == null) ? 0 : id.hashCode());
+      result = prime * result + ((ownerId == null) ? 0 : ownerId.hashCode());
+      this.hash = result;
       this.group = group;
    }
    
@@ -195,7 +199,11 @@
       buf = new byte[in.readInt()];
       in.readFully(buf);
       id = new String(buf, Constants.DEFAULT_ENCODING);
-      hash = id.hashCode();
+      final int prime = 31;
+      int result = 1;
+      result = prime * result + ((id == null) ? 0 : id.hashCode());
+      result = prime * result + ((ownerId == null) ? 0 : ownerId.hashCode());
+      hash = result;
    }
 
    /**

Modified: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/ISPNCacheFactory.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/ISPNCacheFactory.java	2012-03-26 07:27:46 UTC (rev 5955)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/ISPNCacheFactory.java	2012-03-26 07:48:10 UTC (rev 5956)
@@ -35,13 +35,10 @@
 import org.infinispan.configuration.global.GlobalConfigurationBuilder;
 import org.infinispan.configuration.parsing.ConfigurationBuilderHolder;
 import org.infinispan.configuration.parsing.Parser;
-import org.infinispan.distribution.ch.ConsistentHash;
-import org.infinispan.distribution.ch.DefaultConsistentHash;
 import org.infinispan.jmx.MBeanServerLookup;
 import org.infinispan.manager.DefaultCacheManager;
 import org.infinispan.manager.EmbeddedCacheManager;
 import org.infinispan.transaction.lookup.TransactionManagerLookup;
-import org.infinispan.util.Util;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -71,16 +68,16 @@
    public static final String INFINISPAN_CONFIG = "infinispan-configuration";
 
    private final ConfigurationManager configurationManager;
-   
+
    private final TransactionManager transactionManager;
 
    private final TemplateConfigurationHelper configurationHelper;
 
-   private static final Log LOG = ExoLogger
-      .getLogger("exo.jcr.component.core.impl.infinispan.v5.InfinispanCacheFactory");
+   private static final Log LOG = ExoLogger//NOSONAR
+      .getLogger("exo.jcr.component.core.impl.infinispan.v5.InfinispanCacheFactory");//NOSONAR
 
    /**
-    * A Map that contains all the registered CacheManager order by cluster name.    
+    * A Map that contains all the registered CacheManager order by cluster name.
     */
    private static Map<String, EmbeddedCacheManager> CACHE_MANAGERS = new HashMap<String, EmbeddedCacheManager>();
 
@@ -190,9 +187,9 @@
     * has already been registered for the same current container.
     * If no cache manager has been registered, we register the given cache manager otherwise we
     * use the previously registered cache manager and we define a dedicated region for the related cache.
+    * @param regionId the unique id of the cache region to create
     * @param holder the configuration holder of the the cache to create
     * @param tm the transaction manager to put into the configuration of the cache
-    * @param manager the current cache manager of the cache to create
     * @return the given cache manager if it has not been registered otherwise the cache manager of the same
     * type that has already been registered..
     */
@@ -237,17 +234,8 @@
                return tm;
             }
          };
-         confBuilder.transaction().transactionManagerLookup(tml);
+         confBuilder.transaction().transactionManagerLookup(tml);         
       }
-      //TODO remove it once ISPN-1687 will be fixed
-      confBuilder.storeAsBinary().enabled(false);
-      //TODO remove it once ISPN-1689 will be fixed
-      confBuilder
-         .clustering()
-         .hash()
-         .consistentHash(
-            Util.<ConsistentHash> getInstance(DefaultConsistentHash.class.getName(), Thread.currentThread()
-               .getContextClassLoader()));
       Configuration conf = holder.getDefaultConfigurationBuilder().build();
       // Define the configuration of the cache
       manager.defineConfiguration(regionId, conf);

Modified: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/portal/cluster/infinispan-data.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/portal/cluster/infinispan-data.xml	2012-03-26 07:27:46 UTC (rev 5955)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/portal/cluster/infinispan-data.xml	2012-03-26 07:48:10 UTC (rev 5956)
@@ -49,7 +49,7 @@
       <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="20000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="true"/>
       <transaction transactionManagerLookupClass="org.exoplatform.services.transaction.infinispan.JBossStandaloneJTAManagerLookup" syncRollbackPhase="true" syncCommitPhase="true" transactionMode="TRANSACTIONAL"/>
       <jmxStatistics enabled="true"/>
-      <eviction strategy="LRU" threadPolicy="DEFAULT" maxEntries="1000000"/>
+      <eviction strategy="LIRS" threadPolicy="DEFAULT" maxEntries="1000000"/>
       <expiration wakeUpInterval="5000"/>
    </default>
 </infinispan>

Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/distributed-cache-configuration.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/distributed-cache-configuration.xml	                        (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/distributed-cache-configuration.xml	2012-03-26 07:48:10 UTC (rev 5956)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright (C) 2010 eXo Platform SAS.
+
+    This is free software; you can redistribute it and/or modify it
+    under the terms of the GNU Lesser General Public License as
+    published by the Free Software Foundation; either version 2.1 of
+    the License, or (at your option) any later version.
+
+    This software is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this software; if not, write to the Free
+    Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+    02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
+	xmlns="urn:infinispan:config:5.1">
+   <global>
+      <globalJmxStatistics jmxDomain="exo" enabled="true" allowDuplicateDomains="true"/>
+      <transport transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport" clusterName="JCR-cluster" distributedSyncTimeout="20000">
+      	<properties>
+         <property name="configurationFile" value="tcp-mux-v3.xml"/>
+      	</properties>
+      </transport>
+      <shutdown hookBehavior="DEFAULT"/>
+   </global>
+   <namedCache name="JCRCache">
+      <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="120000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="true" />
+      <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup" syncRollbackPhase="true" syncCommitPhase="true" eagerLockSingleNode="true" transactionMode="TRANSACTIONAL"/>
+      <jmxStatistics enabled="true"/>
+      <clustering mode="distribution">
+         <l1 enabled="true" invalidationThreshold="-1"/>
+         <hash numOwners="2" rehashRpcTimeout="120000">
+         	<groups enabled="true"/>
+         </hash>
+         <sync replTimeout="180000"/>
+      </clustering>
+   </namedCache>
+   <namedCache name="eXoCache">
+      <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="120000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="true" />
+      <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup" syncRollbackPhase="true" syncCommitPhase="true" eagerLockSingleNode="true" transactionMode="TRANSACTIONAL"/>
+      <jmxStatistics enabled="true"/>
+      <clustering mode="distribution">
+         <l1 enabled="true" invalidationThreshold="-1"/>
+         <hash numOwners="2" rehashRpcTimeout="120000"/>
+         <sync replTimeout="180000"/>
+      </clustering>
+   </namedCache>
+</infinispan>
\ No newline at end of file

Modified: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-infinispan-config.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-infinispan-config.xml	2012-03-26 07:27:46 UTC (rev 5955)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-infinispan-config.xml	2012-03-26 07:48:10 UTC (rev 5956)
@@ -49,7 +49,7 @@
       <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="20000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="true"/>
       <transaction transactionManagerLookupClass="org.exoplatform.services.transaction.infinispan.JBossStandaloneJTAManagerLookup" syncRollbackPhase="true" syncCommitPhase="true"/>
       <jmxStatistics enabled="true"/>
-      <eviction strategy="LRU" threadPolicy="DEFAULT" maxEntries="1000000"/>
+      <eviction strategy="LIRS" threadPolicy="DEFAULT" maxEntries="1000000"/>
       <expiration wakeUpInterval="5000"/>
    </default>
 </infinispan>

Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/master.xml
===================================================================
--- jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/master.xml	2012-03-26 07:27:46 UTC (rev 5955)
+++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/master.xml	2012-03-26 07:48:10 UTC (rev 5956)
@@ -41,8 +41,8 @@
     <subtitle>Java Content Repository and Extension services</subtitle>
 
     <copyright>
-      <year>2009, 2010</year>
-      <holder>eXoPlatform</holder>
+      <year>2012</year>
+      <holder>eXoPlatform SAS</holder>
     </copyright>
   </bookinfo>
 

Modified: jcr/trunk/pom.xml
===================================================================
--- jcr/trunk/pom.xml	2012-03-26 07:27:46 UTC (rev 5955)
+++ jcr/trunk/pom.xml	2012-03-26 07:48:10 UTC (rev 5956)
@@ -402,12 +402,12 @@
       <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-core</artifactId>
-        <version>5.1.0.CR3</version>
+        <version>5.1.2.FINAL</version>
       </dependency>
       <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-cachestore-jdbc</artifactId>
-        <version>5.1.0.CR3</version>
+        <version>5.1.2.FINAL</version>
       </dependency>
       <dependency>
         <groupId>commons-io</groupId>



More information about the exo-jcr-commits mailing list