[infinispan-commits] Infinispan SVN: r445 - in trunk/core/src/main: java/org/infinispan/config/parsing and 1 other directories.
infinispan-commits at lists.jboss.org
infinispan-commits at lists.jboss.org
Fri Jun 12 07:01:41 EDT 2009
Author: manik.surtani at jboss.com
Date: 2009-06-12 07:01:41 -0400 (Fri, 12 Jun 2009)
New Revision: 445
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/resources/config-samples/all.xml
Log:
Specify separate timeout for rehash related RPC
Modified: trunk/core/src/main/java/org/infinispan/config/Configuration.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/config/Configuration.java 2009-06-12 11:00:44 UTC (rev 444)
+++ trunk/core/src/main/java/org/infinispan/config/Configuration.java 2009-06-12 11:01:41 UTC (rev 445)
@@ -77,6 +77,15 @@
this.unsafeUnreliableReturnValues = unsafeUnreliableReturnValues;
}
+ public void setRehashRpcTimeout(long rehashRpcTimeout) {
+ testImmutability("rehashRpcTimeout");
+ this.rehashRpcTimeout = rehashRpcTimeout;
+ }
+
+ public long getRehashRpcTimeout() {
+ return rehashRpcTimeout;
+ }
+
/**
* Cache replication mode.
*/
@@ -211,6 +220,7 @@
private boolean useLockStriping = true;
private boolean unsafeUnreliableReturnValues = false;
private boolean useAsyncMarshalling = true;
+ private long rehashRpcTimeout = 60 * 1000 * 10; // 10 minutes
@Start(priority = 1)
private void correctIsolationLevels() {
@@ -391,7 +401,7 @@
testImmutability("syncRollbackPhase");
this.syncRollbackPhase = syncRollbackPhase;
}
-
+
public void setUseEagerLocking(boolean useEagerLocking) {
testImmutability("useEagerLocking");
this.useEagerLocking = useEagerLocking;
@@ -533,7 +543,7 @@
public boolean isSyncRollbackPhase() {
return syncRollbackPhase;
}
-
+
public boolean isUseEagerLocking() {
return useEagerLocking;
}
@@ -604,6 +614,7 @@
if (stateRetrievalTimeout != that.stateRetrievalTimeout) return false;
if (syncCommitPhase != that.syncCommitPhase) return false;
if (syncReplTimeout != that.syncReplTimeout) return false;
+ if (rehashRpcTimeout != that.rehashRpcTimeout) return false;
if (syncRollbackPhase != that.syncRollbackPhase) return false;
if (useEagerLocking != that.useEagerLocking) return false;
if (useLazyDeserialization != that.useLazyDeserialization) return false;
@@ -660,6 +671,7 @@
result = 31 * result + (l1CacheEnabled ? 1 : 0);
result = 31 * result + (int) (l1Lifespan ^ (l1Lifespan >>> 32));
result = 31 * result + (int) (rehashWaitTime ^ (rehashWaitTime >>> 32));
+ result = 31 * result + (int) (rehashRpcTimeout ^ (rehashRpcTimeout >>> 32));
result = 31 * result + (l1OnRehash ? 1 : 0);
result = 31 * result + (consistentHashClass != null ? consistentHashClass.hashCode() : 0);
result = 31 * result + numOwners;
Modified: trunk/core/src/main/java/org/infinispan/config/parsing/XmlConfigurationParserImpl.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/config/parsing/XmlConfigurationParserImpl.java 2009-06-12 11:00:44 UTC (rev 444)
+++ trunk/core/src/main/java/org/infinispan/config/parsing/XmlConfigurationParserImpl.java 2009-06-12 11:01:41 UTC (rev 445)
@@ -213,6 +213,8 @@
if (existsAttribute(tmp)) config.setNumOwners(getInt(tmp));
tmp = getAttributeValue(hash, "rehashWait");
if (existsAttribute(tmp)) config.setRehashWaitTime(getLong(tmp));
+ tmp = getAttributeValue(hash, "rehashRpcTimeout");
+ if (existsAttribute(tmp)) config.setRehashRpcTimeout(getLong(tmp));
} else if (getSingleElementInCoreNS("l1", e) != null || getSingleElementInCoreNS("hash", e) != null) {
throw new ConfigurationException("l1 and hash elements cannot be used with cache modes 'REPLICATION' and 'INVALIDATION'!");
}
Modified: trunk/core/src/main/resources/config-samples/all.xml
===================================================================
--- trunk/core/src/main/resources/config-samples/all.xml 2009-06-12 11:00:44 UTC (rev 444)
+++ trunk/core/src/main/resources/config-samples/all.xml 2009-06-12 11:01:41 UTC (rev 445)
@@ -89,7 +89,7 @@
<!--
This element specifies that the cache is clustered.
- modes supported: replication (r) or invalidation (i).
+ modes supported: distribution (d), replication (r) or invalidation (i).
-->
<clustering mode="replication">
@@ -167,7 +167,13 @@
<namedCache name="distributedCache">
<clustering mode="distribution">
<sync/>
- <hash numOwners="3" rehashWait="120000"/>
+ <!--
+ num owners: number of owners for each key. The larger this number is, the safer your data will be, but the
+ slower the cluster will be.
+
+ rehashRpcTimeout: timeout used for RPC calls relating to rehashing. This defaults to 600000 (10 minutes).
+ -->
+ <hash numOwners="3" rehashWait="120000" rehashRpcTimeout="600000"/>
<l1 enabled="true" lifespan="600000"/>
</clustering>
</namedCache>
More information about the infinispan-commits
mailing list