exo-jcr SVN: r3964 - jcr/branches/1.12.x/patch.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-02-11 09:25:48 -0500 (Fri, 11 Feb 2011)
New Revision: 3964
Removed:
jcr/branches/1.12.x/patch/JCR-1552/
Log:
move patches to rigth place
15 years, 2 months
exo-jcr SVN: r3963 - in jcr/branches/1.12.x/patch: 1.12.7-GA and 1 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-02-11 09:25:35 -0500 (Fri, 11 Feb 2011)
New Revision: 3963
Added:
jcr/branches/1.12.x/patch/1.12.7-GA/
jcr/branches/1.12.x/patch/1.12.7-GA/JCR-1552/
jcr/branches/1.12.x/patch/1.12.7-GA/JCR-1552/JCR-1552.patch
Log:
move patches to rigth place
Added: jcr/branches/1.12.x/patch/1.12.7-GA/JCR-1552/JCR-1552.patch
===================================================================
--- jcr/branches/1.12.x/patch/1.12.7-GA/JCR-1552/JCR-1552.patch (rev 0)
+++ jcr/branches/1.12.x/patch/1.12.7-GA/JCR-1552/JCR-1552.patch 2011-02-11 14:25:35 UTC (rev 3963)
@@ -0,0 +1,20 @@
+Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/FileSystemLockPersister.java
+===================================================================
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/FileSystemLockPersister.java (revision 3770)
++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/FileSystemLockPersister.java (working copy)
+@@ -263,14 +263,7 @@
+ {
+ log.debug("Stoping FileSystemLockPersister");
+ }
+- try
+- {
+- removeAll();
+- }
+- catch (LockException e)
+- {
+- log.error(e.getLocalizedMessage(), e);
+- }
++
+ if (log.isDebugEnabled())
+ {
+ log.debug("FileSystemLockPersister stoped");
15 years, 2 months
exo-jcr SVN: r3962 - in jcr/branches/1.12.x/patch/1.12.8-GA: JCR-1581 and 1 other directory.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-02-11 09:16:57 -0500 (Fri, 11 Feb 2011)
New Revision: 3962
Added:
jcr/branches/1.12.x/patch/1.12.8-GA/JCR-1581/
jcr/branches/1.12.x/patch/1.12.8-GA/JCR-1581/JCR-1581.patch
Log:
JCR-1581: patch proposed
Added: jcr/branches/1.12.x/patch/1.12.8-GA/JCR-1581/JCR-1581.patch
===================================================================
--- jcr/branches/1.12.x/patch/1.12.8-GA/JCR-1581/JCR-1581.patch (rev 0)
+++ jcr/branches/1.12.x/patch/1.12.8-GA/JCR-1581/JCR-1581.patch 2011-02-11 14:16:57 UTC (rev 3962)
@@ -0,0 +1,202 @@
+Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
+===================================================================
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java (revision 3961)
++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java (working copy)
+@@ -122,6 +122,8 @@
+ */
+ public static final int DEFAULT_MAX_FIELD_LENGTH = 10000;
+
++ private static final int IOEXCEPTION_RETRY_COUNT = 3;
++
+ /**
+ * The default value for property {@link #extractorPoolSize}.
+ *
+@@ -708,8 +710,7 @@
+ }
+ catch (RepositoryException e)
+ {
+- log
+- .warn("Exception while creating document for node: " + state.getIdentifier() + ": " + e.toString(), e);
++ log.warn("Exception while creating document for node: " + state.getIdentifier() + ": " + e.toString(), e);
+ }
+ return doc;
+ }
+@@ -736,8 +737,7 @@
+ }
+ catch (RepositoryException e)
+ {
+- log
+- .warn("Exception while creating document for node: " + state.getIdentifier() + ": " + e.toString());
++ log.warn("Exception while creating document for node: " + state.getIdentifier() + ": " + e.toString());
+ }
+ return null;
+ }
+@@ -870,25 +870,45 @@
+
+ Sort sort = new Sort(createSortFields(orderProps, orderSpecs));
+
+- final IndexReader reader = getIndexReader(queryImpl.needsSystemTree());
+- JcrIndexSearcher searcher = new JcrIndexSearcher(session, reader, getContext().getItemStateManager());
+- searcher.setSimilarity(getSimilarity());
+- return new FilterMultiColumnQueryHits(searcher.execute(query, sort, resultFetchHint,
+- QueryImpl.DEFAULT_SELECTOR_NAME))
++ for (int i = 0; i < IOEXCEPTION_RETRY_COUNT; i++)
+ {
+- public void close() throws IOException
++ final IndexReader reader = getIndexReader(queryImpl.needsSystemTree());
++ try
+ {
++ JcrIndexSearcher searcher = new JcrIndexSearcher(session, reader, getContext().getItemStateManager());
++ searcher.setSimilarity(getSimilarity());
++ return new FilterMultiColumnQueryHits(searcher.execute(query, sort, resultFetchHint,
++ QueryImpl.DEFAULT_SELECTOR_NAME))
++ {
++ public void close() throws IOException
++ {
++ try
++ {
++ super.close();
++ }
++ finally
++ {
++ PerQueryCache.getInstance().dispose();
++ Util.closeOrRelease(reader);
++ }
++ }
++ };
++ }
++ catch (IOException e)
++ {
+ try
+ {
+- super.close();
++ Util.closeOrRelease(reader);
+ }
+- finally
++ catch (Exception releaseException)
+ {
+- PerQueryCache.getInstance().dispose();
+- Util.closeOrRelease(reader);
++ log.error("Error occured while closing or releasing a reader" + releaseException);
+ }
+ }
+- };
++ }
++
++ throw new IOException("IO exception was encountered more than" + IOEXCEPTION_RETRY_COUNT + " times");
++
+ }
+
+ /**
+@@ -918,24 +938,43 @@
+
+ Sort sort = new Sort(createSortFields(orderProps, orderSpecs));
+
+- final IndexReader reader = getIndexReader();
+- JcrIndexSearcher searcher = new JcrIndexSearcher(session, reader, getContext().getItemStateManager());
+- searcher.setSimilarity(getSimilarity());
+- return new FilterMultiColumnQueryHits(query.execute(searcher, sort, resultFetchHint))
++ for (int i = 0; i < IOEXCEPTION_RETRY_COUNT; i++)
+ {
+- public void close() throws IOException
++ final IndexReader reader = getIndexReader();
++ try
+ {
++ JcrIndexSearcher searcher = new JcrIndexSearcher(session, reader, getContext().getItemStateManager());
++ searcher.setSimilarity(getSimilarity());
++ return new FilterMultiColumnQueryHits(query.execute(searcher, sort, resultFetchHint))
++ {
++ public void close() throws IOException
++ {
++ try
++ {
++ super.close();
++ }
++ finally
++ {
++ PerQueryCache.getInstance().dispose();
++ Util.closeOrRelease(reader);
++ }
++ }
++ };
++ }
++ catch (IOException e)
++ {
+ try
+ {
+- super.close();
++ Util.closeOrRelease(reader);
+ }
+- finally
++ catch (Exception releaseException)
+ {
+- PerQueryCache.getInstance().dispose();
+- Util.closeOrRelease(reader);
++ log.error("Error occured while closing or releasing a reader" + releaseException);
+ }
+ }
+- };
++ }
++
++ throw new IOException("IO exception was encountered more than" + IOEXCEPTION_RETRY_COUNT + " times");
+ }
+
+ /**
+@@ -1330,8 +1369,8 @@
+ {
+ File root = new File(path, synonymProviderConfigPath.substring(0, lastSeparator));
+ fsr =
+- new BufferedInputStream(new FileInputStream(new File(root, synonymProviderConfigPath
+- .substring(lastSeparator + 1))));
++ new BufferedInputStream(new FileInputStream(new File(root,
++ synonymProviderConfigPath.substring(lastSeparator + 1))));
+ }
+ else
+ {
+@@ -1540,8 +1579,7 @@
+ catch (Exception e)
+ {
+ // do not fail if aggregate cannot be created
+- log
+- .warn("Exception while building indexing aggregate for" + " node with UUID: " + state.getIdentifier(), e);
++ log.warn("Exception while building indexing aggregate for" + " node with UUID: " + state.getIdentifier(), e);
+ }
+ }
+ }
+@@ -2712,11 +2750,32 @@
+ {
+ checkOpen();
+
+- IndexReader reader = getIndexReader(true);
+- IndexSearcher searcher = new IndexSearcher(reader);
+- searcher.setSimilarity(getSimilarity());
++ IndexReader reader;
+
+- return new LuceneQueryHits(reader, searcher, query);
++ for (int i = 0; i < IOEXCEPTION_RETRY_COUNT; i++)
++ {
++ reader = getIndexReader(true);
++ try
++ {
++ IndexSearcher searcher = new IndexSearcher(reader);
++ searcher.setSimilarity(getSimilarity());
++
++ return new LuceneQueryHits(reader, searcher, query);
++ }
++ catch (IOException e)
++ {
++ try
++ {
++ Util.closeOrRelease(reader);
++ }
++ catch (Exception releaseException)
++ {
++ log.error("Error occured while closing or releasing a reader" + releaseException);
++ }
++ }
++ }
++
++ throw new IOException("IO exception was encountered more than" + IOEXCEPTION_RETRY_COUNT + " times");
+ }
+
+ /**
15 years, 2 months
exo-jcr SVN: r3961 - in jcr/trunk/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: tolusha
Date: 2011-02-11 01:58:42 -0500 (Fri, 11 Feb 2011)
New Revision: 3961
Added:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/Reindexable.java
Removed:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/Indexable.java
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
Log:
EXOJCR-1104: don't support rdbmsReindexing for HSQLDB
Deleted: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/Indexable.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/Indexable.java 2011-02-10 13:40:09 UTC (rev 3960)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/Indexable.java 2011-02-11 06:58:42 UTC (rev 3961)
@@ -1,50 +0,0 @@
-/*
- * 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.impl.core.query;
-
-import javax.jcr.RepositoryException;
-
-/**
- * Created by The eXo Platform SAS.
- *
- * Date: 1 02 2011
- *
- * @author <a href="mailto:anatoliy.bazko@exoplatform.com.ua">Anatoliy Bazko</a>
- * @version $Id: Indexable.java 34360 2010-11-11 11:11:11Z tolusha $
- */
-public interface Indexable
-{
- /**
- * Returns NodeDataIndexingIterator.
- *
- * @param pageSize
- * the maximum amount of the rows which can be retrieved from storage per once
- * @return NodeDataIndexingIterator
- * @throws RepositoryException
- */
- NodeDataIndexingIterator getNodeDataIndexingIterator(int pageSize) throws RepositoryException;
-
- /**
- * Indicates if component support extracting data from storage using paging.
- *
- * @return boolean
- */
- boolean isPagingSupport();
-
-}
Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/Reindexable.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/Reindexable.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/Reindexable.java 2011-02-11 06:58:42 UTC (rev 3961)
@@ -0,0 +1,50 @@
+/*
+ * 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.impl.core.query;
+
+import javax.jcr.RepositoryException;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * Date: 1 02 2011
+ *
+ * @author <a href="mailto:anatoliy.bazko@exoplatform.com.ua">Anatoliy Bazko</a>
+ * @version $Id: Reindexable.java 34360 2010-11-11 11:11:11Z tolusha $
+ */
+public interface Reindexable
+{
+ /**
+ * Returns NodeDataIndexingIterator.
+ *
+ * @param pageSize
+ * the maximum amount of the rows which can be retrieved from storage per once
+ * @return NodeDataIndexingIterator
+ * @throws RepositoryException
+ */
+ NodeDataIndexingIterator getNodeDataIndexingIterator(int pageSize) throws RepositoryException;
+
+ /**
+ * Indicates if component support extracting data from storage using paging.
+ *
+ * @return boolean
+ */
+ boolean isReindexingSupport();
+
+}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2011-02-10 13:40:09 UTC (rev 3960)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2011-02-11 06:58:42 UTC (rev 3961)
@@ -26,12 +26,12 @@
import org.exoplatform.services.jcr.datamodel.NodeData;
import org.exoplatform.services.jcr.datamodel.NodeDataIndexing;
import org.exoplatform.services.jcr.impl.Constants;
-import org.exoplatform.services.jcr.impl.core.query.Indexable;
import org.exoplatform.services.jcr.impl.core.query.IndexerIoMode;
import org.exoplatform.services.jcr.impl.core.query.IndexerIoModeHandler;
import org.exoplatform.services.jcr.impl.core.query.IndexerIoModeListener;
import org.exoplatform.services.jcr.impl.core.query.IndexingTree;
import org.exoplatform.services.jcr.impl.core.query.NodeDataIndexingIterator;
+import org.exoplatform.services.jcr.impl.core.query.Reindexable;
import org.exoplatform.services.jcr.impl.core.query.lucene.directory.DirectoryManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -434,12 +434,15 @@
long count;
- // check if we have deal with RDBMS indexing mechanism
- Indexable rdbmsIndexableComponent = (Indexable)handler.getContext().getContainer().getComponent(Indexable.class);
- if (handler.isRDBMSReindexing() && rdbmsIndexableComponent != null && rdbmsIndexableComponent.isPagingSupport())
+ // check if we have deal with RDBMS reindexing mechanism
+ Reindexable rdbmsReindexableComponent =
+ (Reindexable)handler.getContext().getContainer().getComponent(Reindexable.class);
+
+ if (handler.isRDBMSReindexing() && rdbmsReindexableComponent != null
+ && rdbmsReindexableComponent.isReindexingSupport())
{
count =
- createIndex(rdbmsIndexableComponent.getNodeDataIndexingIterator(handler.getReindexingPageSize()),
+ createIndex(rdbmsReindexableComponent.getNodeDataIndexingIterator(handler.getReindexingPageSize()),
indexingTree.getIndexingRoot());
}
else
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2011-02-10 13:40:09 UTC (rev 3960)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2011-02-11 06:58:42 UTC (rev 3961)
@@ -1028,7 +1028,9 @@
checkIfOpened();
try
{
+ long start = System.currentTimeMillis();
ResultSet resultSet = findNodesAndProperties(offset, limit);
+ LOG.debug("offset=" + offset + " limit=" + limit + " time=" + (System.currentTimeMillis() - start));
try
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2011-02-10 13:40:09 UTC (rev 3960)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2011-02-11 06:58:42 UTC (rev 3961)
@@ -37,8 +37,8 @@
import org.exoplatform.services.jcr.impl.backup.rdbms.DirectoryRestor;
import org.exoplatform.services.jcr.impl.backup.rdbms.RestoreTableRule;
import org.exoplatform.services.jcr.impl.clean.rdbms.DBCleanService;
-import org.exoplatform.services.jcr.impl.core.query.Indexable;
import org.exoplatform.services.jcr.impl.core.query.NodeDataIndexingIterator;
+import org.exoplatform.services.jcr.impl.core.query.Reindexable;
import org.exoplatform.services.jcr.impl.dataflow.serialization.ObjectReaderImpl;
import org.exoplatform.services.jcr.impl.dataflow.serialization.ObjectWriterImpl;
import org.exoplatform.services.jcr.impl.storage.WorkspaceDataContainerBase;
@@ -100,7 +100,7 @@
* @version $Id:GenericWorkspaceDataContainer.java 13433 2007-03-15 16:07:23Z peterit $
*/
public class JDBCWorkspaceDataContainer extends WorkspaceDataContainerBase implements Startable, JdbcBackupable,
- Indexable
+ Reindexable
{
protected static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.JDBCWorkspaceDataContainer");
@@ -1537,8 +1537,8 @@
/**
* {@inheritDoc}
*/
- public boolean isPagingSupport()
+ public boolean isReindexingSupport()
{
- return !dbDialect.equals(DBConstants.DB_DIALECT_SYBASE);
+ return !dbDialect.equals(DBConstants.DB_DIALECT_SYBASE) && !dbDialect.equals(DBConstants.DB_DIALECT_HSQLDB);
}
}
15 years, 2 months
exo-jcr SVN: r3960 - jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-02-10 08:40:09 -0500 (Thu, 10 Feb 2011)
New Revision: 3960
Modified:
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/query-handler-config.xml
Log:
EXOJCR-1104: add option for disabling rdbms indexing
Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/query-handler-config.xml
===================================================================
--- jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/query-handler-config.xml 2011-02-10 13:39:51 UTC (rev 3959)
+++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/query-handler-config.xml 2011-02-10 13:40:09 UTC (rev 3960)
@@ -100,7 +100,8 @@
<property name="jgroups-multiplexer-stack" value="true" />
<property name="jbosscache-cluster-name" value="JCR-cluster-indexer-ws" />
<property name="max-volatile-time" value="60" />
- <property name="reindexing-page-size" value="10000" />
+ <property name="rdbms-reindexing" value="false" />
+ <property name="reindexing-page-size" value="1000" />
</properties>
</query-handler>
</workspace></programlisting> <table>
@@ -157,6 +158,13 @@
</row>
<row>
+ <entry>rdbms-reindexing</entry>
+
+ <entry>indicate that need to use rdbms reindexing mechanism if
+ possible, the default value is true</entry>
+ </row>
+
+ <row>
<entry>reindexing-page-size</entry>
<entry>maximum amount of nodes which can be retrieved from
15 years, 2 months
exo-jcr SVN: r3959 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr: impl/core/query and 1 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-02-10 08:39:51 -0500 (Thu, 10 Feb 2011)
New Revision: 3959
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/QueryHandlerParams.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchIndexConfigurationHelper.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
Log:
EXOJCR-1104: add option for disabling rdbms indexing
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/QueryHandlerParams.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/QueryHandlerParams.java 2011-02-10 10:04:24 UTC (rev 3958)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/QueryHandlerParams.java 2011-02-10 13:39:51 UTC (rev 3959)
@@ -110,4 +110,6 @@
public static final String PARAM_CHANGES_FILTER_CLASS = "changesfilter-class";
public static final String PARAM_REINDEXING_PAGE_SIZE = "reindexing-page-size";
+
+ public static final String PARAM_RDBMS_REINDEXING = "rdbms-reindexing";
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchIndexConfigurationHelper.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchIndexConfigurationHelper.java 2011-02-10 10:04:24 UTC (rev 3958)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchIndexConfigurationHelper.java 2011-02-10 13:39:51 UTC (rev 3959)
@@ -190,5 +190,9 @@
{
searchIndex.setReindexingPageSize(StringNumberParser.parseNumber(value).intValue());
}
+ else if (QueryHandlerParams.PARAM_RDBMS_REINDEXING.equals(name))
+ {
+ searchIndex.setRDBMSReindexing(Boolean.parseBoolean(value));
+ }
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2011-02-10 10:04:24 UTC (rev 3958)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2011-02-10 13:39:51 UTC (rev 3959)
@@ -434,12 +434,12 @@
long count;
- // check if we have deal with RDBMS reindexing mechanism
- Indexable indexableComponent = (Indexable)handler.getContext().getContainer().getComponent(Indexable.class);
- if (indexableComponent != null && indexableComponent.isPagingSupport())
+ // check if we have deal with RDBMS indexing mechanism
+ Indexable rdbmsIndexableComponent = (Indexable)handler.getContext().getContainer().getComponent(Indexable.class);
+ if (handler.isRDBMSReindexing() && rdbmsIndexableComponent != null && rdbmsIndexableComponent.isPagingSupport())
{
count =
- createIndex(indexableComponent.getNodeDataIndexingIterator(handler.getReindexingPageSize()),
+ createIndex(rdbmsIndexableComponent.getNodeDataIndexingIterator(handler.getReindexingPageSize()),
indexingTree.getIndexingRoot());
}
else
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2011-02-10 10:04:24 UTC (rev 3958)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2011-02-10 13:39:51 UTC (rev 3959)
@@ -176,6 +176,11 @@
public static final int DEFAULT_REINDEXING_PAGE_SIZE = 100;
/**
+ * The default value for {@link #rdbmsReindexing}.
+ */
+ public static final boolean DEFAULT_RDBMS_REINDEXING = true;
+
+ /**
* Default name of the error log file
*/
private static final String ERROR_LOG = "error.log";
@@ -466,6 +471,11 @@
private int reindexingPageSize = DEFAULT_REINDEXING_PAGE_SIZE;
/**
+ * Indicates what reindexing mechanism need to use.
+ */
+ private boolean rdbmsReindexing = DEFAULT_RDBMS_REINDEXING;
+
+ /**
* Working constructor.
*
* @throws RepositoryConfigurationException
@@ -2668,6 +2678,14 @@
}
/**
+ * @return the current value for rdbmsReindexing
+ */
+ public boolean isRDBMSReindexing()
+ {
+ return rdbmsReindexing;
+ }
+
+ /**
* Sets a new value for termInfosIndexDivisor.
*
* @param termInfosIndexDivisor
@@ -2710,6 +2728,17 @@
this.reindexingPageSize = reindexingPageSize;
}
+ /**
+ * Set a new value for reindexingPageSize.
+ *
+ * @param reindexingPageSize
+ * the new value
+ */
+ public void setRDBMSReindexing(boolean rdbmsReindexing)
+ {
+ this.rdbmsReindexing = rdbmsReindexing;
+ }
+
// ----------------------------< internal
// >----------------------------------
15 years, 2 months
exo-jcr SVN: r3958 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-02-10 05:04:24 -0500 (Thu, 10 Feb 2011)
New Revision: 3958
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
Log:
EXOJCR-1104: remove debug info
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2011-02-10 09:03:52 UTC (rev 3957)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2011-02-10 10:04:24 UTC (rev 3958)
@@ -1028,9 +1028,7 @@
checkIfOpened();
try
{
- long start = System.currentTimeMillis();
ResultSet resultSet = findNodesAndProperties(offset, limit);
- System.out.println("end offset=" + offset + " time=" + (System.currentTimeMillis() - start));
try
{
15 years, 2 months
exo-jcr SVN: r3957 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc: db and 1 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-02-10 04:03:52 -0500 (Thu, 10 Feb 2011)
New Revision: 3957
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MySQLMultiDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MySQLMultiDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MySQLSingleDbJDBCConnection.java
Log:
EXOJCR-1104: optimize query for MySQL
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2011-02-09 17:49:16 UTC (rev 3956)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2011-02-10 09:03:52 UTC (rev 3957)
@@ -1028,7 +1028,9 @@
checkIfOpened();
try
{
+ long start = System.currentTimeMillis();
ResultSet resultSet = findNodesAndProperties(offset, limit);
+ System.out.println("end offset=" + offset + " time=" + (System.currentTimeMillis() - start));
try
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MySQLMultiDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MySQLMultiDbJDBCConnection.java 2011-02-09 17:49:16 UTC (rev 3956)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MySQLMultiDbJDBCConnection.java 2011-02-10 09:03:52 UTC (rev 3957)
@@ -72,6 +72,21 @@
* {@inheritDoc}
*/
@Override
+ protected void prepareQueries() throws SQLException
+ {
+ super.prepareQueries();
+ FIND_NODES_AND_PROPERTIES =
+ "select J.*, P.ID AS P_ID, P.NAME AS P_NAME, P.VERSION AS P_VERSION, P.P_TYPE, P.P_MULTIVALUED,"
+ + " V.DATA, V.ORDER_NUM, V.STORAGE_DESC from JCR_MVALUE V, JCR_MITEM P use index(JCR_IDX_MITEM_PARENT_ID)"
+ + " join (select I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_INDEX, I.N_ORDER_NUM from JCR_MITEM I"
+ + " where I.I_CLASS=1 order by I.ID LIMIT ? OFFSET ?) J on P.PARENT_ID = J.ID"
+ + " where P.I_CLASS=2 and V.PROPERTY_ID=P.ID order by J.ID";
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
protected int addNodeRecord(NodeData data) throws SQLException
{
// check if parent exists
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MySQLMultiDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MySQLMultiDbJDBCConnection.java 2011-02-09 17:49:16 UTC (rev 3956)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MySQLMultiDbJDBCConnection.java 2011-02-10 09:03:52 UTC (rev 3957)
@@ -72,6 +72,21 @@
* {@inheritDoc}
*/
@Override
+ protected void prepareQueries() throws SQLException
+ {
+ super.prepareQueries();
+ FIND_NODES_AND_PROPERTIES =
+ "select J.*, P.ID AS P_ID, P.NAME AS P_NAME, P.VERSION AS P_VERSION, P.P_TYPE, P.P_MULTIVALUED,"
+ + " V.DATA, V.ORDER_NUM, V.STORAGE_DESC from JCR_MVALUE V, JCR_MITEM P use index(JCR_IDX_MITEM_PARENT_ID)"
+ + " join (select I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_INDEX, I.N_ORDER_NUM from JCR_MITEM I"
+ + " where I.I_CLASS=1 order by I.ID LIMIT ? OFFSET ?) J on P.PARENT_ID = J.ID"
+ + " where P.I_CLASS=2 and V.PROPERTY_ID=P.ID order by J.ID";
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
protected int addNodeRecord(NodeData data) throws SQLException
{
// check if parent exists
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MySQLSingleDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MySQLSingleDbJDBCConnection.java 2011-02-09 17:49:16 UTC (rev 3956)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MySQLSingleDbJDBCConnection.java 2011-02-10 09:03:52 UTC (rev 3957)
@@ -72,6 +72,21 @@
* {@inheritDoc}
*/
@Override
+ protected void prepareQueries() throws SQLException
+ {
+ super.prepareQueries();
+ FIND_NODES_AND_PROPERTIES =
+ "select J.*, P.ID AS P_ID, P.NAME AS P_NAME, P.VERSION AS P_VERSION, P.P_TYPE, P.P_MULTIVALUED,"
+ + " V.DATA, V.ORDER_NUM, V.STORAGE_DESC from JCR_SVALUE V, JCR_SITEM P use index(JCR_IDX_SITEM_PARENT_ID)"
+ + " join (select I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_INDEX, I.N_ORDER_NUM from JCR_SITEM I"
+ + " where I.CONTAINER_NAME=? AND I.I_CLASS=1 order by I.ID LIMIT ? OFFSET ?) J on P.PARENT_ID = J.ID"
+ + " where P.I_CLASS=2 and P.CONTAINER_NAME=? and V.PROPERTY_ID=P.ID order by J.ID";
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
protected int addNodeRecord(NodeData data) throws SQLException
{
// check if parent exists
15 years, 2 months
exo-jcr SVN: r3956 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc: db and 2 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-02-09 12:49:16 -0500 (Wed, 09 Feb 2011)
New Revision: 3956
Added:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SybaseConnectionFactory.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SybaseMultiDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SybaseSingleDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SybaseConnectionFactory.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SybaseMultiDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SybaseSingleDbJDBCConnection.java
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCWorkspaceDataContainer.java
Log:
EXOJCR-1104: add connection factory for Sybase
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2011-02-09 17:39:52 UTC (rev 3955)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2011-02-09 17:49:16 UTC (rev 3956)
@@ -49,6 +49,7 @@
import org.exoplatform.services.jcr.impl.storage.jdbc.db.MSSQLConnectionFactory;
import org.exoplatform.services.jcr.impl.storage.jdbc.db.MySQLConnectionFactory;
import org.exoplatform.services.jcr.impl.storage.jdbc.db.OracleConnectionFactory;
+import org.exoplatform.services.jcr.impl.storage.jdbc.db.SybaseConnectionFactory;
import org.exoplatform.services.jcr.impl.storage.jdbc.db.WorkspaceStorageConnectionFactory;
import org.exoplatform.services.jcr.impl.storage.jdbc.indexing.JdbcNodeDataIndexingIterator;
import org.exoplatform.services.jcr.impl.storage.jdbc.init.IngresSQLDBInitializer;
@@ -835,7 +836,27 @@
}
else if (dbDialect == DBConstants.DB_DIALECT_SYBASE)
{
- this.connFactory = defaultConnectionFactory();
+ if (dbSourceName != null)
+ {
+ DataSource ds = (DataSource)new InitialContext().lookup(dbSourceName);
+ if (ds != null)
+ {
+ this.connFactory =
+ new SybaseConnectionFactory(ds, containerName, multiDb, valueStorageProvider, maxBufferSize,
+ swapDirectory, swapCleaner);
+ }
+ else
+ {
+ throw new RepositoryException("Datasource '" + dbSourceName + "' is not bound in this context.");
+ }
+ }
+ else
+ {
+ this.connFactory =
+ new SybaseConnectionFactory(dbDriver, dbUrl, dbUserName, dbPassword, containerName, multiDb,
+ valueStorageProvider, maxBufferSize, swapDirectory, swapCleaner);
+ }
+
sqlPath = "/conf/storage/jcr-" + (multiDb ? "m" : "s") + "jdbc.sybase.sql";
dbInitilizer = defaultDBInitializer(sqlPath);
}
Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SybaseConnectionFactory.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SybaseConnectionFactory.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SybaseConnectionFactory.java 2011-02-09 17:49:16 UTC (rev 3956)
@@ -0,0 +1,125 @@
+/*
+ * 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.impl.storage.jdbc.db;
+
+import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
+import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection;
+import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvider;
+
+import java.io.File;
+import java.sql.SQLException;
+
+import javax.jcr.RepositoryException;
+import javax.sql.DataSource;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * Date: 8 02 2011
+ *
+ * @author <a href="mailto:anatoliy.bazko@exoplatform.com.ua">Anatoliy Bazko</a>
+ * @version $Id: SybaseConnectionFactory.java 34360 2010-11-11 11:11:11Z tolusha $
+ */
+public class SybaseConnectionFactory extends GenericConnectionFactory
+{
+
+ /**
+ * SybaseConnectionFactory constructor.
+ *
+ * @param dataSource
+ * - DataSource
+ * @param dbDriver
+ * - JDBC Driver
+ * @param dbUrl
+ * - JDBC URL
+ * @param dbUserName
+ * - database username
+ * @param dbPassword
+ * - database user password
+ * @param containerName
+ * - Container name (see configuration)
+ * @param multiDb
+ * - multidatabase state flag
+ * @param valueStorageProvider
+ * - external Value Storages provider
+ * @param maxBufferSize
+ * - Maximum buffer size (see configuration)
+ * @param swapDirectory
+ * - Swap directory (see configuration)
+ * @param swapCleaner
+ * - Swap cleaner (internal FileCleaner).
+ * @throws RepositoryException
+ * if error eccurs
+ */
+ public SybaseConnectionFactory(String dbDriver, String dbUrl, String dbUserName, String dbPassword,
+ String containerName, boolean multiDb, ValueStoragePluginProvider valueStorageProvider, int maxBufferSize,
+ File swapDirectory, FileCleaner swapCleaner) throws RepositoryException
+ {
+ super(dbDriver, dbUrl, dbUserName, dbPassword, containerName, multiDb, valueStorageProvider, maxBufferSize,
+ swapDirectory, swapCleaner);
+ }
+
+ /**
+ * SybaseConnectionFactory constructor.
+ *
+ * @param dataSource
+ * - DataSource
+ * @param containerName
+ * - Container name (see configuration)
+ * @param multiDb
+ * - multidatabase state flag
+ * @param valueStorageProvider
+ * - external Value Storages provider
+ * @param maxBufferSize
+ * - Maximum buffer size (see configuration)
+ * @param swapDirectory
+ * - Swap directory (see configuration)
+ * @param swapCleaner
+ * - Swap cleaner (internal FileCleaner).
+ */
+ public SybaseConnectionFactory(DataSource dbDataSource, String containerName, boolean multiDb,
+ ValueStoragePluginProvider valueStorageProvider, int maxBufferSize, File swapDirectory, FileCleaner swapCleaner)
+ {
+ super(dbDataSource, containerName, multiDb, valueStorageProvider, maxBufferSize, swapDirectory, swapCleaner);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public WorkspaceStorageConnection openConnection(boolean readOnly) throws RepositoryException
+ {
+ try
+ {
+ if (multiDb)
+ {
+ return new SybaseMultiDbJDBCConnection(getJdbcConnection(readOnly), readOnly, containerName,
+ valueStorageProvider, maxBufferSize, swapDirectory, swapCleaner);
+ }
+
+ return new SybaseSingleDbJDBCConnection(getJdbcConnection(readOnly), readOnly, containerName,
+ valueStorageProvider, maxBufferSize, swapDirectory, swapCleaner);
+
+ }
+ catch (SQLException e)
+ {
+ throw new RepositoryException(e);
+ }
+ }
+}
Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SybaseMultiDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SybaseMultiDbJDBCConnection.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SybaseMultiDbJDBCConnection.java 2011-02-09 17:49:16 UTC (rev 3956)
@@ -0,0 +1,97 @@
+/*
+ * 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.storage.jdbc.db;
+
+import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
+import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvider;
+
+import java.io.File;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * Date: 8 02 2011
+ *
+ * @author <a href="mailto:anatoliy.bazko@exoplatform.com.ua">Anatoliy Bazko</a>
+ * @version $Id: SybaseMultiDbJDBCConnection.java 34360 2010-11-11 11:11:11Z tolusha $
+ */
+public class SybaseMultiDbJDBCConnection extends MultiDbJDBCConnection
+{
+ /**
+ * Sybase Multidatabase JDBC Connection constructor.
+ *
+ * @param dbConnection
+ * JDBC connection, shoudl be opened before
+ * @param readOnly
+ * boolean if true the dbConnection was marked as READ-ONLY.
+ * @param containerName
+ * Workspace Storage Container name (see configuration)
+ * @param valueStorageProvider
+ * External Value Storages provider
+ * @param maxBufferSize
+ * Maximum buffer size (see configuration)
+ * @param swapDirectory
+ * Swap directory File (see configuration)
+ * @param swapCleaner
+ * Swap cleaner (internal FileCleaner).
+ * @throws SQLException
+ *
+ * @see org.exoplatform.services.jcr.impl.util.io.FileCleaner
+ */
+ public SybaseMultiDbJDBCConnection(Connection dbConnection, boolean readOnly, String containerName,
+ ValueStoragePluginProvider valueStorageProvider, int maxBufferSize, File swapDirectory, FileCleaner swapCleaner)
+ throws SQLException
+ {
+ super(dbConnection, readOnly, containerName, valueStorageProvider, maxBufferSize, swapDirectory, swapCleaner);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void prepareQueries() throws SQLException
+ {
+ super.prepareQueries();
+ FIND_NODES_AND_PROPERTIES =
+ "select J.*, P.ID AS P_ID, P.NAME AS P_NAME, P.VERSION AS P_VERSION, P.P_TYPE, P.P_MULTIVALUED,"
+ + " V.DATA, V.ORDER_NUM, V.STORAGE_DESC from JCR_MVALUE V, JCR_MITEM P"
+ + " join (select I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_INDEX, I.N_ORDER_NUM from JCR_MITEM I"
+ + " where I.I_CLASS=1) J on P.PARENT_ID = J.ID"
+ + " where P.I_CLASS=2 and V.PROPERTY_ID=P.ID order by J.ID";
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected ResultSet findNodesAndProperties(int offset, int limit) throws SQLException
+ {
+ if (findNodesAndProperties == null)
+ {
+ findNodesAndProperties = dbConnection.prepareStatement(FIND_NODES_AND_PROPERTIES);
+ }
+ else
+ {
+ findNodesAndProperties.clearParameters();
+ }
+
+ return findNodesAndProperties.executeQuery();
+ }
+}
Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SybaseSingleDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SybaseSingleDbJDBCConnection.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SybaseSingleDbJDBCConnection.java 2011-02-09 17:49:16 UTC (rev 3956)
@@ -0,0 +1,100 @@
+/*
+ * 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.storage.jdbc.db;
+
+import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
+import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvider;
+
+import java.io.File;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * Date: 8 02 2011
+ *
+ * @author <a href="mailto:anatoliy.bazko@exoplatform.com.ua">Anatoliy Bazko</a>
+ * @version $Id: SybaseSingleDbJDBCConnection.java 34360 2010-11-11 11:11:11Z tolusha $
+ */
+public class SybaseSingleDbJDBCConnection extends SingleDbJDBCConnection
+{
+ /**
+ * Sybase Singledatabase JDBC Connection constructor.
+ *
+ * @param dbConnection
+ * JDBC connection, should be opened before
+ * @param readOnly
+ * boolean if true the dbConnection was marked as READ-ONLY.
+ * @param containerName
+ * Workspace Storage Container name (see configuration)
+ * @param valueStorageProvider
+ * External Value Storages provider
+ * @param maxBufferSize
+ * Maximum buffer size (see configuration)
+ * @param swapDirectory
+ * Swap directory File (see configuration)
+ * @param swapCleaner
+ * Swap cleaner (internal FileCleaner).
+ * @throws SQLException
+ *
+ * @see org.exoplatform.services.jcr.impl.util.io.FileCleaner
+ */
+ public SybaseSingleDbJDBCConnection(Connection dbConnection, boolean readOnly, String containerName,
+ ValueStoragePluginProvider valueStorageProvider, int maxBufferSize, File swapDirectory, FileCleaner swapCleaner)
+ throws SQLException
+ {
+ super(dbConnection, readOnly, containerName, valueStorageProvider, maxBufferSize, swapDirectory, swapCleaner);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void prepareQueries() throws SQLException
+ {
+ super.prepareQueries();
+ FIND_NODES_AND_PROPERTIES =
+ "select J.*, P.ID AS P_ID, P.NAME AS P_NAME, P.VERSION AS P_VERSION, P.P_TYPE, P.P_MULTIVALUED,"
+ + " V.DATA, V.ORDER_NUM, V.STORAGE_DESC from JCR_SVALUE V, JCR_SITEM P"
+ + " join (select I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_INDEX, I.N_ORDER_NUM from JCR_SITEM I"
+ + " where I.CONTAINER_NAME=? AND I.I_CLASS=1) J on P.PARENT_ID = J.ID"
+ + " where P.I_CLASS=2 and P.CONTAINER_NAME=? and V.PROPERTY_ID=P.ID order by J.ID";
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected ResultSet findNodesAndProperties(int offset, int limit) throws SQLException
+ {
+ if (findNodesAndProperties == null)
+ {
+ findNodesAndProperties = dbConnection.prepareStatement(FIND_NODES_AND_PROPERTIES);
+ }
+ else
+ {
+ findNodesAndProperties.clearParameters();
+ }
+
+ findNodesAndProperties.setString(1, containerName);
+ findNodesAndProperties.setString(4, containerName);
+
+ return findNodesAndProperties.executeQuery();
+ }
+}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCWorkspaceDataContainer.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCWorkspaceDataContainer.java 2011-02-09 17:39:52 UTC (rev 3955)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCWorkspaceDataContainer.java 2011-02-09 17:49:16 UTC (rev 3956)
@@ -35,6 +35,7 @@
import org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.db.MSSQLConnectionFactory;
import org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.db.MySQLConnectionFactory;
import org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.db.OracleConnectionFactory;
+import org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.db.SybaseConnectionFactory;
import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder;
import org.exoplatform.services.jcr.impl.util.jdbc.DBInitializerException;
import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvider;
@@ -272,7 +273,27 @@
}
else if (dbDialect == DBConstants.DB_DIALECT_SYBASE)
{
- this.connFactory = defaultConnectionFactory();
+ if (dbSourceName != null)
+ {
+ DataSource ds = (DataSource)new InitialContext().lookup(dbSourceName);
+ if (ds != null)
+ {
+ this.connFactory =
+ new SybaseConnectionFactory(ds, containerName, multiDb, valueStorageProvider, maxBufferSize,
+ swapDirectory, swapCleaner);
+ }
+ else
+ {
+ throw new RepositoryException("Datasource '" + dbSourceName + "' is not bound in this context.");
+ }
+ }
+ else
+ {
+ this.connFactory =
+ new SybaseConnectionFactory(dbDriver, dbUrl, dbUserName, dbPassword, containerName, multiDb,
+ valueStorageProvider, maxBufferSize, swapDirectory, swapCleaner);
+ }
+
sqlPath = "/conf/storage/jcr-" + (multiDb ? "m" : "s") + "jdbc.sybase.sql";
dbInitilizer = defaultDBInitializer(sqlPath);
}
Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SybaseConnectionFactory.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SybaseConnectionFactory.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SybaseConnectionFactory.java 2011-02-09 17:49:16 UTC (rev 3956)
@@ -0,0 +1,125 @@
+/*
+ * 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.impl.storage.jdbc.optimisation.db;
+
+import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
+import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection;
+import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvider;
+
+import java.io.File;
+import java.sql.SQLException;
+
+import javax.jcr.RepositoryException;
+import javax.sql.DataSource;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * Date: 8 02 2011
+ *
+ * @author <a href="mailto:anatoliy.bazko@exoplatform.com.ua">Anatoliy Bazko</a>
+ * @version $Id: SybaseConnectionFactory.java 34360 2010-11-11 11:11:11Z tolusha $
+ */
+public class SybaseConnectionFactory extends GenericCQConnectionFactory
+{
+
+ /**
+ * SybaseConnectionFactory constructor.
+ *
+ * @param dataSource
+ * - DataSource
+ * @param dbDriver
+ * - JDBC Driver
+ * @param dbUrl
+ * - JDBC URL
+ * @param dbUserName
+ * - database username
+ * @param dbPassword
+ * - database user password
+ * @param containerName
+ * - Container name (see configuration)
+ * @param multiDb
+ * - multidatabase state flag
+ * @param valueStorageProvider
+ * - external Value Storages provider
+ * @param maxBufferSize
+ * - Maximum buffer size (see configuration)
+ * @param swapDirectory
+ * - Swap directory (see configuration)
+ * @param swapCleaner
+ * - Swap cleaner (internal FileCleaner).
+ * @throws RepositoryException
+ * if error eccurs
+ */
+ public SybaseConnectionFactory(String dbDriver, String dbUrl, String dbUserName, String dbPassword,
+ String containerName, boolean multiDb, ValueStoragePluginProvider valueStorageProvider, int maxBufferSize,
+ File swapDirectory, FileCleaner swapCleaner) throws RepositoryException
+ {
+ super(dbDriver, dbUrl, dbUserName, dbPassword, containerName, multiDb, valueStorageProvider, maxBufferSize,
+ swapDirectory, swapCleaner);
+ }
+
+ /**
+ * SybaseConnectionFactory constructor.
+ *
+ * @param dataSource
+ * - DataSource
+ * @param containerName
+ * - Container name (see configuration)
+ * @param multiDb
+ * - multidatabase state flag
+ * @param valueStorageProvider
+ * - external Value Storages provider
+ * @param maxBufferSize
+ * - Maximum buffer size (see configuration)
+ * @param swapDirectory
+ * - Swap directory (see configuration)
+ * @param swapCleaner
+ * - Swap cleaner (internal FileCleaner).
+ */
+ public SybaseConnectionFactory(DataSource dbDataSource, String containerName, boolean multiDb,
+ ValueStoragePluginProvider valueStorageProvider, int maxBufferSize, File swapDirectory, FileCleaner swapCleaner)
+ {
+ super(dbDataSource, containerName, multiDb, valueStorageProvider, maxBufferSize, swapDirectory, swapCleaner);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public WorkspaceStorageConnection openConnection(boolean readOnly) throws RepositoryException
+ {
+ try
+ {
+ if (multiDb)
+ {
+ return new SybaseMultiDbJDBCConnection(getJdbcConnection(readOnly), readOnly, containerName,
+ valueStorageProvider, maxBufferSize, swapDirectory, swapCleaner);
+ }
+
+ return new SybaseSingleDbJDBCConnection(getJdbcConnection(readOnly), readOnly, containerName,
+ valueStorageProvider, maxBufferSize, swapDirectory, swapCleaner);
+
+ }
+ catch (SQLException e)
+ {
+ throw new RepositoryException(e);
+ }
+ }
+}
Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SybaseMultiDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SybaseMultiDbJDBCConnection.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SybaseMultiDbJDBCConnection.java 2011-02-09 17:49:16 UTC (rev 3956)
@@ -0,0 +1,97 @@
+/*
+ * 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.storage.jdbc.optimisation.db;
+
+import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
+import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvider;
+
+import java.io.File;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * Date: 8 02 2011
+ *
+ * @author <a href="mailto:anatoliy.bazko@exoplatform.com.ua">Anatoliy Bazko</a>
+ * @version $Id: SybaseMultiDbJDBCConnection.java 34360 2010-11-11 11:11:11Z tolusha $
+ */
+public class SybaseMultiDbJDBCConnection extends MultiDbJDBCConnection
+{
+ /**
+ * Sybase Multidatabase JDBC Connection constructor.
+ *
+ * @param dbConnection
+ * JDBC connection, shoudl be opened before
+ * @param readOnly
+ * boolean if true the dbConnection was marked as READ-ONLY.
+ * @param containerName
+ * Workspace Storage Container name (see configuration)
+ * @param valueStorageProvider
+ * External Value Storages provider
+ * @param maxBufferSize
+ * Maximum buffer size (see configuration)
+ * @param swapDirectory
+ * Swap directory File (see configuration)
+ * @param swapCleaner
+ * Swap cleaner (internal FileCleaner).
+ * @throws SQLException
+ *
+ * @see org.exoplatform.services.jcr.impl.util.io.FileCleaner
+ */
+ public SybaseMultiDbJDBCConnection(Connection dbConnection, boolean readOnly, String containerName,
+ ValueStoragePluginProvider valueStorageProvider, int maxBufferSize, File swapDirectory, FileCleaner swapCleaner)
+ throws SQLException
+ {
+ super(dbConnection, readOnly, containerName, valueStorageProvider, maxBufferSize, swapDirectory, swapCleaner);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void prepareQueries() throws SQLException
+ {
+ super.prepareQueries();
+ FIND_NODES_AND_PROPERTIES =
+ "select J.*, P.ID AS P_ID, P.NAME AS P_NAME, P.VERSION AS P_VERSION, P.P_TYPE, P.P_MULTIVALUED,"
+ + " V.DATA, V.ORDER_NUM, V.STORAGE_DESC from JCR_MVALUE V, JCR_MITEM P"
+ + " join (select I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_INDEX, I.N_ORDER_NUM from JCR_MITEM I"
+ + " where I.I_CLASS=1) J on P.PARENT_ID = J.ID"
+ + " where P.I_CLASS=2 and V.PROPERTY_ID=P.ID order by J.ID";
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected ResultSet findNodesAndProperties(int offset, int limit) throws SQLException
+ {
+ if (findNodesAndProperties == null)
+ {
+ findNodesAndProperties = dbConnection.prepareStatement(FIND_NODES_AND_PROPERTIES);
+ }
+ else
+ {
+ findNodesAndProperties.clearParameters();
+ }
+
+ return findNodesAndProperties.executeQuery();
+ }
+}
Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SybaseSingleDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SybaseSingleDbJDBCConnection.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SybaseSingleDbJDBCConnection.java 2011-02-09 17:49:16 UTC (rev 3956)
@@ -0,0 +1,100 @@
+/*
+ * 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.storage.jdbc.optimisation.db;
+
+import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
+import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvider;
+
+import java.io.File;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * Date: 8 02 2011
+ *
+ * @author <a href="mailto:anatoliy.bazko@exoplatform.com.ua">Anatoliy Bazko</a>
+ * @version $Id: SybaseSingleDbJDBCConnection.java 34360 2010-11-11 11:11:11Z tolusha $
+ */
+public class SybaseSingleDbJDBCConnection extends SingleDbJDBCConnection
+{
+ /**
+ * Sybase Singledatabase JDBC Connection constructor.
+ *
+ * @param dbConnection
+ * JDBC connection, should be opened before
+ * @param readOnly
+ * boolean if true the dbConnection was marked as READ-ONLY.
+ * @param containerName
+ * Workspace Storage Container name (see configuration)
+ * @param valueStorageProvider
+ * External Value Storages provider
+ * @param maxBufferSize
+ * Maximum buffer size (see configuration)
+ * @param swapDirectory
+ * Swap directory File (see configuration)
+ * @param swapCleaner
+ * Swap cleaner (internal FileCleaner).
+ * @throws SQLException
+ *
+ * @see org.exoplatform.services.jcr.impl.util.io.FileCleaner
+ */
+ public SybaseSingleDbJDBCConnection(Connection dbConnection, boolean readOnly, String containerName,
+ ValueStoragePluginProvider valueStorageProvider, int maxBufferSize, File swapDirectory, FileCleaner swapCleaner)
+ throws SQLException
+ {
+ super(dbConnection, readOnly, containerName, valueStorageProvider, maxBufferSize, swapDirectory, swapCleaner);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void prepareQueries() throws SQLException
+ {
+ super.prepareQueries();
+ FIND_NODES_AND_PROPERTIES =
+ "select J.*, P.ID AS P_ID, P.NAME AS P_NAME, P.VERSION AS P_VERSION, P.P_TYPE, P.P_MULTIVALUED,"
+ + " V.DATA, V.ORDER_NUM, V.STORAGE_DESC from JCR_SVALUE V, JCR_SITEM P"
+ + " join (select I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_INDEX, I.N_ORDER_NUM from JCR_SITEM I"
+ + " where I.CONTAINER_NAME=? AND I.I_CLASS=1) J on P.PARENT_ID = J.ID"
+ + " where P.I_CLASS=2 and P.CONTAINER_NAME=? and V.PROPERTY_ID=P.ID order by J.ID";
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected ResultSet findNodesAndProperties(int offset, int limit) throws SQLException
+ {
+ if (findNodesAndProperties == null)
+ {
+ findNodesAndProperties = dbConnection.prepareStatement(FIND_NODES_AND_PROPERTIES);
+ }
+ else
+ {
+ findNodesAndProperties.clearParameters();
+ }
+
+ findNodesAndProperties.setString(1, containerName);
+ findNodesAndProperties.setString(4, containerName);
+
+ return findNodesAndProperties.executeQuery();
+ }
+}
15 years, 2 months
exo-jcr SVN: r3955 - in jcr/trunk/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: tolusha
Date: 2011-02-09 12:39:52 -0500 (Wed, 09 Feb 2011)
New Revision: 3955
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/Indexable.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
Log:
EXOJCR-1104: add isPagingSupport method
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/Indexable.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/Indexable.java 2011-02-09 11:25:30 UTC (rev 3954)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/Indexable.java 2011-02-09 17:39:52 UTC (rev 3955)
@@ -31,12 +31,20 @@
public interface Indexable
{
/**
- * Returns NodeDataIndexingIterator or null.
+ * Returns NodeDataIndexingIterator.
*
* @param pageSize
* the maximum amount of the rows which can be retrieved from storage per once
- * @return NodeDataIndexingIterator or null
+ * @return NodeDataIndexingIterator
* @throws RepositoryException
*/
NodeDataIndexingIterator getNodeDataIndexingIterator(int pageSize) throws RepositoryException;
+
+ /**
+ * Indicates if component support extracting data from storage using paging.
+ *
+ * @return boolean
+ */
+ boolean isPagingSupport();
+
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2011-02-09 11:25:30 UTC (rev 3954)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2011-02-09 17:39:52 UTC (rev 3955)
@@ -434,20 +434,17 @@
long count;
- // check if we have deal with JDBC indexing mechanism
+ // check if we have deal with RDBMS reindexing mechanism
Indexable indexableComponent = (Indexable)handler.getContext().getContainer().getComponent(Indexable.class);
- if (indexableComponent == null)
+ if (indexableComponent != null && indexableComponent.isPagingSupport())
{
- count = createIndex(indexingTree.getIndexingRoot(), stateMgr);
+ count =
+ createIndex(indexableComponent.getNodeDataIndexingIterator(handler.getReindexingPageSize()),
+ indexingTree.getIndexingRoot());
}
else
{
- NodeDataIndexingIterator iterator =
- indexableComponent.getNodeDataIndexingIterator(handler.getReindexingPageSize());
-
- count =
- iterator == null ? createIndex(indexingTree.getIndexingRoot(), stateMgr) : createIndex(iterator,
- indexingTree.getIndexingRoot());
+ count = createIndex(indexingTree.getIndexingRoot(), stateMgr);
}
executeAndLog(new Commit(getTransactionId()));
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2011-02-09 11:25:30 UTC (rev 3954)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2011-02-09 17:39:52 UTC (rev 3955)
@@ -1508,10 +1508,16 @@
/**
* {@inheritDoc}
*/
- public NodeDataIndexingIterator getNodeDataIndexingIterator(int pageSize)
- throws RepositoryException
+ public NodeDataIndexingIterator getNodeDataIndexingIterator(int pageSize) throws RepositoryException
{
- return dbDialect.equals(DBConstants.DB_DIALECT_SYBASE) ? null : new JdbcNodeDataIndexingIterator(connFactory,
- pageSize);
+ return new JdbcNodeDataIndexingIterator(connFactory, pageSize);
}
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isPagingSupport()
+ {
+ return !dbDialect.equals(DBConstants.DB_DIALECT_SYBASE);
+ }
}
15 years, 2 months