exo-jcr SVN: r1888 - jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-02-18 06:08:34 -0500 (Thu, 18 Feb 2010)
New Revision: 1888
Added:
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/external-value-storages.xml
Log:
EXOJCR-490: external-value-storage updated
Added: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/external-value-storages.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/external-value-storages.xml (rev 0)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/external-value-storages.xml 2010-02-18 11:08:34 UTC (rev 1888)
@@ -0,0 +1,247 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<article>
+ <articleinfo>
+ <title>External Value Storages</title>
+ </articleinfo>
+
+ <section>
+ <title>Introduction</title>
+
+ <para>By default JCR Values are stored in the Workspace Data container
+ along with the JCR structure (i.e. Nodes and Properties). eXo JCR offers
+ an additional option of storing JCR Values separately from Workspace Data
+ container, which can be extremely helpful to keep Binary Large Objects
+ (BLOBs) for example (see [TODOBinary values processing link]).</para>
+
+ <para>Value storage configuration is a part of Repository configuration,
+ find more details there [TODO link to repository configuration].</para>
+
+ <para>Tree-based storage is recommended for most of cases. If you run an
+ application on Amazon EC2 - the S3 option may be interesting for
+ architecture. Simple 'flat' storage is good in speed of creation/deletion
+ of values, it might be a compromise for a small storages.</para>
+ </section>
+
+ <section>
+ <title>Tree File Value Storage</title>
+
+ <para>Holds Values in tree-like FileSystem files.
+ <property>path</property> property points to the root directory to store
+ the files.</para>
+
+ <para>This is a recommended type of external storage, it can contain large
+ amount of files limited only by disk/volume free space.</para>
+
+ <para>A disadvantage it's a higher time on Value deletion due to unused
+ tree-nodes remove.</para>
+
+ <programlisting><value-storage id="Storage #1" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="data/values"/>
+ </properties>
+ <filters>
+ <filter property-type="Binary" min-value-size="1M"/>
+ </filters></programlisting>
+
+ <para>Where :<simplelist>
+ <member><parameter>id</parameter> - the value storage unique
+ identifier, used for linking with properties stored in workspace
+ container</member>
+
+ <member><parameter>path</parameter> - a location where value files
+ will be stored</member>
+ </simplelist></para>
+
+ <para>Each file value storage can have the <function>filter(s)</function>
+ for incoming values. A filter can match values by property type
+ (<property>property-type</property>), property name
+ (<property>property-name</property>), ancestor path
+ (<property>ancestor-path</property>) and/or size of values stored
+ (<property>min-value-size</property>, in bytes). In code sample we use a
+ filter with property-type and min-value-size only. I.e. storage for binary
+ values with size greater of 1MB. It's recommended to store properties with
+ large values in file value storage only.</para>
+
+ <para>Another example shows a value storage with different locations for
+ large files (<property>min-value-size</property> a 20Mb-sized filter). A
+ value storage uses ORed logic in the process of filter selection. That
+ means the first filter in the list will be asked first and if not matched
+ the next will be called etc. Here a value matches the 20 MB-sized filter
+ <property>min-value-size</property> and will be stored in the path
+ "data/20Mvalues", all other in "data/values".</para>
+
+ <programlisting><value-storages>
+ <value-storage id="Storage #1" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="data/20Mvalues"/>
+ </properties>
+ <filters>
+ <filter property-type="Binary" min-value-size="20M"/>
+ </filters>
+ <value-storage>
+ <value-storage id="Storage #2" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="data/values"/>
+ </properties>
+ <filters>
+ <filter property-type="Binary" min-value-size="1M"/>
+ </filters>
+ <value-storage>
+<value-storages></programlisting>
+ </section>
+
+ <section>
+ <title>S3 File Value Storage</title>
+
+ <para>Holds Values at Amazon S3 storage. For more about S3 see <ulink
+ url="http://www.amazon.com/S3-AWS-home-page-Money/b/ref=sc_fe_l_2/103-7720231-...">http://www.amazon.com/S3-AWS-home-page-Money/b/ref=sc_fe_l_2/103-7720231-...</ulink>.</para>
+
+ <para>This type of storage saves all matching Values on Amazon S3 service.
+ That is very useful for <phrase>cloud computing</phrase> (like Amazon EC2
+ hosted repositories). But can be used in any environment and storages
+ combinations. It's often used in combined with Workspace Simple DB storage
+ [TODO Workspace Simple DB storage].</para>
+
+ <para>It's networked storage with RESTbased access (via HTTP) that makes a
+ footprint on performance of the Repository.</para>
+
+ <programlisting><value-storage id="Storage #1" class="org.exoplatform.services.jcr.impl.storage.value.s3.SimpleS3ValueStorage">
+ <properties>
+ <property name="bucket" value="BUCKET NAME HERE"/>
+ <property name="aws-access-key" value="INSERT YOUR AWS ACCESS KEY ID HERE"/>
+ <property name="aws-secret-access-key" value="INSERT YOUR AWS SECRET ACCESS KEY HERE"/>
+ <property name="s3-swap-directory" value="s3swap_directory_name"/>
+ </properties>
+ <filters>
+ <filter property-type="Binary"/>
+ </filters>
+</value-storage></programlisting>
+ </section>
+
+ <section>
+ <title>Simple File Value Storage</title>
+
+ <note>
+ <para>Not recommended to use in production due to low capacity
+ capabilities on most file systems.</para>
+
+ <para>But if you're sure in your file-system or data amount is small it
+ may be useful for you as haves a faster speed of Value removal.</para>
+ </note>
+
+ <para>Holds Values in flat FileSystem files. <property>path</property>
+ property points to root directory in order to store files</para>
+
+ <programlisting><value-storage id="Storage #1" class="org.exoplatform.services.jcr.impl.storage.value.fs.SimpleFileValueStorage">
+ <properties>
+ <property name="path" value="data/values"/>
+ </properties>
+ <filters>
+ <filter property-type="Binary" min-value-size="1M"/>
+ </filters></programlisting>
+ </section>
+
+ <section>
+ <title>Content Addressable Value storage (CAS) support</title>
+
+ <remark>Available from version 1.9.3</remark>
+
+ <para>eXo JCR supports <phrase>Content-addressable storage</phrase>
+ feature for <phrase>Values</phrase> storing.</para>
+
+ <note>
+ <para>Content-addressable storage, also referred to as associative
+ storage and abbreviated CAS, is a mechanism for storing information that
+ can be retrieved based on its content, not its storage location. It is
+ typically used for high-speed storage and retrieval of fixed content,
+ such as documents stored for compliance with government
+ regulations.</para>
+ </note>
+
+ <para>Content Addressable Value storage stores unique content once.
+ Different properties (values) with same content will be stored as one data
+ file shared between those values. We can tell the Value content will be
+ shared across some Values in storage and will be stored on one physical
+ file.</para>
+
+ <para>Storage size will be decreased for application which governs
+ potentially same data in the content.</para>
+
+ <note>
+ <para>For example: if you have 100 different properties containing the
+ same data (e.g. mail attachment) the storage stores only one single
+ file. The file will be shared with all referencing properties.</para>
+ </note>
+
+ <para>If property Value changes it is stored in an additional file.
+ Alternatively the file is shared with other values, pointing to the same
+ content.</para>
+
+ <para>The storage calculates Value content address each time the property
+ was changed. CAS write operations are much more expensive compared to the
+ non-CAS storages.</para>
+
+ <para>Content address calculation based on java.security.MessageDigest
+ hash computation and tested with <abbrev>MD5</abbrev> and
+ <abbrev>SHA1</abbrev> algorithms.</para>
+
+ <note>
+ <para>CAS storage works most efficiently on data that does not change
+ often. For data that changes frequently, CAS is not as efficient as
+ location-based addressing.</para>
+ </note>
+
+ <para>CAS support can be enabled for <phrase>Tree</phrase> and
+ <phrase>Simple File Value Storage</phrase> types.</para>
+
+ <para>To enable CAS support just configure it in JCR Repositories
+ configuration like we do for other Value Storages.</para>
+
+ <programlisting><workspaces>
+ <workspace name="ws">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr"/>
+ <property name="dialect" value="oracle"/>
+ <property name="multi-db" value="false"/>
+ <property name="update-storage" value="false"/>
+ <property name="max-buffer-size" value="200k"/>
+ <property name="swap-directory" value="target/temp/swap/ws"/>
+ </properties>
+ <value-storages>
+<!------------------- here ----------------------->
+ <value-storage id="ws" class="org.exoplatform.services.jcr.impl.storage.value.fs.CASableTreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/ws"/>
+ <property name="digest-algo" value="MD5"/>
+ <property name="vcas-type" value="org.exoplatform.services.jcr.impl.storage.value.cas.JDBCValueContentAddressStorageImpl"/>
+ <property name="jdbc-source-name" value="jdbcjcr"/>
+ <property name="jdbc-dialect" value="oracle"/>
+ </properties>
+ <filters>
+ <filter property-type="Binary"/>
+ </filters>
+ </value-storage>
+ </value-storages></programlisting>
+
+ <para>Properties:<simplelist>
+ <member><parameter>digest-algo</parameter> - digest hash algorithm
+ (MD5 and SHA1 were tested);</member>
+
+ <member><parameter>vcas-type</parameter> - Value CAS internal data
+ type, JDBC backed is currently implemented
+ org.exoplatform.services.jcr.impl.storage.value.cas.JDBCValueContentAddressStorageImp;l</member>
+
+ <member><parameter>jdbc-source-name</parameter> -
+ JDBCValueContentAddressStorageImpl specific parameter, database will
+ be used to save CAS metadata. It's simple to use same as in workspace
+ container;</member>
+
+ <member><parameter>jdbc-dialect</parameter> -
+ JDBCValueContentAddressStorageImpl specific parameter, database
+ dialect. It's simple to use same as in workspace container;</member>
+ </simplelist></para>
+ </section>
+</article>
16 years, 2 months
exo-jcr SVN: r1887 - jcr/trunk/applications/product-patches/as/tomcat/bin.
by do-not-reply@jboss.org
Author: tolusha
Date: 2010-02-18 05:41:44 -0500 (Thu, 18 Feb 2010)
New Revision: 1887
Modified:
jcr/trunk/applications/product-patches/as/tomcat/bin/eXo.bat
Log:
EXOJCR-515: fix eXo.bat for Windows OS
Modified: jcr/trunk/applications/product-patches/as/tomcat/bin/eXo.bat
===================================================================
--- jcr/trunk/applications/product-patches/as/tomcat/bin/eXo.bat 2010-02-18 10:34:09 UTC (rev 1886)
+++ jcr/trunk/applications/product-patches/as/tomcat/bin/eXo.bat 2010-02-18 10:41:44 UTC (rev 1887)
@@ -3,7 +3,7 @@
rem Computes the absolute path of eXo
setlocal ENABLEDELAYEDEXPANSION
for %%i in ( !%~f0! ) do set BIN_DIR=%%~dpi
-for %%i in ( !%BIN_DIR%\..! ) do set TOMCAT_HOME=%%~dpni
+for %%i in ( !%BIN_DIR%\..! ) do set TOMCAT_HOME=%%~fi
rem Sets some variables
set LOG_OPTS="-Dorg.exoplatform.services.log.Log=org.apache.commons.logging.impl.SimpleLog"
16 years, 2 months
exo-jcr SVN: r1886 - in ws/branches/2.2.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext: proxy and 1 other directory.
by do-not-reply@jboss.org
Author: max_shaposhnik
Date: 2010-02-18 05:34:09 -0500 (Thu, 18 Feb 2010)
New Revision: 1886
Added:
ws/branches/2.2.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/proxy/
ws/branches/2.2.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/proxy/BaseConnector.java
ws/branches/2.2.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/proxy/Connector.java
ws/branches/2.2.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/proxy/ProxyService.java
Log:
Added proxy service
Added: ws/branches/2.2.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/proxy/BaseConnector.java
===================================================================
--- ws/branches/2.2.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/proxy/BaseConnector.java (rev 0)
+++ ws/branches/2.2.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/proxy/BaseConnector.java 2010-02-18 10:34:09 UTC (rev 1886)
@@ -0,0 +1,206 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.services.rest.ext.proxy;
+
+import java.io.DataInputStream;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Enumeration;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.exoplatform.common.http.client.Codecs;
+import org.exoplatform.common.http.client.HTTPConnection;
+import org.exoplatform.common.http.client.HTTPResponse;
+import org.exoplatform.common.http.client.ModuleException;
+import org.exoplatform.common.http.client.NVPair;
+import org.exoplatform.common.http.client.ParseException;
+import org.exoplatform.common.http.client.ProtocolNotSuppException;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+
+/**
+ * @author <a href="mailto:max.shaposhnik@exoplatform.com">Max Shaposhnik</a>
+ * @version $Id$
+ */
+public class BaseConnector extends Connector
+{
+
+ /** The connection. */
+ private HTTPConnection conn;
+
+ /** The HTTPResponse. */
+ HTTPResponse resp = null;
+
+ /** The form_data array. */
+ NVPair[] form_data;
+
+ /** The headers array. */
+ NVPair[] headers;
+
+ /** Logger. */
+ private static final Log LOG = ExoLogger.getLogger(BaseConnector.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public HTTPResponse fetchGet(HttpServletRequest httpRequest, String url) throws MalformedURLException,
+ ProtocolNotSuppException, IOException, ModuleException, ParseException
+ {
+ URL url_obj = null;
+ url_obj = new URL(url);
+
+ conn = new HTTPConnection(url_obj);
+ conn.setTimeout(DEFAULT_CONNECT_TIMEOUT_MS);
+ prepareRequestHeaders(httpRequest);
+ prepareFormParams(url_obj);
+ conn.setAllowUserInteraction(false);
+ resp = conn.Get(url_obj.getProtocol() + "://" + url_obj.getAuthority() + url_obj.getPath(), form_data, headers);
+ if (resp.getStatusCode() >= 300)
+ {
+ LOG.error("Received Error: " + resp.getReasonLine());
+ LOG.error(resp.getText());
+ }
+ return resp;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public HTTPResponse fetchPost(HttpServletRequest httpRequest, String url) throws MalformedURLException,
+ ProtocolNotSuppException, IOException, ModuleException, ParseException
+ {
+ URL url_obj = null;
+ url_obj = new URL(url);
+
+ conn = new HTTPConnection(url_obj);
+ conn.setTimeout(DEFAULT_CONNECT_TIMEOUT_MS);
+ conn.setAllowUserInteraction(false);
+ prepareRequestHeaders(httpRequest);
+
+ byte[] body = new byte[httpRequest.getContentLength()];
+ new DataInputStream(httpRequest.getInputStream()).readFully(body);
+ resp = conn.Post(url_obj.getProtocol() + "://" + url_obj.getAuthority() + url_obj.getPath(), body, headers);
+ if (resp.getStatusCode() >= 300)
+ {
+ LOG.error("Received Error: " + resp.getReasonLine());
+ LOG.error(resp.getText());
+ }
+ conn.stop();
+ return resp;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public HTTPResponse doPut(HttpServletRequest httpRequest, String url) throws MalformedURLException,
+ ProtocolNotSuppException, IOException, ModuleException, ParseException
+ {
+ URL url_obj = null;
+ url_obj = new URL(url);
+
+ conn = new HTTPConnection(url_obj);
+ conn.setTimeout(DEFAULT_CONNECT_TIMEOUT_MS);
+ conn.setAllowUserInteraction(false);
+ prepareRequestHeaders(httpRequest);
+
+ byte[] body = new byte[httpRequest.getContentLength()];
+ new DataInputStream(httpRequest.getInputStream()).readFully(body);
+ resp = conn.Put(url_obj.getProtocol() + "://" + url_obj.getAuthority() + url_obj.getPath(), body, headers);
+ if (resp.getStatusCode() >= 300)
+ {
+ LOG.error("Received Error: " + resp.getReasonLine());
+ LOG.error(resp.getText());
+ }
+ conn.stop();
+ return resp;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public HTTPResponse doDelete(HttpServletRequest httpRequest, String url) throws MalformedURLException,
+ ProtocolNotSuppException, IOException, ModuleException, ParseException
+ {
+ URL url_obj = null;
+ url_obj = new URL(url);
+
+ conn = new HTTPConnection(url_obj);
+ conn.setTimeout(DEFAULT_CONNECT_TIMEOUT_MS);
+ conn.setAllowUserInteraction(false);
+ prepareRequestHeaders(httpRequest);
+ resp = conn.Delete(url_obj.getProtocol() + "://" + url_obj.getAuthority() + url_obj.getPath(), headers);
+ if (resp.getStatusCode() >= 300)
+ {
+ LOG.error("Received Error: " + resp.getReasonLine());
+ LOG.error(resp.getText());
+ }
+ conn.stop();
+ return resp;
+ }
+
+ /**
+ * Prepares request headers.
+ *
+ * @param httpRequest the http request
+ */
+ private void prepareRequestHeaders(HttpServletRequest httpRequest)
+ {
+ ArrayList<NVPair> hds = new ArrayList<NVPair>();
+ for (Enumeration<String> en = httpRequest.getHeaderNames(); en.hasMoreElements();)
+ {
+ NVPair pair = null;
+ String headerName = (String)en.nextElement();
+ for (Enumeration<String> en2 = httpRequest.getHeaders(headerName); en2.hasMoreElements();)
+ {
+ pair = new NVPair(headerName, en2.nextElement());
+ }
+ hds.add(pair);
+ this.headers = new NVPair[hds.size()];
+ this.headers = hds.toArray(headers);
+ }
+ }
+
+ /**
+ * Prepares form params.
+ *
+ * @param url the url
+ */
+ private void prepareFormParams(URL url)
+ {
+ String query = url.getQuery();
+ if (query != null)
+ {
+ try
+ {
+ this.form_data = Codecs.query2nv(query);
+ }
+ catch (ParseException e)
+ {
+ LOG.error(e.getMessage());
+ }
+ }
+ }
+}
Property changes on: ws/branches/2.2.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/proxy/BaseConnector.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: ws/branches/2.2.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/proxy/Connector.java
===================================================================
--- ws/branches/2.2.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/proxy/Connector.java (rev 0)
+++ ws/branches/2.2.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/proxy/Connector.java 2010-02-18 10:34:09 UTC (rev 1886)
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.services.rest.ext.proxy;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.exoplatform.common.http.client.HTTPResponse;
+import org.exoplatform.common.http.client.ModuleException;
+import org.exoplatform.common.http.client.ParseException;
+import org.exoplatform.common.http.client.ProtocolNotSuppException;
+
+/**
+ * @author <a href="mailto:max.shaposhnik@exoplatform.com">Max Shaposhnik</a>
+ * @version $Id$
+ */
+public abstract class Connector
+{
+
+ /** The connect timeout. */
+ protected static final int DEFAULT_CONNECT_TIMEOUT_MS = 5000;
+
+
+ /**
+ * Do GET proxy request.
+ *
+ * @param httpRequest the HttpServletRequest
+ * @param url the url to request
+ * @return response HTTPResponse
+ */
+ abstract HTTPResponse fetchGet(HttpServletRequest httpRequest, String url) throws MalformedURLException, ProtocolNotSuppException,
+ IOException, ModuleException,ParseException;
+
+ /**
+ * Do POST proxy request.
+ *
+ * @param httpRequest the HttpServletRequest
+ * @param url the url to request
+ * @return response HTTPResponse
+ */
+ abstract HTTPResponse fetchPost(HttpServletRequest httpRequest, String url) throws MalformedURLException, ProtocolNotSuppException,
+ IOException, ModuleException,ParseException;
+
+
+ /**
+ * Do PUT proxy request.
+ *
+ * @param httpRequest the HttpServletRequest
+ * @param url the url to request
+ * @return response HTTPResponse
+ */
+ abstract HTTPResponse doPut(HttpServletRequest httpRequest, String url) throws MalformedURLException, ProtocolNotSuppException,
+ IOException, ModuleException,ParseException;
+
+
+ /**
+ * Do DELETE proxy request.
+ *
+ * @param httpRequest the HttpServletRequest
+ * @param url the url to request
+ * @return response HTTPResponse
+ */
+ abstract HTTPResponse doDelete(HttpServletRequest httpRequest, String url) throws MalformedURLException, ProtocolNotSuppException,
+ IOException, ModuleException,ParseException;
+
+}
Property changes on: ws/branches/2.2.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/proxy/Connector.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: ws/branches/2.2.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/proxy/ProxyService.java
===================================================================
--- ws/branches/2.2.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/proxy/ProxyService.java (rev 0)
+++ ws/branches/2.2.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/proxy/ProxyService.java 2010-02-18 10:34:09 UTC (rev 1886)
@@ -0,0 +1,265 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.services.rest.ext.proxy;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.util.Enumeration;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.ResponseBuilder;
+
+import org.exoplatform.common.http.client.HTTPResponse;
+import org.exoplatform.common.http.client.ModuleException;
+import org.exoplatform.common.http.client.ParseException;
+import org.exoplatform.common.http.client.ProtocolNotSuppException;
+import org.exoplatform.services.rest.resource.ResourceContainer;
+
+/**
+ * @author <a href="mailto:max.shaposhnik@exoplatform.com">Max Shaposhnik</a>
+ * @version $Id$
+ */
+@Path("proxy")
+public class ProxyService implements ResourceContainer
+{
+ /**
+ * Handles GET proxy request.
+ *
+ * @param httpRequestHttpServletRequest
+ * @param url the url to request
+ * @return response Response
+ */
+ @GET
+ public Response doProxyGet(@Context HttpServletRequest httpRequest, @QueryParam("url") String url)
+ {
+ BaseConnector conn = new BaseConnector();
+ if (url == null)
+ {
+ Throwable e = new Throwable("Necessary URL parameter not found in proxy request");
+ throw new WebApplicationException(e, createErrorResponse(e, 404));
+ }
+ try
+ {
+ HTTPResponse resp = conn.fetchGet(httpRequest, url);
+ return createResponse(resp);
+ }
+ catch (MalformedURLException mue)
+ {
+ throw new WebApplicationException(mue, createErrorResponse(mue, 400));
+ }
+ catch (ProtocolNotSuppException pnse)
+ {
+ throw new WebApplicationException(pnse, createErrorResponse(pnse, 400));
+ }
+ catch (IOException ioe)
+ {
+ throw new WebApplicationException(ioe, createErrorResponse(ioe, 500));
+ }
+ catch (ModuleException me)
+ {
+ throw new WebApplicationException(me, createErrorResponse(me, 500));
+ }
+ catch (ParseException pe)
+ {
+ throw new WebApplicationException(pe, createErrorResponse(pe, 400));
+ }
+
+ }
+
+ /**
+ * Handles POST proxy request.
+ *
+ * @param httpRequestHttpServletRequest
+ * @param url the url to request
+ * @return response Response
+ */
+ @POST
+ public Response doProxyPost(@Context HttpServletRequest httpRequest, @QueryParam("url") String url)
+ {
+ BaseConnector conn = new BaseConnector();
+ if (url == null)
+ {
+ Throwable e = new Throwable("Necessary URL parameter not found in proxy request");
+ throw new WebApplicationException(e, createErrorResponse(e, 404));
+ }
+ try
+ {
+ HTTPResponse resp = conn.fetchPost(httpRequest, url);
+ return createResponse(resp);
+ }
+ catch (MalformedURLException mue)
+ {
+ throw new WebApplicationException(mue, createErrorResponse(mue, 400));
+ }
+ catch (ProtocolNotSuppException pnse)
+ {
+ throw new WebApplicationException(pnse, createErrorResponse(pnse, 400));
+ }
+ catch (IOException ioe)
+ {
+ throw new WebApplicationException(ioe, createErrorResponse(ioe, 500));
+ }
+ catch (ModuleException me)
+ {
+ throw new WebApplicationException(me, createErrorResponse(me, 500));
+ }
+ catch (ParseException pe)
+ {
+ throw new WebApplicationException(pe, createErrorResponse(pe, 400));
+ }
+ }
+
+ /**
+ * Handles PUT proxy request.
+ *
+ * @param httpRequestHttpServletRequest
+ * @param url the url to request
+ * @return response Response
+ */
+ @PUT
+ public Response doProxyPut(@Context HttpServletRequest httpRequest, @QueryParam("url") String url)
+ {
+ BaseConnector conn = new BaseConnector();
+ if (url == null)
+ {
+ Throwable e = new Throwable("Necessary URL parameter not found in proxy request");
+ throw new WebApplicationException(e, createErrorResponse(e, 404));
+ }
+ try
+ {
+ HTTPResponse resp = conn.doPut(httpRequest, url);
+ return createResponse(resp);
+ }
+ catch (MalformedURLException mue)
+ {
+ throw new WebApplicationException(mue, createErrorResponse(mue, 400));
+ }
+ catch (ProtocolNotSuppException pnse)
+ {
+ throw new WebApplicationException(pnse, createErrorResponse(pnse, 400));
+ }
+ catch (IOException ioe)
+ {
+ throw new WebApplicationException(ioe, createErrorResponse(ioe, 500));
+ }
+ catch (ModuleException me)
+ {
+ throw new WebApplicationException(me, createErrorResponse(me, 500));
+ }
+ catch (ParseException pe)
+ {
+ throw new WebApplicationException(pe, createErrorResponse(pe, 400));
+ }
+
+ }
+
+ /**
+ * Handles DELETE proxy request.
+ *
+ * @param httpRequestHttpServletRequest
+ * @param url the url to request
+ * @return response Response
+ */
+ @DELETE
+ public Response doProxyDelete(@Context HttpServletRequest httpRequest, @QueryParam("url") String url)
+ {
+ BaseConnector conn = new BaseConnector();
+ if (url == null)
+ {
+ Throwable e = new Throwable("Necessary URL parameter not found in proxy request");
+ throw new WebApplicationException(e, createErrorResponse(e, 404));
+ }
+ try
+ {
+ HTTPResponse resp = conn.doDelete(httpRequest, url);
+ return createResponse(resp);
+ }
+ catch (MalformedURLException mue)
+ {
+ throw new WebApplicationException(mue, createErrorResponse(mue, 400));
+ }
+ catch (ProtocolNotSuppException pnse)
+ {
+ throw new WebApplicationException(pnse, createErrorResponse(pnse, 400));
+ }
+ catch (IOException ioe)
+ {
+ throw new WebApplicationException(ioe, createErrorResponse(ioe, 500));
+ }
+ catch (ModuleException me)
+ {
+ throw new WebApplicationException(me, createErrorResponse(me, 500));
+ }
+ catch (ParseException pe)
+ {
+ throw new WebApplicationException(pe, createErrorResponse(pe, 400));
+ }
+
+ }
+
+ /**
+ * Creates the response from HTTP response.
+ *
+ * @param httpResponse the http response
+ * @return response Response
+ */
+ private Response createResponse(HTTPResponse httpResponse)
+ {
+ ResponseBuilder responseBuilder;
+ try
+ {
+ responseBuilder = Response.status(httpResponse.getStatusCode());
+ for (Enumeration<String> en = httpResponse.listHeaders(); en.hasMoreElements();)
+ {
+ String headerName = (String)en.nextElement();
+ responseBuilder.header(headerName, httpResponse.getHeader(headerName));
+ }
+ return responseBuilder.entity(httpResponse.getInputStream()).build();
+ }
+ catch (IOException e)
+ {
+ throw new WebApplicationException(e, createErrorResponse(e, 500));
+ }
+ catch (ModuleException me)
+ {
+ throw new WebApplicationException(me, createErrorResponse(me, 400));
+ }
+ }
+
+ /**
+ * Creates the error response.
+ *
+ * @param t Throwable
+ * @param status integer response status
+ * @return response Response
+ */
+ private Response createErrorResponse(Throwable t, int status)
+ {
+ return Response.status(status).entity(t.getMessage()).type("text/plain").build();
+ }
+}
Property changes on: ws/branches/2.2.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/proxy/ProxyService.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
16 years, 2 months
exo-jcr SVN: r1885 - ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/proxy.
by do-not-reply@jboss.org
Author: max_shaposhnik
Date: 2010-02-18 05:32:55 -0500 (Thu, 18 Feb 2010)
New Revision: 1885
Modified:
ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/proxy/BaseConnector.java
Log:
EXOJCR=524 disabled pop-up windows alerts
Modified: ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/proxy/BaseConnector.java
===================================================================
--- ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/proxy/BaseConnector.java 2010-02-18 10:17:33 UTC (rev 1884)
+++ ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/proxy/BaseConnector.java 2010-02-18 10:32:55 UTC (rev 1885)
@@ -73,6 +73,7 @@
conn.setTimeout(DEFAULT_CONNECT_TIMEOUT_MS);
prepareRequestHeaders(httpRequest);
prepareFormParams(url_obj);
+ conn.setAllowUserInteraction(false);
resp = conn.Get(url_obj.getProtocol() + "://" + url_obj.getAuthority() + url_obj.getPath(), form_data, headers);
if (resp.getStatusCode() >= 300)
{
@@ -94,6 +95,7 @@
conn = new HTTPConnection(url_obj);
conn.setTimeout(DEFAULT_CONNECT_TIMEOUT_MS);
+ conn.setAllowUserInteraction(false);
prepareRequestHeaders(httpRequest);
byte[] body = new byte[httpRequest.getContentLength()];
@@ -104,6 +106,7 @@
LOG.error("Received Error: " + resp.getReasonLine());
LOG.error(resp.getText());
}
+ conn.stop();
return resp;
}
@@ -119,6 +122,7 @@
conn = new HTTPConnection(url_obj);
conn.setTimeout(DEFAULT_CONNECT_TIMEOUT_MS);
+ conn.setAllowUserInteraction(false);
prepareRequestHeaders(httpRequest);
byte[] body = new byte[httpRequest.getContentLength()];
@@ -129,6 +133,7 @@
LOG.error("Received Error: " + resp.getReasonLine());
LOG.error(resp.getText());
}
+ conn.stop();
return resp;
}
@@ -144,6 +149,7 @@
conn = new HTTPConnection(url_obj);
conn.setTimeout(DEFAULT_CONNECT_TIMEOUT_MS);
+ conn.setAllowUserInteraction(false);
prepareRequestHeaders(httpRequest);
resp = conn.Delete(url_obj.getProtocol() + "://" + url_obj.getAuthority() + url_obj.getPath(), headers);
if (resp.getStatusCode() >= 300)
@@ -151,6 +157,7 @@
LOG.error("Received Error: " + resp.getReasonLine());
LOG.error(resp.getText());
}
+ conn.stop();
return resp;
}
16 years, 2 months
exo-jcr SVN: r1884 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session.
by do-not-reply@jboss.org
Author: tolusha
Date: 2010-02-18 05:17:33 -0500 (Thu, 18 Feb 2010)
New Revision: 1884
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableResourceManager.java
Log:
EXOJCR-115: avoid using private method putIfAbsent
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableResourceManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableResourceManager.java 2010-02-18 08:38:06 UTC (rev 1883)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableResourceManager.java 2010-02-18 10:17:33 UTC (rev 1884)
@@ -86,7 +86,7 @@
// make sure the list is not removed by another Session of same user, see
// remove()
- putIfAbsent(userSession.getUserID(), joinedList);
+ txResources.putIfAbsent(userSession.getUserID(), joinedList);
}
else
{
@@ -94,7 +94,7 @@
final ConcurrentLinkedQueue<SoftReference<XASessionImpl>> newJoinedList =
new ConcurrentLinkedQueue<SoftReference<XASessionImpl>>();
final ConcurrentLinkedQueue<SoftReference<XASessionImpl>> previous =
- putIfAbsent(userSession.getUserID(), newJoinedList);
+ txResources.putIfAbsent(userSession.getUserID(), newJoinedList);
if (previous != null)
{
previous.add(new SoftReference<XASessionImpl>(userSession));
@@ -251,18 +251,4 @@
}
}
}
-
- private ConcurrentLinkedQueue<SoftReference<XASessionImpl>> putIfAbsent(String key,
- ConcurrentLinkedQueue<SoftReference<XASessionImpl>> value)
- {
- if (!txResources.containsKey(key))
- {
- return txResources.put(key, value);
- }
- else
- {
- return txResources.get(key);
- }
- }
-
}
16 years, 2 months
exo-jcr SVN: r1883 - core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database/impl.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-02-18 03:38:06 -0500 (Thu, 18 Feb 2010)
New Revision: 1883
Modified:
core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database/impl/HibernateServiceImpl.java
Log:
EXOJCR-485: NPE on wrong datasource fixed
Modified: core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database/impl/HibernateServiceImpl.java
===================================================================
--- core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database/impl/HibernateServiceImpl.java 2010-02-18 08:34:30 UTC (rev 1882)
+++ core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database/impl/HibernateServiceImpl.java 2010-02-18 08:38:06 UTC (rev 1883)
@@ -123,11 +123,11 @@
try
{
- // check is there is datasource
+ // check is there is data source
String dataSourceName = conf_.getProperty("hibernate.connection.datasource");
if (dataSourceName != null)
{
- //detect with datasource
+ //detect dialect by data source
DataSource dataSource;
try
{
@@ -136,30 +136,28 @@
{
log_.error("DataSource is configured but not finded.", new Exception());
}
+ else
+ {
+ connection = dataSource.getConnection();
- connection = dataSource.getConnection();
-
- Dialect d = DialectFactory.buildDialect(new Properties(), connection);
- conf_.setProperty("hibernate.dialect", d.getClass().getName());
-
+ Dialect d = DialectFactory.buildDialect(new Properties(), connection);
+ conf_.setProperty("hibernate.dialect", d.getClass().getName());
+ }
}
catch (NamingException e)
{
log_.error(e.getMessage(), e);
}
-
}
else
{
-
String url = conf_.getProperty("hibernate.connection.url");
if (url != null)
{
- //detect with url
- //get driver class
-
+ //detect dialect by url
try
{
+ //load driver class
Class.forName(conf_.getProperty("hibernate.connection.driver_class")).newInstance();
}
catch (InstantiationException e)
@@ -184,7 +182,6 @@
Dialect d = DialectFactory.buildDialect(new Properties(), connection);
conf_.setProperty("hibernate.dialect", d.getClass().getName());
-
}
else
{
@@ -192,7 +189,6 @@
log_.error(e.getMessage(), e);
}
}
-
}
catch (SQLException e)
{
@@ -212,9 +208,7 @@
}
}
}
-
}
-
}
public void addPlugin(ComponentPlugin plugin)
16 years, 2 months
exo-jcr SVN: r1882 - in jcr/trunk/docs/reference/en/src/main/docbook/en-US: modules and 1 other directory.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-02-18 03:34:30 -0500 (Thu, 18 Feb 2010)
New Revision: 1882
Modified:
jcr/trunk/docs/reference/en/src/main/docbook/en-US/master.xml
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/query-handler-config.xml
Log:
EXOJCR-490: small updates
Modified: jcr/trunk/docs/reference/en/src/main/docbook/en-US/master.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/master.xml 2010-02-17 17:07:52 UTC (rev 1881)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/master.xml 2010-02-18 08:34:30 UTC (rev 1882)
@@ -66,6 +66,9 @@
<xi:include href="modules/cluster-config.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="modules/jbosscache-configuration-templates.xml"
+ xmlns:xi="http://www.w3.org/2001/XInclude" />
+
<xi:include href="modules/lock-manager-config.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
Modified: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/query-handler-config.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/query-handler-config.xml 2010-02-17 17:07:52 UTC (rev 1881)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/query-handler-config.xml 2010-02-18 08:34:30 UTC (rev 1882)
@@ -1,186 +1,188 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<article>
- <articleinfo>
- <title>QueryHandler configuration</title>
- </articleinfo>
-
- <section>
- <title>How does it work?</title>
-
- <para>Lets talk about indexing content in cluster.</para>
-
- <para>For couple of reasons, we can't replicate index. That's means, some
- data added and indexed on one cluster node, will be replicated to another
- cluster node, but will not be indexed on that node.</para>
-
- <para>So, how do the indexing works in cluster environment?</para>
-
- <para>As, we can not index same data on all nodes of cluster, we must
- index it on one node. Node, that can index data and do changes on lucene
- index, is called "coordinator". Coordinator-node is choosen automaticaly,
- so we do not need special configuration for coordinator.</para>
-
- <para>But, how can another nodes save their changes to lucene
- index?</para>
-
- <para>First of all, data is already saved and replicated to another
- cluster-nodes, so we need only deliver message like "we need to index this
- data" to coordinator. Thats why Jboss-cache is used.</para>
-
- <para>All nodes of cluster writes messages into JBoss-cache but only
- coordinator takes those messages and makes changes Lucene index.</para>
-
- <para>How do the search works in cluster environment?</para>
-
- <para>Search engine do not works with indexer, coordinator, etc. Search
- needs only lucene index. But only one cluster node can change lucene index
- - asking you. Yes - lucene index is shared. So, all cluster nodes must be
- configured to use lucene index from shared directory.</para>
-
- <para>A little bit about indexing process (no matter, cluster or not)
- Indexer do not writes changes to FS lucene index immediately. At first,
- Indexer writes changes to Volatile index. If Volatile index size become
- 1Mb or more it is flushed to FS. Also there is timer, that flushes
- volatile index by timeout. Volatile index timeout configured by
- "max-volatile-time" paremeter.</para>
-
- <para>Common scheme of Shared Index<mediaobject>
- <imageobject>
- <imagedata fileref="images/diagram-shared-index.png" />
- </imageobject>
- </mediaobject></para>
- </section>
-
- <section>
- <title>Configuration</title>
-
- <section>
- <title>Common requirements</title>
-
- <para>Now, lets see what we need to run Search engine in cluster
- environment.<itemizedlist>
- <listitem>
- <para>shared directory for storing Lucene index (i.e. NFS);</para>
- </listitem>
-
- <listitem>
- <para>changes filter configured as
- org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter;</para>
-
- <note>
- <para>This filter ignore changes on non-coordinator nodes, and
- index changes on coordinator node.</para>
- </note>
- </listitem>
-
- <listitem>
- <para>configure JBoss-cache, course;</para>
- </listitem>
- </itemizedlist></para>
- </section>
-
- <section>
- <title>Query-handler configuration</title>
-
- <para>Configuration example:<programlisting><workspace name="ws">
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="shareddir/index/db1/ws" />
- <property name="changesfilter-class"
- value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" />
- <property name="jbosscache-configuration" value="jbosscache-indexer.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="jgroups-multiplexer-stack" value="true" />
- <property name="jbosscache-cluster-name" value="JCR-cluster-indexer-ws" />
- <property name="max-volatile-time" value="60" />
- </properties>
- </query-handler>
-</workspace></programlisting> <table>
- <title>Config properties description</title>
-
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Property name</entry>
-
- <entry>Description</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>index-dir</entry>
-
- <entry>path to index</entry>
- </row>
-
- <row>
- <entry>jbosscache-configuration</entry>
-
- <entry>template of JBoss-cache configuration for all
- query-handlers in repository</entry>
- </row>
-
- <row>
- <entry>jgroups-configuration</entry>
-
- <entry>jgroups-configuration is template configuration for all
- components (search, cache, locks) [Add link to document
- describing template configurations]</entry>
- </row>
-
- <row>
- <entry>jgroups-multiplexer-stack</entry>
-
- <entry>[TODO about jgroups-multiplexer-stack - add link to
- JBoss doc]</entry>
- </row>
-
- <row>
- <entry>jbosscache-cluster-name</entry>
-
- <entry>cluster name (must be unique)</entry>
- </row>
-
- <row>
- <entry>max-volatile-time</entry>
-
- <entry>max time to live for Volatile Index</entry>
- </row>
- </tbody>
- </tgroup>
- </table></para>
- </section>
-
- <section>
- <title>JBoss-Cache template configuration</title>
-
- <para>JBoss-Cache template configuration for query handler.</para>
-
- <para>jbosscache-indexer.xml<programlisting><?xml version="1.0" encoding="UTF-8"?>
-<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.1">
-
- <locking useLockStriping="false" concurrencyLevel="50000" lockParentForChildInsertRemove="false"
- lockAcquisitionTimeout="20000" />
- <!-- Configure the TransactionManager -->
- <transaction transactionManagerLookupClass="org.jboss.cache.transaction.JBossStandaloneJTAManagerLookup" />
-
- <clustering mode="replication" clusterName="${jbosscache-cluster-name}">
- <stateRetrieval timeout="20000" fetchInMemoryState="false" />
- <jgroupsConfig multiplexerStack="jcr.stack" />
- <sync />
- </clustering>
- <!-- Eviction configuration -->
- <eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.cache.eviction.FIFOAlgorithm" eventQueueSize="1000000">
- <property name="maxNodes" value="10000" />
- <property name="minTimeToLive" value="60000" />
- </default>
- </eviction>
-
-</jbosscache></programlisting></para>
- </section>
- </section>
-</article>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<article>
+ <articleinfo>
+ <title>QueryHandler configuration</title>
+ </articleinfo>
+
+ <section>
+ <title>How does it work?</title>
+
+ <para>Lets talk about indexing content in cluster.</para>
+
+ <para>For couple of reasons, we can't replicate index. That's means, some
+ data added and indexed on one cluster node, will be replicated to another
+ cluster node, but will not be indexed on that node.</para>
+
+ <para><citetitle>So, how do the indexing works in cluster
+ environment?</citetitle></para>
+
+ <para>As, we can not index same data on all nodes of cluster, we must
+ index it on one node. Node, that can index data and do changes on lucene
+ index, is called "coordinator". Coordinator-node is choosen automaticaly,
+ so we do not need special configuration for coordinator.</para>
+
+ <para>But, how can another nodes save their changes to lucene
+ index?</para>
+
+ <para>First of all, data is already saved and replicated to another
+ cluster-nodes, so we need only deliver message like "we need to index this
+ data" to coordinator. Thats why Jboss-cache is used.</para>
+
+ <para>All nodes of cluster writes messages into JBoss-cache but only
+ coordinator takes those messages and makes changes Lucene index.</para>
+
+ <para><citetitle>How do the search works in cluster
+ environment?</citetitle></para>
+
+ <para>Search engine do not works with indexer, coordinator, etc. Search
+ needs only lucene index. But only one cluster node can change lucene index
+ - asking you. Yes - lucene index is shared. So, all cluster nodes must be
+ configured to use lucene index from shared directory.</para>
+
+ <para>A little bit about indexing process (no matter, cluster or not)
+ Indexer do not writes changes to FS lucene index immediately. At first,
+ Indexer writes changes to Volatile index. If Volatile index size become
+ 1Mb or more it is flushed to FS. Also there is timer, that flushes
+ volatile index by timeout. Volatile index timeout configured by
+ "max-volatile-time" paremeter.</para>
+
+ <para>Common scheme of Shared Index<mediaobject>
+ <imageobject>
+ <imagedata fileref="images/diagram-shared-index.png" />
+ </imageobject>
+ </mediaobject></para>
+ </section>
+
+ <section>
+ <title>Configuration</title>
+
+ <section>
+ <title>Common requirements</title>
+
+ <para>Now, lets see what we need to run Search engine in cluster
+ environment.<itemizedlist>
+ <listitem>
+ <para>shared directory for storing Lucene index (i.e. NFS);</para>
+ </listitem>
+
+ <listitem>
+ <para>changes filter configured as
+ org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter;</para>
+
+ <note>
+ <para>This filter ignore changes on non-coordinator nodes, and
+ index changes on coordinator node.</para>
+ </note>
+ </listitem>
+
+ <listitem>
+ <para>configure JBoss-cache, course;</para>
+ </listitem>
+ </itemizedlist></para>
+ </section>
+
+ <section>
+ <title>Query-handler configuration</title>
+
+ <para>Configuration example:<programlisting><workspace name="ws">
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="shareddir/index/db1/ws" />
+ <property name="changesfilter-class"
+ value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" />
+ <property name="jbosscache-configuration" value="jbosscache-indexer.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="jgroups-multiplexer-stack" value="true" />
+ <property name="jbosscache-cluster-name" value="JCR-cluster-indexer-ws" />
+ <property name="max-volatile-time" value="60" />
+ </properties>
+ </query-handler>
+</workspace></programlisting> <table>
+ <title>Config properties description</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Property name</entry>
+
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>index-dir</entry>
+
+ <entry>path to index</entry>
+ </row>
+
+ <row>
+ <entry>jbosscache-configuration</entry>
+
+ <entry>template of JBoss-cache configuration for all
+ query-handlers in repository</entry>
+ </row>
+
+ <row>
+ <entry>jgroups-configuration</entry>
+
+ <entry>jgroups-configuration is template configuration for all
+ components (search, cache, locks) [Add link to document
+ describing template configurations]</entry>
+ </row>
+
+ <row>
+ <entry>jgroups-multiplexer-stack</entry>
+
+ <entry>[TODO about jgroups-multiplexer-stack - add link to
+ JBoss doc]</entry>
+ </row>
+
+ <row>
+ <entry>jbosscache-cluster-name</entry>
+
+ <entry>cluster name (must be unique)</entry>
+ </row>
+
+ <row>
+ <entry>max-volatile-time</entry>
+
+ <entry>max time to live for Volatile Index</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table></para>
+ </section>
+
+ <section>
+ <title>JBoss-Cache template configuration</title>
+
+ <para>JBoss-Cache template configuration for query handler.</para>
+
+ <para>jbosscache-indexer.xml<programlisting><?xml version="1.0" encoding="UTF-8"?>
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.1">
+
+ <locking useLockStriping="false" concurrencyLevel="50000" lockParentForChildInsertRemove="false"
+ lockAcquisitionTimeout="20000" />
+ <!-- Configure the TransactionManager -->
+ <transaction transactionManagerLookupClass="org.jboss.cache.transaction.JBossStandaloneJTAManagerLookup" />
+
+ <clustering mode="replication" clusterName="${jbosscache-cluster-name}">
+ <stateRetrieval timeout="20000" fetchInMemoryState="false" />
+ <jgroupsConfig multiplexerStack="jcr.stack" />
+ <sync />
+ </clustering>
+ <!-- Eviction configuration -->
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.FIFOAlgorithm" eventQueueSize="1000000">
+ <property name="maxNodes" value="10000" />
+ <property name="minTimeToLive" value="60000" />
+ </default>
+ </eviction>
+
+</jbosscache></programlisting></para>
+ </section>
+ </section>
+</article>
16 years, 2 months
exo-jcr SVN: r1881 - in jcr/trunk/docs/reference/en/src/main/docbook/en-US: modules and 1 other directory.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-02-17 12:07:52 -0500 (Wed, 17 Feb 2010)
New Revision: 1881
Modified:
jcr/trunk/docs/reference/en/src/main/docbook/en-US/master.xml
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/cluster-config.xml
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/lock-manager-config.xml
Log:
EXOJCR-490: few links added
Modified: jcr/trunk/docs/reference/en/src/main/docbook/en-US/master.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/master.xml 2010-02-17 16:53:26 UTC (rev 1880)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/master.xml 2010-02-17 17:07:52 UTC (rev 1881)
@@ -63,6 +63,9 @@
<xi:include href="modules/configuration.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="modules/cluster-config.xml"
+ xmlns:xi="http://www.w3.org/2001/XInclude" />
+
<xi:include href="modules/lock-manager-config.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
Modified: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/cluster-config.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/cluster-config.xml 2010-02-17 16:53:26 UTC (rev 1880)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/cluster-config.xml 2010-02-17 17:07:52 UTC (rev 1881)
@@ -64,7 +64,7 @@
</orderedlist>
</section>
- <section>
+ <section id="sect_conf_cluster_jcr">
<title>Configuring JCR to use external configuration</title>
<itemizedlist>
@@ -92,7 +92,7 @@
<property name="swap-directory" value="../temp/swap/production" />
</properties>
<value-storages>
- see "Value storage configuration" part.
+ see "<link linkend="conf_value_storage">Value storage configuration</link>" part.
</value-storages>
</container>
<initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
@@ -101,13 +101,13 @@
</properties>
</initializer>
<cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
- see "Cache configuration" part.
+ see "<link linkend="conf_cache">Cache configuration</link>" part.
</cache>
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- see "Indexer configuration" part.
+ see "<link linkend="conf_indexer">Indexer configuration</link>" part.
</query-handler>
<lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
- see "Lock Manager configuration" part.
+ see "<link linkend="conf_lock_manager">Lock Manager configuration</link>" part.
</lock-manager>
</workspace>
<workspace name="ws2">
@@ -176,7 +176,7 @@
such parts:</para>
<itemizedlist>
- <listitem>
+ <listitem id="conf_value_storage">
<para>Value Storage configuration:</para>
<programlisting><value-storages>
@@ -190,10 +190,8 @@
</value-storage>
</value-storages></programlisting>
</listitem>
- </itemizedlist>
- <itemizedlist>
- <listitem>
+ <listitem id="conf_cache">
<para>Cache configuration:</para>
<programlisting><cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
@@ -205,10 +203,8 @@
</properties>
</cache> </programlisting>
</listitem>
- </itemizedlist>
- <itemizedlist>
- <listitem>
+ <listitem id="conf_indexer">
<para>Indexer configuration:</para>
<programlisting><query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
@@ -223,7 +219,7 @@
</query-handler> </programlisting>
</listitem>
- <listitem>
+ <listitem id="conf_lock_manager">
<para>Lock Manager configuration:</para>
<programlisting><lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
Modified: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/lock-manager-config.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/lock-manager-config.xml 2010-02-17 16:53:26 UTC (rev 1880)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/lock-manager-config.xml 2010-02-17 17:07:52 UTC (rev 1881)
@@ -1,437 +1,440 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<article>
- <articleinfo>
- <title>LockManager configuration</title>
- </articleinfo>
-
- <section>
- <title>Introduction</title>
-
- <para>What LockManager does?</para>
-
- <para>In common words, LockManager stores lock objects, so it can give
- Lock object or can release it, etc.</para>
-
- <para>Also LockManager is responsible for removing Locks that live too
- long. This parameter may be configured with "time-out" property.</para>
-
- <para>JCR provide two base implementation of LockManager:</para>
-
- <itemizedlist>
- <listitem>
- <para>org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl;</para>
- </listitem>
-
- <listitem>
- <para>org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl;</para>
- </listitem>
- </itemizedlist>
-
- <para>In this article we will talk mostly about
- CacheableLockManagerImpl.</para>
-
- <para>You can enable LockManager by adding lock-manager-configuration to
- workspace-configuration.</para>
-
- <para>For example:</para>
-
- <programlisting><workspace name="ws">
- ...
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- ...
- </properties>
- </lock-manager>
- ...
-</workspace></programlisting>
- </section>
-
- <section>
- <title>LockManagerImpl</title>
-
- <para>LockManagerImpl is simple implementation of LockManager, and also
- faster than CacheableLockManager. It stores Lock objects in HashMap and
- may also persist Locks if LockPersister is configured. LockManagerImpl do
- not support replication in any way.</para>
-
- <para>See <ulink
- url="http://wiki.exoplatform.com/xwiki/bin/view/JCR/Configuration#HLockManager...">LockManagerImpl
- configuration</ulink></para>
- </section>
-
- <section>
- <title>CacheableLockManagerImpl</title>
-
- <para>CacheableLockManagerImpl stores Lock object in JBoss-cache, so Locks
- are replicable and affects on cluster, not only a single node. Also
- JBoss-cache has JDBCCacheLoader, so locks will be stored to
- database.</para>
-
- <para>Both implementation supports Expired Locks removing. There is
- LockRemover - separate thread, that periodically ask LockManager for Locks
- that lives to much and must be removed. So, timeout for LockRemover may be
- set as follows, default value is 30m.</para>
-
- <programlisting><properties>
- <property name="time-out" value="10m" />
- ...
-</properties></programlisting>
-
- <section>
- <title>Configuration</title>
-
- <para>Replication requirements are same as for Cache</para>
-
- <para>Common tips:</para>
-
- <itemizedlist>
- <listitem>
- <para>clusterName ("jbosscache-cluster-name") must be unique;</para>
- </listitem>
-
- <listitem>
- <para>cache.jdbc.table.name must be unique per datasource;</para>
- </listitem>
-
- <listitem>
- <para>cache.jdbc.fqn.type must and cache.jdbc.node.type must be
- configured according to used database;</para>
- </listitem>
- </itemizedlist>
-
- <para>There is few ways how to configure CacheableLockManagerImpl, and
- all of them configures JBoss-cache and JDBCCacheLoader.</para>
-
- <para>See <ulink
- url="http://community.jboss.org/wiki/JBossCacheJDBCCacheLoader">http://community.jboss.org/wiki/JBossCacheJDBCCacheLoader</ulink></para>
- </section>
-
- <section>
- <title>Simple JbossCache Configuraion</title>
-
- <para>First one is - put JbossCache configuraion file path to
- CacheableLockManagerImpl</para>
-
- <para><note>
- <para>This configuration is not so good, as you can think. Because
- repository may contain many workspaces, and each workspace must
- contain LockManager configuration, and LockManager config may
- contain JbossCache config file. So total configuration is growing
- up. But it is usefull if we want a single LockManager with special
- configuration.</para>
- </note></para>
-
- <para>Config is:</para>
-
- <programlisting><lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="jbosscache-configuration" value="conf/standalone/cluster/test-jbosscache-lock-config.xml" />
- </properties>
-</lock-manager></programlisting>
-
- <para>test-jbosscache-lock-config.xml<programlisting><?xml version="1.0" encoding="UTF-8"?>
-<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.2">
-
- <locking useLockStriping="false" concurrencyLevel="50000" lockParentForChildInsertRemove="false" lockAcquisitionTimeout="20000" />
-
- <clustering mode="replication" clusterName="JBoss-Cache-Lock-Cluster_Name">
- <stateRetrieval timeout="20000" fetchInMemoryState="false" nonBlocking="true" />
- <jgroupsConfig>
-
- <TCP bind_addr="127.0.0.1" start_port="9800" loopback="true" recv_buf_size="20000000" send_buf_size="640000" discard_incompatible_packets="true"
- max_bundle_size="64000" max_bundle_timeout="30" use_incoming_packet_handler="true" enable_bundling="false" use_send_queues="false" sock_conn_timeout="300"
- skip_suspected_members="true" use_concurrent_stack="true" thread_pool.enabled="true" thread_pool.min_threads="1" thread_pool.max_threads="25"
- thread_pool.keep_alive_time="5000" thread_pool.queue_enabled="false" thread_pool.queue_max_size="100" thread_pool.rejection_policy="run"
- oob_thread_pool.enabled="true" oob_thread_pool.min_threads="1" oob_thread_pool.max_threads="8" oob_thread_pool.keep_alive_time="5000"
- oob_thread_pool.queue_enabled="false" oob_thread_pool.queue_max_size="100" oob_thread_pool.rejection_policy="run" />
- <MPING timeout="2000" num_initial_members="2" mcast_port="34540" bind_addr="127.0.0.1" mcast_addr="224.0.0.1" />
-
-
- <MERGE2 max_interval="30000" min_interval="10000" />
- <FD_SOCK />
- <FD max_tries="5" shun="true" timeout="10000" />
- <VERIFY_SUSPECT timeout="1500" />
- <pbcast.NAKACK discard_delivered_msgs="true" gc_lag="0" retransmit_timeout="300,600,1200,2400,4800" use_mcast_xmit="false" />
- <UNICAST timeout="300,600,1200,2400,3600" />
- <pbcast.STABLE desired_avg_gossip="50000" max_bytes="400000" stability_delay="1000" />
- <pbcast.GMS join_timeout="5000" print_local_addr="true" shun="false" view_ack_collection_timeout="5000" view_bundling="true" />
- <FRAG2 frag_size="60000" />
- <pbcast.STREAMING_STATE_TRANSFER />
- <pbcast.FLUSH timeout="0" />
-
- </jgroupsConfig
-
- <sync />
- </clustering>
-
- <loaders passivation="false" shared="true">
- <preload>
- <node fqn="/" />
- </preload>
- <loader class="org.jboss.cache.loader.JDBCCacheLoader" async="false" fetchPersistentState="false" ignoreModifications="false" purgeOnStartup="false">
- <properties>
- cache.jdbc.table.name=jcrlocks_ws
- cache.jdbc.table.create=true
- cache.jdbc.table.drop=false
- cache.jdbc.table.primarykey=jcrlocks_ws_pk
- cache.jdbc.fqn.column=fqn
- cache.jdbc.fqn.type=VARCHAR(512)
- cache.jdbc.node.column=node
- cache.jdbc.node.type=<BLOB>
- cache.jdbc.parent.column=parent
- cache.jdbc.datasource=jdbcjcr
- </properties>
- </loader>
-
- </loaders>
-
-</jbosscache></programlisting></para>
-
- <para>Configuration requirements:</para>
-
- <itemizedlist>
- <listitem>
- <para><clustering mode="replication"
- clusterName="JBoss-Cache-Lock-Cluster_Name"> - cluster name must
- be unique;</para>
- </listitem>
-
- <listitem>
- <para><quote>cache.jdbc.table.name</quote> must be unique per
- datasource;</para>
- </listitem>
-
- <listitem>
- <para><quote>cache.jdbc.node.type</quote> and
- <quote>cache.jdbc.fqn.type</quote> must be configured according to
- using database. See <link endterm="datatypes.title"
- linkend="datatypes"></link> .</para>
- </listitem>
- </itemizedlist>
- </section>
-
- <section>
- <title>Template JBossCache Configuration</title>
-
- <para>Second one is - use template JBoss-cache configuration for all
- LockManagers</para>
-
- <para><citetitle>Lock template configuration</citetitle></para>
-
- <para>test-jbosscache-lock.xml</para>
-
- <programlisting><?xml version="1.0" encoding="UTF-8"?>
-<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.1">
-
- <locking useLockStriping="false" concurrencyLevel="50000" lockParentForChildInsertRemove="false"
- lockAcquisitionTimeout="20000" />
-
- <clustering mode="replication" clusterName="${jbosscache-cluster-name}">
- <stateRetrieval timeout="20000" fetchInMemoryState="false" />
- <jgroupsConfig multiplexerStack="jcr.stack" />
- <sync />
- </clustering>
-
- <loaders passivation="false" shared="true">
- <!-- All the data of the JCR locks needs to be loaded at startup -->
- <preload>
- <node fqn="/" />
- </preload>
- <!--
- For another cache-loader class you should use another template with
- cache-loader specific parameters
- ->
- <loader class="org.jboss.cache.loader.JDBCCacheLoader" async=q"false" fetchPersistentState="false"
- ignoreModifications="false" purgeOnStartup="false">
- <properties>
- cache.jdbc.table.name=${jbosscache-cl-cache.jdbc.table.name}
- cache.jdbc.table.create=${jbosscache-cl-cache.jdbc.table.create}
- cache.jdbc.table.drop=${jbosscache-cl-cache.jdbc.table.drop}
- cache.jdbc.table.primarykey=${jbosscache-cl-cache.jdbc.table.primarykey}
- cache.jdbc.fqn.column=${jbosscache-cl-cache.jdbc.fqn.column}
- cache.jdbc.fqn.type=${jbosscache-cl-cache.jdbc.fqn.type}
- cache.jdbc.node.column=${jbosscache-cl-cache.jdbc.node.column}
- cache.jdbc.node.type=${jbosscache-cl-cache.jdbc.node.type}
- cache.jdbc.parent.column=${jbosscache-cl-cache.jdbc.parent.column}
- cache.jdbc.datasource=${jbosscache-cl-cache.jdbc.datasource}
- </properties>
- </loader>
- </loaders>
-</jbosscache></programlisting>
-
- <para>As you see, all configurable paramaters filled by templates and
- will be replaced by LockManagers conf parameters:</para>
-
- <programlisting><lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="jbosscache-configuration" value="test-jbosscache-lock.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="jgroups-multiplexer-stack" value="true" />
- <property name="jbosscache-cluster-name" value="JCR-cluster-locks-ws" />
- <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks_ws" />
- <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
- <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
- <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_ws_pk" />
- <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
- <property name="jbosscache-cl-cache.jdbc.fqn.type" value="AUTO"/>
- <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
- <property name="jbosscache-cl-cache.jdbc.node.type" value="AUTO"/>
- <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
- <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr" />
- </properties>
-</lock-manager></programlisting>
-
- <para>Configuration requirements:<itemizedlist>
- <listitem>
- <para><quote>jbosscache-cl-cache.jdbc.fqn.column</quote> and
- <quote>jbosscache-cl-cache.jdbc.node.type</quote> is nothing else
- as cache.jdbc.fqn.type and cache.jdbc.node.type in JBoss-Cache
- configuration. You can set those data types according to database
- type (See <link endterm="datatypes.title"
- linkend="datatypes"></link>) or set it as AUTO (or do not set at
- all) and data type will by detected automaticaly.</para>
- </listitem>
-
- <listitem>
- <para>as you see, jgroups-configuration moved to separate config
- file - udp-mux.xml; In our case udp-mux.xml is common JGroup
- config for all components (QueryHandler, cache, LockManager). But
- we, still, can create own config.</para>
- </listitem>
- </itemizedlist></para>
-
- <para>our-udp-mux.xml<programlisting><protocol_stacks>
- <stack name="jcr.stack">
- <config>
- <UDP mcast_addr="228.10.10.10" mcast_port="45588" tos="8" ucast_recv_buf_size="20000000"
- ucast_send_buf_size="640000" mcast_recv_buf_size="25000000" mcast_send_buf_size="640000" loopback="false"
- discard_incompatible_packets="true" max_bundle_size="64000" max_bundle_timeout="30"
- use_incoming_packet_handler="true" ip_ttl="2" enable_bundling="true" enable_diagnostics="true"
- thread_naming_pattern="cl" use_concurrent_stack="true" thread_pool.enabled="true" thread_pool.min_threads="2"
- thread_pool.max_threads="8" thread_pool.keep_alive_time="5000" thread_pool.queue_enabled="true"
- thread_pool.queue_max_size="1000" thread_pool.rejection_policy="discard" oob_thread_pool.enabled="true"
- oob_thread_pool.min_threads="1" oob_thread_pool.max_threads="8" oob_thread_pool.keep_alive_time="5000"
- oob_thread_pool.queue_enabled="false" oob_thread_pool.queue_max_size="100" oob_thread_pool.rejection_policy="Run" />
-
- <PING timeout="2000" num_initial_members="3" />
- <MERGE2 max_interval="30000" min_interval="10000" />
- <FD_SOCK />
- <FD timeout="10000" max_tries="5" shun="true" />
- <VERIFY_SUSPECT timeout="1500" />
- <BARRIER />
- <pbcast.NAKACK use_stats_for_retransmission="false" exponential_backoff="150" use_mcast_xmit="true"
- gc_lag="0" retransmit_timeout="50,300,600,1200" discard_delivered_msgs="true" />
- <UNICAST timeout="300,600,1200" />
- <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000" max_bytes="1000000" />
- <VIEW_SYNC avg_send_interval="60000" />
- <pbcast.GMS print_local_addr="true" join_timeout="3000" shun="false" view_bundling="true" />
- <FC max_credits="500000" min_threshold="0.20" />
- <FRAG2 frag_size="60000" />
- <!--pbcast.STREAMING_STATE_TRANSFER /-->
- <pbcast.STATE_TRANSFER />
- <!-- pbcast.FLUSH /-->
- </config>
- </stack>
-</protocol_stacks> </programlisting></para>
- </section>
-
- <section id="datatypes">
- <title id="datatypes.title">Data Types in Different Databases</title>
-
- <table>
- <title>Fqn type and node type in different databases</title>
-
- <tgroup cols="3">
- <thead>
- <row>
- <entry>DataBase name</entry>
-
- <entry>Node data type</entry>
-
- <entry>FQN data type</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>default</entry>
-
- <entry>BLOB</entry>
-
- <entry>VARCHAR(512)</entry>
- </row>
-
- <row>
- <entry>HSSQL</entry>
-
- <entry>OBJECT</entry>
-
- <entry>VARCHAR(512)</entry>
- </row>
-
- <row>
- <entry>MySQL</entry>
-
- <entry>LONGBLOB</entry>
-
- <entry>VARCHAR(512)</entry>
- </row>
-
- <row>
- <entry>ORACLE</entry>
-
- <entry>BLOB</entry>
-
- <entry>VARCHAR2(512)</entry>
- </row>
-
- <row>
- <entry>PostgreSQL</entry>
-
- <entry>bytea</entry>
-
- <entry>VARCHAR(512)</entry>
- </row>
-
- <row>
- <entry>MSSQL</entry>
-
- <entry>VARBINARY(MAX)</entry>
-
- <entry>VARCHAR(512)</entry>
- </row>
-
- <row>
- <entry>DB2</entry>
-
- <entry>BLOB</entry>
-
- <entry>VARCHAR(512)</entry>
- </row>
-
- <row>
- <entry>Sybase</entry>
-
- <entry>IMAGE</entry>
-
- <entry>VARCHAR(512)</entry>
- </row>
-
- <row>
- <entry>Ingres</entry>
-
- <entry>long byte</entry>
-
- <entry>VARCHAR(512)</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </section>
- </section>
-</article>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<article>
+ <articleinfo>
+ <title>LockManager configuration</title>
+ </articleinfo>
+
+ <section>
+ <title>Introduction</title>
+
+ <para>What LockManager does?</para>
+
+ <para>In common words, LockManager stores lock objects, so it can give
+ Lock object or can release it, etc.</para>
+
+ <para>Also LockManager is responsible for removing Locks that live too
+ long. This parameter may be configured with "time-out" property.</para>
+
+ <para>JCR provide two base implementation of LockManager:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl;</para>
+ </listitem>
+
+ <listitem>
+ <para>org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl;</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>In this article we will talk mostly about
+ CacheableLockManagerImpl.</para>
+
+ <para>You can enable LockManager by adding lock-manager-configuration to
+ workspace-configuration.</para>
+
+ <para>For example:</para>
+
+ <programlisting><workspace name="ws">
+ ...
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ ...
+ </properties>
+ </lock-manager>
+ ...
+</workspace></programlisting>
+ </section>
+
+ <section>
+ <title>LockManagerImpl</title>
+
+ <para>LockManagerImpl is simple implementation of LockManager, and also
+ faster than CacheableLockManager. It stores Lock objects in HashMap and
+ may also persist Locks if LockPersister is configured. LockManagerImpl do
+ not support replication in any way.</para>
+
+ <para>See <ulink
+ url="http://wiki.exoplatform.com/xwiki/bin/view/JCR/Configuration#HLockManager...">LockManagerImpl
+ configuration</ulink></para>
+ </section>
+
+ <section>
+ <title>CacheableLockManagerImpl</title>
+
+ <para>CacheableLockManagerImpl stores Lock object in JBoss-cache, so Locks
+ are replicable and affects on cluster, not only a single node. Also
+ JBoss-cache has JDBCCacheLoader, so locks will be stored to
+ database.</para>
+
+ <para>Both implementation supports Expired Locks removing. There is
+ LockRemover - separate thread, that periodically ask LockManager for Locks
+ that lives to much and must be removed. So, timeout for LockRemover may be
+ set as follows, default value is 30m.</para>
+
+ <programlisting><properties>
+ <property name="time-out" value="10m" />
+ ...
+</properties></programlisting>
+
+ <section>
+ <title>Configuration</title>
+
+ <para>Replication requirements are same as for Cache</para>
+
+ <para>Full JCR configuration example you can see there <xref
+ linkend="sect_conf_cluster_jcr"/></para>
+
+ <para>Common tips:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>clusterName ("jbosscache-cluster-name") must be unique;</para>
+ </listitem>
+
+ <listitem>
+ <para>cache.jdbc.table.name must be unique per datasource;</para>
+ </listitem>
+
+ <listitem>
+ <para>cache.jdbc.fqn.type must and cache.jdbc.node.type must be
+ configured according to used database;</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>There is few ways how to configure CacheableLockManagerImpl, and
+ all of them configures JBoss-cache and JDBCCacheLoader.</para>
+
+ <para>See <ulink
+ url="http://community.jboss.org/wiki/JBossCacheJDBCCacheLoader">http://community.jboss.org/wiki/JBossCacheJDBCCacheLoader</ulink></para>
+ </section>
+
+ <section>
+ <title>Simple JbossCache Configuraion</title>
+
+ <para>First one is - put JbossCache configuraion file path to
+ CacheableLockManagerImpl</para>
+
+ <para><note>
+ <para>This configuration is not so good, as you can think. Because
+ repository may contain many workspaces, and each workspace must
+ contain LockManager configuration, and LockManager config may
+ contain JbossCache config file. So total configuration is growing
+ up. But it is usefull if we want a single LockManager with special
+ configuration.</para>
+ </note></para>
+
+ <para>Config is:</para>
+
+ <programlisting><lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/cluster/test-jbosscache-lock-config.xml" />
+ </properties>
+</lock-manager></programlisting>
+
+ <para>test-jbosscache-lock-config.xml<programlisting><?xml version="1.0" encoding="UTF-8"?>
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.2">
+
+ <locking useLockStriping="false" concurrencyLevel="50000" lockParentForChildInsertRemove="false" lockAcquisitionTimeout="20000" />
+
+ <clustering mode="replication" clusterName="JBoss-Cache-Lock-Cluster_Name">
+ <stateRetrieval timeout="20000" fetchInMemoryState="false" nonBlocking="true" />
+ <jgroupsConfig>
+
+ <TCP bind_addr="127.0.0.1" start_port="9800" loopback="true" recv_buf_size="20000000" send_buf_size="640000" discard_incompatible_packets="true"
+ max_bundle_size="64000" max_bundle_timeout="30" use_incoming_packet_handler="true" enable_bundling="false" use_send_queues="false" sock_conn_timeout="300"
+ skip_suspected_members="true" use_concurrent_stack="true" thread_pool.enabled="true" thread_pool.min_threads="1" thread_pool.max_threads="25"
+ thread_pool.keep_alive_time="5000" thread_pool.queue_enabled="false" thread_pool.queue_max_size="100" thread_pool.rejection_policy="run"
+ oob_thread_pool.enabled="true" oob_thread_pool.min_threads="1" oob_thread_pool.max_threads="8" oob_thread_pool.keep_alive_time="5000"
+ oob_thread_pool.queue_enabled="false" oob_thread_pool.queue_max_size="100" oob_thread_pool.rejection_policy="run" />
+ <MPING timeout="2000" num_initial_members="2" mcast_port="34540" bind_addr="127.0.0.1" mcast_addr="224.0.0.1" />
+
+
+ <MERGE2 max_interval="30000" min_interval="10000" />
+ <FD_SOCK />
+ <FD max_tries="5" shun="true" timeout="10000" />
+ <VERIFY_SUSPECT timeout="1500" />
+ <pbcast.NAKACK discard_delivered_msgs="true" gc_lag="0" retransmit_timeout="300,600,1200,2400,4800" use_mcast_xmit="false" />
+ <UNICAST timeout="300,600,1200,2400,3600" />
+ <pbcast.STABLE desired_avg_gossip="50000" max_bytes="400000" stability_delay="1000" />
+ <pbcast.GMS join_timeout="5000" print_local_addr="true" shun="false" view_ack_collection_timeout="5000" view_bundling="true" />
+ <FRAG2 frag_size="60000" />
+ <pbcast.STREAMING_STATE_TRANSFER />
+ <pbcast.FLUSH timeout="0" />
+
+ </jgroupsConfig
+
+ <sync />
+ </clustering>
+
+ <loaders passivation="false" shared="true">
+ <preload>
+ <node fqn="/" />
+ </preload>
+ <loader class="org.jboss.cache.loader.JDBCCacheLoader" async="false" fetchPersistentState="false" ignoreModifications="false" purgeOnStartup="false">
+ <properties>
+ cache.jdbc.table.name=jcrlocks_ws
+ cache.jdbc.table.create=true
+ cache.jdbc.table.drop=false
+ cache.jdbc.table.primarykey=jcrlocks_ws_pk
+ cache.jdbc.fqn.column=fqn
+ cache.jdbc.fqn.type=VARCHAR(512)
+ cache.jdbc.node.column=node
+ cache.jdbc.node.type=<BLOB>
+ cache.jdbc.parent.column=parent
+ cache.jdbc.datasource=jdbcjcr
+ </properties>
+ </loader>
+
+ </loaders>
+
+</jbosscache></programlisting></para>
+
+ <para>Configuration requirements:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><clustering mode="replication"
+ clusterName="JBoss-Cache-Lock-Cluster_Name"> - cluster name must
+ be unique;</para>
+ </listitem>
+
+ <listitem>
+ <para><quote>cache.jdbc.table.name</quote> must be unique per
+ datasource;</para>
+ </listitem>
+
+ <listitem>
+ <para><quote>cache.jdbc.node.type</quote> and
+ <quote>cache.jdbc.fqn.type</quote> must be configured according to
+ using database. See <link endterm="datatypes.title"
+ linkend="datatypes"></link> .</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section>
+ <title>Template JBossCache Configuration</title>
+
+ <para>Second one is - use template JBoss-cache configuration for all
+ LockManagers</para>
+
+ <para><citetitle>Lock template configuration</citetitle></para>
+
+ <para>test-jbosscache-lock.xml</para>
+
+ <programlisting><?xml version="1.0" encoding="UTF-8"?>
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.1">
+
+ <locking useLockStriping="false" concurrencyLevel="50000" lockParentForChildInsertRemove="false"
+ lockAcquisitionTimeout="20000" />
+
+ <clustering mode="replication" clusterName="${jbosscache-cluster-name}">
+ <stateRetrieval timeout="20000" fetchInMemoryState="false" />
+ <jgroupsConfig multiplexerStack="jcr.stack" />
+ <sync />
+ </clustering>
+
+ <loaders passivation="false" shared="true">
+ <!-- All the data of the JCR locks needs to be loaded at startup -->
+ <preload>
+ <node fqn="/" />
+ </preload>
+ <!--
+ For another cache-loader class you should use another template with
+ cache-loader specific parameters
+ ->
+ <loader class="org.jboss.cache.loader.JDBCCacheLoader" async=q"false" fetchPersistentState="false"
+ ignoreModifications="false" purgeOnStartup="false">
+ <properties>
+ cache.jdbc.table.name=${jbosscache-cl-cache.jdbc.table.name}
+ cache.jdbc.table.create=${jbosscache-cl-cache.jdbc.table.create}
+ cache.jdbc.table.drop=${jbosscache-cl-cache.jdbc.table.drop}
+ cache.jdbc.table.primarykey=${jbosscache-cl-cache.jdbc.table.primarykey}
+ cache.jdbc.fqn.column=${jbosscache-cl-cache.jdbc.fqn.column}
+ cache.jdbc.fqn.type=${jbosscache-cl-cache.jdbc.fqn.type}
+ cache.jdbc.node.column=${jbosscache-cl-cache.jdbc.node.column}
+ cache.jdbc.node.type=${jbosscache-cl-cache.jdbc.node.type}
+ cache.jdbc.parent.column=${jbosscache-cl-cache.jdbc.parent.column}
+ cache.jdbc.datasource=${jbosscache-cl-cache.jdbc.datasource}
+ </properties>
+ </loader>
+ </loaders>
+</jbosscache></programlisting>
+
+ <para>As you see, all configurable paramaters filled by templates and
+ will be replaced by LockManagers conf parameters:</para>
+
+ <programlisting><lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="test-jbosscache-lock.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="jgroups-multiplexer-stack" value="true" />
+ <property name="jbosscache-cluster-name" value="JCR-cluster-locks-ws" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks_ws" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_ws_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.type" value="AUTO"/>
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.node.type" value="AUTO"/>
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr" />
+ </properties>
+</lock-manager></programlisting>
+
+ <para>Configuration requirements:<itemizedlist>
+ <listitem>
+ <para><quote>jbosscache-cl-cache.jdbc.fqn.column</quote> and
+ <quote>jbosscache-cl-cache.jdbc.node.type</quote> is nothing else
+ as cache.jdbc.fqn.type and cache.jdbc.node.type in JBoss-Cache
+ configuration. You can set those data types according to database
+ type (See <link endterm="datatypes.title"
+ linkend="datatypes"></link>) or set it as AUTO (or do not set at
+ all) and data type will by detected automaticaly.</para>
+ </listitem>
+
+ <listitem>
+ <para>as you see, jgroups-configuration moved to separate config
+ file - udp-mux.xml; In our case udp-mux.xml is common JGroup
+ config for all components (QueryHandler, cache, LockManager). But
+ we, still, can create own config.</para>
+ </listitem>
+ </itemizedlist></para>
+
+ <para>our-udp-mux.xml<programlisting><protocol_stacks>
+ <stack name="jcr.stack">
+ <config>
+ <UDP mcast_addr="228.10.10.10" mcast_port="45588" tos="8" ucast_recv_buf_size="20000000"
+ ucast_send_buf_size="640000" mcast_recv_buf_size="25000000" mcast_send_buf_size="640000" loopback="false"
+ discard_incompatible_packets="true" max_bundle_size="64000" max_bundle_timeout="30"
+ use_incoming_packet_handler="true" ip_ttl="2" enable_bundling="true" enable_diagnostics="true"
+ thread_naming_pattern="cl" use_concurrent_stack="true" thread_pool.enabled="true" thread_pool.min_threads="2"
+ thread_pool.max_threads="8" thread_pool.keep_alive_time="5000" thread_pool.queue_enabled="true"
+ thread_pool.queue_max_size="1000" thread_pool.rejection_policy="discard" oob_thread_pool.enabled="true"
+ oob_thread_pool.min_threads="1" oob_thread_pool.max_threads="8" oob_thread_pool.keep_alive_time="5000"
+ oob_thread_pool.queue_enabled="false" oob_thread_pool.queue_max_size="100" oob_thread_pool.rejection_policy="Run" />
+
+ <PING timeout="2000" num_initial_members="3" />
+ <MERGE2 max_interval="30000" min_interval="10000" />
+ <FD_SOCK />
+ <FD timeout="10000" max_tries="5" shun="true" />
+ <VERIFY_SUSPECT timeout="1500" />
+ <BARRIER />
+ <pbcast.NAKACK use_stats_for_retransmission="false" exponential_backoff="150" use_mcast_xmit="true"
+ gc_lag="0" retransmit_timeout="50,300,600,1200" discard_delivered_msgs="true" />
+ <UNICAST timeout="300,600,1200" />
+ <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000" max_bytes="1000000" />
+ <VIEW_SYNC avg_send_interval="60000" />
+ <pbcast.GMS print_local_addr="true" join_timeout="3000" shun="false" view_bundling="true" />
+ <FC max_credits="500000" min_threshold="0.20" />
+ <FRAG2 frag_size="60000" />
+ <!--pbcast.STREAMING_STATE_TRANSFER /-->
+ <pbcast.STATE_TRANSFER />
+ <!-- pbcast.FLUSH /-->
+ </config>
+ </stack>
+</protocol_stacks> </programlisting></para>
+ </section>
+
+ <section id="datatypes">
+ <title id="datatypes.title">Data Types in Different Databases</title>
+
+ <table>
+ <title>Fqn type and node type in different databases</title>
+
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>DataBase name</entry>
+
+ <entry>Node data type</entry>
+
+ <entry>FQN data type</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>default</entry>
+
+ <entry>BLOB</entry>
+
+ <entry>VARCHAR(512)</entry>
+ </row>
+
+ <row>
+ <entry>HSSQL</entry>
+
+ <entry>OBJECT</entry>
+
+ <entry>VARCHAR(512)</entry>
+ </row>
+
+ <row>
+ <entry>MySQL</entry>
+
+ <entry>LONGBLOB</entry>
+
+ <entry>VARCHAR(512)</entry>
+ </row>
+
+ <row>
+ <entry>ORACLE</entry>
+
+ <entry>BLOB</entry>
+
+ <entry>VARCHAR2(512)</entry>
+ </row>
+
+ <row>
+ <entry>PostgreSQL</entry>
+
+ <entry>bytea</entry>
+
+ <entry>VARCHAR(512)</entry>
+ </row>
+
+ <row>
+ <entry>MSSQL</entry>
+
+ <entry>VARBINARY(MAX)</entry>
+
+ <entry>VARCHAR(512)</entry>
+ </row>
+
+ <row>
+ <entry>DB2</entry>
+
+ <entry>BLOB</entry>
+
+ <entry>VARCHAR(512)</entry>
+ </row>
+
+ <row>
+ <entry>Sybase</entry>
+
+ <entry>IMAGE</entry>
+
+ <entry>VARCHAR(512)</entry>
+ </row>
+
+ <row>
+ <entry>Ingres</entry>
+
+ <entry>long byte</entry>
+
+ <entry>VARCHAR(512)</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+ </section>
+</article>
16 years, 2 months
exo-jcr SVN: r1880 - jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2010-02-17 11:53:26 -0500 (Wed, 17 Feb 2010)
New Revision: 1880
Modified:
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/configuration.xml
Log:
EXOJCR-512 jcr configuration (in progress)
Modified: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/configuration.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/configuration.xml 2010-02-17 16:40:01 UTC (rev 1879)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/configuration.xml 2010-02-17 16:53:26 UTC (rev 1880)
@@ -149,8 +149,7 @@
</section>
<section>
- <title>Repository service configuration (JCR repositories
- configuration)</title>
+ <title>Repository service configuration </title>
<para>Default configuration of the Repository Service located in
jar:/conf/portal/exo-jcr-config.xml, it will be available for portal and
@@ -338,6 +337,113 @@
is applicable</para>
<para>Initializer configuration (optional):</para>
+
+ <para>class - initializer implementation class. </para>
+
+ <para>properties - the list of properties (name-value pairs). Properties
+ are supported:</para>
+
+ <para> root-nodetype - The node type for root node initialization
+ </para>
+
+ <para> root-permissions - Default permissions of the root node. It is
+ defined as a set of semicolon-delimited permissions containing a group
+ of space-delimited identities (user, group etc, see Organization service
+ documentation for details) and the type of permission. For example any
+ read;:/admin read;:/admin add_node;:/admin set_property;:/admin remove
+ means that users from group admin have all permissions and other users
+ have only a 'read' permission.</para>
+
+ <para>Configurable initializer adds a capability to override workspace
+ initial startup procedure.</para>
+
+ <para>Cache configuration:</para>
+
+ <para>enabled - if workspace cache is enabled</para>
+
+ <para>class - cache implementation class, optional from 1.9. Default
+ value is
+ org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl.
+ </para>
+
+ <para>Cache can be configured to use concrete implementation of
+ WorkspaceStorageCache interface. JCR core has two implementation to use:
+ * LinkedWorkspaceStorageCacheImpl - default, with configurable read
+ behavior and statistic. * WorkspaceStorageCacheImpl - pre 1.9, still can
+ be used. </para>
+
+ <para>properties - the list of properties (name-value pairs) for
+ Workspace cache: </para>
+
+ <para> max-size - cache maximum size. </para>
+
+ <para> live-time - cached item live time.</para>
+
+ <para>LinkedWorkspaceStorageCacheImpl supports additional optional
+ parameters TODO</para>
+
+ <para>Query Handler configuration:</para>
+
+ <para>class - A Query Handler class name</para>
+
+ <para>properties - the list of properties (name-value pairs) for a Query
+ Handler (indexDir) properties and advanced features described in *Search
+ Configuration*</para>
+
+ <para>Lock Manager configuration:</para>
+
+ <para>time-out - time after which the unused global lock will be
+ removed. </para>
+
+ <para>persister - a class for storing lock information for future use.
+ For example, remove lock after jcr restart. </para>
+
+ <para>path - a lock folder, each workspace has its own.</para>
+
+ <para></para>
+
+ <para>Configuration definition:</para>
+
+ <programlisting><!ELEMENT repository-service (repositories)>
+ <!ATTLIST repository-service default-repository NMTOKEN #REQUIRED>
+ <!ELEMENT repositories (repository)>
+ <!ELEMENT repository (security-domain,access-control,session-max-age,authentication-policy,workspaces)>
+ <!ATTLIST repository
+ default-workspace NMTOKEN #REQUIRED
+ name NMTOKEN #REQUIRED
+ system-workspace NMTOKEN #REQUIRED
+ >
+ <!ELEMENT security-domain (#PCDATA)>
+ <!ELEMENT access-control (#PCDATA)>
+ <!ELEMENT session-max-age (#PCDATA)>
+ <!ELEMENT authentication-policy (#PCDATA)>
+ <!ELEMENT workspaces (workspace+)>
+ <!ELEMENT workspace (container,initializer,cache,query-handler)>
+ <!ATTLIST workspace name NMTOKEN #REQUIRED>
+ <!ELEMENT container (properties,value-storages)>
+ <!ATTLIST container class NMTOKEN #REQUIRED>
+ <!ELEMENT value-storages (value-storage+)>
+ <!ELEMENT value-storage (properties,filters)>
+ <!ATTLIST value-storage class NMTOKEN #REQUIRED>
+ <!ELEMENT filters (filter+)>
+ <!ELEMENT filter EMPTY>
+ <!ATTLIST filter property-type NMTOKEN #REQUIRED>
+ <!ELEMENT initializer (properties)>
+ <!ATTLIST initializer class NMTOKEN #REQUIRED>
+ <!ELEMENT cache (properties)>
+ <!ATTLIST cache
+ enabled NMTOKEN #REQUIRED
+ class NMTOKEN #REQUIRED
+ >
+ <!ELEMENT query-handler (properties)>
+ <!ATTLIST query-handler class NMTOKEN #REQUIRED>
+ <!ELEMENT access-manager (properties)>
+ <!ATTLIST access-manager class NMTOKEN #REQUIRED>
+ <!ELEMENT lock-manager (time-out,persister)>
+ <!ELEMENT time-out (#PCDATA)>
+ <!ELEMENT persister (properties)>
+ <!ELEMENT properties (property+)>
+ <!ELEMENT property EMPTY></programlisting>
</section>
</section>
</article>
16 years, 2 months
exo-jcr SVN: r1879 - jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-02-17 11:40:01 -0500 (Wed, 17 Feb 2010)
New Revision: 1879
Modified:
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/cluster-config.xml
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/lock-manager-config.xml
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/query-handler-config.xml
Log:
EXOJCR-490: docbook version updated
Modified: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/cluster-config.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/cluster-config.xml 2010-02-17 16:32:39 UTC (rev 1878)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/cluster-config.xml 2010-02-17 16:40:01 UTC (rev 1879)
@@ -1,251 +1,251 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
-"http://www.oasis-open.org/docbook/xml/4.3b2/docbookx.dtd">
-<article>
- <articleinfo>
- <title>Configuring JBoss AS with eXo JCR in cluster</title>
- </articleinfo>
-
- <sect1>
- <title>Launching Cluster</title>
-
- <sect2>
- <title>Deploying eXo JCR to JBoss As</title>
-
- <para>To deploy eXo JCR to JBoss As follow next steps:</para>
-
- <orderedlist>
- <listitem>
- <para>Dowload the latest version of eXo JCR ear distribution from
- [LINK THERE]</para>
- </listitem>
-
- <listitem>
- <para>Copy <jcr.ear> into
- <%jboss_home%/server/default/deploy></para>
- </listitem>
-
- <listitem>
- <para>Put exo-configuration.xml to the root
- <%jboss_home%/exo-configuration.xml></para>
- </listitem>
-
- <listitem>
- <para>Configure JAAS by inserting XML fragment shown below into
- <%jboss_home%/server/default/conf/login-config.xml></para>
-
- <programlisting><application-policy name="exo-domain">
- <authentication>
- <login-module code="org.exoplatform.services.security.j2ee.JbossLoginModule" flag="required"></login-module>
- </authentication>
-</application-policy></programlisting>
- </listitem>
-
- <listitem>
- <para>Start server:</para>
-
- <itemizedlist>
- <listitem>
- <para>bin/run.sh for Unix</para>
- </listitem>
-
- <listitem>
- <para>bin/run.bat for Windows</para>
- </listitem>
- </itemizedlist>
- </listitem>
-
- <listitem>
- <para>Try accessing <ulink
- url="http://localhost:8080/browser">http://localhost:8080/browser</ulink>
- with root/exo as login/password if you have done everything right,
- you'll get access to repository browser.</para>
- </listitem>
- </orderedlist>
- </sect2>
-
- <sect2>
- <title>Configuring JCR to use external configuration</title>
-
- <itemizedlist>
- <listitem>
- <para>To manually configure repository create a new configuration
- file (f.e. exo-jcr-configuration.xml). For details see <ulink
- url="http://wiki.exoplatform.org/xwiki/bin/view/JCR/#HConfiguration">JCR
- Configuration</ulink>. Your configuration must look like:</para>
-
- <programlisting><repository-service default-repository="repository1">
- <repositories>
- <repository name="repository1" system-workspace="ws1" default-workspace="ws1">
- <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="ws1">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcr" />
- <property name="dialect" value="oracle" />
- <property name="multi-db" value="false" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="../temp/swap/production" />
- </properties>
- <value-storages>
- see "Value storage configuration" part.
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured" />
- </properties>
- </initializer>
- <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
- see "Cache configuration" part.
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- see "Indexer configuration" part.
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
- see "Lock Manager configuration" part.
- </lock-manager>
- </workspace>
- <workspace name="ws2">
- ...
- </workspace>
- <workspace name="wsN">
- ...
- </workspace>
- </workspaces>
- </repository>
- </repositories>
-</repository-service> </programlisting>
- </listitem>
-
- <listitem>
- <para>and update RepositoryServiceConfiguration configuration in
- exo-configuration.xml to use this file:<programlisting><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>exo-jcr-configuration.xml</value>
- </value-param>
- </init-params>
-</component></programlisting></para>
- </listitem>
- </itemizedlist>
- </sect2>
- </sect1>
-
- <sect1>
- <title>Requirements</title>
-
- <sect2>
- <title>Enviorenment requirements</title>
-
- <itemizedlist>
- <listitem>
- <para>Every node of cluster MUST have the same mounted Network File
- System with read and write permissions on it.</para>
-
- <para>"/mnt/tornado" - path to the mounted Network File System (all
- cluster nodes must use the same NFS)</para>
- </listitem>
-
- <listitem>
- <para>Every node of cluster MUST use the same database</para>
- </listitem>
-
- <listitem>
- <para>Same Clusters on different nodes MUST have the same cluster
- names (f.e if Indexer cluster in workspace production on the first
- node has name "production_indexer_cluster", then indexer clusters in
- workspace production on all other nodes MUST have the same name
- "production_indexer_cluster" )</para>
- </listitem>
- </itemizedlist>
- </sect2>
-
- <sect2>
- <title>Enviorenment requirements</title>
-
- <para>Configuration of every workspace in repository must contains of
- such parts:</para>
-
- <itemizedlist>
- <listitem>
- <para>Value Storage configuration:</para>
-
- <programlisting><value-storages>
- <value-storage id="system" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="/mnt/tornado/temp/values/production" /> - path within NFS where ValueStorage will hold it's data
- </properties>
- <filters>
- <filter property-type="Binary" />
- </filters>
- </value-storage>
-</value-storages></programlisting>
- </listitem>
- </itemizedlist>
-
- <itemizedlist>
- <listitem>
- <para>Cache configuration:</para>
-
- <programlisting><cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
- <properties>
- <property name="jbosscache-configuration" value="jar:/conf/portal/test-jbosscache-data.xml" /> - path to JBoss Cache configuration for data storage
- <property name="jgroups-configuration" value="jar:/conf/portal/udp-mux.xml" /> - path to JGroups configuration
- <property name="jbosscache-cluster-name" value="JCR_Cluster_cache_production" /> - JBoss Cache data storage cluster name
- <property name="jgroups-multiplexer-stack" value="true" />
- </properties>
-</cache> </programlisting>
- </listitem>
- </itemizedlist>
-
- <itemizedlist>
- <listitem>
- <para>Indexer configuration:</para>
-
- <programlisting><query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" />
- <property name="index-dir" value="/mnt/tornado/temp/jcrlucenedb/production" /> - path within NFS where ValueStorage will hold it's data
- <property name="jbosscache-configuration" value="jar:/conf/portal/test-jbosscache-indexer.xml" /> - path to JBoss Cache configuration for indexer
- <property name="jgroups-configuration" value="jar:/conf/portal/udp-mux.xml" /> - path to JGroups configuration
- <property name="jbosscache-cluster-name" value="JCR_Cluster_indexer_production" /> - JBoss Cache indexer cluster name
- <property name="jgroups-multiplexer-stack" value="true" />
- </properties>
-</query-handler> </programlisting>
- </listitem>
-
- <listitem>
- <para>Lock Manager configuration:</para>
-
- <programlisting><lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="jbosscache-configuration" value="jar:/conf/portal/test-jbosscache-lock.xml" /> - path to JBoss Cache configuration for lock manager
- <property name="jgroups-configuration" value="jar:/conf/portal/udp-mux.xml" /> - path to JGroups configuration
- <property name="jgroups-multiplexer-stack" value="true" />
- <property name="jbosscache-cluster-name" value="JCR_Cluster_lock_production" /> - JBoss Cache locks cluster name
-
- <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks_production"/> - the name of the DB table where lock's data will be stored
- <property name="jbosscache-cl-cache.jdbc.table.create" value="true"/>
- <property name="jbosscache-cl-cache.jdbc.table.drop" value="false"/>
- <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_production_pk"/>
- <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn"/>
- <property name="jbosscache-cl-cache.jdbc.node.column" value="node"/>
- <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent"/>
- <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr"/>
- </properties>
-</lock-manager></programlisting>
- </listitem>
- </itemizedlist>
- </sect2>
- </sect1>
-</article>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<article>
+ <articleinfo>
+ <title>Configuring JBoss AS with eXo JCR in cluster</title>
+ </articleinfo>
+
+ <section>
+ <title>Launching Cluster</title>
+
+ <section>
+ <title>Deploying eXo JCR to JBoss As</title>
+
+ <para>To deploy eXo JCR to JBoss As follow next steps:</para>
+
+ <orderedlist>
+ <listitem>
+ <para>Dowload the latest version of eXo JCR ear distribution from
+ [LINK THERE]</para>
+ </listitem>
+
+ <listitem>
+ <para>Copy <jcr.ear> into
+ <%jboss_home%/server/default/deploy></para>
+ </listitem>
+
+ <listitem>
+ <para>Put exo-configuration.xml to the root
+ <%jboss_home%/exo-configuration.xml></para>
+ </listitem>
+
+ <listitem>
+ <para>Configure JAAS by inserting XML fragment shown below into
+ <%jboss_home%/server/default/conf/login-config.xml></para>
+
+ <programlisting><application-policy name="exo-domain">
+ <authentication>
+ <login-module code="org.exoplatform.services.security.j2ee.JbossLoginModule" flag="required"></login-module>
+ </authentication>
+</application-policy></programlisting>
+ </listitem>
+
+ <listitem>
+ <para>Start server:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>bin/run.sh for Unix</para>
+ </listitem>
+
+ <listitem>
+ <para>bin/run.bat for Windows</para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+
+ <listitem>
+ <para>Try accessing <ulink
+ url="http://localhost:8080/browser">http://localhost:8080/browser</ulink>
+ with root/exo as login/password if you have done everything right,
+ you'll get access to repository browser.</para>
+ </listitem>
+ </orderedlist>
+ </section>
+
+ <section>
+ <title>Configuring JCR to use external configuration</title>
+
+ <itemizedlist>
+ <listitem>
+ <para>To manually configure repository create a new configuration
+ file (f.e. exo-jcr-configuration.xml). For details see <ulink
+ url="http://wiki.exoplatform.org/xwiki/bin/view/JCR/#HConfiguration">JCR
+ Configuration</ulink>. Your configuration must look like:</para>
+
+ <programlisting><repository-service default-repository="repository1">
+ <repositories>
+ <repository name="repository1" system-workspace="ws1" default-workspace="ws1">
+ <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="ws1">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr" />
+ <property name="dialect" value="oracle" />
+ <property name="multi-db" value="false" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="../temp/swap/production" />
+ </properties>
+ <value-storages>
+ see "Value storage configuration" part.
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ </properties>
+ </initializer>
+ <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
+ see "Cache configuration" part.
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ see "Indexer configuration" part.
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ see "Lock Manager configuration" part.
+ </lock-manager>
+ </workspace>
+ <workspace name="ws2">
+ ...
+ </workspace>
+ <workspace name="wsN">
+ ...
+ </workspace>
+ </workspaces>
+ </repository>
+ </repositories>
+</repository-service> </programlisting>
+ </listitem>
+
+ <listitem>
+ <para>and update RepositoryServiceConfiguration configuration in
+ exo-configuration.xml to use this file:<programlisting><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>exo-jcr-configuration.xml</value>
+ </value-param>
+ </init-params>
+</component></programlisting></para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ </section>
+
+ <section>
+ <title>Requirements</title>
+
+ <section>
+ <title>Enviorenment requirements</title>
+
+ <itemizedlist>
+ <listitem>
+ <para>Every node of cluster MUST have the same mounted Network File
+ System with read and write permissions on it.</para>
+
+ <para>"/mnt/tornado" - path to the mounted Network File System (all
+ cluster nodes must use the same NFS)</para>
+ </listitem>
+
+ <listitem>
+ <para>Every node of cluster MUST use the same database</para>
+ </listitem>
+
+ <listitem>
+ <para>Same Clusters on different nodes MUST have the same cluster
+ names (f.e if Indexer cluster in workspace production on the first
+ node has name "production_indexer_cluster", then indexer clusters in
+ workspace production on all other nodes MUST have the same name
+ "production_indexer_cluster" )</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section>
+ <title>Enviorenment requirements</title>
+
+ <para>Configuration of every workspace in repository must contains of
+ such parts:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Value Storage configuration:</para>
+
+ <programlisting><value-storages>
+ <value-storage id="system" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="/mnt/tornado/temp/values/production" /> - path within NFS where ValueStorage will hold it's data
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+</value-storages></programlisting>
+ </listitem>
+ </itemizedlist>
+
+ <itemizedlist>
+ <listitem>
+ <para>Cache configuration:</para>
+
+ <programlisting><cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
+ <properties>
+ <property name="jbosscache-configuration" value="jar:/conf/portal/test-jbosscache-data.xml" /> - path to JBoss Cache configuration for data storage
+ <property name="jgroups-configuration" value="jar:/conf/portal/udp-mux.xml" /> - path to JGroups configuration
+ <property name="jbosscache-cluster-name" value="JCR_Cluster_cache_production" /> - JBoss Cache data storage cluster name
+ <property name="jgroups-multiplexer-stack" value="true" />
+ </properties>
+</cache> </programlisting>
+ </listitem>
+ </itemizedlist>
+
+ <itemizedlist>
+ <listitem>
+ <para>Indexer configuration:</para>
+
+ <programlisting><query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" />
+ <property name="index-dir" value="/mnt/tornado/temp/jcrlucenedb/production" /> - path within NFS where ValueStorage will hold it's data
+ <property name="jbosscache-configuration" value="jar:/conf/portal/test-jbosscache-indexer.xml" /> - path to JBoss Cache configuration for indexer
+ <property name="jgroups-configuration" value="jar:/conf/portal/udp-mux.xml" /> - path to JGroups configuration
+ <property name="jbosscache-cluster-name" value="JCR_Cluster_indexer_production" /> - JBoss Cache indexer cluster name
+ <property name="jgroups-multiplexer-stack" value="true" />
+ </properties>
+</query-handler> </programlisting>
+ </listitem>
+
+ <listitem>
+ <para>Lock Manager configuration:</para>
+
+ <programlisting><lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="jar:/conf/portal/test-jbosscache-lock.xml" /> - path to JBoss Cache configuration for lock manager
+ <property name="jgroups-configuration" value="jar:/conf/portal/udp-mux.xml" /> - path to JGroups configuration
+ <property name="jgroups-multiplexer-stack" value="true" />
+ <property name="jbosscache-cluster-name" value="JCR_Cluster_lock_production" /> - JBoss Cache locks cluster name
+
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks_production"/> - the name of the DB table where lock's data will be stored
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true"/>
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false"/>
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_production_pk"/>
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn"/>
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node"/>
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent"/>
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr"/>
+ </properties>
+</lock-manager></programlisting>
+ </listitem>
+ </itemizedlist>
+ </section>
+ </section>
+</article>
Modified: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/lock-manager-config.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/lock-manager-config.xml 2010-02-17 16:32:39 UTC (rev 1878)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/lock-manager-config.xml 2010-02-17 16:40:01 UTC (rev 1879)
@@ -1,442 +1,437 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
-"http://www.oasis-open.org/docbook/xml/4.3b2/docbookx.dtd">
-<article>
- <articleinfo>
- <title>LockManager configuration</title>
- </articleinfo>
-
- <sect1>
- <title>Introduction</title>
-
- <para>What LockManager does?</para>
-
- <para>In common words, LockManager stores lock objects, so it can give
- Lock object or can release it, etc.</para>
-
- <para>Also LockManager is responsible for removing Locks that live too
- long. This parameter may be configured with "time-out" property.</para>
-
- <para>JCR provide two base implementation of LockManager:</para>
-
- <itemizedlist>
- <listitem>
- <para>org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl;</para>
- </listitem>
-
- <listitem>
- <para>org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl;</para>
- </listitem>
- </itemizedlist>
-
- <para>In this article we will talk mostly about
- CacheableLockManagerImpl.</para>
-
- <para>You can enable LockManager by adding lock-manager-configuration to
- workspace-configuration.</para>
-
- <para>For example:</para>
-
- <programlisting><workspace name="ws">
- ...
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- ...
- </properties>
- </lock-manager>
- ...
-</workspace></programlisting>
- </sect1>
-
- <sect1>
- <title>LockManagerImpl</title>
-
- <para>LockManagerImpl is simple implementation of LockManager, and also
- faster than CacheableLockManager. It stores Lock objects in HashMap and
- may also persist Locks if LockPersister is configured. LockManagerImpl do
- not support replication in any way.</para>
-
- <para>See <ulink
- url="http://wiki.exoplatform.com/xwiki/bin/view/JCR/Configuration#HLockManager...">LockManagerImpl
- configuration</ulink></para>
- </sect1>
-
- <sect1>
- <title>CacheableLockManagerImpl</title>
-
- <para>CacheableLockManagerImpl stores Lock object in JBoss-cache, so Locks
- are replicable and affects on cluster, not only a single node. Also
- JBoss-cache has JDBCCacheLoader, so locks will be stored to
- database.</para>
-
- <para>Both implementation supports Expired Locks removing. There is
- LockRemover - separate thread, that periodically ask LockManager for Locks
- that lives to much and must be removed. So, timeout for LockRemover may be
- set as follows, default value is 30m.</para>
-
- <programlisting><properties>
- <property name="time-out" value="10m" />
- ...
-</properties></programlisting>
-
- <para>Replication requirements are same as for Cache</para>
-
- <warning>
- <para>[TODO add link to replication configuration]</para>
- </warning>
-
- <sect2>
- <title>Configuration</title>
-
- <para>Replication requirements are same as for Cache</para>
-
- <para>Common tips:</para>
-
- <itemizedlist>
- <listitem>
- <para>clusterName ("jbosscache-cluster-name") must be unique;</para>
- </listitem>
-
- <listitem>
- <para>cache.jdbc.table.name must be unique per datasource;</para>
- </listitem>
-
- <listitem>
- <para>cache.jdbc.fqn.type must and cache.jdbc.node.type must be
- configured according to used database;</para>
- </listitem>
- </itemizedlist>
-
- <para>There is few ways how to configure CacheableLockManagerImpl, and
- all of them configures JBoss-cache and JDBCCacheLoader.</para>
-
- <para>See <ulink
- url="http://community.jboss.org/wiki/JBossCacheJDBCCacheLoader">http://community.jboss.org/wiki/JBossCacheJDBCCacheLoader</ulink></para>
- </sect2>
-
- <sect2>
- <title>Simple JbossCache Configuraion</title>
-
- <para>First one is - put JbossCache configuraion file path to
- CacheableLockManagerImpl</para>
-
- <para><note>
- <para>This configuration is not so good, as you can think. Because
- repository may contain many workspaces, and each workspace must
- contain LockManager configuration, and LockManager config may
- contain JbossCache config file. So total configuration is growing
- up. But it is usefull if we want a single LockManager with special
- configuration.</para>
- </note></para>
-
- <para>Config is:</para>
-
- <programlisting><lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="jbosscache-configuration" value="conf/standalone/cluster/test-jbosscache-lock-config.xml" />
- </properties>
-</lock-manager></programlisting>
-
- <para>test-jbosscache-lock-config.xml<programlisting><?xml version="1.0" encoding="UTF-8"?>
-<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.2">
-
- <locking useLockStriping="false" concurrencyLevel="50000" lockParentForChildInsertRemove="false" lockAcquisitionTimeout="20000" />
-
- <clustering mode="replication" clusterName="JBoss-Cache-Lock-Cluster_Name">
- <stateRetrieval timeout="20000" fetchInMemoryState="false" nonBlocking="true" />
- <jgroupsConfig>
-
- <TCP bind_addr="127.0.0.1" start_port="9800" loopback="true" recv_buf_size="20000000" send_buf_size="640000" discard_incompatible_packets="true"
- max_bundle_size="64000" max_bundle_timeout="30" use_incoming_packet_handler="true" enable_bundling="false" use_send_queues="false" sock_conn_timeout="300"
- skip_suspected_members="true" use_concurrent_stack="true" thread_pool.enabled="true" thread_pool.min_threads="1" thread_pool.max_threads="25"
- thread_pool.keep_alive_time="5000" thread_pool.queue_enabled="false" thread_pool.queue_max_size="100" thread_pool.rejection_policy="run"
- oob_thread_pool.enabled="true" oob_thread_pool.min_threads="1" oob_thread_pool.max_threads="8" oob_thread_pool.keep_alive_time="5000"
- oob_thread_pool.queue_enabled="false" oob_thread_pool.queue_max_size="100" oob_thread_pool.rejection_policy="run" />
- <MPING timeout="2000" num_initial_members="2" mcast_port="34540" bind_addr="127.0.0.1" mcast_addr="224.0.0.1" />
-
-
- <MERGE2 max_interval="30000" min_interval="10000" />
- <FD_SOCK />
- <FD max_tries="5" shun="true" timeout="10000" />
- <VERIFY_SUSPECT timeout="1500" />
- <pbcast.NAKACK discard_delivered_msgs="true" gc_lag="0" retransmit_timeout="300,600,1200,2400,4800" use_mcast_xmit="false" />
- <UNICAST timeout="300,600,1200,2400,3600" />
- <pbcast.STABLE desired_avg_gossip="50000" max_bytes="400000" stability_delay="1000" />
- <pbcast.GMS join_timeout="5000" print_local_addr="true" shun="false" view_ack_collection_timeout="5000" view_bundling="true" />
- <FRAG2 frag_size="60000" />
- <pbcast.STREAMING_STATE_TRANSFER />
- <pbcast.FLUSH timeout="0" />
-
- </jgroupsConfig
-
- <sync />
- </clustering>
-
- <loaders passivation="false" shared="true">
- <preload>
- <node fqn="/" />
- </preload>
- <loader class="org.jboss.cache.loader.JDBCCacheLoader" async="false" fetchPersistentState="false" ignoreModifications="false" purgeOnStartup="false">
- <properties>
- cache.jdbc.table.name=jcrlocks_ws
- cache.jdbc.table.create=true
- cache.jdbc.table.drop=false
- cache.jdbc.table.primarykey=jcrlocks_ws_pk
- cache.jdbc.fqn.column=fqn
- cache.jdbc.fqn.type=VARCHAR(512)
- cache.jdbc.node.column=node
- cache.jdbc.node.type=<BLOB>
- cache.jdbc.parent.column=parent
- cache.jdbc.datasource=jdbcjcr
- </properties>
- </loader>
-
- </loaders>
-
-</jbosscache></programlisting></para>
-
- <para>Configuration requirements:</para>
-
- <itemizedlist>
- <listitem>
- <para><clustering mode="replication"
- clusterName="JBoss-Cache-Lock-Cluster_Name"> - cluster name must
- be unique;</para>
- </listitem>
-
- <listitem>
- <para><quote>cache.jdbc.table.name</quote> must be unique per
- datasource;</para>
- </listitem>
-
- <listitem>
- <para><quote>cache.jdbc.node.type</quote> and
- <quote>cache.jdbc.fqn.type</quote> must be configured according to
- using database. See <link linkend='datatypes' endterm="datatypes.title"/> .</para>
- </listitem>
- </itemizedlist>
- </sect2>
-
- <sect2>
- <title>Template JBossCache Configuration</title>
-
- <para>Second one is - use template JBoss-cache configuration for all
- LockManagers</para>
-
- <para><citetitle>Lock template configuration</citetitle></para>
-
- <para>test-jbosscache-lock.xml</para>
-
- <programlisting><?xml version="1.0" encoding="UTF-8"?>
-<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.1">
-
- <locking useLockStriping="false" concurrencyLevel="50000" lockParentForChildInsertRemove="false"
- lockAcquisitionTimeout="20000" />
-
- <clustering mode="replication" clusterName="${jbosscache-cluster-name}">
- <stateRetrieval timeout="20000" fetchInMemoryState="false" />
- <jgroupsConfig multiplexerStack="jcr.stack" />
- <sync />
- </clustering>
-
- <loaders passivation="false" shared="true">
- <!-- All the data of the JCR locks needs to be loaded at startup -->
- <preload>
- <node fqn="/" />
- </preload>
- <!--
- For another cache-loader class you should use another template with
- cache-loader specific parameters
- ->
- <loader class="org.jboss.cache.loader.JDBCCacheLoader" async=q"false" fetchPersistentState="false"
- ignoreModifications="false" purgeOnStartup="false">
- <properties>
- cache.jdbc.table.name=${jbosscache-cl-cache.jdbc.table.name}
- cache.jdbc.table.create=${jbosscache-cl-cache.jdbc.table.create}
- cache.jdbc.table.drop=${jbosscache-cl-cache.jdbc.table.drop}
- cache.jdbc.table.primarykey=${jbosscache-cl-cache.jdbc.table.primarykey}
- cache.jdbc.fqn.column=${jbosscache-cl-cache.jdbc.fqn.column}
- cache.jdbc.fqn.type=${jbosscache-cl-cache.jdbc.fqn.type}
- cache.jdbc.node.column=${jbosscache-cl-cache.jdbc.node.column}
- cache.jdbc.node.type=${jbosscache-cl-cache.jdbc.node.type}
- cache.jdbc.parent.column=${jbosscache-cl-cache.jdbc.parent.column}
- cache.jdbc.datasource=${jbosscache-cl-cache.jdbc.datasource}
- </properties>
- </loader>
- </loaders>
-</jbosscache></programlisting>
-
- <para>As you see, all configurable paramaters filled by templates and
- will be replaced by LockManagers conf parameters:</para>
-
- <programlisting><lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="jbosscache-configuration" value="test-jbosscache-lock.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="jgroups-multiplexer-stack" value="true" />
- <property name="jbosscache-cluster-name" value="JCR-cluster-locks-ws" />
- <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks_ws" />
- <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
- <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
- <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_ws_pk" />
- <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
- <property name="jbosscache-cl-cache.jdbc.fqn.type" value="AUTO"/>
- <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
- <property name="jbosscache-cl-cache.jdbc.node.type" value="AUTO"/>
- <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
- <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr" />
- </properties>
-</lock-manager></programlisting>
-
- <para>Configuration requirements:<itemizedlist>
- <listitem>
- <para><quote>jbosscache-cl-cache.jdbc.fqn.column</quote> and
- <quote>jbosscache-cl-cache.jdbc.node.type</quote> is nothing else
- as cache.jdbc.fqn.type and cache.jdbc.node.type in JBoss-Cache
- configuration. You can set those data types according to database
- type (See <link linkend='datatypes' endterm="datatypes.title"/>) or set it as
- AUTO (or do not set at all) and data type will by detected
- automaticaly.</para>
- </listitem>
-
- <listitem>
- <para>as you see, jgroups-configuration moved to separate config
- file - udp-mux.xml; In our case udp-mux.xml is common JGroup
- config for all components (QueryHandler, cache, LockManager). But
- we, still, can create own config.</para>
- </listitem>
- </itemizedlist></para>
-
- <para>our-udp-mux.xml<programlisting><protocol_stacks>
- <stack name="jcr.stack">
- <config>
- <UDP mcast_addr="228.10.10.10" mcast_port="45588" tos="8" ucast_recv_buf_size="20000000"
- ucast_send_buf_size="640000" mcast_recv_buf_size="25000000" mcast_send_buf_size="640000" loopback="false"
- discard_incompatible_packets="true" max_bundle_size="64000" max_bundle_timeout="30"
- use_incoming_packet_handler="true" ip_ttl="2" enable_bundling="true" enable_diagnostics="true"
- thread_naming_pattern="cl" use_concurrent_stack="true" thread_pool.enabled="true" thread_pool.min_threads="2"
- thread_pool.max_threads="8" thread_pool.keep_alive_time="5000" thread_pool.queue_enabled="true"
- thread_pool.queue_max_size="1000" thread_pool.rejection_policy="discard" oob_thread_pool.enabled="true"
- oob_thread_pool.min_threads="1" oob_thread_pool.max_threads="8" oob_thread_pool.keep_alive_time="5000"
- oob_thread_pool.queue_enabled="false" oob_thread_pool.queue_max_size="100" oob_thread_pool.rejection_policy="Run" />
-
- <PING timeout="2000" num_initial_members="3" />
- <MERGE2 max_interval="30000" min_interval="10000" />
- <FD_SOCK />
- <FD timeout="10000" max_tries="5" shun="true" />
- <VERIFY_SUSPECT timeout="1500" />
- <BARRIER />
- <pbcast.NAKACK use_stats_for_retransmission="false" exponential_backoff="150" use_mcast_xmit="true"
- gc_lag="0" retransmit_timeout="50,300,600,1200" discard_delivered_msgs="true" />
- <UNICAST timeout="300,600,1200" />
- <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000" max_bytes="1000000" />
- <VIEW_SYNC avg_send_interval="60000" />
- <pbcast.GMS print_local_addr="true" join_timeout="3000" shun="false" view_bundling="true" />
- <FC max_credits="500000" min_threshold="0.20" />
- <FRAG2 frag_size="60000" />
- <!--pbcast.STREAMING_STATE_TRANSFER /-->
- <pbcast.STATE_TRANSFER />
- <!-- pbcast.FLUSH /-->
- </config>
- </stack>
-</protocol_stacks> </programlisting></para>
- </sect2>
-
- <sect2 id="datatypes">
- <title id="datatypes.title">Data Types in Different Databases</title>
-
- <table>
- <title>Fqn type and node type in different databases</title>
-
- <tgroup cols="3">
- <thead>
- <row>
- <entry>DataBase name</entry>
-
- <entry>Node data type</entry>
-
- <entry>FQN data type</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>default</entry>
-
- <entry>BLOB</entry>
-
- <entry>VARCHAR(512)</entry>
- </row>
-
- <row>
- <entry>HSSQL</entry>
-
- <entry>OBJECT</entry>
-
- <entry>VARCHAR(512)</entry>
- </row>
-
- <row>
- <entry>MySQL</entry>
-
- <entry>LONGBLOB</entry>
-
- <entry>VARCHAR(512)</entry>
- </row>
-
- <row>
- <entry>ORACLE</entry>
-
- <entry>BLOB</entry>
-
- <entry>VARCHAR2(512)</entry>
- </row>
-
- <row>
- <entry>PostgreSQL</entry>
-
- <entry>bytea</entry>
-
- <entry>VARCHAR(512)</entry>
- </row>
-
- <row>
- <entry>MSSQL</entry>
-
- <entry>VARBINARY(MAX)</entry>
-
- <entry>VARCHAR(512)</entry>
- </row>
-
- <row>
- <entry>DB2</entry>
-
- <entry>BLOB</entry>
-
- <entry>VARCHAR(512)</entry>
- </row>
-
- <row>
- <entry>Sybase</entry>
-
- <entry>IMAGE</entry>
-
- <entry>VARCHAR(512)</entry>
- </row>
-
- <row>
- <entry>Ingres</entry>
-
- <entry>long byte</entry>
-
- <entry>VARCHAR(512)</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </sect2>
- </sect1>
-</article>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<article>
+ <articleinfo>
+ <title>LockManager configuration</title>
+ </articleinfo>
+
+ <section>
+ <title>Introduction</title>
+
+ <para>What LockManager does?</para>
+
+ <para>In common words, LockManager stores lock objects, so it can give
+ Lock object or can release it, etc.</para>
+
+ <para>Also LockManager is responsible for removing Locks that live too
+ long. This parameter may be configured with "time-out" property.</para>
+
+ <para>JCR provide two base implementation of LockManager:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl;</para>
+ </listitem>
+
+ <listitem>
+ <para>org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl;</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>In this article we will talk mostly about
+ CacheableLockManagerImpl.</para>
+
+ <para>You can enable LockManager by adding lock-manager-configuration to
+ workspace-configuration.</para>
+
+ <para>For example:</para>
+
+ <programlisting><workspace name="ws">
+ ...
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ ...
+ </properties>
+ </lock-manager>
+ ...
+</workspace></programlisting>
+ </section>
+
+ <section>
+ <title>LockManagerImpl</title>
+
+ <para>LockManagerImpl is simple implementation of LockManager, and also
+ faster than CacheableLockManager. It stores Lock objects in HashMap and
+ may also persist Locks if LockPersister is configured. LockManagerImpl do
+ not support replication in any way.</para>
+
+ <para>See <ulink
+ url="http://wiki.exoplatform.com/xwiki/bin/view/JCR/Configuration#HLockManager...">LockManagerImpl
+ configuration</ulink></para>
+ </section>
+
+ <section>
+ <title>CacheableLockManagerImpl</title>
+
+ <para>CacheableLockManagerImpl stores Lock object in JBoss-cache, so Locks
+ are replicable and affects on cluster, not only a single node. Also
+ JBoss-cache has JDBCCacheLoader, so locks will be stored to
+ database.</para>
+
+ <para>Both implementation supports Expired Locks removing. There is
+ LockRemover - separate thread, that periodically ask LockManager for Locks
+ that lives to much and must be removed. So, timeout for LockRemover may be
+ set as follows, default value is 30m.</para>
+
+ <programlisting><properties>
+ <property name="time-out" value="10m" />
+ ...
+</properties></programlisting>
+
+ <section>
+ <title>Configuration</title>
+
+ <para>Replication requirements are same as for Cache</para>
+
+ <para>Common tips:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>clusterName ("jbosscache-cluster-name") must be unique;</para>
+ </listitem>
+
+ <listitem>
+ <para>cache.jdbc.table.name must be unique per datasource;</para>
+ </listitem>
+
+ <listitem>
+ <para>cache.jdbc.fqn.type must and cache.jdbc.node.type must be
+ configured according to used database;</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>There is few ways how to configure CacheableLockManagerImpl, and
+ all of them configures JBoss-cache and JDBCCacheLoader.</para>
+
+ <para>See <ulink
+ url="http://community.jboss.org/wiki/JBossCacheJDBCCacheLoader">http://community.jboss.org/wiki/JBossCacheJDBCCacheLoader</ulink></para>
+ </section>
+
+ <section>
+ <title>Simple JbossCache Configuraion</title>
+
+ <para>First one is - put JbossCache configuraion file path to
+ CacheableLockManagerImpl</para>
+
+ <para><note>
+ <para>This configuration is not so good, as you can think. Because
+ repository may contain many workspaces, and each workspace must
+ contain LockManager configuration, and LockManager config may
+ contain JbossCache config file. So total configuration is growing
+ up. But it is usefull if we want a single LockManager with special
+ configuration.</para>
+ </note></para>
+
+ <para>Config is:</para>
+
+ <programlisting><lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/cluster/test-jbosscache-lock-config.xml" />
+ </properties>
+</lock-manager></programlisting>
+
+ <para>test-jbosscache-lock-config.xml<programlisting><?xml version="1.0" encoding="UTF-8"?>
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.2">
+
+ <locking useLockStriping="false" concurrencyLevel="50000" lockParentForChildInsertRemove="false" lockAcquisitionTimeout="20000" />
+
+ <clustering mode="replication" clusterName="JBoss-Cache-Lock-Cluster_Name">
+ <stateRetrieval timeout="20000" fetchInMemoryState="false" nonBlocking="true" />
+ <jgroupsConfig>
+
+ <TCP bind_addr="127.0.0.1" start_port="9800" loopback="true" recv_buf_size="20000000" send_buf_size="640000" discard_incompatible_packets="true"
+ max_bundle_size="64000" max_bundle_timeout="30" use_incoming_packet_handler="true" enable_bundling="false" use_send_queues="false" sock_conn_timeout="300"
+ skip_suspected_members="true" use_concurrent_stack="true" thread_pool.enabled="true" thread_pool.min_threads="1" thread_pool.max_threads="25"
+ thread_pool.keep_alive_time="5000" thread_pool.queue_enabled="false" thread_pool.queue_max_size="100" thread_pool.rejection_policy="run"
+ oob_thread_pool.enabled="true" oob_thread_pool.min_threads="1" oob_thread_pool.max_threads="8" oob_thread_pool.keep_alive_time="5000"
+ oob_thread_pool.queue_enabled="false" oob_thread_pool.queue_max_size="100" oob_thread_pool.rejection_policy="run" />
+ <MPING timeout="2000" num_initial_members="2" mcast_port="34540" bind_addr="127.0.0.1" mcast_addr="224.0.0.1" />
+
+
+ <MERGE2 max_interval="30000" min_interval="10000" />
+ <FD_SOCK />
+ <FD max_tries="5" shun="true" timeout="10000" />
+ <VERIFY_SUSPECT timeout="1500" />
+ <pbcast.NAKACK discard_delivered_msgs="true" gc_lag="0" retransmit_timeout="300,600,1200,2400,4800" use_mcast_xmit="false" />
+ <UNICAST timeout="300,600,1200,2400,3600" />
+ <pbcast.STABLE desired_avg_gossip="50000" max_bytes="400000" stability_delay="1000" />
+ <pbcast.GMS join_timeout="5000" print_local_addr="true" shun="false" view_ack_collection_timeout="5000" view_bundling="true" />
+ <FRAG2 frag_size="60000" />
+ <pbcast.STREAMING_STATE_TRANSFER />
+ <pbcast.FLUSH timeout="0" />
+
+ </jgroupsConfig
+
+ <sync />
+ </clustering>
+
+ <loaders passivation="false" shared="true">
+ <preload>
+ <node fqn="/" />
+ </preload>
+ <loader class="org.jboss.cache.loader.JDBCCacheLoader" async="false" fetchPersistentState="false" ignoreModifications="false" purgeOnStartup="false">
+ <properties>
+ cache.jdbc.table.name=jcrlocks_ws
+ cache.jdbc.table.create=true
+ cache.jdbc.table.drop=false
+ cache.jdbc.table.primarykey=jcrlocks_ws_pk
+ cache.jdbc.fqn.column=fqn
+ cache.jdbc.fqn.type=VARCHAR(512)
+ cache.jdbc.node.column=node
+ cache.jdbc.node.type=<BLOB>
+ cache.jdbc.parent.column=parent
+ cache.jdbc.datasource=jdbcjcr
+ </properties>
+ </loader>
+
+ </loaders>
+
+</jbosscache></programlisting></para>
+
+ <para>Configuration requirements:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><clustering mode="replication"
+ clusterName="JBoss-Cache-Lock-Cluster_Name"> - cluster name must
+ be unique;</para>
+ </listitem>
+
+ <listitem>
+ <para><quote>cache.jdbc.table.name</quote> must be unique per
+ datasource;</para>
+ </listitem>
+
+ <listitem>
+ <para><quote>cache.jdbc.node.type</quote> and
+ <quote>cache.jdbc.fqn.type</quote> must be configured according to
+ using database. See <link endterm="datatypes.title"
+ linkend="datatypes"></link> .</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section>
+ <title>Template JBossCache Configuration</title>
+
+ <para>Second one is - use template JBoss-cache configuration for all
+ LockManagers</para>
+
+ <para><citetitle>Lock template configuration</citetitle></para>
+
+ <para>test-jbosscache-lock.xml</para>
+
+ <programlisting><?xml version="1.0" encoding="UTF-8"?>
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.1">
+
+ <locking useLockStriping="false" concurrencyLevel="50000" lockParentForChildInsertRemove="false"
+ lockAcquisitionTimeout="20000" />
+
+ <clustering mode="replication" clusterName="${jbosscache-cluster-name}">
+ <stateRetrieval timeout="20000" fetchInMemoryState="false" />
+ <jgroupsConfig multiplexerStack="jcr.stack" />
+ <sync />
+ </clustering>
+
+ <loaders passivation="false" shared="true">
+ <!-- All the data of the JCR locks needs to be loaded at startup -->
+ <preload>
+ <node fqn="/" />
+ </preload>
+ <!--
+ For another cache-loader class you should use another template with
+ cache-loader specific parameters
+ ->
+ <loader class="org.jboss.cache.loader.JDBCCacheLoader" async=q"false" fetchPersistentState="false"
+ ignoreModifications="false" purgeOnStartup="false">
+ <properties>
+ cache.jdbc.table.name=${jbosscache-cl-cache.jdbc.table.name}
+ cache.jdbc.table.create=${jbosscache-cl-cache.jdbc.table.create}
+ cache.jdbc.table.drop=${jbosscache-cl-cache.jdbc.table.drop}
+ cache.jdbc.table.primarykey=${jbosscache-cl-cache.jdbc.table.primarykey}
+ cache.jdbc.fqn.column=${jbosscache-cl-cache.jdbc.fqn.column}
+ cache.jdbc.fqn.type=${jbosscache-cl-cache.jdbc.fqn.type}
+ cache.jdbc.node.column=${jbosscache-cl-cache.jdbc.node.column}
+ cache.jdbc.node.type=${jbosscache-cl-cache.jdbc.node.type}
+ cache.jdbc.parent.column=${jbosscache-cl-cache.jdbc.parent.column}
+ cache.jdbc.datasource=${jbosscache-cl-cache.jdbc.datasource}
+ </properties>
+ </loader>
+ </loaders>
+</jbosscache></programlisting>
+
+ <para>As you see, all configurable paramaters filled by templates and
+ will be replaced by LockManagers conf parameters:</para>
+
+ <programlisting><lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="test-jbosscache-lock.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="jgroups-multiplexer-stack" value="true" />
+ <property name="jbosscache-cluster-name" value="JCR-cluster-locks-ws" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks_ws" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_ws_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.type" value="AUTO"/>
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.node.type" value="AUTO"/>
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr" />
+ </properties>
+</lock-manager></programlisting>
+
+ <para>Configuration requirements:<itemizedlist>
+ <listitem>
+ <para><quote>jbosscache-cl-cache.jdbc.fqn.column</quote> and
+ <quote>jbosscache-cl-cache.jdbc.node.type</quote> is nothing else
+ as cache.jdbc.fqn.type and cache.jdbc.node.type in JBoss-Cache
+ configuration. You can set those data types according to database
+ type (See <link endterm="datatypes.title"
+ linkend="datatypes"></link>) or set it as AUTO (or do not set at
+ all) and data type will by detected automaticaly.</para>
+ </listitem>
+
+ <listitem>
+ <para>as you see, jgroups-configuration moved to separate config
+ file - udp-mux.xml; In our case udp-mux.xml is common JGroup
+ config for all components (QueryHandler, cache, LockManager). But
+ we, still, can create own config.</para>
+ </listitem>
+ </itemizedlist></para>
+
+ <para>our-udp-mux.xml<programlisting><protocol_stacks>
+ <stack name="jcr.stack">
+ <config>
+ <UDP mcast_addr="228.10.10.10" mcast_port="45588" tos="8" ucast_recv_buf_size="20000000"
+ ucast_send_buf_size="640000" mcast_recv_buf_size="25000000" mcast_send_buf_size="640000" loopback="false"
+ discard_incompatible_packets="true" max_bundle_size="64000" max_bundle_timeout="30"
+ use_incoming_packet_handler="true" ip_ttl="2" enable_bundling="true" enable_diagnostics="true"
+ thread_naming_pattern="cl" use_concurrent_stack="true" thread_pool.enabled="true" thread_pool.min_threads="2"
+ thread_pool.max_threads="8" thread_pool.keep_alive_time="5000" thread_pool.queue_enabled="true"
+ thread_pool.queue_max_size="1000" thread_pool.rejection_policy="discard" oob_thread_pool.enabled="true"
+ oob_thread_pool.min_threads="1" oob_thread_pool.max_threads="8" oob_thread_pool.keep_alive_time="5000"
+ oob_thread_pool.queue_enabled="false" oob_thread_pool.queue_max_size="100" oob_thread_pool.rejection_policy="Run" />
+
+ <PING timeout="2000" num_initial_members="3" />
+ <MERGE2 max_interval="30000" min_interval="10000" />
+ <FD_SOCK />
+ <FD timeout="10000" max_tries="5" shun="true" />
+ <VERIFY_SUSPECT timeout="1500" />
+ <BARRIER />
+ <pbcast.NAKACK use_stats_for_retransmission="false" exponential_backoff="150" use_mcast_xmit="true"
+ gc_lag="0" retransmit_timeout="50,300,600,1200" discard_delivered_msgs="true" />
+ <UNICAST timeout="300,600,1200" />
+ <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000" max_bytes="1000000" />
+ <VIEW_SYNC avg_send_interval="60000" />
+ <pbcast.GMS print_local_addr="true" join_timeout="3000" shun="false" view_bundling="true" />
+ <FC max_credits="500000" min_threshold="0.20" />
+ <FRAG2 frag_size="60000" />
+ <!--pbcast.STREAMING_STATE_TRANSFER /-->
+ <pbcast.STATE_TRANSFER />
+ <!-- pbcast.FLUSH /-->
+ </config>
+ </stack>
+</protocol_stacks> </programlisting></para>
+ </section>
+
+ <section id="datatypes">
+ <title id="datatypes.title">Data Types in Different Databases</title>
+
+ <table>
+ <title>Fqn type and node type in different databases</title>
+
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>DataBase name</entry>
+
+ <entry>Node data type</entry>
+
+ <entry>FQN data type</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>default</entry>
+
+ <entry>BLOB</entry>
+
+ <entry>VARCHAR(512)</entry>
+ </row>
+
+ <row>
+ <entry>HSSQL</entry>
+
+ <entry>OBJECT</entry>
+
+ <entry>VARCHAR(512)</entry>
+ </row>
+
+ <row>
+ <entry>MySQL</entry>
+
+ <entry>LONGBLOB</entry>
+
+ <entry>VARCHAR(512)</entry>
+ </row>
+
+ <row>
+ <entry>ORACLE</entry>
+
+ <entry>BLOB</entry>
+
+ <entry>VARCHAR2(512)</entry>
+ </row>
+
+ <row>
+ <entry>PostgreSQL</entry>
+
+ <entry>bytea</entry>
+
+ <entry>VARCHAR(512)</entry>
+ </row>
+
+ <row>
+ <entry>MSSQL</entry>
+
+ <entry>VARBINARY(MAX)</entry>
+
+ <entry>VARCHAR(512)</entry>
+ </row>
+
+ <row>
+ <entry>DB2</entry>
+
+ <entry>BLOB</entry>
+
+ <entry>VARCHAR(512)</entry>
+ </row>
+
+ <row>
+ <entry>Sybase</entry>
+
+ <entry>IMAGE</entry>
+
+ <entry>VARCHAR(512)</entry>
+ </row>
+
+ <row>
+ <entry>Ingres</entry>
+
+ <entry>long byte</entry>
+
+ <entry>VARCHAR(512)</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+ </section>
+</article>
Modified: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/query-handler-config.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/query-handler-config.xml 2010-02-17 16:32:39 UTC (rev 1878)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/query-handler-config.xml 2010-02-17 16:40:01 UTC (rev 1879)
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
-"http://www.oasis-open.org/docbook/xml/4.3b2/docbookx.dtd">
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<article>
<articleinfo>
<title>QueryHandler configuration</title>
</articleinfo>
- <sect1>
+ <section>
<title>How does it work?</title>
<para>Lets talk about indexing content in cluster.</para>
@@ -51,12 +51,12 @@
<imagedata fileref="images/diagram-shared-index.png" />
</imageobject>
</mediaobject></para>
- </sect1>
+ </section>
- <sect1>
+ <section>
<title>Configuration</title>
- <sect2>
+ <section>
<title>Common requirements</title>
<para>Now, lets see what we need to run Search engine in cluster
@@ -79,9 +79,9 @@
<para>configure JBoss-cache, course;</para>
</listitem>
</itemizedlist></para>
- </sect2>
+ </section>
- <sect2>
+ <section>
<title>Query-handler configuration</title>
<para>Configuration example:<programlisting><workspace name="ws">
@@ -152,9 +152,9 @@
</tbody>
</tgroup>
</table></para>
- </sect2>
+ </section>
- <sect2>
+ <section>
<title>JBoss-Cache template configuration</title>
<para>JBoss-Cache template configuration for query handler.</para>
@@ -181,6 +181,6 @@
</eviction>
</jbosscache></programlisting></para>
- </sect2>
- </sect1>
+ </section>
+ </section>
</article>
16 years, 2 months