exo-jcr SVN: r1294 - jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/jdbc.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2010-01-05 09:01:39 -0500 (Tue, 05 Jan 2010)
New Revision: 1294
Modified:
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/jdbc/SQLBenchmarkTest.java
Log:
EXOJCR-302: Benchmark with 100 threads added to SQLBenchmarkTest
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/jdbc/SQLBenchmarkTest.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/jdbc/SQLBenchmarkTest.java 2010-01-05 12:58:22 UTC (rev 1293)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/jdbc/SQLBenchmarkTest.java 2010-01-05 14:01:39 UTC (rev 1294)
@@ -90,6 +90,7 @@
benchmark(10, container);
benchmark(20, container);
benchmark(50, container);
+ benchmark(100, container);
}
private static void benchmark(int threads, StandaloneContainer container) throws Exception
16 years, 4 months
exo-jcr SVN: r1293 - jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.webdav/src/main/resources/conf.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2010-01-05 07:58:22 -0500 (Tue, 05 Jan 2010)
New Revision: 1293
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.webdav/src/main/resources/conf/webdav-nodetypes.xml
Log:
EXOJCR-340: added mix:title nodetype
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.webdav/src/main/resources/conf/webdav-nodetypes.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.webdav/src/main/resources/conf/webdav-nodetypes.xml 2010-01-05 12:43:52 UTC (rev 1292)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.webdav/src/main/resources/conf/webdav-nodetypes.xml 2010-01-05 12:58:22 UTC (rev 1293)
@@ -107,27 +107,46 @@
</nodeType>
- <nodeType name="exo:testResource" isMixin="false" hasOrderableChildNodes="true" primaryItemName="">
-
- <supertypes>
- <supertype>nt:resource</supertype>
- <supertype>nt:unstructured</supertype>
- </supertypes>
- <!-- propertyDefinitions>
- <propertyDefinition name="*" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="IGNORE" protected="false"
- multiple="false">
- <valueConstraints />
- </propertyDefinition>
- </propertyDefinitions>
- <childNodeDefinitions>
- <childNodeDefinition name="*" defaultPrimaryType="nt:unstructured" autoCreated="false" mandatory="false" onParentVersion="IGNORE"
- protected="false" sameNameSiblings="false">
- <requiredPrimaryTypes>
- <requiredPrimaryType>nt:unstructured</requiredPrimaryType>
- </requiredPrimaryTypes>
- </childNodeDefinition>
- </childNodeDefinitions -->
+ <nodeType name="exo:testResource" isMixin="false" hasOrderableChildNodes="true" primaryItemName="">
+
+ <supertypes>
+ <supertype>nt:resource</supertype>
+ <supertype>nt:unstructured</supertype>
+ </supertypes>
+ <!-- propertyDefinitions>
+ <propertyDefinition name="*" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="IGNORE" protected="false"
+ multiple="false">
+ <valueConstraints />
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*" defaultPrimaryType="nt:unstructured" autoCreated="false" mandatory="false" onParentVersion="IGNORE"
+ protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>nt:unstructured</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions -->
</nodeType>
+
+ <nodeType name="mix:title" isMixin="true" hasOrderableChildNodes="false" primaryItemName="">
+ <propertyDefinitions>
+ <propertyDefinition name="jcr:title" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="jcr:description" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="jcr:pagecount" requiredType="long" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+
</nodeTypes>
16 years, 4 months
exo-jcr SVN: r1292 - jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/jdbc.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2010-01-05 07:43:52 -0500 (Tue, 05 Jan 2010)
New Revision: 1292
Modified:
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/jdbc/SQLBenchmarkTest.java
Log:
EXOJCR-302: Make all the threads start at the same time in SQLBenchmarkTest
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/jdbc/SQLBenchmarkTest.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/jdbc/SQLBenchmarkTest.java 2010-01-05 12:16:01 UTC (rev 1291)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/jdbc/SQLBenchmarkTest.java 2010-01-05 12:43:52 UTC (rev 1292)
@@ -678,6 +678,7 @@
{
try
{
+ startSignal.await();
for (int i = 0; i < totalTimes; i++)
{
result.set(task.execute(args));
16 years, 4 months
exo-jcr SVN: r1291 - jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/jdbc.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2010-01-05 07:16:01 -0500 (Tue, 05 Jan 2010)
New Revision: 1291
Modified:
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/jdbc/SQLBenchmarkTest.java
Log:
EXOJCR-302: The MonitorDriver has been commented in SQLBenchmarkTest
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/jdbc/SQLBenchmarkTest.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/jdbc/SQLBenchmarkTest.java 2010-01-05 11:55:40 UTC (rev 1290)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/jdbc/SQLBenchmarkTest.java 2010-01-05 12:16:01 UTC (rev 1291)
@@ -55,6 +55,7 @@
*/
public class SQLBenchmarkTest
{
+/*
static
{
try
@@ -68,7 +69,7 @@
}
}
-
+*/
/**
* @param args
*/
16 years, 4 months
exo-jcr SVN: r1290 - in jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation: db and 1 other directory.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2010-01-05 06:55:40 -0500 (Tue, 05 Jan 2010)
New Revision: 1290
Modified:
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.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
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: We now use a CQ for traverseQPath
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java 2010-01-05 11:37:19 UTC (rev 1289)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java 2010-01-05 11:55:40 UTC (rev 1290)
@@ -28,6 +28,7 @@
import org.exoplatform.services.jcr.datamodel.NodeData;
import org.exoplatform.services.jcr.datamodel.PropertyData;
import org.exoplatform.services.jcr.datamodel.QPath;
+import org.exoplatform.services.jcr.datamodel.QPathEntry;
import org.exoplatform.services.jcr.datamodel.ValueData;
import org.exoplatform.services.jcr.impl.Constants;
import org.exoplatform.services.jcr.impl.dataflow.persistent.ByteArrayPersistedValueData;
@@ -84,6 +85,11 @@
protected String FIND_REFERENCE_PROPERTIES;
/**
+ * FIND_ITEM_QPATH_BY_ID_CQ.
+ */
+ protected String FIND_ITEM_QPATH_BY_ID_CQ;
+
+ /**
* Class needed to store node details (property also) since result set is not sorted in valid way.
*/
private static class TempNodeData
@@ -631,160 +637,84 @@
}
}
- // protected PersistedNodeData loadNodeRecord(ResultSet item, QPath parentPath, AccessControlList pACL)
- // throws RepositoryException, SQLException, IOException
- // {
- //
- // String cid = item.getString(COLUMN_ID);
- // String cname = item.getString(COLUMN_NAME);
- // int cversion = item.getInt(COLUMN_VERSION);
- // String cpid = item.getString(COLUMN_PARENTID);
- // int cindex = item.getInt(COLUMN_INDEX);
- // int cnordernumb = item.getInt(COLUMN_NORDERNUM);
- // AccessControlList parentACL = pACL;
- //
- // try
- // {
- // InternalQName qname = InternalQName.parse(cname);
- //
- // // TODO can't avoid QPath traverse
- // QPath qpath;
- // String parentCid;
- // if (parentPath != null)
- // {
- // // get by parent and name
- // qpath = QPath.makeChildPath(parentPath, qname, cindex);
- // parentCid = cpid;
- // }
- // else
- // {
- // // get by id
- // if (cpid.equals(Constants.ROOT_PARENT_UUID))
- // {
- // // root node
- // qpath = Constants.ROOT_PATH;
- // parentCid = null;
- // }
- // else
- // {
- // qpath = QPath.makeChildPath(traverseQPath(cpid), qname, cindex);
- // parentCid = cpid;
- // }
- // }
- //
- // // preload properties
- //
- // Map<String, List<byte[]>> properties = new LinkedHashMap<String, List<byte[]>>();
- //
- // // PRIMARY
- // if (!item.next() || !item.getString(COLUMN_NAME).equals(Constants.JCR_PRIMARYTYPE.getAsString()))
- // {
- // throw new SQLException("Node finded but primaryType property not " + cid);
- // }
- //
- // byte[] data = item.getBytes(COLUMN_VDATA);
- // InternalQName ptName = InternalQName.parse(new String((data != null ? data : new byte[]{})));
- //
- // // MIXIN
- // MixinInfo mixins = null;
- // List<InternalQName> mts = null;
- // boolean owneable = false;
- // boolean privilegeable = false;
- // while (item.next() && item.getString(COLUMN_NAME).equals(Constants.JCR_MIXINTYPES.getAsString()))
- // {
- // mts = new ArrayList<InternalQName>();
- // byte[] mxnb = item.getBytes(COLUMN_VDATA);
- // if (mxnb != null)
- // {
- // InternalQName mxn = InternalQName.parse(new String(mxnb));
- // mts.add(mxn);
- //
- // if (!privilegeable && Constants.EXO_PRIVILEGEABLE.equals(mxn))
- // privilegeable = true;
- // else if (!owneable && Constants.EXO_OWNEABLE.equals(mxn))
- // owneable = true;
- // } // else, if SQL NULL - skip it
- //
- // }
- //
- // mixins = new MixinInfo(mts, owneable, privilegeable);
- //
- // try
- // {
- // // ACL
- // AccessControlList acl; // NO DEFAULT values!
- //
- // if (mixins.hasOwneable())
- // {
- // // has own owner
- // if (mixins.hasPrivilegeable())
- // {
- // // and permissions
- // acl = new AccessControlList(readACLOwner(cid), readACLPermisions(cid));
- // }
- // else if (parentACL != null)
- // {
- // // use permissions from existed parent
- // acl =
- // new AccessControlList(readACLOwner(cid), parentACL.hasPermissions() ? parentACL
- // .getPermissionEntries() : null);
- // }
- // else
- // {
- // // have to search nearest ancestor permissions in ACL manager
- // // acl = new AccessControlList(readACLOwner(cid), traverseACLPermissions(cpid));
- // acl = new AccessControlList(readACLOwner(cid), null);
- // }
- // }
- // else if (mixins.hasPrivilegeable())
- // {
- // // has own permissions
- // if (mixins.hasOwneable())
- // {
- // // and owner
- // acl = new AccessControlList(readACLOwner(cid), readACLPermisions(cid));
- // }
- // else if (parentACL != null)
- // {
- // // use owner from existed parent
- // acl = new AccessControlList(parentACL.getOwner(), readACLPermisions(cid));
- // }
- // else
- // {
- // // have to search nearest ancestor owner in ACL manager
- // // acl = new AccessControlList(traverseACLOwner(cpid), readACLPermisions(cid));
- // acl = new AccessControlList(null, readACLPermisions(cid));
- // }
- // }
- // else
- // {
- // if (parentACL != null)
- // // construct ACL from existed parent ACL
- // acl =
- // new AccessControlList(parentACL.getOwner(), parentACL.hasPermissions() ? parentACL
- // .getPermissionEntries() : null);
- // else
- // // have to search nearest ancestor owner and permissions in ACL manager
- // // acl = traverseACL(cpid);
- // acl = null;
- // }
- //
- // return new PersistedNodeData(getIdentifier(cid), qpath, getIdentifier(parentCid), cversion, cnordernumb,
- // ptName, mixins.mixinNames(), acl);
- //
- // }
- // catch (IllegalACLException e)
- // {
- // throw new RepositoryException("FATAL ERROR Node " + getIdentifier(cid) + " " + qpath.getAsString()
- // + " has wrong formed ACL. ", e);
- // }
- // }
- // catch (IllegalNameException e)
- // {
- // throw new RepositoryException(e);
- // }
- // }
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected QPath traverseQPath(String cpid) throws SQLException, InvalidItemStateException, IllegalNameException
+ {
+ String id = getIdentifier(cpid);
+ if (id.equals(Constants.ROOT_UUID))
+ {
+ return Constants.ROOT_PATH;
+ }
+ // get item by Identifier usecase
+ List<QPathEntry> qrpath = new ArrayList<QPathEntry>(); // reverted path
+ String caid = cpid; // container ancestor id
+ boolean isRoot = false;
+ do
+ {
+ ResultSet result = null;
+ try
+ {
+ result = findItemQPathByIdentifierCQ(caid);
+ if (!result.next())
+ throw new InvalidItemStateException("Parent not found, uuid: " + getIdentifier(caid));
+ QPathEntry qpe1 =
+ new QPathEntry(InternalQName.parse(result.getString(COLUMN_NAME)), result.getInt(COLUMN_INDEX));
+ boolean isChild = caid.equals(result.getString(COLUMN_ID));
+ caid = result.getString(COLUMN_PARENTID);
+ if (result.next())
+ {
+ QPathEntry qpe2 =
+ new QPathEntry(InternalQName.parse(result.getString(COLUMN_NAME)), result.getInt(COLUMN_INDEX));
+ if (isChild)
+ {
+ // The child is the first result then we have the parent
+ qrpath.add(qpe1);
+ qrpath.add(qpe2);
+ // We need to take the value of the parent node
+ caid = result.getString(COLUMN_PARENTID);
+ }
+ else
+ {
+ // The parent is the first result then we have the child
+ qrpath.add(qpe2);
+ qrpath.add(qpe1);
+ }
+ }
+ else
+ {
+ qrpath.add(qpe1);
+ }
+ }
+ finally
+ {
+ result.close();
+ }
+ if (caid.equals(Constants.ROOT_PARENT_UUID) || (id = getIdentifier(caid)).equals(Constants.ROOT_UUID))
+ {
+ if (id.equals(Constants.ROOT_UUID))
+ {
+ qrpath.add(Constants.ROOT_PATH.getEntries()[0]);
+ }
+ isRoot = true;
+ }
+ }
+ while (!isRoot);
+
+ QPathEntry[] qentries = new QPathEntry[qrpath.size()];
+ int qi = 0;
+ for (int i = qrpath.size() - 1; i >= 0; i--)
+ {
+ qentries[qi++] = qrpath.get(i);
+ }
+ return new QPath(qentries);
+ }
+
+ protected abstract ResultSet findItemQPathByIdentifierCQ(String identifier) throws SQLException;
+
protected abstract ResultSet findChildNodesByParentIdentifierCQ(String parentIdentifier) throws SQLException;
protected abstract ResultSet findChildPropertiesByParentIdentifierCQ(String parentIdentifier) throws SQLException;
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-05 11:37:19 UTC (rev 1289)
+++ 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-05 11:55:40 UTC (rev 1290)
@@ -90,6 +90,8 @@
protected PreparedStatement findNodeMainPropertiesByParentIdentifierCQ;
+ protected PreparedStatement findItemQPathByIdentifierCQ;
+
protected PreparedStatement insertNode;
protected PreparedStatement insertProperty;
@@ -205,13 +207,18 @@
"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"
+ " 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, 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";
FIND_NODE_MAIN_PROPERTIES_BY_PARENTID_CQ =
"select I.NAME, V.DATA"
+ " 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_ITEM_QPATH_BY_ID_CQ =
+ "select I.ID, I.PARENT_ID, I.NAME, I.I_INDEX"
+ + " from JCR_MITEM I, (SELECT ID, PARENT_ID from JCR_MITEM where ID=?) J"
+ + " where I.ID = J.ID or I.ID = J.PARENT_ID";
+
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";
@@ -639,6 +646,18 @@
return findNodeMainPropertiesByParentIdentifierCQ.executeQuery();
}
+ @Override
+ protected ResultSet findItemQPathByIdentifierCQ(String identifier) throws SQLException
+ {
+ if (findItemQPathByIdentifierCQ == null)
+ findItemQPathByIdentifierCQ = dbConnection.prepareStatement(FIND_ITEM_QPATH_BY_ID_CQ);
+ else
+ findItemQPathByIdentifierCQ.clearParameters();
+
+ findItemQPathByIdentifierCQ.setString(1, identifier);
+ return findItemQPathByIdentifierCQ.executeQuery();
+ }
+
/**
* {@inheritDoc}
*/
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-05 11:37:19 UTC (rev 1289)
+++ 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-05 11:55:40 UTC (rev 1290)
@@ -87,6 +87,8 @@
protected PreparedStatement findNodeMainPropertiesByParentIdentifierCQ;
+ protected PreparedStatement findItemQPathByIdentifierCQ;
+
protected PreparedStatement insertItem;
protected PreparedStatement insertNode;
@@ -219,6 +221,11 @@
+ " 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_ITEM_QPATH_BY_ID_CQ =
+ "select I.ID, I.PARENT_ID, I.NAME, I.I_INDEX"
+ + " from JCR_SITEM I, (SELECT ID, PARENT_ID from JCR_SITEM where ID=?) J"
+ + " where I.ID = J.ID or I.ID = J.PARENT_ID";
+
FIND_NODES_COUNT_BY_PARENTID =
"select count(ID) from JCR_SITEM" + " where I_CLASS=1 and CONTAINER_NAME=? and PARENT_ID=?";
@@ -657,6 +664,18 @@
}
@Override
+ protected ResultSet findItemQPathByIdentifierCQ(String identifier) throws SQLException
+ {
+ if (findItemQPathByIdentifierCQ == null)
+ findItemQPathByIdentifierCQ = dbConnection.prepareStatement(FIND_ITEM_QPATH_BY_ID_CQ);
+ else
+ findItemQPathByIdentifierCQ.clearParameters();
+
+ findItemQPathByIdentifierCQ.setString(1, identifier);
+ return findItemQPathByIdentifierCQ.executeQuery();
+ }
+
+ @Override
protected ResultSet findReferencePropertiesCQ(String nodeIdentifier) throws SQLException
{
if (findReferencePropertiesCQ == null)
16 years, 4 months
exo-jcr SVN: r1289 - jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-01-05 06:37:19 -0500 (Tue, 05 Jan 2010)
New Revision: 1289
Modified:
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java
Log:
EXOJCR-302: code cleanup
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java 2010-01-05 11:31:28 UTC (rev 1288)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java 2010-01-05 11:37:19 UTC (rev 1289)
@@ -266,12 +266,8 @@
{
String cid = resultSet.getString(COLUMN_ID);
String identifier = getIdentifier(cid);
- String cname = resultSet.getString(COLUMN_NAME);
+
int cversion = resultSet.getInt(COLUMN_VERSION);
- String cpid = resultSet.getString(COLUMN_PARENTID);
- int cptype = resultSet.getInt(COLUMN_PTYPE);
- boolean cpmultivalued = resultSet.getBoolean(COLUMN_PMULTIVALUED);
- QPath qpath = QPath.makeChildPath(traverseQPath(cpid), InternalQName.parse(cname));
int valueOrderNum = resultSet.getInt(COLUMN_VORDERNUM);
PersistedPropertyData prop = propertyBuffer.get(identifier);
@@ -279,6 +275,13 @@
if (prop == null)
{
// make temporary PropertyData without values
+ String cname = resultSet.getString(COLUMN_NAME);
+
+ String cpid = resultSet.getString(COLUMN_PARENTID);
+ int cptype = resultSet.getInt(COLUMN_PTYPE);
+ boolean cpmultivalued = resultSet.getBoolean(COLUMN_PMULTIVALUED);
+ QPath qpath = QPath.makeChildPath(traverseQPath(cpid), InternalQName.parse(cname));
+
prop =
new PersistedPropertyData(identifier, qpath, getIdentifier(cpid), cversion, cptype, cpmultivalued,
null);
@@ -601,19 +604,16 @@
List<ValueData> data = new ArrayList<ValueData>();
String identifier = getIdentifier(cid);
- int orderNum = -1;
-
do
{
- orderNum = resultSet.getInt(COLUMN_VORDERNUM);
+ int orderNum = resultSet.getInt(COLUMN_VORDERNUM);
final String storageId = resultSet.getString(COLUMN_VSTORAGE_DESC);
ValueData vdata =
resultSet.wasNull() ? readValueData(cid, orderNum, cversion, resultSet.getBinaryStream(COLUMN_VDATA))
: readValueData(identifier, orderNum, storageId);
data.add(vdata);
}
- while (resultSet.next() && resultSet.getString(COLUMN_ID).equals(cid)
- && (resultSet.getInt(COLUMN_VORDERNUM)) > orderNum);
+ while (resultSet.next() && resultSet.getString(COLUMN_ID).equals(cid));
PersistedPropertyData pdata =
new PersistedPropertyData(identifier, qpath, getIdentifier(cpid), cversion, cptype, cpmultivalued, data);
16 years, 4 months
exo-jcr SVN: r1288 - in jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources: SQLBenchmark and 1 other directory.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2010-01-05 06:31:28 -0500 (Tue, 05 Jan 2010)
New Revision: 1288
Added:
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/SQLBenchmark/
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/SQLBenchmark/exodb_data.sql.zip
Log:
EXOJCR-302: Data added for the SQL Benchmark
Added: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/SQLBenchmark/exodb_data.sql.zip
===================================================================
(Binary files differ)
Property changes on: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/SQLBenchmark/exodb_data.sql.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 4 months
exo-jcr SVN: r1287 - jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-01-05 06:10:51 -0500 (Tue, 05 Jan 2010)
New Revision: 1287
Modified:
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java
Log:
EXOJCR-302: getReferenceProperites fixed
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java 2010-01-05 10:01:51 UTC (rev 1286)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java 2010-01-05 11:10:51 UTC (rev 1287)
@@ -30,6 +30,7 @@
import org.exoplatform.services.jcr.datamodel.QPath;
import org.exoplatform.services.jcr.datamodel.ValueData;
import org.exoplatform.services.jcr.impl.Constants;
+import org.exoplatform.services.jcr.impl.dataflow.persistent.ByteArrayPersistedValueData;
import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCStorageConnection;
import org.exoplatform.services.jcr.impl.storage.jdbc.PrimaryTypeNotFoundException;
import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
@@ -227,13 +228,16 @@
try
{
ResultSet refProps = findReferencePropertiesCQ(getInternalId(nodeIdentifier));
- List<PropertyData> references = new ArrayList<PropertyData>();
- while (refProps.next())
- {
- while (!refProps.isAfterLast())
- references.add(loadPropertyRecord(refProps, null));
- }
- return references;
+ // List<PropertyData> references = new ArrayList<PropertyData>();
+ //
+ //
+ // while (refProps.next())
+ // {
+ // while (!refProps.isAfterLast())
+ // references.add(loadPropertyRecord(refProps, null));
+ // }
+ // return references;
+ return loadReferences(refProps);
}
catch (SQLException e)
{
@@ -245,6 +249,107 @@
}
}
+ private List<PropertyData> loadReferences(ResultSet resultSet) throws RepositoryException, SQLException, IOException
+ {
+
+ List<PropertyData> resultProps = new ArrayList<PropertyData>();
+
+ // id and how many copies in result
+ Map<String, Integer> dublicatedProps = new HashMap<String, Integer>();
+
+ Map<String, PersistedPropertyData> propertyBuffer = new HashMap<String, PersistedPropertyData>();
+ Map<String, List<ValueData>> valuesBuffer = new HashMap<String, List<ValueData>>();
+
+ try
+ {
+ while (resultSet.next())
+ {
+ String cid = resultSet.getString(COLUMN_ID);
+ String identifier = getIdentifier(cid);
+ String cname = resultSet.getString(COLUMN_NAME);
+ int cversion = resultSet.getInt(COLUMN_VERSION);
+ String cpid = resultSet.getString(COLUMN_PARENTID);
+ int cptype = resultSet.getInt(COLUMN_PTYPE);
+ boolean cpmultivalued = resultSet.getBoolean(COLUMN_PMULTIVALUED);
+ QPath qpath = QPath.makeChildPath(traverseQPath(cpid), InternalQName.parse(cname));
+
+ int valueOrderNum = resultSet.getInt(COLUMN_VORDERNUM);
+ PersistedPropertyData prop = propertyBuffer.get(identifier);
+
+ if (prop == null)
+ {
+ // make temporary PropertyData without values
+ prop =
+ new PersistedPropertyData(identifier, qpath, getIdentifier(cpid), cversion, cptype, cpmultivalued,
+ null);
+ propertyBuffer.put(identifier, prop);
+ valuesBuffer.put(identifier, new ArrayList<ValueData>());
+ dublicatedProps.put(identifier, new Integer(1));
+ }
+
+ List<ValueData> values = valuesBuffer.get(identifier);
+ if (valueOrderNum == 0 && values.size() > 0)
+ {
+ // ignore it, this is a new copy
+ Integer copies = dublicatedProps.get(identifier);
+ copies++;
+ dublicatedProps.put(identifier, copies);
+ }
+ else if (values.size() <= valueOrderNum)
+ {
+ // read value and put into values buffer
+ final String storageId = resultSet.getString(COLUMN_VSTORAGE_DESC);
+ ValueData vdata =
+ resultSet.wasNull() ? readValueData(cid, valueOrderNum, cversion, resultSet
+ .getBinaryStream(COLUMN_VDATA)) : readValueData(identifier, valueOrderNum, storageId);
+
+ values.add(vdata);
+ //TODO do we need reset values list into buffer?
+ valuesBuffer.put(identifier, values);
+ }
+ }
+
+ for (String id : propertyBuffer.keySet())
+ {
+
+ PersistedPropertyData prop = propertyBuffer.get(id);
+ List<ValueData> values = valuesBuffer.get(id);
+ int count = dublicatedProps.get(id).intValue();
+
+ for (int i = 0; i < count; i++)
+ {
+ //make a copy
+ List<ValueData> newValues = new ArrayList<ValueData>();
+ for (ValueData vd : values)
+ {
+ newValues.add(new ByteArrayPersistedValueData(vd.getOrderNumber(), vd.getAsByteArray()));
+ }
+
+ resultProps.add(new PersistedPropertyData(prop.getIdentifier(), prop.getQPath(), prop
+ .getParentIdentifier(), prop.getPersistedVersion(), prop.getType(), prop.isMultiValued(), newValues));
+ }
+
+ values.clear();
+ }
+
+ }
+ catch (IllegalNameException e)
+ {
+ throw new RepositoryException(e);
+ }
+ finally
+ {
+
+ // clean buffers
+ propertyBuffer.clear();
+ valuesBuffer.clear();
+ dublicatedProps.clear();
+ }
+
+ return resultProps;
+
+ }
+
protected List<AccessControlEntry> readACLPermisions(String cid, Map<String, List<byte[]>> properties)
throws SQLException, IllegalACLException
{
16 years, 4 months
exo-jcr SVN: r1286 - jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.webdav/src/test/resources/conf/test.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2010-01-05 05:01:51 -0500 (Tue, 05 Jan 2010)
New Revision: 1286
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.webdav/src/test/resources/conf/test/webdav-nodetypes.xml
Log:
EXOJCR-340: added mix:title nodetype
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.webdav/src/test/resources/conf/test/webdav-nodetypes.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.webdav/src/test/resources/conf/test/webdav-nodetypes.xml 2010-01-05 09:45:57 UTC (rev 1285)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.webdav/src/test/resources/conf/test/webdav-nodetypes.xml 2010-01-05 10:01:51 UTC (rev 1286)
@@ -155,6 +155,23 @@
</propertyDefinition>
</propertyDefinitions>
+ </nodeType>
+
+ <nodeType name="mix:title" isMixin="true" hasOrderableChildNodes="false" primaryItemName="">
+ <propertyDefinitions>
+ <propertyDefinition name="jcr:title" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="jcr:description" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="jcr:pagecount" requiredType="long" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
</nodeType>
</nodeTypes>
16 years, 4 months
exo-jcr SVN: r1285 - in jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test: resources/conf/standalone and 1 other directory.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2010-01-05 04:45:57 -0500 (Tue, 05 Jan 2010)
New Revision: 1285
Added:
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/jdbc/SQLBenchmarkTest.java
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/standalone/sql-benchmark-configuration.xml
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/standalone/sql-benchmark-jcr-config.xml
Log:
EXOJCR-302: SQL Benchmark added to compare the old and the new strategy
Added: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/jdbc/SQLBenchmarkTest.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/jdbc/SQLBenchmarkTest.java (rev 0)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/jdbc/SQLBenchmarkTest.java 2010-01-05 09:45:57 UTC (rev 1285)
@@ -0,0 +1,702 @@
+package org.exoplatform.services.jcr.impl.storage.jdbc;
+
+import org.exoplatform.container.StandaloneContainer;
+import org.exoplatform.services.jcr.BaseStandaloneTest;
+import org.exoplatform.services.jcr.RepositoryService;
+import org.exoplatform.services.jcr.core.WorkspaceContainerFacade;
+import org.exoplatform.services.jcr.dataflow.persistent.PersistedNodeData;
+import org.exoplatform.services.jcr.dataflow.persistent.PersistedPropertyData;
+import org.exoplatform.services.jcr.datamodel.IllegalNameException;
+import org.exoplatform.services.jcr.datamodel.ItemData;
+import org.exoplatform.services.jcr.datamodel.NodeData;
+import org.exoplatform.services.jcr.datamodel.PropertyData;
+import org.exoplatform.services.jcr.datamodel.QPath;
+import org.exoplatform.services.jcr.datamodel.QPathEntry;
+import org.exoplatform.services.jcr.datamodel.ValueData;
+import org.exoplatform.services.jcr.impl.Constants;
+import org.exoplatform.services.jcr.impl.core.RepositoryImpl;
+import org.exoplatform.services.jcr.storage.WorkspaceDataContainer;
+import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection;
+
+import java.sql.SQLException;
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicReference;
+
+import javax.jcr.InvalidItemStateException;
+import javax.jcr.RepositoryException;
+
+/*
+ * Copyright (C) 2003-2009 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/>.
+ */
+
+/**
+ * This benchmark only works with mysql with the dump that you can find in src/test/resources/SQLBenchmark/exodb_data.sql.zip
+ *
+ *
+ * Created by The eXo Platform SAS
+ * Author : Nicolas Filotto
+ * nicolas.filotto(a)exoplatform.com
+ * 18 nov. 2009
+ */
+public class SQLBenchmarkTest
+{
+ static
+ {
+ try
+ {
+ Class.forName("com.jdbmonitor.MonitorDriver");
+ System.out.println("Driver Loaded");
+ }
+ catch (ClassNotFoundException e)
+ {
+ e.printStackTrace();
+ }
+
+ }
+
+ /**
+ * @param args
+ */
+ public static void main(String[] args) throws Exception
+ {
+ String containerConf =
+ BaseStandaloneTest.class.getResource("/conf/standalone/sql-benchmark-configuration.xml").toString();
+ String loginConf = BaseStandaloneTest.class.getResource("/login.conf").toString();
+
+ StandaloneContainer.addConfigurationURL(containerConf);
+
+ StandaloneContainer container = StandaloneContainer.getInstance();
+
+ if (System.getProperty("java.security.auth.login.config") == null)
+ System.setProperty("java.security.auth.login.config", loginConf);
+
+ benchmark(1, container);
+ benchmark(10, container);
+ benchmark(20, container);
+ benchmark(50, container);
+ }
+
+ private static void benchmark(int threads, StandaloneContainer container) throws Exception
+ {
+ RepositoryService repositoryService =
+ (RepositoryService)container.getComponentInstanceOfType(RepositoryService.class);
+ RepositoryImpl repository1 = (RepositoryImpl)repositoryService.getRepository("repository1");
+ WorkspaceContainerFacade wsc1 = repository1.getWorkspaceContainer("collaboration");
+ final WorkspaceDataContainer dataContainer1 =
+ (WorkspaceDataContainer)wsc1.getComponent(WorkspaceDataContainer.class);
+ WorkspaceContainerFacade wsc1s = repository1.getWorkspaceContainer("system");
+ final WorkspaceDataContainer dataContainer1s =
+ (WorkspaceDataContainer)wsc1s.getComponent(WorkspaceDataContainer.class);
+ RepositoryImpl repository2 = (RepositoryImpl)repositoryService.getRepository("repository2");
+ WorkspaceContainerFacade wsc2 = repository2.getWorkspaceContainer("collaboration");
+ final WorkspaceDataContainer dataContainer2 =
+ (WorkspaceDataContainer)wsc2.getComponent(WorkspaceDataContainer.class);
+ WorkspaceContainerFacade wsc2s = repository2.getWorkspaceContainer("system");
+ final WorkspaceDataContainer dataContainer2s =
+ (WorkspaceDataContainer)wsc2s.getComponent(WorkspaceDataContainer.class);
+
+ System.out.println("########################################");
+
+ int totalTimes;
+ long time;
+ NodeData parent;
+
+ totalTimes = 5000 / threads;
+ QPath path1 = null;
+ Task<QPath> traverseQPath = new Task<QPath>()
+ {
+ public QPath execute(Object... args) throws Exception
+ {
+ return traverseQPath((WorkspaceDataContainer)args[0], (String)args[1]);
+ }
+
+ };
+ Result<QPath> rTraverseQPath =
+ executeTask(traverseQPath, totalTimes, threads, dataContainer1, Constants.ROOT_UUID);
+ path1 = rTraverseQPath.getResult();
+ time = rTraverseQPath.getTime();
+ System.out.println("traverseQPath with deep 0, thread " + threads
+ + ": Total time with the old strategy (n queries) = " + time + ", avg = " + (time / (threads * totalTimes)));
+ QPath path2 = null;
+ rTraverseQPath = executeTask(traverseQPath, totalTimes, threads, dataContainer2, Constants.ROOT_UUID);
+ path2 = rTraverseQPath.getResult();
+ time = rTraverseQPath.getTime();
+ System.out.println("traverseQPath with deep 0, thread " + threads + ": Total time with the new strategy 0 = "
+ + time + ", avg = " + (time / (threads * totalTimes)));
+ System.out.println("path1 == path2 = " + equals(path1, path2));
+
+ rTraverseQPath =
+ executeTask(traverseQPath, totalTimes, threads, dataContainer1, "dfcbd34bc0a8010b006357806c7f108d");
+ path1 = rTraverseQPath.getResult();
+ time = rTraverseQPath.getTime();
+ System.out.println("traverseQPath with deep 1, thread " + threads
+ + ": Total time with the old strategy (n queries) = " + time + ", avg = " + (time / (threads * totalTimes)));
+
+ rTraverseQPath =
+ executeTask(traverseQPath, totalTimes, threads, dataContainer2, "dfcbd34bc0a8010b006357806c7f108d");
+ path2 = rTraverseQPath.getResult();
+ time = rTraverseQPath.getTime();
+ System.out.println("traverseQPath with deep 1, thread " + threads
+ + ": Total time with the new strategy (n/2 queries) = " + time + ", avg = " + (time / (threads * totalTimes)));
+ System.out.println("path1 == path2 = " + equals(path1, path2));
+
+ rTraverseQPath =
+ executeTask(traverseQPath, totalTimes, threads, dataContainer1, "dfcbe240c0a8010b00ff024d54e46b9f");
+ path1 = rTraverseQPath.getResult();
+ time = rTraverseQPath.getTime();
+ System.out.println("traverseQPath with deep 2, thread " + threads
+ + ": Total time with the old strategy (n queries) = " + time + ", avg = " + (time / (threads * totalTimes)));
+
+ rTraverseQPath =
+ executeTask(traverseQPath, totalTimes, threads, dataContainer2, "dfcbe240c0a8010b00ff024d54e46b9f");
+ path2 = rTraverseQPath.getResult();
+ time = rTraverseQPath.getTime();
+ System.out.println("traverseQPath with deep 2, thread " + threads
+ + ": Total time with the new strategy (n/2 queries) = " + time + ", avg = " + (time / (threads * totalTimes)));
+ System.out.println("path1 == path2 = " + equals(path1, path2));
+
+ rTraverseQPath =
+ executeTask(traverseQPath, totalTimes, threads, dataContainer1, "dfcbffaec0a8010b00ed7dad7cb43540");
+ path1 = rTraverseQPath.getResult();
+ time = rTraverseQPath.getTime();
+ System.out.println("traverseQPath with deep 5, thread " + threads
+ + ": Total time with the old strategy (n queries) = " + time + ", avg = " + (time / (threads * totalTimes)));
+
+ rTraverseQPath =
+ executeTask(traverseQPath, totalTimes, threads, dataContainer2, "dfcbffaec0a8010b00ed7dad7cb43540");
+ path2 = rTraverseQPath.getResult();
+ time = rTraverseQPath.getTime();
+ System.out.println("traverseQPath with deep 5, thread " + threads
+ + ": Total time with the new strategy (n/2 queries) = " + time + ", avg = " + (time / (threads * totalTimes)));
+ System.out.println("path1 == path2 = " + equals(path1, path2));
+
+ rTraverseQPath =
+ executeTask(traverseQPath, totalTimes, threads, dataContainer1, "83cb7ebeac1b00a400bf3596e43c8f18");
+ path1 = rTraverseQPath.getResult();
+ time = rTraverseQPath.getTime();
+ System.out.println("traverseQPath with deep 9, thread " + threads
+ + ": Total time with the old strategy (n queries) = " + time + ", avg = " + (time / (threads * totalTimes)));
+
+ rTraverseQPath =
+ executeTask(traverseQPath, totalTimes, threads, dataContainer2, "83cb7ebeac1b00a400bf3596e43c8f18");
+ path2 = rTraverseQPath.getResult();
+ time = rTraverseQPath.getTime();
+ System.out.println("traverseQPath with deep 9, thread " + threads
+ + ": Total time with the new strategy (n/2 queries) = " + time + ", avg = " + (time / (threads * totalTimes)));
+ System.out.println("path1 == path2 = " + equals(path1, path2));
+
+ totalTimes = 1;
+ parent =
+ new PersistedNodeData("83cb2a36ac1b00a400bdbe4f3f4f6e0e", Constants.ROOT_PATH, null, 0, 0, null, null, null);
+
+ Task<List<NodeData>> getChildNodesData = new Task<List<NodeData>>()
+ {
+ public List<NodeData> execute(Object... args) throws Exception
+ {
+ return getChildNodesData((WorkspaceDataContainer)args[0], (NodeData)args[1]);
+ }
+
+ };
+ List<NodeData> nodesData1 = null;
+
+ Result<List<NodeData>> rGetChildNodesData =
+ executeTask(getChildNodesData, totalTimes, threads, dataContainer1, parent);
+ nodesData1 = rGetChildNodesData.getResult();
+ time = rGetChildNodesData.getTime();
+ System.out.println("getChildNodesData with 1034 subnodes, thread " + threads
+ + ": Total time with the old strategy (4*n + 1 queries) = " + time + ", avg = "
+ + (time / (threads * totalTimes)));
+ List<NodeData> nodesData2 = null;
+ rGetChildNodesData = executeTask(getChildNodesData, totalTimes, threads, dataContainer2, parent);
+ nodesData2 = rGetChildNodesData.getResult();
+ time = rGetChildNodesData.getTime();
+ System.out.println("getChildNodesData with 1034 subnodes, thread " + threads
+ + ": Total time with the new strategy (1 query) = " + time + ", avg = " + (time / (threads * totalTimes)));
+ try
+ {
+ System.out.println("length = " + nodesData1.size());
+ System.out.println("nodesData1 == nodesData2 = " + equals(nodesData1, nodesData2) + " length = "
+ + nodesData1.size());
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ totalTimes = 100 / threads;
+ parent =
+ new PersistedNodeData("83c6e36cac1b00a400688aeb844539b2", Constants.ROOT_PATH, null, 0, 0, null, null, null);
+ rGetChildNodesData = executeTask(getChildNodesData, totalTimes, threads, dataContainer1, parent);
+ nodesData1 = rGetChildNodesData.getResult();
+ time = rGetChildNodesData.getTime();
+ System.out.println("getChildNodesData with 4 subnodes, thread " + threads
+ + ": Total time with the old strategy (4*n + 1 queries) = " + time + ", avg = "
+ + (time / (threads * totalTimes)));
+
+ rGetChildNodesData = executeTask(getChildNodesData, totalTimes, threads, dataContainer2, parent);
+ nodesData2 = rGetChildNodesData.getResult();
+ time = rGetChildNodesData.getTime();
+ System.out.println("getChildNodesData with 4 subnodes, thread " + threads
+ + ": Total time with the new strategy (1 query) = " + time + ", avg = " + (time / (threads * totalTimes)));
+ System.out.println("nodesData1 == nodesData2 = " + equals(nodesData1, nodesData2) + " length = "
+ + nodesData1.size());
+
+ totalTimes = 1000 / threads;
+
+ Task<ItemData> getItemData = new Task<ItemData>()
+ {
+ public ItemData execute(Object... args) throws Exception
+ {
+ return getItemData((WorkspaceDataContainer)args[0], (String)args[1]);
+ }
+
+ };
+ PersistedNodeData nodeData1 = null;
+ Result<ItemData> rGetItemData =
+ executeTask(getItemData, totalTimes, threads, dataContainer1, "83c6e36cac1b00a400688aeb844539b2");
+ nodeData1 = (PersistedNodeData)rGetItemData.getResult();
+ time = rGetItemData.getTime();
+ System.out.println("getItemData by Id for a node, thread " + threads
+ + ": Total time with the old strategy (5 queries) = " + time + ", avg = " + (time / (threads * totalTimes)));
+
+ PersistedNodeData nodeData2 = null;
+ rGetItemData = executeTask(getItemData, totalTimes, threads, dataContainer2, "83c6e36cac1b00a400688aeb844539b2");
+ nodeData2 = (PersistedNodeData)rGetItemData.getResult();
+ time = rGetItemData.getTime();
+ System.out.println("getItemData by Id for a node, thread " + threads
+ + ": Total time with the new strategy (2 queries) = " + time + ", avg = " + (time / (threads * totalTimes)));
+ System.out.println("nodeData1 == nodeData2 = " + equals(nodeData1, nodeData2));
+
+ PersistedPropertyData propertyData1 = null;
+ rGetItemData = executeTask(getItemData, totalTimes, threads, dataContainer1, "83c6e36cac1b00a40038e9e950ecff39");
+ propertyData1 = (PersistedPropertyData)rGetItemData.getResult();
+ time = rGetItemData.getTime();
+ System.out.println("getItemData by Id for a property, thread " + threads
+ + ": Total time with the old strategy (2 queries) = " + time + ", avg = " + (time / (threads * totalTimes)));
+
+ PersistedPropertyData propertyData2 = null;
+ rGetItemData = executeTask(getItemData, totalTimes, threads, dataContainer2, "83c6e36cac1b00a40038e9e950ecff39");
+ propertyData2 = (PersistedPropertyData)rGetItemData.getResult();
+ time = rGetItemData.getTime();
+ System.out.println("getItemData by Id for a property, thread " + threads
+ + ": Total time with the new strategy (2 queries) (=old strategy) = " + time + ", avg = "
+ + (time / (threads * totalTimes)));
+ System.out.println("propertyData1 == propertyData2 = " + equals(propertyData1, propertyData2));
+
+ NodeData parent2 =
+ new PersistedNodeData("00exo0jcr0root0uuid0000000000000", Constants.ROOT_PATH, null, 0, 0, null, null, null);
+ QPathEntry name2 = new QPathEntry(null, "Documents", 1);
+
+ Task<ItemData> getItemData2 = new Task<ItemData>()
+ {
+ public ItemData execute(Object... args) throws Exception
+ {
+ return getItemData((WorkspaceDataContainer)args[0], (NodeData)args[1], (QPathEntry)args[2]);
+ }
+
+ };
+ rGetItemData = executeTask(getItemData2, totalTimes, threads, dataContainer1, parent2, name2);
+ nodeData1 = (PersistedNodeData)rGetItemData.getResult();
+ time = rGetItemData.getTime();
+ System.out.println("getItemData by QPathEntry for a node, thread " + threads
+ + ": Total time with the old strategy = " + time + ", avg = " + (time / (threads * totalTimes)));
+
+ rGetItemData = executeTask(getItemData2, totalTimes, threads, dataContainer2, parent2, name2);
+ nodeData2 = (PersistedNodeData)rGetItemData.getResult();
+ time = rGetItemData.getTime();
+ System.out.println("getItemData by QPathEntry for a node, thread " + threads
+ + ": Total time with the new strategy = " + time + ", avg = " + (time / (threads * totalTimes)));
+ System.out.println("nodeData1 == nodeData2 = " + equals(nodeData1, nodeData2));
+
+ NodeData parent3 = nodeData1;
+ QPathEntry name3 = new QPathEntry("http://www.exoplatform.com/jcr/exo/1.0", "permissions", 1);
+
+ rGetItemData = executeTask(getItemData2, totalTimes, threads, dataContainer1, parent3, name3);
+ propertyData1 = (PersistedPropertyData)rGetItemData.getResult();
+ time = rGetItemData.getTime();
+ System.out.println("getItemData by QPathEntry for a property, thread " + threads
+ + ": Total time with the old strategy = " + time + ", avg = " + (time / (threads * totalTimes)));
+
+ rGetItemData = executeTask(getItemData2, totalTimes, threads, dataContainer2, parent3, name3);
+ propertyData2 = (PersistedPropertyData)rGetItemData.getResult();
+ time = rGetItemData.getTime();
+ System.out.println("getItemData by QPathEntry for a property, thread " + threads
+ + ": Total time with the new strategy = " + time + ", avg = " + (time / (threads * totalTimes)));
+ System.out.println("propertyData1 == propertyData2 = " + equals(propertyData1, propertyData2));
+
+ parent =
+ new PersistedNodeData("83c7507eac1b00a400cf6d951b948e23", Constants.ROOT_PATH, null, 0, 0, null, null, null);
+
+ totalTimes = 100 / threads;
+ Task<List<PropertyData>> getChildPropertiesData = new Task<List<PropertyData>>()
+ {
+ public List<PropertyData> execute(Object... args) throws Exception
+ {
+ return getChildPropertiesData((WorkspaceDataContainer)args[0], (NodeData)args[1]);
+ }
+
+ };
+ List<PropertyData> propertiesData1 = null;
+ Result<List<PropertyData>> rGetChildPropertiesData =
+ executeTask(getChildPropertiesData, totalTimes, threads, dataContainer1, parent);
+ propertiesData1 = rGetChildPropertiesData.getResult();
+ time = rGetChildPropertiesData.getTime();
+ System.out.println("getChildPropertiesData with 20 properties, thread " + threads
+ + ": Total time with the old strategy (n + 1 queries) = " + time + ", avg = "
+ + (time / (threads * totalTimes)));
+ List<PropertyData> propertiesData2 = null;
+ rGetChildPropertiesData = executeTask(getChildPropertiesData, totalTimes, threads, dataContainer2, parent);
+ propertiesData2 = rGetChildPropertiesData.getResult();
+ time = rGetChildPropertiesData.getTime();
+ System.out.println("getChildPropertiesData with 20 properties, thread " + threads
+ + ": Total time with the new strategy (1 query) = " + time + ", avg = " + (time / (threads * totalTimes)));
+ try
+ {
+ System.out.println("propertiesData1 == propertiesData2 = " + equalsP(propertiesData1, propertiesData2)
+ + " length = " + propertiesData1.size());
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ totalTimes = 100 / threads;
+ parent =
+ new PersistedNodeData("83c6e36cac1b00a400688aeb844539b2", Constants.ROOT_PATH, null, 0, 0, null, null, null);
+ rGetChildPropertiesData = executeTask(getChildPropertiesData, totalTimes, threads, dataContainer1, parent);
+ propertiesData1 = rGetChildPropertiesData.getResult();
+ time = rGetChildPropertiesData.getTime();
+ System.out.println("getChildPropertiesData with 6 properties, thread " + threads
+ + ": Total time with the old strategy (n + 1 queries) = " + time + ", avg = "
+ + (time / (threads * totalTimes)));
+
+ rGetChildPropertiesData = executeTask(getChildPropertiesData, totalTimes, threads, dataContainer2, parent);
+ propertiesData2 = rGetChildPropertiesData.getResult();
+ time = rGetChildPropertiesData.getTime();
+ System.out.println("getChildPropertiesData with 6 properties, thread " + threads
+ + ": Total time with the new strategy (1 query) = " + time + ", avg = " + (time / (threads * totalTimes)));
+ System.out.println("propertiesData1 == propertiesData2 = " + equalsP(propertiesData1, propertiesData2)
+ + " length = " + propertiesData1.size());
+
+ totalTimes = 100 / threads;
+ Task<List<PropertyData>> getReferencesData = new Task<List<PropertyData>>()
+ {
+ public List<PropertyData> execute(Object... args) throws Exception
+ {
+ return getReferencesData((WorkspaceDataContainer)args[0], (String)args[1]);
+ }
+
+ };
+ Result<List<PropertyData>> rGetReferencesData =
+ executeTask(getReferencesData, totalTimes, threads, dataContainer1s, "dfcbf3cfc0a8010b00a3f5f3b962c76a");
+ propertiesData1 = rGetReferencesData.getResult();
+ time = rGetReferencesData.getTime();
+ System.out.println("getReferencesData with 3 properties, thread " + threads
+ + ": Total time with the old strategy (n + 1 queries) = " + time + ", avg = "
+ + (time / (threads * totalTimes)));
+
+ rGetReferencesData =
+ executeTask(getReferencesData, totalTimes, threads, dataContainer2s, "dfcbf3cfc0a8010b00a3f5f3b962c76a");
+ propertiesData2 = rGetReferencesData.getResult();
+ time = rGetReferencesData.getTime();
+ System.out.println("getReferencesData with 3 properties, thread " + threads
+ + ": Total time with the new strategy (1 query) = " + time + ", avg = " + (time / (threads * totalTimes)));
+ try
+ {
+ System.out.println("propertiesData1 == propertiesData2 = " + equalsP(propertiesData1, propertiesData2)
+ + " length = " + propertiesData1.size());
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ totalTimes = 100 / threads;
+ rGetReferencesData =
+ executeTask(getReferencesData, totalTimes, threads, dataContainer1, "dfcbe9d6c0a8010b004ccac41a161c5d");
+ propertiesData1 = rGetReferencesData.getResult();
+ time = rGetReferencesData.getTime();
+ System.out.println("getReferencesData with 1 property, thread " + threads
+ + ": Total time with the old strategy (n + 1 queries) = " + time + ", avg = "
+ + (time / (threads * totalTimes)));
+
+ rGetReferencesData =
+ executeTask(getReferencesData, totalTimes, threads, dataContainer2, "dfcbe9d6c0a8010b004ccac41a161c5d");
+ propertiesData2 = rGetReferencesData.getResult();
+ time = rGetReferencesData.getTime();
+ System.out.println("getReferencesData with 1 property, thread " + threads
+ + ": Total time with the new strategy (1 query) = " + time + ", avg = " + (time / (threads * totalTimes)));
+ System.out.println("propertiesData1 == propertiesData2 = " + equalsP(propertiesData1, propertiesData2)
+ + " length = " + propertiesData1.size());
+ }
+
+ private static boolean equals(PersistedNodeData nodeData1, PersistedNodeData nodeData2)
+ {
+ return nodeData1.getACL().equals(nodeData2.getACL())
+ && nodeData1.getIdentifier().equals(nodeData2.getIdentifier())
+ && Arrays.equals(nodeData1.getMixinTypeNames(), nodeData2.getMixinTypeNames())
+ && nodeData1.getOrderNumber() == nodeData2.getOrderNumber()
+ && nodeData1.getParentIdentifier().equals(nodeData2.getParentIdentifier())
+ && nodeData1.getPersistedVersion() == nodeData2.getPersistedVersion()
+ && nodeData1.getPrimaryTypeName().equals(nodeData2.getPrimaryTypeName())
+ && nodeData1.getQPath().equals(nodeData2.getQPath()) && nodeData1.isNode() == nodeData2.isNode();
+ }
+
+ private static boolean equals(PersistedPropertyData propertyData1, PersistedPropertyData propertyData2)
+ {
+ boolean result =
+ propertyData1.isMultiValued() == propertyData2.isMultiValued()
+ && propertyData1.isNode() == propertyData2.isNode()
+ && propertyData1.getIdentifier().equals(propertyData2.getIdentifier())
+ && propertyData1.getParentIdentifier().equals(propertyData2.getParentIdentifier())
+ && propertyData1.getPersistedVersion() == propertyData2.getPersistedVersion()
+ && propertyData1.getQPath().equals(propertyData2.getQPath())
+ && propertyData1.getType() == propertyData2.getType();
+ if (!result)
+ {
+ return false;
+ }
+ List<ValueData> values1 = propertyData1.getValues();
+ List<ValueData> values2 = propertyData2.getValues();
+ if (values1 == null)
+ {
+ return values2 == null;
+ }
+ else if (values2 == null || values1.size() != values2.size())
+ {
+ return false;
+ }
+ else
+ {
+ for (int i = 0; i < values1.size(); i++)
+ {
+ ValueData value1 = values1.get(i);
+ ValueData value2 = values2.get(i);
+ result =
+ value1.isByteArray() == value2.isByteArray() && value1.getLength() == value2.getLength()
+ && value1.getOrderNumber() == value2.getOrderNumber();
+ if (!result)
+ {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ private static boolean equals(QPath path1, QPath path2)
+ {
+ return path1.equals(path2);
+ }
+
+ private static boolean equalsP(List<PropertyData> propertiesData1, List<PropertyData> propertiesData2)
+ {
+ if (propertiesData1 == null)
+ {
+ return propertiesData2 == null;
+ }
+ else if (propertiesData2 == null || propertiesData1.size() != propertiesData2.size())
+ {
+ return false;
+ }
+ else
+ {
+ for (int i = 0; i < propertiesData1.size(); i++)
+ {
+ PersistedPropertyData propertyData1 = (PersistedPropertyData)propertiesData1.get(i);
+ PersistedPropertyData propertyData2 = (PersistedPropertyData)propertiesData2.get(i);
+ if (!equals(propertyData1, propertyData2))
+ {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ private static boolean equals(List<NodeData> nodesData1, List<NodeData> nodesData2)
+ {
+ if (nodesData1 == null)
+ {
+ return nodesData2 == null;
+ }
+ else if (nodesData2 == null || nodesData1.size() != nodesData2.size())
+ {
+ return false;
+ }
+ else
+ {
+ for (int i = 0; i < nodesData1.size(); i++)
+ {
+ PersistedNodeData nodeData1 = (PersistedNodeData)nodesData1.get(i);
+ PersistedNodeData nodeData2 = (PersistedNodeData)nodesData2.get(i);
+ if (!equals(nodeData1, nodeData2))
+ {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ public static ItemData getItemData(WorkspaceDataContainer dataContainer, NodeData parentData, QPathEntry name)
+ throws RepositoryException, IllegalStateException
+ {
+ final WorkspaceStorageConnection con = dataContainer.openConnection();
+ try
+ {
+ return con.getItemData(parentData, name);
+ }
+ finally
+ {
+ con.close();
+ }
+ }
+
+ private static ItemData getItemData(WorkspaceDataContainer dataContainer, final String identifier)
+ throws RepositoryException
+ {
+ final WorkspaceStorageConnection con = dataContainer.openConnection();
+ try
+ {
+ return con.getItemData(identifier);
+ }
+ finally
+ {
+ con.close();
+ }
+ }
+
+ private static List<NodeData> getChildNodesData(WorkspaceDataContainer dataContainer, final NodeData parent)
+ throws RepositoryException
+ {
+ final WorkspaceStorageConnection con = dataContainer.openConnection();
+ try
+ {
+ return con.getChildNodesData(parent);
+ }
+ finally
+ {
+ con.close();
+ }
+ }
+
+ private static List<PropertyData> getChildPropertiesData(WorkspaceDataContainer dataContainer, final NodeData parent)
+ throws RepositoryException
+ {
+ final WorkspaceStorageConnection con = dataContainer.openConnection();
+ try
+ {
+ return con.getChildPropertiesData(parent);
+ }
+ finally
+ {
+ con.close();
+ }
+ }
+
+ private static List<PropertyData> getReferencesData(WorkspaceDataContainer dataContainer, final String identifier)
+ throws RepositoryException
+ {
+ final WorkspaceStorageConnection con = dataContainer.openConnection();
+ try
+ {
+ return con.getReferencesData(identifier);
+ }
+ finally
+ {
+ con.close();
+ }
+ }
+
+ private static QPath traverseQPath(WorkspaceDataContainer dataContainer, final String identifier)
+ throws RepositoryException, SQLException, InvalidItemStateException, IllegalNameException
+ {
+ final JDBCStorageConnection con = (JDBCStorageConnection)dataContainer.openConnection();
+ try
+ {
+ return con.traverseQPath(con.getInternalId(identifier));
+ }
+ finally
+ {
+ con.close();
+ }
+ }
+
+ private static interface Task<R>
+ {
+ R execute(Object... args) throws Exception;
+ }
+
+ private static class Result<R>
+ {
+ private final R result;
+
+ private final long time;
+
+ public Result(R result, long time)
+ {
+ this.result = result;
+ this.time = time;
+ }
+
+ public R getResult()
+ {
+ return result;
+ }
+
+ public long getTime()
+ {
+ return time;
+ }
+ }
+
+ private static <R> Result<R> executeTask(final Task<R> task, final int totalTimes, int threads, final Object... args)
+ throws InterruptedException
+ {
+ final CountDownLatch startSignal = new CountDownLatch(1);
+ final CountDownLatch doneSignal = new CountDownLatch(threads);
+ final AtomicReference<R> result = new AtomicReference<R>();
+ for (int i = 0; i < threads; i++)
+ {
+ Thread t = new Thread()
+ {
+ public void run()
+ {
+ try
+ {
+ for (int i = 0; i < totalTimes; i++)
+ {
+ result.set(task.execute(args));
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ finally
+ {
+ doneSignal.countDown();
+ }
+ }
+ };
+ t.start();
+ }
+ long time = System.currentTimeMillis();
+ startSignal.countDown();
+ doneSignal.await();
+ return new Result<R>(result.get(), System.currentTimeMillis() - time);
+ }
+}
Added: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/standalone/sql-benchmark-configuration.xml
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/standalone/sql-benchmark-configuration.xml (rev 0)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/standalone/sql-benchmark-configuration.xml 2010-01-05 09:45:57 UTC (rev 1285)
@@ -0,0 +1,198 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+ <component>
+ <key>org.exoplatform.services.log.LogConfigurationInitializer</key>
+ <type>org.exoplatform.services.log.LogConfigurationInitializer</type>
+ <init-params>
+ <value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedLog4JLogger</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.Log4JConfigurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>Log4J properties</description>
+ <property name="log4j.rootLogger" value="INFO, stdout, file"/>
+
+ <property name="log4j.appender.stdout" value="org.apache.log4j.ConsoleAppender"/>
+ <property name="log4j.appender.stdout.threshold" value="DEBUG"/>
+
+ <property name="log4j.appender.stdout.layout" value="org.apache.log4j.PatternLayout"/>
+ <property name="log4j.appender.stdout.layout.ConversionPattern"
+ value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n"/>
+
+ <property name="log4j.appender.file" value="org.apache.log4j.FileAppender"/>
+ <property name="log4j.appender.file.File" value="target/jcr.log"/>
+
+ <property name="log4j.appender.file.layout" value="org.apache.log4j.PatternLayout"/>
+ <property name="log4j.appender.file.layout.ConversionPattern"
+ value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n"/>
+
+ <property name="log4j.category.jcr.FileCleaner" value="DEBUG"/>
+
+ <!-- property name="log4j.category.jcr.JDBCStorageConnection" value="DEBUG"/>
+ <property name="log4j.category.jcr.NodeImpl" value="DEBUG"/ -->
+
+ <!-- property name="log4j.category.jcr.WorkspaceStorageCacheImpl" value="DEBUG"/ -->
+ <!-- property name="log4j.category.database.DBSchemaCreator" value="DEBUG"/ -->
+ <!-- property name="log4j.category.jcr.WorkspaceDataReplicator" value="DEBUG"/ -->
+
+ <!-- property name="log4j.category.jcr.WorkspaceStorageCacheImpl" value="DEBUG"/ -->
+ <!-- property name="log4j.category.jcr.WorkspacePersistentDataManager" value="DEBUG"/ -->
+ <!-- property name="log4j.category.jcr.SessionDataManager" value="DEBUG"/ -->
+ </properties-param>
+
+ <!-- value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedSimpleLog</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.SimpleLogConfigurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>SimpleLog properties</description>
+ <property name="org.apache.commons.logging.simplelog.defaultlog" value="debug"/>
+ <property name="org.apache.commons.logging.simplelog.showdatetime" value="true"/>
+ </properties-param -->
+
+ <!-- value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedJdk14Logger</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.Jdk14Configurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>jdk1.4 Logger properties</description>
+ <property name="handlers" value="java.util.logging.ConsoleHandler"/>
+ <property name=".level" value="FINE"/>
+ <property name="java.util.logging.ConsoleHandler.level" value="FINE"/>
+ </properties-param -->
+
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.RepositoryService</key>
+ <type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
+ <component-plugins>
+ <component-plugin>
+ <name>add.namespaces</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
+ <init-params>
+ <properties-param>
+ <name>namespaces</name>
+ <property name="test" value="http://www.apache.org/jackrabbit/test"/>
+ <property name="exojcrtest" value="http://www.exoplatform.org/jcr/test/1.0"/>
+ <property name="rma" value="http://www.rma.com/jcr/"/>
+ <property name="metadata" value="http://www.exoplatform.com/jcr/metadata/1.1/"/>
+ <property name="dc" value="http://purl.org/dc/elements/1.1/"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ </component-plugins>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
+ <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
+ <init-params>
+ <value-param>
+ <name>conf-path</name>
+ <description>JCR configuration file</description>
+ <value>jar:/conf/standalone/sql-benchmark-jcr-config.xml</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.organization.impl.mock.DummyOrganizationService</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.security.Authenticator</key>
+ <type>org.exoplatform.services.organization.auth.OrganizationAuthenticatorImpl</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.impl.ext.action.SessionActionCatalog</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.transaction.TransactionService</key>
+ <type>org.exoplatform.services.transaction.impl.jotm.TransactionServiceJotmImpl</type>
+ <init-params>
+ <value-param>
+ <name>timeout</name>
+ <value>5</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.naming.InitialContextInitializer</target-component>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcexo</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
+ <property name="url" value="jdbc:mysql://localhost:3306/exodb?relaxAutoCommit=true&autoReconnect=true&useUnicode=true&characterEncoding=utf8"/>
+ <property name="username" value="root"/>
+ <property name="password" value="root"/>
+ <property name="maxActive" value="50" />
+ <property name="maxIdle" value="5" />
+ <property name="initialSize" value="50" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+ <remove-configuration>org.exoplatform.services.scheduler.JobSchedulerService</remove-configuration>
+</configuration>
Added: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/standalone/sql-benchmark-jcr-config.xml
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/standalone/sql-benchmark-jcr-config.xml (rev 0)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/standalone/sql-benchmark-jcr-config.xml 2010-01-05 09:45:57 UTC (rev 1285)
@@ -0,0 +1,474 @@
+<repository-service default-repository="repository">
+ <repositories>
+ <repository name="repository1" system-workspace="system"
+ default-workspace="collaboration">
+ <security-domain>exo-domain</security-domain>
+ <access-control>optional</access-control>
+ <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
+ <workspaces>
+ <workspace name="system">
+ <container
+ class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcexo" />
+ <property name="dialect" value="MySQL" />
+ <!--<property name="dialect" value="hsqldb"/>-->
+ <property name="multi-db" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="../temp/swap/system" />
+ </properties>
+ <value-storages>
+ <value-storage id="system"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="../temp/values/system" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer
+ class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ <property name="root-permissions"
+ value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
+ </properties>
+ </initializer>
+ <cache enabled="true"
+ class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
+ <properties>
+ <property name="max-size" value="20k" />
+ <property name="live-time" value="1h" />
+ </properties>
+ </cache>
+<!-- <query-handler-->
+<!-- class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">-->
+<!-- <properties>-->
+<!-- <property name="index-dir" value="../temp/jcrlucenedb/system" />-->
+<!-- <property name="support-highlighting" value="true" />-->
+<!-- <property name="excerptprovider-class"-->
+<!-- value="org.exoplatform.services.jcr.impl.core.query.lucene.DefaultHTMLExcerpt" />-->
+<!-- </properties>-->
+<!-- </query-handler>-->
+ <lock-manager>
+ <time-out>15m</time-out>
+ <persister
+ class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path" value="../temp/lock/system" />
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
+ <workspace name="collaboration">
+ <container
+ class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcexo" />
+ <property name="dialect" value="MySQL" />
+ <!--<property name="dialect" value="hsqldb"/> -->
+ <property name="multi-db" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="../temp/swap/collaboration" />
+ </properties>
+ <value-storages>
+ <value-storage id="collaboration"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="../temp/values/collaboration" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer
+ class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ <property name="root-permissions"
+ value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
+ </properties>
+ </initializer>
+ <cache enabled="true"
+ class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
+ <properties>
+ <property name="max-size" value="20k" />
+ <property name="live-time" value="1h" />
+ </properties>
+ </cache>
+<!-- <query-handler-->
+<!-- class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">-->
+<!-- <properties>-->
+<!-- <property name="index-dir" value="../temp/jcrlucenedb/collaboration" />-->
+<!-- <property name="support-highlighting" value="true" />-->
+<!-- <property name="excerptprovider-class"-->
+<!-- value="org.exoplatform.services.jcr.impl.core.query.lucene.DefaultHTMLExcerpt" />-->
+<!-- </properties>-->
+<!-- </query-handler>-->
+ <lock-manager>
+ <time-out>15m</time-out>
+ <persister
+ class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path" value="../temp/lock/collaboration" />
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
+ <workspace name="backup">
+ <container
+ class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcexo" />
+ <property name="dialect" value="MySQL" />
+ <!--<property name="dialect" value="hsqldb"/> -->
+ <property name="multi-db" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="../temp/swap/backup" />
+ </properties>
+ <value-storages>
+ <value-storage id="backup"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="../temp/values/backup" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer
+ class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ <property name="root-permissions"
+ value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
+ </properties>
+ </initializer>
+ <cache enabled="true"
+ class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
+ <properties>
+ <property name="max-size" value="5k" />
+ <property name="live-time" value="20m" />
+ </properties>
+ </cache>
+<!-- <query-handler-->
+<!-- class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">-->
+<!-- <properties>-->
+<!-- <property name="index-dir" value="../temp/jcrlucenedb/backup" />-->
+<!-- <property name="support-highlighting" value="true" />-->
+<!-- <property name="excerptprovider-class"-->
+<!-- value="org.exoplatform.services.jcr.impl.core.query.lucene.DefaultHTMLExcerpt" />-->
+<!-- </properties>-->
+<!-- </query-handler>-->
+ <lock-manager>
+ <time-out>15m</time-out>
+ <persister
+ class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path" value="../temp/lock/backup" />
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
+ <workspace name="gadgets">
+ <!-- for system storage -->
+ <container
+ class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcexo" />
+ <property name="dialect" value="MySQL" />
+ <!--<property name="dialect" value="hsqldb"/> -->
+ <property name="multi-db" value="false" />
+ <property name="update-storage" value="true" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="../temp/swap/gadgets" />
+ </properties>
+ <value-storages>
+ <value-storage id="gadgets"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="../temp/values/gadgets" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer
+ class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ <property name="root-permissions"
+ value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
+ </properties>
+ </initializer>
+ <cache enabled="true"
+ class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
+ <properties>
+ <property name="max-size" value="20k" />
+ <property name="live-time" value="1h" />
+ </properties>
+ </cache>
+<!-- <query-handler-->
+<!-- class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">-->
+<!-- <properties>-->
+<!-- <property name="index-dir" value="../temp/jcrlucenedb/gadgets" />-->
+<!-- </properties>-->
+<!-- </query-handler>-->
+ <lock-manager>
+ <time-out>15m</time-out><!-- 15min -->
+ <persister
+ class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path" value="../temp/lock/gadgets" />
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
+ </workspaces>
+ </repository>
+ <repository name="repository2" system-workspace="system"
+ default-workspace="collaboration">
+ <security-domain>exo-domain</security-domain>
+ <access-control>optional</access-control>
+ <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
+ <workspaces>
+ <workspace name="system">
+ <container
+ class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcexo" />
+ <property name="dialect" value="MySQL" />
+ <!--<property name="dialect" value="hsqldb"/>-->
+ <property name="multi-db" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="../temp/swap/system" />
+ </properties>
+ <value-storages>
+ <value-storage id="system"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="../temp/values/system" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer
+ class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ <property name="root-permissions"
+ value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
+ </properties>
+ </initializer>
+ <cache enabled="true"
+ class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
+ <properties>
+ <property name="max-size" value="20k" />
+ <property name="live-time" value="1h" />
+ </properties>
+ </cache>
+<!-- <query-handler-->
+<!-- class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">-->
+<!-- <properties>-->
+<!-- <property name="index-dir" value="../temp/jcrlucenedb/system2" />-->
+<!-- <property name="support-highlighting" value="true" />-->
+<!-- <property name="excerptprovider-class"-->
+<!-- value="org.exoplatform.services.jcr.impl.core.query.lucene.DefaultHTMLExcerpt" />-->
+<!-- </properties>-->
+<!-- </query-handler>-->
+ <lock-manager>
+ <time-out>15m</time-out>
+ <persister
+ class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path" value="../temp/lock/system" />
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
+ <workspace name="collaboration">
+ <container
+ class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcexo" />
+ <property name="dialect" value="MySQL" />
+ <!--<property name="dialect" value="hsqldb"/> -->
+ <property name="multi-db" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="../temp/swap/collaboration" />
+ </properties>
+ <value-storages>
+ <value-storage id="collaboration"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="../temp/values/collaboration" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer
+ class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ <property name="root-permissions"
+ value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
+ </properties>
+ </initializer>
+ <cache enabled="true"
+ class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
+ <properties>
+ <property name="max-size" value="20k" />
+ <property name="live-time" value="1h" />
+ </properties>
+ </cache>
+<!-- <query-handler-->
+<!-- class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">-->
+<!-- <properties>-->
+<!-- <property name="index-dir" value="../temp/jcrlucenedb/collaboration2" />-->
+<!-- <property name="support-highlighting" value="true" />-->
+<!-- <property name="excerptprovider-class"-->
+<!-- value="org.exoplatform.services.jcr.impl.core.query.lucene.DefaultHTMLExcerpt" />-->
+<!-- </properties>-->
+<!-- </query-handler>-->
+ <lock-manager>
+ <time-out>15m</time-out>
+ <persister
+ class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path" value="../temp/lock/collaboration" />
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
+ <workspace name="backup">
+ <container
+ class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcexo" />
+ <property name="dialect" value="MySQL" />
+ <!--<property name="dialect" value="hsqldb"/> -->
+ <property name="multi-db" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="../temp/swap/backup" />
+ </properties>
+ <value-storages>
+ <value-storage id="backup"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="../temp/values/backup" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer
+ class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ <property name="root-permissions"
+ value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
+ </properties>
+ </initializer>
+ <cache enabled="true"
+ class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
+ <properties>
+ <property name="max-size" value="5k" />
+ <property name="live-time" value="20m" />
+ </properties>
+ </cache>
+<!-- <query-handler-->
+<!-- class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">-->
+<!-- <properties>-->
+<!-- <property name="index-dir" value="../temp/jcrlucenedb/backup2" />-->
+<!-- <property name="support-highlighting" value="true" />-->
+<!-- <property name="excerptprovider-class"-->
+<!-- value="org.exoplatform.services.jcr.impl.core.query.lucene.DefaultHTMLExcerpt" />-->
+<!-- </properties>-->
+<!-- </query-handler>-->
+ <lock-manager>
+ <time-out>15m</time-out>
+ <persister
+ class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path" value="../temp/lock/backup" />
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
+ <workspace name="gadgets">
+ <!-- for system storage -->
+ <container
+ class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcexo" />
+ <property name="dialect" value="MySQL" />
+ <!--<property name="dialect" value="hsqldb"/> -->
+ <property name="multi-db" value="false" />
+ <property name="update-storage" value="true" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="../temp/swap/gadgets" />
+ </properties>
+ <value-storages>
+ <value-storage id="gadgets"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="../temp/values/gadgets" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer
+ class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ <property name="root-permissions"
+ value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
+ </properties>
+ </initializer>
+ <cache enabled="true"
+ class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
+ <properties>
+ <property name="max-size" value="20k" />
+ <property name="live-time" value="1h" />
+ </properties>
+ </cache>
+<!-- <query-handler-->
+<!-- class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">-->
+<!-- <properties>-->
+<!-- <property name="index-dir" value="../temp/jcrlucenedb/gadgets2" />-->
+<!-- </properties>-->
+<!-- </query-handler>-->
+ <lock-manager>
+ <time-out>15m</time-out><!-- 15min -->
+ <persister
+ class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path" value="../temp/lock/gadgets" />
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
+ </workspaces>
+ </repository>
+ </repositories>
+</repository-service>
16 years, 4 months