[infinispan-commits] Infinispan SVN: r293 - in trunk/core/src: main/java/org/infinispan/config/parsing and 5 other directories.
infinispan-commits at lists.jboss.org
infinispan-commits at lists.jboss.org
Thu May 14 07:07:06 EDT 2009
Author: manik.surtani at jboss.com
Date: 2009-05-14 07:07:06 -0400 (Thu, 14 May 2009)
New Revision: 293
Modified:
trunk/core/src/main/java/org/infinispan/config/Configuration.java
trunk/core/src/main/java/org/infinispan/config/parsing/XmlConfigurationParserImpl.java
trunk/core/src/main/java/org/infinispan/remoting/rpc/CacheRpcManager.java
trunk/core/src/main/resources/config-samples/all.xml
trunk/core/src/main/resources/schema/infinispan-config-4.0.xsd
trunk/core/src/test/java/org/infinispan/config/parsing/ConfigurationParserTest.java
trunk/core/src/test/java/org/infinispan/config/parsing/XmlFileParsingTest.java
trunk/core/src/test/resources/configs/named-cache-test.xml
Log:
Added separate configuration for asynchronous marshalling
Modified: trunk/core/src/main/java/org/infinispan/config/Configuration.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/config/Configuration.java 2009-05-14 10:55:29 UTC (rev 292)
+++ trunk/core/src/main/java/org/infinispan/config/Configuration.java 2009-05-14 11:07:06 UTC (rev 293)
@@ -55,10 +55,6 @@
this.globalConfiguration = globalConfiguration;
}
- public boolean isUseAsyncSerialization() {
- return useAsyncSerialization;
- }
-
public boolean isStateTransferEnabled() {
return fetchInMemoryState || (cacheLoaderManagerConfig != null && cacheLoaderManagerConfig.isFetchPersistentState());
}
@@ -199,7 +195,6 @@
private boolean writeSkewCheck = false;
private int concurrencyLevel = 500;
private boolean invocationBatchingEnabled;
- private boolean useAsyncSerialization = true;
private long evictionWakeUpInterval = 5000;
private EvictionStrategy evictionStrategy = EvictionStrategy.NONE;
private int evictionMaxEntries = -1;
@@ -213,7 +208,7 @@
private long rehashWaitTime = 60000;
private boolean useLockStriping = true;
private boolean unsafeUnreliableReturnValues = false;
- private boolean asyncMarshalling = true;
+ private boolean useAsyncMarshalling = true;
@Start(priority = 1)
private void correctIsolationLevels() {
@@ -429,11 +424,6 @@
this.useLazyDeserialization = useLazyDeserialization;
}
- public void setUseAsyncSerialization(boolean useAsyncSerialization) {
- testImmutability("useAsyncSerialization");
- this.useAsyncSerialization = useAsyncSerialization;
- }
-
public void setL1CacheEnabled(boolean l1CacheEnabled) {
testImmutability("l1CacheEnabled");
this.l1CacheEnabled = l1CacheEnabled;
@@ -464,17 +454,17 @@
this.rehashWaitTime = rehashWaitTime;
}
- public void setAsyncMarshalling(boolean asyncMarshalling) {
- testImmutability("asyncMarshalling");
- this.asyncMarshalling = asyncMarshalling;
+ public void setUseAsyncMarshalling(boolean useAsyncMarshalling) {
+ testImmutability("useAsyncMarshalling");
+ this.useAsyncMarshalling = useAsyncMarshalling;
}
// ------------------------------------------------------------------------------------------------------------
// GETTERS
// ------------------------------------------------------------------------------------------------------------
- public boolean isAsyncMarshalling() {
- return asyncMarshalling;
+ public boolean isUseAsyncMarshalling() {
+ return useAsyncMarshalling;
}
public boolean isUseReplQueue() {
@@ -604,7 +594,6 @@
if (syncCommitPhase != that.syncCommitPhase) return false;
if (syncReplTimeout != that.syncReplTimeout) return false;
if (syncRollbackPhase != that.syncRollbackPhase) return false;
- if (useAsyncSerialization != that.useAsyncSerialization) return false;
if (useLazyDeserialization != that.useLazyDeserialization) return false;
if (useLockStriping != that.useLockStriping) return false;
if (useReplQueue != that.useReplQueue) return false;
@@ -622,7 +611,7 @@
if (isolationLevel != that.isolationLevel) return false;
if (transactionManagerLookupClass != null ? !transactionManagerLookupClass.equals(that.transactionManagerLookupClass) : that.transactionManagerLookupClass != null)
return false;
- if (asyncMarshalling != that.asyncMarshalling) return false;
+ if (useAsyncMarshalling != that.useAsyncMarshalling) return false;
return true;
}
@@ -650,7 +639,6 @@
result = 31 * result + (writeSkewCheck ? 1 : 0);
result = 31 * result + concurrencyLevel;
result = 31 * result + (invocationBatchingEnabled ? 1 : 0);
- result = 31 * result + (useAsyncSerialization ? 1 : 0);
result = 31 * result + (int) (evictionWakeUpInterval ^ (evictionWakeUpInterval >>> 32));
result = 31 * result + (evictionStrategy != null ? evictionStrategy.hashCode() : 0);
result = 31 * result + evictionMaxEntries;
@@ -662,7 +650,7 @@
result = 31 * result + (l1OnRehash ? 1 : 0);
result = 31 * result + (consistentHashClass != null ? consistentHashClass.hashCode() : 0);
result = 31 * result + numOwners;
- result = 31 * result + (asyncMarshalling ? 1 : 0);
+ result = 31 * result + (useAsyncMarshalling ? 1 : 0);
return result;
}
Modified: trunk/core/src/main/java/org/infinispan/config/parsing/XmlConfigurationParserImpl.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/config/parsing/XmlConfigurationParserImpl.java 2009-05-14 10:55:29 UTC (rev 292)
+++ trunk/core/src/main/java/org/infinispan/config/parsing/XmlConfigurationParserImpl.java 2009-05-14 11:07:06 UTC (rev 293)
@@ -135,7 +135,7 @@
if (globalElement != null) {
globalElement.normalize();
configureAsyncListenerExecutor(getSingleElementInCoreNS("asyncListenerExecutor", globalElement), gc);
- configureAsyncSerializationExecutor(getSingleElementInCoreNS("asyncSerializationExecutor", globalElement), gc);
+ configureAsyncSerializationExecutor(getSingleElementInCoreNS("asyncTransportExecutor", globalElement), gc);
configureEvictionScheduledExecutor(getSingleElementInCoreNS("evictionScheduledExecutor", globalElement), gc);
configureReplicationQueueScheduledExecutor(getSingleElementInCoreNS("replicationQueueScheduledExecutor", globalElement), gc);
configureTransport(getSingleElementInCoreNS("transport", globalElement), gc);
@@ -345,10 +345,8 @@
if (existsAttribute(tmp)) config.setReplQueueInterval(getLong(tmp));
tmp = getAttributeValue(element, "replQueueMaxElements");
if (existsAttribute(tmp)) config.setReplQueueMaxElements(getInt(tmp));
- tmp = getAttributeValue(element, "useAsyncSerialization");
- if (existsAttribute(tmp)) config.setUseAsyncSerialization(getBoolean(tmp));
tmp = getAttributeValue(element, "asyncMarshalling");
- if (existsAttribute(tmp)) config.setAsyncMarshalling(getBoolean(tmp));
+ if (existsAttribute(tmp)) config.setUseAsyncMarshalling(getBoolean(tmp));
}
void configureLocking(Element element, Configuration config) {
Modified: trunk/core/src/main/java/org/infinispan/remoting/rpc/CacheRpcManager.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/remoting/rpc/CacheRpcManager.java 2009-05-14 10:55:29 UTC (rev 292)
+++ trunk/core/src/main/java/org/infinispan/remoting/rpc/CacheRpcManager.java 2009-05-14 11:07:06 UTC (rev 293)
@@ -70,7 +70,7 @@
}
private ResponseMode getResponseMode(boolean sync) {
- return sync ? ResponseMode.SYNCHRONOUS : configuration.isAsyncMarshalling() ? ResponseMode.ASYNCHRONOUS : ResponseMode.ASYNCHRONOUS_WITH_SYNC_MARSHALLING;
+ return sync ? ResponseMode.SYNCHRONOUS : configuration.isUseAsyncMarshalling() ? ResponseMode.ASYNCHRONOUS : ResponseMode.ASYNCHRONOUS_WITH_SYNC_MARSHALLING;
}
public void multicastRpcCommand(List<Address> recipients, CacheRpcCommand command, boolean sync, boolean useOutOfBandMessage) throws ReplicationException {
Modified: trunk/core/src/main/resources/config-samples/all.xml
===================================================================
--- trunk/core/src/main/resources/config-samples/all.xml 2009-05-14 10:55:29 UTC (rev 292)
+++ trunk/core/src/main/resources/config-samples/all.xml 2009-05-14 11:07:06 UTC (rev 293)
@@ -14,10 +14,10 @@
<property name="threadNamePrefix" value="AsyncListenerThread"/>
</asyncListenerExecutor>
- <asyncSerializationExecutor factory="org.infinispan.executors.DefaultExecutorFactory">
+ <asyncTransportExecutor factory="org.infinispan.executors.DefaultExecutorFactory">
<property name="maxThreads" value="25"/>
<property name="threadNamePrefix" value="AsyncSerializationThread"/>
- </asyncSerializationExecutor>
+ </asyncTransportExecutor>
<evictionScheduledExecutor factory="org.infinispan.executors.DefaultScheduledExecutorFactory">
<property name="threadNamePrefix" value="EvictionThread"/>
@@ -113,6 +113,12 @@
<!-- Individually configured "named" caches -->
<!-- ************************************** -->
+ <namedCache name="asyncCache">
+ <clustering mode="replication">
+ <async asyncMarshalling="true"/>
+ </clustering>
+ </namedCache>
+
<!-- Note that any of the elements appearing in a namedCache section can also appear in the default section as a template. -->
<namedCache name="evictionCache">
Modified: trunk/core/src/main/resources/schema/infinispan-config-4.0.xsd
===================================================================
--- trunk/core/src/main/resources/schema/infinispan-config-4.0.xsd 2009-05-14 10:55:29 UTC (rev 292)
+++ trunk/core/src/main/resources/schema/infinispan-config-4.0.xsd 2009-05-14 11:07:06 UTC (rev 293)
@@ -180,7 +180,6 @@
<xs:attribute name="useReplQueue" type="tns:booleanType"/>
<xs:attribute name="replQueueInterval" type="tns:positiveNumber"/>
<xs:attribute name="replQueueMaxElements" type="tns:positiveNumber"/>
- <xs:attribute name="useAsyncSerialization" type="tns:booleanType"/>
</xs:complexType>
<xs:complexType name="evictionType">
Modified: trunk/core/src/test/java/org/infinispan/config/parsing/ConfigurationParserTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/config/parsing/ConfigurationParserTest.java 2009-05-14 10:55:29 UTC (rev 292)
+++ trunk/core/src/test/java/org/infinispan/config/parsing/ConfigurationParserTest.java 2009-05-14 11:07:06 UTC (rev 293)
@@ -83,7 +83,7 @@
Configuration c = new Configuration();
parser.configureLazyDeserialization(e, c);
- assert c.isUseAsyncSerialization();
+ assert c.isUseAsyncMarshalling();
}
public void testJmxStatisticsDefaults() throws Exception {
@@ -123,7 +123,7 @@
XmlConfigurationParserImpl parser = new XmlConfigurationParserImpl();
String xml = "<clustering mode=\"invalidation\">\n" +
" <stateRetrieval timeout=\"20000\" fetchInMemoryState=\"false\"/>\n" +
- " <async useReplQueue=\"true\" replQueueInterval=\"10000\" replQueueMaxElements=\"500\"/>\n" +
+ " <async useReplQueue=\"true\" replQueueInterval=\"10000\" replQueueMaxElements=\"500\" asyncMarshalling=\"false\"/>\n" +
" </clustering>";
Element e = XmlConfigHelper.stringToElement(xml);
@@ -136,6 +136,7 @@
assert c.isUseReplQueue();
assert c.getReplQueueInterval() == 10000;
assert c.getReplQueueMaxElements() == 500;
+ assert c.isUseAsyncMarshalling() == false;
}
public void testClusteringDefaults() throws Exception {
Modified: trunk/core/src/test/java/org/infinispan/config/parsing/XmlFileParsingTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/config/parsing/XmlFileParsingTest.java 2009-05-14 10:55:29 UTC (rev 292)
+++ trunk/core/src/test/java/org/infinispan/config/parsing/XmlFileParsingTest.java 2009-05-14 11:07:06 UTC (rev 293)
@@ -63,14 +63,14 @@
assert c.getCacheMode() == Configuration.CacheMode.REPL_ASYNC;
assert !c.isUseReplQueue();
- assert !c.isUseAsyncSerialization();
+ assert !c.isUseAsyncMarshalling();
assert !c.isFetchInMemoryState();
c = namedCaches.get("asyncReplQueue");
assert c.getCacheMode() == Configuration.CacheMode.REPL_ASYNC;
assert c.isUseReplQueue();
- assert c.isUseAsyncSerialization();
+ assert c.isUseAsyncMarshalling();
assert !c.isFetchInMemoryState();
c = namedCaches.get("txSyncRepl");
@@ -149,7 +149,7 @@
assert c.getTransactionManagerLookupClass() == null;
assert c.getCacheMode() == Configuration.CacheMode.REPL_ASYNC;
assert !c.isUseReplQueue();
- assert !c.isUseAsyncSerialization();
+ assert !c.isUseAsyncMarshalling();
assert !c.isFetchInMemoryState();
assert c.getLockAcquisitionTimeout() == 1000;
assert c.getIsolationLevel() == IsolationLevel.READ_COMMITTED;
@@ -163,7 +163,7 @@
assert c.isUseReplQueue();
assert c.getReplQueueInterval() == 1234;
assert c.getReplQueueMaxElements() == 100;
- assert c.isUseAsyncSerialization();
+ assert c.isUseAsyncMarshalling();
assert !c.isFetchInMemoryState();
assert c.getLockAcquisitionTimeout() == 1000;
assert c.getIsolationLevel() == IsolationLevel.READ_COMMITTED;
Modified: trunk/core/src/test/resources/configs/named-cache-test.xml
===================================================================
--- trunk/core/src/test/resources/configs/named-cache-test.xml 2009-05-14 10:55:29 UTC (rev 292)
+++ trunk/core/src/test/resources/configs/named-cache-test.xml 2009-05-14 11:07:06 UTC (rev 293)
@@ -8,10 +8,10 @@
<property name="threadNamePrefix" value="AsyncListenerThread"/>
</asyncListenerExecutor>
- <asyncSerializationExecutor factory="org.infinispan.executors.DefaultExecutorFactory">
+ <asyncTransportExecutor factory="org.infinispan.executors.DefaultExecutorFactory">
<property name="maxThreads" value="25"/>
<property name="threadNamePrefix" value="AsyncSerializationThread"/>
- </asyncSerializationExecutor>
+ </asyncTransportExecutor>
<evictionScheduledExecutor factory="org.infinispan.executors.DefaultScheduledExecutorFactory">
<property name="threadNamePrefix" value="EvictionThread"/>
@@ -50,7 +50,7 @@
<namedCache name="asyncRepl">
<clustering mode="repl">
<stateRetrieval fetchInMemoryState="false"/>
- <async useAsyncSerialization="false"/>
+ <async asyncMarshalling="false"/>
</clustering>
</namedCache>
More information about the infinispan-commits
mailing list