Author: jason.greene(a)jboss.com
Date: 2009-02-04 19:00:18 -0500 (Wed, 04 Feb 2009)
New Revision: 7650
Modified:
core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferGenerator.java
Log:
Improve non progress alg
Modified:
core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferGenerator.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferGenerator.java 2009-02-04
23:54:51 UTC (rev 7649)
+++
core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferGenerator.java 2009-02-05
00:00:18 UTC (rev 7650)
@@ -159,7 +159,7 @@
if (nonBlocking && generateTransient)
{
- for (int nonProgress = 0, size = txLog.size(); nonProgress <
maxNonProgressingLogWrites && size > 0;)
+ for (int nonProgress = 0, size = txLog.size(); size > 0;)
{
if (log.isTraceEnabled())
log.trace("Tx Log remaining entries = " + size);
@@ -168,8 +168,8 @@
// If size did not decrease then we did not make progress, and could be
wasting
// our time. Limit this to the specified max.
- if (newSize >= size)
- nonProgress++;
+ if (newSize >= size && ++nonProgress >=
maxNonProgressingLogWrites)
+ break;
size = newSize;
}