[jbosscache-commits] JBoss Cache SVN: r7113 - in core/trunk/src: main/resources/config-samples and 1 other directories.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Tue Nov 11 12:19:39 EST 2008


Author: mircea.markus
Date: 2008-11-11 12:19:39 -0500 (Tue, 11 Nov 2008)
New Revision: 7113

Modified:
   core/trunk/src/main/java/org/jboss/cache/RegionImpl.java
   core/trunk/src/main/resources/config-samples/all.xml
   core/trunk/src/main/resources/config-samples/eviction-enabled.xml
   core/trunk/src/main/resources/config-samples/external-jgroups-file.xml
   core/trunk/src/main/resources/config-samples/invalidation-async.xml
   core/trunk/src/test/java/org/jboss/cache/config/parsing/SampleConfigFilesCorrectnessTest.java
Log:
fixed sample configuration files

Modified: core/trunk/src/main/java/org/jboss/cache/RegionImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/RegionImpl.java	2008-11-11 16:15:55 UTC (rev 7112)
+++ core/trunk/src/main/java/org/jboss/cache/RegionImpl.java	2008-11-11 17:19:39 UTC (rev 7113)
@@ -267,7 +267,7 @@
          capacityWarnThreshold = (98 * size) / 100 - 100;
          if (capacityWarnThreshold <= 0 && log.isWarnEnabled())
          {
-            log.warn("Capacity warn threshold used in eviction is smaller than 1.");
+            log.warn("Capacity warn threshold used in eviction is smaller than 1. Defined Event queu size is:" + size);
          }
          synchronized (this)
          {

Modified: core/trunk/src/main/resources/config-samples/all.xml
===================================================================
--- core/trunk/src/main/resources/config-samples/all.xml	2008-11-11 16:15:55 UTC (rev 7112)
+++ core/trunk/src/main/resources/config-samples/all.xml	2008-11-11 17:19:39 UTC (rev 7113)
@@ -102,26 +102,33 @@
          Configures the JGroups channel.  Looks up a JGroups config file on the classpath or filesystem.  udp.xml
          ships with jgroups.jar and will be picked up by the class loader.
       -->
-      <jgroupsConfig configFile="udp.xml">
-         <!-- uncomment to define a JGroups stack here
+      <jgroupsConfig>
 
-         <PING timeout="2000" num_initial_members="3"/>
+         <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"/>
          <MERGE2 max_interval="30000" min_interval="10000"/>
          <FD_SOCK/>
-         <FD timeout="10000" max_tries="5" shun="true"/>
+         <FD max_tries="5" shun="true" timeout="10000"/>
          <VERIFY_SUSPECT timeout="1500"/>
-         <pbcast.NAKACK use_mcast_xmit="false" gc_lag="0"
-                        retransmit_timeout="300,600,1200,2400,4800"
-                        discard_delivered_msgs="true"/>
+         <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 stability_delay="1000" desired_avg_gossip="50000"
-                        max_bytes="400000"/>
-         <pbcast.GMS print_local_addr="true" join_timeout="5000" shun="false"
-                     view_bundling="true" view_ack_collection_timeout="5000"/>
+         <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 use_reading_thread="true"/>
+         <pbcast.STREAMING_STATE_TRANSFER/>
          <pbcast.FLUSH timeout="0"/>
-          -->
+
       </jgroupsConfig>
    </clustering>
 
@@ -131,15 +138,15 @@
    -->
    <eviction wakeUpInterval="500">
       <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm" eventQueueSize="200000">
-         <property name="maxNodes" value="5000" />
-         <property name="timeToLive" value="1000" />
+         <property name="maxNodes" value="5000"/>
+         <property name="timeToLive" value="1000"/>
       </default>
       <region name="/org/jboss/data1">
-         <property name="timeToLive" value="2000" />
+         <property name="timeToLive" value="2000"/>
       </region>
       <region name="/org/jboss/data2" algorithmClass="org.jboss.cache.eviction.FIFOAlgorithm" eventQueueSize="100000">
-         <property name="maxNodes" value="3000" />
-         <property name="minTimeToLive" value="4000" />
+         <property name="maxNodes" value="3000"/>
+         <property name="minTimeToLive" value="4000"/>
       </region>
    </eviction>
 
@@ -165,12 +172,30 @@
       -->
       <loader class="org.jboss.cache.loader.JDBCCacheLoader" async="true" fetchPersistentState="true"
               ignoreModifications="true" purgeOnStartup="true">
+
          <properties>
-            cache.jdbc.datasource=DefaultDS
             cache.jdbc.table.name=jbosscache
             cache.jdbc.table.create=true
             cache.jdbc.table.drop=true
+            cache.jdbc.table.primarykey=jbosscache_pk
+            cache.jdbc.fqn.column=fqn
+            cache.jdbc.fqn.type=varchar(255)
+            cache.jdbc.node.column=node
+            cache.jdbc.node.type=blob
+            cache.jdbc.parent.column=parent
+            cache.jdbc.sql-concat=1 || 2
+            cache.jdbc.driver = org.apache.derby.jdbc.EmbeddedDriver
+            cache.jdbc.url=jdbc:derby:jbossdb;create=true
+            cache.jdbc.user=user1
+            cache.jdbc.password=user1
          </properties>
+         <!-- alternatively use a connection from a datasorce, as per the code sample below-->
+         <!--<properties>-->
+         <!--cache.jdbc.datasource=AllSampleDS-->
+         <!--cache.jdbc.table.name=jbosscache-->
+         <!--cache.jdbc.table.create=true-->
+         <!--cache.jdbc.table.drop=true-->
+         <!--</properties>-->
          <singletonStore enabled="true" class="org.jboss.cache.loader.SingletonStoreCacheLoader">
             <properties>
                pushStateWhenCoordinator=true

Modified: core/trunk/src/main/resources/config-samples/eviction-enabled.xml
===================================================================
--- core/trunk/src/main/resources/config-samples/eviction-enabled.xml	2008-11-11 16:15:55 UTC (rev 7112)
+++ core/trunk/src/main/resources/config-samples/eviction-enabled.xml	2008-11-11 17:19:39 UTC (rev 7113)
@@ -36,6 +36,6 @@
          <property name="timeToLive" value="8000" />
          <property name="maxAge" value="10000" />
       </region>
-      <region name="/org/jboss/data1/inherit" eventQueueSize="100" />      
+      <region name="/org/jboss/data1/inherit"/>      
    </eviction>
 </jbosscache>

Modified: core/trunk/src/main/resources/config-samples/external-jgroups-file.xml
===================================================================
--- core/trunk/src/main/resources/config-samples/external-jgroups-file.xml	2008-11-11 16:15:55 UTC (rev 7112)
+++ core/trunk/src/main/resources/config-samples/external-jgroups-file.xml	2008-11-11 17:19:39 UTC (rev 7113)
@@ -5,7 +5,7 @@
    <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
 
    <clustering>
-      <sync />
+      <async />
       <!--
          Here we specify a path to an external JGroups configuration file.  First the classpath is scanned, and then
          the filesystem for the file.  In this case, "udp.xml" ships with jgroups.jar and will be picked up by the

Modified: core/trunk/src/main/resources/config-samples/invalidation-async.xml
===================================================================
--- core/trunk/src/main/resources/config-samples/invalidation-async.xml	2008-11-11 16:15:55 UTC (rev 7112)
+++ core/trunk/src/main/resources/config-samples/invalidation-async.xml	2008-11-11 17:19:39 UTC (rev 7113)
@@ -43,9 +43,9 @@
          <pbcast.FLUSH timeout="0"/>
       </jgroupsConfig>
 
-      <sync />
-      <!-- Alternatively, to use async replication, comment out the element above and uncomment the element below.  -->
-      <!-- <async /> -->
+      <async />
+      <!-- Alternatively, to use sync replication, comment out the element above and uncomment the element below.  -->
+      <!-- <sync /> -->
       
    </clustering>
 </jbosscache>

Modified: core/trunk/src/test/java/org/jboss/cache/config/parsing/SampleConfigFilesCorrectnessTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/config/parsing/SampleConfigFilesCorrectnessTest.java	2008-11-11 16:15:55 UTC (rev 7112)
+++ core/trunk/src/test/java/org/jboss/cache/config/parsing/SampleConfigFilesCorrectnessTest.java	2008-11-11 17:19:39 UTC (rev 7113)
@@ -93,8 +93,8 @@
       {
          System.out.println("Processing file: " + aConfFile);
          assert !appender.isFoundUnknownWarning();
-         Cache cache = ucf.createCache(CONFIG_ROOT + "/" + aConfFile, false);
-//         cache.stop();
+         Cache cache = ucf.createCache(CONFIG_ROOT + "/" + aConfFile, true);
+         cache.stop();
          assert !appender.isFoundUnknownWarning();
       }
    }
@@ -117,9 +117,16 @@
       String[] TOLERABLE_WARNINGS = {"Falling back to DummyTransactionManager"};
       boolean foundUnknownWarning = false;
 
+      /**
+       * As this test runs in parallel with other tests tha also log information, we should disregard
+       * other possible warnings from other threads and only consider warnings issues within this test class's test.
+       * @see #isExpectedThread()  
+       */
+      private Thread loggerThread = Thread.currentThread();
+
       protected void append(LoggingEvent event)
       {
-         if (event.getLevel().equals(Level.WARN))
+         if (event.getLevel().equals(Level.WARN) && isExpectedThread())
          {
             boolean skipPrinting = false;
             foundUnknownWarning = true;
@@ -152,5 +159,10 @@
       {
          return foundUnknownWarning;
       }
+
+      public boolean isExpectedThread()
+      {
+         return loggerThread.equals(Thread.currentThread());
+      }
    }
 }




More information about the jbosscache-commits mailing list