Author: nzamosenchuk
Date: 2010-08-30 03:21:36 -0400 (Mon, 30 Aug 2010)
New Revision: 3007
Modified:
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
Log:
EXOJCR-919: updating max-volatile-time logic
Modified:
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
===================================================================
---
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2010-08-30
07:15:55 UTC (rev 3006)
+++
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2010-08-30
07:21:36 UTC (rev 3007)
@@ -1088,6 +1088,7 @@
redoLog.clear();
lastFlushTime = System.currentTimeMillis();
+ lastFileSystemFlushTime = System.currentTimeMillis();
}
// delete obsolete indexes
@@ -1238,12 +1239,6 @@
commitVolatileIndex();
return true;
}
- long volatileTime = System.currentTimeMillis() - lastFileSystemFlushTime;
- if (handler.getMaxVolatileTime() > 0 && volatileTime >=
handler.getMaxVolatileTime() * 1000)
- {
- commitVolatileIndex();
- return true;
- }
return false;
}
@@ -1276,7 +1271,6 @@
// create new volatile index
resetVolatileIndex();
- lastFileSystemFlushTime = System.currentTimeMillis();
time = System.currentTimeMillis() - time;
log.debug("Committed in-memory index in " + time + "ms.");
@@ -1394,8 +1388,10 @@
private synchronized void checkFlush()
{
long idleTime = System.currentTimeMillis() - lastFlushTime;
+ long volatileTime = System.currentTimeMillis() - lastFileSystemFlushTime;
// do not flush if volatileIdleTime is zero or negative
- if (handler.getVolatileIdleTime() > 0 && idleTime >
handler.getVolatileIdleTime() * 1000)
+ if ((handler.getVolatileIdleTime() > 0 && idleTime >
handler.getVolatileIdleTime() * 1000)
+ || (handler.getMaxVolatileTime() > 0 && volatileTime >
handler.getMaxVolatileTime() * 1000))
{
try
{
Show replies by date