Author: skabashnyuk
Date: 2009-12-07 07:55:35 -0500 (Mon, 07 Dec 2009)
New Revision: 933
Added:
jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jbosscache-indexer-config-exoloader_db1_ws.xml
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexChangesFilter.java
jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jcr-config.xml
Log:
EXOJCR-283: Test configuration added
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexChangesFilter.java
===================================================================
---
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexChangesFilter.java 2009-12-07
12:04:47 UTC (rev 932)
+++
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexChangesFilter.java 2009-12-07
12:55:35 UTC (rev 933)
@@ -19,10 +19,18 @@
package org.exoplatform.services.jcr.impl.core.query.jbosscache;
import org.exoplatform.services.jcr.config.QueryHandlerEntry;
+import org.exoplatform.services.jcr.config.QueryHandlerParams;
+import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.impl.core.query.IndexerChangesFilter;
import org.exoplatform.services.jcr.impl.core.query.IndexingTree;
import org.exoplatform.services.jcr.impl.core.query.SearchManager;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.jboss.cache.Cache;
+import org.jboss.cache.CacheFactory;
+import org.jboss.cache.DefaultCacheFactory;
+import java.io.Serializable;
import java.util.Set;
/**
@@ -32,16 +40,30 @@
*/
public class JbossCacheIndexChangesFilter extends IndexerChangesFilter
{
+ /**
+ * Logger instance for this class
+ */
+ private final Log log = ExoLogger.getLogger(JbossCacheIndexChangesFilter.class);
+ private final Cache<Serializable, Object> cache;
+
/**
* @param searchManager
* @param config
* @param indexingTree
+ * @throws RepositoryConfigurationException
*/
public JbossCacheIndexChangesFilter(SearchManager searchManager, QueryHandlerEntry
config, IndexingTree indexingTree)
+ throws RepositoryConfigurationException
{
super(searchManager, config, indexingTree);
- //TODO create cache;
+ String jbcConfig =
config.getParameterValue(QueryHandlerParams.PARAM_CHANGES_FILTER_CONFIG_PATH);
+ CacheFactory<Serializable, Object> factory = new
DefaultCacheFactory<Serializable, Object>();
+ log.info("JBoss Cache configuration used: " + jbcConfig);
+ this.cache = factory.createCache(jbcConfig, false);
+ this.cache.create();
+ this.cache.start();
+
}
/**
Added:
jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jbosscache-indexer-config-exoloader_db1_ws.xml
===================================================================
---
jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jbosscache-indexer-config-exoloader_db1_ws.xml
(rev 0)
+++
jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jbosscache-indexer-config-exoloader_db1_ws.xml 2009-12-07
12:55:35 UTC (rev 933)
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbosscache
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="urn:jboss:jbosscache-core:config:3.1">
+
+ <!-- Configure the TransactionManager -->
+ <transaction
+
transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"
/>
+
+ <clustering mode="replication"
clusterName="JBoss-Cache-Indexer-Cluster_db1_ws">
+
+ <jgroupsConfig>
+ <!--UDP discard_incompatible_packets="true"
enable_bundling="false" enable_diagnostics="false"
ip_ttl="2"
+ loopback="false" max_bundle_size="64000"
max_bundle_timeout="30" mcast_addr="228.10.10.10"
+ mcast_port="45588" mcast_recv_buf_size="25000000"
mcast_send_buf_size="640000"
+ oob_thread_pool.enabled="true"
oob_thread_pool.keep_alive_time="10000"
oob_thread_pool.max_threads="4"
+ oob_thread_pool.min_threads="1"
oob_thread_pool.queue_enabled="true"
oob_thread_pool.queue_max_size="10"
+ oob_thread_pool.rejection_policy="Run"
thread_naming_pattern="pl" thread_pool.enabled="true"
+ thread_pool.keep_alive_time="30000"
thread_pool.max_threads="25" thread_pool.min_threads="1"
+ thread_pool.queue_enabled="true"
thread_pool.queue_max_size="10" thread_pool.rejection_policy="Run"
+ tos="8" ucast_recv_buf_size="20000000"
ucast_send_buf_size="640000" use_concurrent_stack="true"
+ use_incoming_packet_handler="true" />
+ <PING num_initial_members="3" timeout="2000" /-->
+
+ <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="true"
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="3"
mcast_port="34521" 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 />
+ <!-- Alternatively, to use async replication, comment out the element above and
uncomment the element below. -->
+ <!-- <async /> -->
+ </clustering>
+
+ <loaders passivation="false" shared="false">
+ <loader class="org.jboss.cache.loader.FileCacheLoader"
async="false"
+ fetchPersistentState="true" ignoreModifications="false"
+ purgeOnStartup="false">
+ <properties>
+ location=/tmp/test-jboss-cache/proxy
+ </properties>
+ </loader>
+
+ <!-- loader
class="org.exoplatform.services.jcr.impl.storage.jbosscache.JDBCCacheLoader"
+ async="false" fetchPersistentState="true"
ignoreModifications="false" purgeOnStartup="false">
+ <properties>
+ </properties>
+ </loader-->
+
+ <!-- loader
class="org.exoplatform.services.jcr.impl.core.query.cacheloader.IndexerCacheLoader"
+ async="false" fetchPersistentState="false"
ignoreModifications="false" purgeOnStartup="false">
+ <properties>
+ </properties>
+ </loader-->
+
+ </loaders>
+
+ <!-- Enable batching -->
+ <invocationBatching enabled="true"/>
+</jbosscache>
Property changes on:
jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jbosscache-indexer-config-exoloader_db1_ws.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jcr-config.xml
===================================================================
---
jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jcr-config.xml 2009-12-07
12:04:47 UTC (rev 932)
+++
jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jcr-config.xml 2009-12-07
12:55:35 UTC (rev 933)
@@ -63,6 +63,9 @@
<query-handler
class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
<properties>
<property name="index-dir"
value="target/temp/index/db1/ws" />
+ <!-- property name="changesfilter-class"
value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JbossCacheIndexChangesFilter"
/>
+ <property name="changesfilter-config-path"
value="conf/standalone/test-jbosscache-indexer-config-exoloader_db1_ws.xml"
/-->
+
</properties>
</query-handler>
<!-- lock-manager>