exo-jcr SVN: r1274 - jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache.
by do-not-reply@jboss.org
Author: skabashnyuk
Date: 2010-01-04 07:49:51 -0500 (Mon, 04 Jan 2010)
New Revision: 1274
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/ExoEvictionActionPolicy.java
Log:
EXOJCR-361 : logger removed
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/ExoEvictionActionPolicy.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/ExoEvictionActionPolicy.java 2010-01-04 12:39:05 UTC (rev 1273)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/ExoEvictionActionPolicy.java 2010-01-04 12:49:51 UTC (rev 1274)
@@ -60,10 +60,8 @@
{
try
{
- // if (LOG.isDebugEnabled())
- // LOG.debug("Evicting Fqn " + fqn);
- //For testing
- LOG.info("Evicting Fqn " + fqn);
+ if (LOG.isDebugEnabled())
+ LOG.debug("Evicting Fqn " + fqn);
cache.evict(fqn);
return true;
16 years, 4 months
exo-jcr SVN: r1273 - jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache.
by do-not-reply@jboss.org
Author: skabashnyuk
Date: 2010-01-04 07:39:05 -0500 (Mon, 04 Jan 2010)
New Revision: 1273
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/ExoEvictionActionPolicy.java
Log:
EXOJCR-361 : logger enabled
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/ExoEvictionActionPolicy.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/ExoEvictionActionPolicy.java 2010-01-04 12:26:21 UTC (rev 1272)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/ExoEvictionActionPolicy.java 2010-01-04 12:39:05 UTC (rev 1273)
@@ -30,8 +30,7 @@
* @author <a href="mailto:alex.reshetnyak@exoplatform.com.ua">Alex Reshetnyak</a>
* @version $Id$
*/
-public class ExoEvictionActionPolicy
- implements EvictionActionPolicy
+public class ExoEvictionActionPolicy implements EvictionActionPolicy
{
private static final Log LOG = ExoLogger.getLogger("jcr.ExoEvictionActionPolicy");
@@ -61,8 +60,10 @@
{
try
{
- if (LOG.isDebugEnabled())
- LOG.debug("Evicting Fqn " + fqn);
+ // if (LOG.isDebugEnabled())
+ // LOG.debug("Evicting Fqn " + fqn);
+ //For testing
+ LOG.info("Evicting Fqn " + fqn);
cache.evict(fqn);
return true;
16 years, 4 months
exo-jcr SVN: r1272 - jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster.
by do-not-reply@jboss.org
Author: skabashnyuk
Date: 2010-01-04 07:26:21 -0500 (Mon, 04 Jan 2010)
New Revision: 1272
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws.xml
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws1.xml
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws2.xml
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws3.xml
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-wstck.xml
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-wstck1.xml
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-wstck2.xml
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-indexer-config-exoloader_db1_ws.xml
Log:
EXOJCR-361 : Eviction added
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws.xml 2010-01-04 12:19:22 UTC (rev 1271)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws.xml 2010-01-04 12:26:21 UTC (rev 1272)
@@ -83,4 +83,15 @@
<!-- Enable batching -->
<invocationBatching enabled="true" />
+ <!-- Eviction configuration -->
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
+ <property name="maxNodes" value="5000" />
+ <property name="timeToLiveSeconds" value="120" />
+ </default>
+ <region name="/" algorithmClass="org.jboss.cache.eviction.LRUAlgorithm" actionPolicyClass="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.ExoEvictionActionPolicy" eventQueueSize="1000000">
+ <property name="maxNodes" value="5000" />
+ <property name="timeToLiveSeconds" value="120" />
+ </region>
+ </eviction>
</jbosscache>
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws1.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws1.xml 2010-01-04 12:19:22 UTC (rev 1271)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws1.xml 2010-01-04 12:26:21 UTC (rev 1272)
@@ -83,4 +83,15 @@
<!-- Enable batching -->
<invocationBatching enabled="true" />
+ <!-- Eviction configuration -->
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
+ <property name="maxNodes" value="5000" />
+ <property name="timeToLiveSeconds" value="120" />
+ </default>
+ <region name="/" algorithmClass="org.jboss.cache.eviction.LRUAlgorithm" actionPolicyClass="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.ExoEvictionActionPolicy" eventQueueSize="1000000">
+ <property name="maxNodes" value="5000" />
+ <property name="timeToLiveSeconds" value="120" />
+ </region>
+ </eviction>
</jbosscache>
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws2.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws2.xml 2010-01-04 12:19:22 UTC (rev 1271)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws2.xml 2010-01-04 12:26:21 UTC (rev 1272)
@@ -83,4 +83,15 @@
<!-- Enable batching -->
<invocationBatching enabled="true" />
+ <!-- Eviction configuration -->
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
+ <property name="maxNodes" value="5000" />
+ <property name="timeToLiveSeconds" value="120" />
+ </default>
+ <region name="/" algorithmClass="org.jboss.cache.eviction.LRUAlgorithm" actionPolicyClass="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.ExoEvictionActionPolicy" eventQueueSize="1000000">
+ <property name="maxNodes" value="5000" />
+ <property name="timeToLiveSeconds" value="120" />
+ </region>
+ </eviction>
</jbosscache>
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws3.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws3.xml 2010-01-04 12:19:22 UTC (rev 1271)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws3.xml 2010-01-04 12:26:21 UTC (rev 1272)
@@ -83,4 +83,15 @@
<!-- Enable batching -->
<invocationBatching enabled="true" />
+ <!-- Eviction configuration -->
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
+ <property name="maxNodes" value="5000" />
+ <property name="timeToLiveSeconds" value="120" />
+ </default>
+ <region name="/" algorithmClass="org.jboss.cache.eviction.LRUAlgorithm" actionPolicyClass="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.ExoEvictionActionPolicy" eventQueueSize="1000000">
+ <property name="maxNodes" value="5000" />
+ <property name="timeToLiveSeconds" value="120" />
+ </region>
+ </eviction>
</jbosscache>
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-wstck.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-wstck.xml 2010-01-04 12:19:22 UTC (rev 1271)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-wstck.xml 2010-01-04 12:26:21 UTC (rev 1272)
@@ -83,4 +83,15 @@
<!-- Enable batching -->
<invocationBatching enabled="true" />
+ <!-- Eviction configuration -->
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
+ <property name="maxNodes" value="5000" />
+ <property name="timeToLiveSeconds" value="120" />
+ </default>
+ <region name="/" algorithmClass="org.jboss.cache.eviction.LRUAlgorithm" actionPolicyClass="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.ExoEvictionActionPolicy" eventQueueSize="1000000">
+ <property name="maxNodes" value="5000" />
+ <property name="timeToLiveSeconds" value="120" />
+ </region>
+ </eviction>
</jbosscache>
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-wstck1.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-wstck1.xml 2010-01-04 12:19:22 UTC (rev 1271)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-wstck1.xml 2010-01-04 12:26:21 UTC (rev 1272)
@@ -83,4 +83,16 @@
<!-- Enable batching -->
<invocationBatching enabled="true" />
+ <!-- Eviction configuration -->
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
+ <property name="maxNodes" value="5000" />
+ <property name="timeToLiveSeconds" value="120" />
+ </default>
+ <region name="/" algorithmClass="org.jboss.cache.eviction.LRUAlgorithm" actionPolicyClass="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.ExoEvictionActionPolicy" eventQueueSize="1000000">
+ <property name="maxNodes" value="5000" />
+ <property name="timeToLiveSeconds" value="120" />
+ </region>
+ </eviction>
+
</jbosscache>
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-wstck2.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-wstck2.xml 2010-01-04 12:19:22 UTC (rev 1271)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-wstck2.xml 2010-01-04 12:26:21 UTC (rev 1272)
@@ -83,4 +83,15 @@
<!-- Enable batching -->
<invocationBatching enabled="true" />
+ <!-- Eviction configuration -->
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
+ <property name="maxNodes" value="5000" />
+ <property name="timeToLiveSeconds" value="120" />
+ </default>
+ <region name="/" algorithmClass="org.jboss.cache.eviction.LRUAlgorithm" actionPolicyClass="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.ExoEvictionActionPolicy" eventQueueSize="1000000">
+ <property name="maxNodes" value="5000" />
+ <property name="timeToLiveSeconds" value="120" />
+ </region>
+ </eviction>
</jbosscache>
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-indexer-config-exoloader_db1_ws.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-indexer-config-exoloader_db1_ws.xml 2010-01-04 12:19:22 UTC (rev 1271)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-indexer-config-exoloader_db1_ws.xml 2010-01-04 12:26:21 UTC (rev 1272)
@@ -70,4 +70,15 @@
<sync />
</clustering>
<invocationBatching enabled="false" />
+ <!-- Eviction configuration -->
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
+ <property name="maxNodes" value="5000" />
+ <property name="timeToLiveSeconds" value="120" />
+ </default>
+ <region name="/" algorithmClass="org.jboss.cache.eviction.LRUAlgorithm" actionPolicyClass="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.ExoEvictionActionPolicy" eventQueueSize="1000000">
+ <property name="maxNodes" value="5000" />
+ <property name="timeToLiveSeconds" value="120" />
+ </region>
+ </eviction>
</jbosscache>
16 years, 4 months
exo-jcr SVN: r1271 - in jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test: resources/conf/cluster and 1 other directory.
by do-not-reply@jboss.org
Author: skabashnyuk
Date: 2010-01-04 07:19:22 -0500 (Mon, 04 Jan 2010)
New Revision: 1271
Added:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestPrintNodes.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestWriteAndQuery.java
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws.xml
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws1.xml
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws2.xml
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws3.xml
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-wstck.xml
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-wstck1.xml
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-wstck2.xml
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-indexer-config-exoloader_db1_ws.xml
Log:
EXOJCR-361 : Test and configuration for cluster
Added: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestPrintNodes.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestPrintNodes.java (rev 0)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestPrintNodes.java 2010-01-04 12:19:22 UTC (rev 1271)
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2009 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.
+ */
+package org.exoplatform.services.jcr.lab.cluster.test;
+
+import org.exoplatform.services.jcr.JcrAPIBaseTest;
+
+import javax.jcr.NodeIterator;
+import javax.jcr.RepositoryException;
+
+/**
+ * @author <a href="mailto:Sergey.Kabashnyuk@exoplatform.org">Sergey Kabashnyuk</a>
+ * @version $Id: exo-jboss-codetemplates.xml 34360 2009-07-22 23:58:59Z ksm $
+ *
+ */
+public class TestPrintNodes extends JcrAPIBaseTest
+
+{
+ public void testPrintNodes() throws RepositoryException
+ {
+
+ while (true)
+ {
+ System.out.println("===============================");
+ NodeIterator iter = root.getNodes();
+ while (iter.hasNext())
+ {
+ System.out.println(iter.nextNode().getName());
+ }
+
+ try
+ {
+ Thread.sleep(2000);
+ }
+ catch (InterruptedException e)
+ {
+ }
+ }
+
+ }
+}
Property changes on: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestPrintNodes.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestWriteAndQuery.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestWriteAndQuery.java (rev 0)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestWriteAndQuery.java 2010-01-04 12:19:22 UTC (rev 1271)
@@ -0,0 +1,283 @@
+/*
+ * Copyright (C) 2009 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.
+ */
+package org.exoplatform.services.jcr.lab.cluster.test;
+
+import junit.framework.AssertionFailedError;
+
+import org.exoplatform.services.jcr.JcrAPIBaseTest;
+import org.exoplatform.services.jcr.core.CredentialsImpl;
+import org.exoplatform.services.jcr.impl.core.SessionImpl;
+import org.exoplatform.services.jcr.lab.cluster.prepare.TestLoadIndexerWriter;
+
+import java.util.Random;
+
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.RepositoryException;
+import javax.jcr.query.Query;
+import javax.jcr.query.QueryManager;
+import javax.jcr.query.QueryResult;
+
+/**
+ * @author <a href="mailto:nikolazius@gmail.com">Nikolay Zamosenchuk</a>
+ * @version $Id: TestLoadIndexerQuery.java 34360 2009-07-22 23:58:59Z nzamosenchuk $
+ *
+ */
+public class TestWriteAndQuery extends JcrAPIBaseTest
+{
+ public static final String COUNT = "count";
+
+ public static final String CONTENT = "Content";
+
+ public static final String STATISTIC = "Statistic";
+
+ private boolean stop = false;
+
+ private int threadCount = 10;
+
+ private static final String[] words =
+ new String[]{"private", "branch", "final", "string", "logging", "bottle", "property", "node", "repository",
+ "exception", "cycle", "value", "index", "meaning", "strange", "words", "hello", "outline", "finest",
+ "basetest", "writer"};
+
+ public void testQuery() throws RepositoryException
+ {
+ log.info("Creating threads...");
+ for (int i = 0; i < threadCount; i++)
+ {
+ // create new thread and start it
+ new Thread(new WriterTask(i)).start();
+ log.info("Write Thread#" + i + " created and started.");
+ // create new thread and start it
+ new Thread(new QueryTask()).start();
+ log.info("Query Thread#" + i + " created and started.");
+ }
+
+ // wait 4 minutes
+ try
+ {
+ Thread.sleep(60000 * 4);
+ }
+ catch (InterruptedException e)
+ {
+ log.error(e);
+ }
+
+ stop = true;
+ }
+
+ private class QueryTask implements Runnable
+ {
+ private SessionImpl sessionLocal;
+
+ private Node rootLocal;
+
+ private Random random;
+
+ public QueryTask() throws RepositoryException
+ {
+ // login
+ CredentialsImpl credentials = new CredentialsImpl("admin", "admin".toCharArray());
+ sessionLocal = (SessionImpl)repository.login(credentials, "ws");
+ // prepare nodes
+ rootLocal = sessionLocal.getRootNode();
+ random = new Random();
+ }
+
+ /**
+ * @see java.lang.Runnable#run()
+ */
+ public void run()
+ {
+ try
+ {
+ while (!stop)
+ {
+ Node threadNode = getRandomChild(rootLocal, "Thread*");
+ if (threadNode != null)
+ {
+ Node statisticNode = threadNode.getNode(TestLoadIndexerWriter.STATISTIC);
+ Node wordNode = getRandomChild(statisticNode, "*");
+ if (wordNode != null)
+ {
+ String word = wordNode.getName();
+ Long count = wordNode.getProperty(TestLoadIndexerWriter.COUNT).getLong();
+
+ QueryManager qman = sessionLocal.getWorkspace().getQueryManager();
+
+ Query q = qman.createQuery("SELECT * FROM nt:base WHERE fn:name() = '" + word + "'", Query.SQL);
+ QueryResult res = q.execute();
+ long sqlsize = res.getNodes().getSize();
+ try
+ {
+ assertTrue("Exp: " + count + "\t found:" + sqlsize, sqlsize >= count);
+ System.out.print("+(" + sqlsize + ")");
+ }
+ catch (AssertionFailedError e)
+ {
+ System.out.println("-" + e.getMessage());
+ }
+ }
+ }
+ }
+
+ }
+ catch (RepositoryException e)
+ {
+ log.error(e);
+ }
+ }
+
+ private Node getRandomChild(Node parent, String pattern) throws RepositoryException
+ {
+ NodeIterator iterator = parent.getNodes(pattern);
+ if (iterator.getSize() < 1)
+ {
+ return null;
+ }
+ int i = random.nextInt((int)iterator.getSize());
+ iterator.skip(i);
+ return iterator.nextNode();
+ }
+ }
+
+ private class WriterTask implements Runnable
+ {
+
+ private int id;
+
+ private SessionImpl sessionLocal;
+
+ private Node statisticNode;
+
+ private Node contentNode;
+
+ private Random random;
+
+ public WriterTask(int id) throws RepositoryException
+ {
+ this.id = id;
+ // login
+ CredentialsImpl credentials = new CredentialsImpl("admin", "admin".toCharArray());
+ sessionLocal = (SessionImpl)repository.login(credentials, "ws");
+ // prepare nodes
+ Node root = sessionLocal.getRootNode();
+ Node threadNode = root.addNode("Thread" + id);
+ statisticNode = threadNode.addNode(STATISTIC);
+ contentNode = threadNode.addNode(CONTENT);
+ random = new Random();
+ sessionLocal.save();
+ }
+
+ /**
+ * @see java.lang.Runnable#run()
+ */
+ public void run()
+ {
+ try
+ {
+ while (!stop)
+ {
+ // get any word
+ int i = random.nextInt(words.length);
+ String word = words[i] + id; // "hello12" if thread#12 is creating it
+ // update statistic
+ updateStatistic(word);
+ // add actual node
+ createTree().addNode(word);
+ sessionLocal.save();
+ System.out.print("#");
+
+ try
+ {
+ Thread.sleep(300);
+ }
+ catch (InterruptedException e)
+ {
+ }
+ }
+ }
+ catch (RepositoryException e)
+ {
+ log.error(e);
+ }
+ }
+
+ /**
+ * increments property in JCR: "./statistic/[word].count"
+ *
+ * @param word
+ * @throws RepositoryException
+ */
+ private void updateStatistic(String word) throws RepositoryException
+ {
+ Node wordNode;
+ long count = 0;
+ if (statisticNode.hasNode(word))
+ {
+ wordNode = statisticNode.getNode(word);
+ count = wordNode.getProperty(COUNT).getLong();
+ }
+ else
+ {
+ wordNode = statisticNode.addNode(word);
+ }
+ wordNode.setProperty(COUNT, count + 1);
+ }
+
+ /**
+ * Created node tree like: "./content/n123456/n1234567/n12345678"
+ * based on current time
+ *
+ * @return
+ * @throws RepositoryException
+ */
+ private Node createTree() throws RepositoryException
+ {
+ // created node tree like: "./content/n123456/n1234567/n12345678"
+ Node end;
+ long time = System.currentTimeMillis();
+ long child1 = time / 100000; // each 100s new node
+ long child2 = time / 10000; // each 10s new node
+ long child3 = time / 1000; // each 1s new node
+ end = addOrCreate("n" + child1, contentNode);
+ end = addOrCreate("n" + child2, end);
+ end = addOrCreate("n" + child3, end);
+ return end;
+ }
+
+ /**
+ * Gets or creates node
+ *
+ * @param name
+ * @param parent
+ * @return
+ * @throws RepositoryException
+ */
+ private Node addOrCreate(String name, Node parent) throws RepositoryException
+ {
+ if (parent.hasNode(name))
+ {
+ return parent.getNode(name);
+ }
+ else
+ return parent.addNode(name);
+ }
+ }
+}
Property changes on: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestWriteAndQuery.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws.xml 2010-01-04 12:11:29 UTC (rev 1270)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws.xml 2010-01-04 12:19:22 UTC (rev 1271)
@@ -2,7 +2,7 @@
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:jboss:jbosscache-core:config:3.1">
- <locking useLockStriping="false" concurrencyLevel="50000" />
+ <locking useLockStriping="false" concurrencyLevel="50000" lockParentForChildInsertRemove="false" lockAcquisitionTimeout="3600000" />
<clustering mode="replication" clusterName="JBoss-Cache-Cluster_db1_ws">
<!--
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws1.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws1.xml 2010-01-04 12:11:29 UTC (rev 1270)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws1.xml 2010-01-04 12:19:22 UTC (rev 1271)
@@ -2,7 +2,7 @@
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:jboss:jbosscache-core:config:3.1">
- <locking useLockStriping="false" concurrencyLevel="50000" />
+ <locking useLockStriping="false" concurrencyLevel="50000" lockParentForChildInsertRemove="false" lockAcquisitionTimeout="3600000" />
<clustering mode="replication" clusterName="JBoss-Cache-Cluster_db1_ws1">
<!--
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws2.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws2.xml 2010-01-04 12:11:29 UTC (rev 1270)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws2.xml 2010-01-04 12:19:22 UTC (rev 1271)
@@ -2,7 +2,7 @@
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:jboss:jbosscache-core:config:3.1">
- <locking useLockStriping="false" concurrencyLevel="50000" />
+ <locking useLockStriping="false" concurrencyLevel="50000" lockParentForChildInsertRemove="false" lockAcquisitionTimeout="3600000" />
<clustering mode="replication" clusterName="JBoss-Cache-Cluster_db1_ws2">
<!--
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws3.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws3.xml 2010-01-04 12:11:29 UTC (rev 1270)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-ws3.xml 2010-01-04 12:19:22 UTC (rev 1271)
@@ -2,7 +2,7 @@
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:jboss:jbosscache-core:config:3.1">
- <locking useLockStriping="false" concurrencyLevel="50000" />
+ <locking useLockStriping="false" concurrencyLevel="50000" lockParentForChildInsertRemove="false" lockAcquisitionTimeout="3600000" />
<clustering mode="replication" clusterName="JBoss-Cache-Cluster_db1_ws3">
<!--
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-wstck.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-wstck.xml 2010-01-04 12:11:29 UTC (rev 1270)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-wstck.xml 2010-01-04 12:19:22 UTC (rev 1271)
@@ -2,7 +2,7 @@
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:jboss:jbosscache-core:config:3.1">
- <locking useLockStriping="false" concurrencyLevel="50000" />
+ <locking useLockStriping="false" concurrencyLevel="50000" lockParentForChildInsertRemove="false" lockAcquisitionTimeout="3600000" />
<clustering mode="replication" clusterName="JBoss-Cache-Cluster_db1tck_wstck">
<!--
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-wstck1.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-wstck1.xml 2010-01-04 12:11:29 UTC (rev 1270)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-wstck1.xml 2010-01-04 12:19:22 UTC (rev 1271)
@@ -2,7 +2,7 @@
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:jboss:jbosscache-core:config:3.1">
- <locking useLockStriping="false" concurrencyLevel="50000" />
+ <locking useLockStriping="false" concurrencyLevel="50000" lockParentForChildInsertRemove="false" lockAcquisitionTimeout="3600000" />
<clustering mode="replication" clusterName="JBoss-Cache-Cluster_db1tck_wstck1">
<!--
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-wstck2.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-wstck2.xml 2010-01-04 12:11:29 UTC (rev 1270)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-config-wstck2.xml 2010-01-04 12:19:22 UTC (rev 1271)
@@ -2,7 +2,7 @@
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:jboss:jbosscache-core:config:3.1">
- <locking useLockStriping="false" concurrencyLevel="50000" />
+ <locking useLockStriping="false" concurrencyLevel="50000" lockParentForChildInsertRemove="false" lockAcquisitionTimeout="3600000" />
<clustering mode="replication" clusterName="JBoss-Cache-Cluster_db1tck_wstck2">
<!--
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-indexer-config-exoloader_db1_ws.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-indexer-config-exoloader_db1_ws.xml 2010-01-04 12:11:29 UTC (rev 1270)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-jbosscache-indexer-config-exoloader_db1_ws.xml 2010-01-04 12:19:22 UTC (rev 1271)
@@ -2,14 +2,13 @@
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:jboss:jbosscache-core:config:3.1">
- <locking useLockStriping="false" concurrencyLevel="50000" lockParentForChildInsertRemove="false" lockAcquisitionTimeout="20000" />
-
+ <locking useLockStriping="false" concurrencyLevel="50000" lockParentForChildInsertRemove="false" lockAcquisitionTimeout="3600000" />
<!-- Configure the TransactionManager -->
<transaction
transactionManagerLookupClass="org.jboss.cache.transaction.JBossStandaloneJTAManagerLookup" />
<clustering mode="replication" clusterName="JBoss-Cache-Indexer-Cluster_db1_ws">
- <stateRetrieval timeout="20000" fetchInMemoryState="false" />
+ <stateRetrieval timeout="20000" fetchInMemoryState="false" nonBlocking="true"/>
<jgroupsConfig>
<!--
UDP discard_incompatible_packets="true" enable_bundling="false"
16 years, 4 months
exo-jcr SVN: r1270 - in jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src: main/java/org/exoplatform/services/jcr/impl/core/query/lucene and 1 other directories.
by do-not-reply@jboss.org
Author: skabashnyuk
Date: 2010-01-04 07:11:29 -0500 (Mon, 04 Jan 2010)
New Revision: 1270
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexUpdateMonitor.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DefaultIndexUpdateMonitor.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexUpdateMonitor.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/prepare/TestIndexUpdateMonitor.java
Log:
EXOJCR-331 : Added locks
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexUpdateMonitor.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexUpdateMonitor.java 2010-01-04 11:33:34 UTC (rev 1269)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexUpdateMonitor.java 2010-01-04 12:11:29 UTC (rev 1270)
@@ -69,32 +69,57 @@
}
- public boolean lock(String name, LockType lockType) throws InterruptedException
+ /**
+ * @see org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMonitor#getUpdateInProgress()
+ */
+ public boolean getUpdateInProgress()
{
- LockManager lm = ((CacheSPI<Serializable, Object>)cache).getComponentRegistry().getComponent(LockManager.class);
- return lm.lock(Fqn.fromRelativeFqn(PARAMETER_ROOT, Fqn.fromString(name)), lockType, Integer.MAX_VALUE);
+ Object value = cache.get(PARAMETER_ROOT, PARAMETER_NAME);
+ return value != null ? (Boolean)value : false;
}
- public void unlock(String name)
+ /**
+ * Returns true if the node is locked (either for reading or writing) by anyone, and false otherwise.
+ * @param name
+ * @return
+ */
+ public boolean isLocked(String name)
{
LockManager lm = ((CacheSPI<Serializable, Object>)cache).getComponentRegistry().getComponent(LockManager.class);
- lm.unlock(Fqn.fromRelativeFqn(PARAMETER_ROOT, Fqn.fromString(name)), cache.getInvocationContext()
- .getGlobalTransaction());
+ return lm.isLocked(Fqn.fromRelativeFqn(PARAMETER_ROOT, Fqn.fromString(name)));
}
- public boolean isLocked(String name)
+ /**
+ * Acquires a lock of type lockType, for a given owner
+ * @param name
+ * @param lockType
+ * @return
+ * @throws InterruptedException
+ */
+ public boolean lock(String name, LockType lockType)
{
+
LockManager lm = ((CacheSPI<Serializable, Object>)cache).getComponentRegistry().getComponent(LockManager.class);
- return lm.isLocked(Fqn.fromRelativeFqn(PARAMETER_ROOT, Fqn.fromString(name)));
+ try
+ {
+ return lm.lock(Fqn.fromRelativeFqn(PARAMETER_ROOT, Fqn.fromString(name)), lockType, Integer.MAX_VALUE);
+ }
+ catch (InterruptedException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return false;
}
/**
- * @see org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMonitor#getUpdateInProgress()
+ * Sets {@link IndexerIoMode} to indexInfos;
+ * @param ioMode
+ * @throws IOException
*/
- public boolean getUpdateInProgress()
+ public void setIoMode(IndexerIoMode ioMode) throws IOException
{
- Object value = cache.get(PARAMETER_ROOT, PARAMETER_NAME);
- return value != null ? (Boolean)value : false;
+ this.ioMode = ioMode;
}
/**
@@ -107,7 +132,7 @@
throw new IllegalStateException("Unable to set updateInProgress value in IndexerIoMode.READ_ONLY mode");
}
- log.info("setUpdateInProgress=" + updateInProgress);
+ // log.info("setUpdateInProgress=" + updateInProgress);
TransactionManager tm = ((CacheSPI<Serializable, Object>)cache).getTransactionManager();
try
{
@@ -145,12 +170,13 @@
}
/**
- * Sets {@link IndexerIoMode} to indexInfos;
- * @param ioMode
- * @throws IOException
+ * Releases the lock passed in
+ * @param name
*/
- public void setIoMode(IndexerIoMode ioMode) throws IOException
+ public void unlock(String name)
{
- this.ioMode = ioMode;
+ LockManager lm = ((CacheSPI<Serializable, Object>)cache).getComponentRegistry().getComponent(LockManager.class);
+ lm.unlock(Fqn.fromRelativeFqn(PARAMETER_ROOT, Fqn.fromString(name)), cache.getInvocationContext()
+ .getGlobalTransaction());
}
}
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DefaultIndexUpdateMonitor.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DefaultIndexUpdateMonitor.java 2010-01-04 11:33:34 UTC (rev 1269)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DefaultIndexUpdateMonitor.java 2010-01-04 12:11:29 UTC (rev 1270)
@@ -19,6 +19,7 @@
package org.exoplatform.services.jcr.impl.core.query.lucene;
import org.exoplatform.services.jcr.impl.core.query.IndexerIoMode;
+import org.jboss.cache.lock.LockType;
import java.io.IOException;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -70,4 +71,27 @@
this.ioMode = ioMode;
}
+ /**
+ * @see org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMonitor#unlock(java.lang.String)
+ */
+ public void unlock(String name)
+ {
+ }
+
+ /**
+ * @see org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMonitor#lock(java.lang.String, org.jboss.cache.lock.LockType)
+ */
+ public boolean lock(String name, LockType lockType)
+ {
+ return false;
+ }
+
+ /**
+ * @see org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMonitor#isLocked(java.lang.String)
+ */
+ public boolean isLocked(String name)
+ {
+ return false;
+ }
+
}
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexUpdateMonitor.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexUpdateMonitor.java 2010-01-04 11:33:34 UTC (rev 1269)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexUpdateMonitor.java 2010-01-04 12:11:29 UTC (rev 1270)
@@ -19,6 +19,7 @@
package org.exoplatform.services.jcr.impl.core.query.lucene;
import org.exoplatform.services.jcr.impl.core.query.IndexerIoMode;
+import org.jboss.cache.lock.LockType;
import java.io.IOException;
@@ -46,4 +47,26 @@
*/
public void setIoMode(IndexerIoMode ioMode) throws IOException;
+ /**
+ * Returns true if the node is locked (either for reading or writing) by anyone, and false otherwise.
+ * @param name
+ * @return
+ */
+ public boolean isLocked(String name);
+
+ /**
+ * Acquires a lock of type lockType, for a given owner
+ * @param name
+ * @param lockType
+ * @return
+ * @throws InterruptedException
+ */
+ public boolean lock(String name, LockType lockType);
+
+ /**
+ * Releases the lock passed in
+ * @param name
+ */
+ public void unlock(String name);
+
}
\ No newline at end of file
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/prepare/TestIndexUpdateMonitor.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/prepare/TestIndexUpdateMonitor.java 2010-01-04 11:33:34 UTC (rev 1269)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/prepare/TestIndexUpdateMonitor.java 2010-01-04 12:11:29 UTC (rev 1270)
@@ -22,6 +22,7 @@
import org.exoplatform.services.jcr.impl.core.query.IndexerIoMode;
import org.exoplatform.services.jcr.impl.core.query.jbosscache.JbossCacheIndexUpdateMonitor;
+import org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMonitor;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.jboss.cache.Cache;
@@ -47,7 +48,7 @@
*/
private final Log log = ExoLogger.getLogger(TestIndexUpdateMonitor.class);
- private JbossCacheIndexUpdateMonitor indexUpdateMonitor;
+ private IndexUpdateMonitor indexUpdateMonitor;
private Cache<Serializable, Object> cache;
@@ -157,32 +158,23 @@
/**
* @param indexUpdateMonitor
*/
- public LockChecker(JbossCacheIndexUpdateMonitor indexUpdateMonitor, String lockName)
+ public LockChecker(IndexUpdateMonitor indexUpdateMonitor, String lockName)
{
super();
this.indexUpdateMonitor = indexUpdateMonitor;
this.lockName = lockName;
}
- private final JbossCacheIndexUpdateMonitor indexUpdateMonitor;
+ private final IndexUpdateMonitor indexUpdateMonitor;
/**
* @see java.lang.Runnable#run()
*/
public void run()
{
- // TODO Auto-generated method stub
- try
- {
- waiting = true;
- assertTrue(indexUpdateMonitor.lock(lockName, LockType.WRITE));
- waiting = false;
- }
- catch (InterruptedException e)
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+ waiting = true;
+ assertTrue(indexUpdateMonitor.lock(lockName, LockType.WRITE));
+ waiting = false;
}
}
16 years, 4 months
exo-jcr SVN: r1269 - jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-01-04 06:33:34 -0500 (Mon, 04 Jan 2010)
New Revision: 1269
Modified:
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java
Log:
EXOJCR-302: FIND_NODES_BY_PARENTID_CQ ordering updated
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java 2010-01-04 11:27:34 UTC (rev 1268)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java 2010-01-04 11:33:34 UTC (rev 1269)
@@ -198,9 +198,9 @@
FIND_NODES_BY_PARENTID_CQ =
"select I.*, P.NAME AS PROP_NAME, V.ORDER_NUM, V.DATA"
- + " from (select * from JCR_MITEM where PARENT_ID=? AND I_CLASS=1) I, JCR_MITEM P, JCR_MVALUE V"
+ + " from (select * from JCR_MITEM where PARENT_ID=? and I_CLASS=1) I, JCR_MITEM P, JCR_MVALUE V"
+ " where (P.PARENT_ID=I.ID and P.I_CLASS=2 and (P.NAME='[http://www.jcp.org/jcr/1.0]primaryType' or P.NAME='[http://www.jcp.org/jcr/1.0]mixinTypes' or P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions') and V.PROPERTY_ID=P.ID)"
- + " order by I.ID, PROP_NAME DESC, V.ORDER_NUM"; //I.N_ORDER_NUM
+ + " order by I.N_ORDER_NUM, I.ID, PROP_NAME DESC, V.ORDER_NUM"; //I.N_ORDER_NUM
FIND_NODE_MAIN_PROPERTIES_BY_PARENTID_CQ =
"select I.NAME, V.DATA"
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java 2010-01-04 11:27:34 UTC (rev 1268)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java 2010-01-04 11:33:34 UTC (rev 1269)
@@ -84,7 +84,7 @@
protected PreparedStatement findPropertiesByParentIdCQ;
protected PreparedStatement findNodeMainPropertiesByParentIdentifierCQ;
-
+
protected PreparedStatement insertItem;
protected PreparedStatement insertNode;
@@ -203,15 +203,15 @@
FIND_NODES_BY_PARENTID_CQ =
"select I.*, P.NAME AS PROP_NAME, V.ORDER_NUM, V.DATA"
- + " from (select * from JCR_SITEM where CONTAINER_NAME=? and PARENT_ID=? AND I_CLASS=1) I, JCR_SITEM P, JCR_SVALUE V"
- + " where (P.CONTAINER_NAME=? and P.PARENT_ID=I.ID and P.I_CLASS=2 and (P.NAME='[http://www.jcp.org/jcr/1.0]primaryType' or P.NAME='[http://www.jcp.org/jcr/1.0]mixinTypes' or P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions') and V.PROPERTY_ID=P.ID)"
- + " order by I.N_ORDER_NUM, PROP_NAME DESC, V.ORDER_NUM";
+ + " from (select * from JCR_SITEM where CONTAINER_NAME=? and PARENT_ID=? AND I_CLASS=1) I, JCR_SITEM P, JCR_SVALUE V"
+ + " where (P.CONTAINER_NAME=? and P.PARENT_ID=I.ID and P.I_CLASS=2 and (P.NAME='[http://www.jcp.org/jcr/1.0]primaryType' or P.NAME='[http://www.jcp.org/jcr/1.0]mixinTypes' or P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions') and V.PROPERTY_ID=P.ID)"
+ + " order by I.N_ORDER_NUM, I.ID, PROP_NAME DESC, V.ORDER_NUM";
- FIND_NODE_MAIN_PROPERTIES_BY_PARENTID_CQ =
+ FIND_NODE_MAIN_PROPERTIES_BY_PARENTID_CQ =
"select I.NAME, V.DATA"
- + " from JCR_SITEM I, JCR_SVALUE V"
- + " where I.I_CLASS=2 and I.CONTAINER_NAME=? and I.PARENT_ID=? and (I.NAME='[http://www.jcp.org/jcr/1.0]primaryType' or I.NAME='[http://www.jcp.org/jcr/1.0]mixinTypes' or I.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or I.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions') and I.ID=V.PROPERTY_ID order by V.ORDER_NUM";
-
+ + " from JCR_SITEM I, JCR_SVALUE V"
+ + " where I.I_CLASS=2 and I.CONTAINER_NAME=? and I.PARENT_ID=? and (I.NAME='[http://www.jcp.org/jcr/1.0]primaryType' or I.NAME='[http://www.jcp.org/jcr/1.0]mixinTypes' or I.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or I.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions') and I.ID=V.PROPERTY_ID order by V.ORDER_NUM";
+
FIND_NODES_COUNT_BY_PARENTID =
"select count(ID) from JCR_SITEM" + " where I_CLASS=1 and CONTAINER_NAME=? and PARENT_ID=?";
@@ -638,12 +638,13 @@
protected ResultSet findNodeMainPropertiesByParentIdentifierCQ(String parentIdentifier) throws SQLException
{
if (findNodeMainPropertiesByParentIdentifierCQ == null)
- findNodeMainPropertiesByParentIdentifierCQ = dbConnection.prepareStatement(FIND_NODE_MAIN_PROPERTIES_BY_PARENTID_CQ);
+ findNodeMainPropertiesByParentIdentifierCQ =
+ dbConnection.prepareStatement(FIND_NODE_MAIN_PROPERTIES_BY_PARENTID_CQ);
else
findNodeMainPropertiesByParentIdentifierCQ.clearParameters();
findNodeMainPropertiesByParentIdentifierCQ.setString(1, containerName);
findNodeMainPropertiesByParentIdentifierCQ.setString(2, parentIdentifier);
return findNodeMainPropertiesByParentIdentifierCQ.executeQuery();
- }
+ }
}
16 years, 4 months
exo-jcr SVN: r1268 - jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/standalone.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2010-01-04 06:27:34 -0500 (Mon, 04 Jan 2010)
New Revision: 1268
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/standalone/test-jbosscache-config.xml
Log:
EXOJCR-333 : The implementation ExoEvictionActionPolicy was added. The eviction configuration was added.
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/standalone/test-jbosscache-config.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/standalone/test-jbosscache-config.xml 2010-01-04 11:12:24 UTC (rev 1267)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/standalone/test-jbosscache-config.xml 2010-01-04 11:27:34 UTC (rev 1268)
@@ -1,22 +1,22 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.1">
-
- <!-- Configure the TransactionManager -->
- <transaction transactionManagerLookupClass="org.jboss.cache.transaction.JBossStandaloneJTAManagerLookup" />
-
- <!-- Enable batching -->
- <invocationBatching enabled="true" />
-
- <!-- Eviction configuration -->
- <eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
- <property name="maxNodes" value="5000" />
- <property name="timeToLiveSeconds" value="120" />
- </default>
- <region name="/" algorithmClass="org.jboss.cache.eviction.LRUAlgorithm" actionPolicyClass="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.ExoEvictionActionPolicy">
- <property name="maxNodes" value="5000" />
- <property name="timeToLiveSeconds" value="120" />
- </region>
- </eviction>
-
-</jbosscache>
+<?xml version="1.0" encoding="UTF-8"?>
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.1">
+
+ <!-- Configure the TransactionManager -->
+ <transaction transactionManagerLookupClass="org.jboss.cache.transaction.JBossStandaloneJTAManagerLookup" />
+
+ <!-- Enable batching -->
+ <invocationBatching enabled="true" />
+
+ <!-- Eviction configuration -->
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
+ <property name="maxNodes" value="5000" />
+ <property name="timeToLiveSeconds" value="120" />
+ </default>
+ <region name="/" algorithmClass="org.jboss.cache.eviction.LRUAlgorithm" actionPolicyClass="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.ExoEvictionActionPolicy" eventQueueSize="1000000">
+ <property name="maxNodes" value="5000" />
+ <property name="timeToLiveSeconds" value="120" />
+ </region>
+ </eviction>
+
+</jbosscache>
16 years, 4 months
exo-jcr SVN: r1267 - in jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src: test/resources/conf/standalone and 1 other directory.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2010-01-04 06:12:24 -0500 (Mon, 04 Jan 2010)
New Revision: 1267
Added:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/ExoEvictionActionPolicy.java
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/standalone/test-jbosscache-config.xml
Log:
EXOJCR-333 : The implementation ExoEvictionActionPolicy was added. The eviction configuration was added.
Added: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/ExoEvictionActionPolicy.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/ExoEvictionActionPolicy.java (rev 0)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/ExoEvictionActionPolicy.java 2010-01-04 11:12:24 UTC (rev 1267)
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2003-2010 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache;
+
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.jboss.cache.Cache;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.eviction.EvictionActionPolicy;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>Date: 2010
+ *
+ * @author <a href="mailto:alex.reshetnyak@exoplatform.com.ua">Alex Reshetnyak</a>
+ * @version $Id$
+ */
+public class ExoEvictionActionPolicy
+ implements EvictionActionPolicy
+{
+ private static final Log LOG = ExoLogger.getLogger("jcr.ExoEvictionActionPolicy");
+
+ private Cache<?, ?> cache;
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean evict(Fqn fqn)
+ {
+
+ if (fqn.size() == 3 && JBossCacheWorkspaceStorageCache.CHILD_NODES_LIST.equals(fqn.get(0)))
+ {
+ return eviction(fqn.getParent());
+ }
+ else if (fqn.size() == 3 && JBossCacheWorkspaceStorageCache.CHILD_NODES_LIST.equals(fqn.get(0)))
+ {
+ return eviction(fqn.getParent());
+ }
+ else
+ {
+ return eviction(fqn);
+ }
+ }
+
+ private boolean eviction(Fqn fqn)
+ {
+ try
+ {
+ if (LOG.isDebugEnabled())
+ LOG.debug("Evicting Fqn " + fqn);
+
+ cache.evict(fqn);
+ return true;
+ }
+ catch (Exception e)
+ {
+ LOG.error("Unable to evict " + fqn, e);
+ return false;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setCache(Cache<?, ?> cache)
+ {
+ this.cache = cache;
+ }
+
+}
Property changes on: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/ExoEvictionActionPolicy.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/standalone/test-jbosscache-config.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/standalone/test-jbosscache-config.xml 2010-01-04 10:56:02 UTC (rev 1266)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/standalone/test-jbosscache-config.xml 2010-01-04 11:12:24 UTC (rev 1267)
@@ -1,10 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
-<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="urn:jboss:jbosscache-core:config:3.1">
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.1">
<!-- Configure the TransactionManager -->
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.JBossStandaloneJTAManagerLookup" />
-
+
<!-- Enable batching -->
- <invocationBatching enabled="true"/>
+ <invocationBatching enabled="true" />
+
+ <!-- Eviction configuration -->
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
+ <property name="maxNodes" value="5000" />
+ <property name="timeToLiveSeconds" value="120" />
+ </default>
+ <region name="/" algorithmClass="org.jboss.cache.eviction.LRUAlgorithm" actionPolicyClass="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.ExoEvictionActionPolicy">
+ <property name="maxNodes" value="5000" />
+ <property name="timeToLiveSeconds" value="120" />
+ </region>
+ </eviction>
+
</jbosscache>
16 years, 4 months
exo-jcr SVN: r1266 - jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-01-04 05:56:02 -0500 (Mon, 04 Jan 2010)
New Revision: 1266
Modified:
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java
Log:
EXOJCR-302: multidb queries updated
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java 2010-01-04 07:49:31 UTC (rev 1265)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java 2010-01-04 10:56:02 UTC (rev 1266)
@@ -87,7 +87,7 @@
protected PreparedStatement findPropertiesByParentId;
protected PreparedStatement findPropertiesByParentIdCQ;
-
+
protected PreparedStatement findNodeMainPropertiesByParentIdentifierCQ;
protected PreparedStatement insertNode;
@@ -198,16 +198,15 @@
FIND_NODES_BY_PARENTID_CQ =
"select I.*, P.NAME AS PROP_NAME, V.ORDER_NUM, V.DATA"
- + " from (select * from JCR_SITEM where PARENT_ID=? AND I_CLASS=1) I, JCR_SITEM P, JCR_SVALUE V"
- + " where (P.PARENT_ID=I.ID and P.I_CLASS=2 and (P.NAME='[http://www.jcp.org/jcr/1.0]primaryType' or P.NAME='[http://www.jcp.org/jcr/1.0]mixinTypes' or P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions') and V.PROPERTY_ID=P.ID)"
- + " order by I.N_ORDER_NUM, PROP_NAME DESC, V.ORDER_NUM";
+ + " from (select * from JCR_MITEM where PARENT_ID=? AND I_CLASS=1) I, JCR_MITEM P, JCR_MVALUE V"
+ + " where (P.PARENT_ID=I.ID and P.I_CLASS=2 and (P.NAME='[http://www.jcp.org/jcr/1.0]primaryType' or P.NAME='[http://www.jcp.org/jcr/1.0]mixinTypes' or P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions') and V.PROPERTY_ID=P.ID)"
+ + " order by I.ID, PROP_NAME DESC, V.ORDER_NUM"; //I.N_ORDER_NUM
- FIND_NODE_MAIN_PROPERTIES_BY_PARENTID_CQ =
+ FIND_NODE_MAIN_PROPERTIES_BY_PARENTID_CQ =
"select I.NAME, V.DATA"
- + " from JCR_SITEM I, JCR_SVALUE V"
- + " where I.I_CLASS=2 and I.PARENT_ID=? and (I.NAME='[http://www.jcp.org/jcr/1.0]primaryType' or I.NAME='[http://www.jcp.org/jcr/1.0]mixinTypes' or I.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or I.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions') and I.ID=V.PROPERTY_ID order by V.ORDER_NUM";
-
-
+ + " from JCR_MITEM I, JCR_MVALUE V"
+ + " where I.I_CLASS=2 and I.PARENT_ID=? and (I.NAME='[http://www.jcp.org/jcr/1.0]primaryType' or I.NAME='[http://www.jcp.org/jcr/1.0]mixinTypes' or I.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or I.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions') and I.ID=V.PROPERTY_ID order by V.ORDER_NUM";
+
FIND_NODES_COUNT_BY_PARENTID = "select count(ID) from JCR_MITEM" + " where I_CLASS=1 and PARENT_ID=?";
FIND_PROPERTIES_BY_PARENTID = "select * from JCR_MITEM" + " where I_CLASS=2 and PARENT_ID=?" + " order by ID";
@@ -625,7 +624,8 @@
protected ResultSet findNodeMainPropertiesByParentIdentifierCQ(String parentIdentifier) throws SQLException
{
if (findNodeMainPropertiesByParentIdentifierCQ == null)
- findNodeMainPropertiesByParentIdentifierCQ = dbConnection.prepareStatement(FIND_NODE_MAIN_PROPERTIES_BY_PARENTID_CQ);
+ findNodeMainPropertiesByParentIdentifierCQ =
+ dbConnection.prepareStatement(FIND_NODE_MAIN_PROPERTIES_BY_PARENTID_CQ);
else
findNodeMainPropertiesByParentIdentifierCQ.clearParameters();
16 years, 4 months
exo-jcr SVN: r1265 - jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core.
by do-not-reply@jboss.org
Author: tolusha
Date: 2010-01-04 02:49:31 -0500 (Mon, 04 Jan 2010)
New Revision: 1265
Modified:
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java
Log:
EXOJCR-338: remove unnecessary remove operation
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java 2010-01-01 12:41:47 UTC (rev 1264)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java 2010-01-04 07:49:31 UTC (rev 1265)
@@ -2592,13 +2592,9 @@
{
NodeData node = it.next();
- if (!(session.getAccessManager().hasPermission(node.getACL(), new String[]{PermissionType.READ}, session
- .getUserState().getIdentity())))
+ if (session.getAccessManager().hasPermission(node.getACL(), new String[]{PermissionType.READ},
+ session.getUserState().getIdentity()))
{
- it.remove();
- }
- else
- {
ItemImpl pooled = dataManager.reloadItem(node);
if (pooled != null)
{
16 years, 4 months