public void flush() { forceFlush(); }
public void flush() { forceFlush(); }
/** * Called before LocalRegion clears the contents of its entries map */ void prepareForClose(LocalRegion region, DiskRegion dr) { if (dr.isBackup()) { // Need to flush any async ops done on dr. // The easiest way to do this is to flush the entire async queue. forceFlush(); } }
public void flushForTesting() { if (this.fp != null) { this.fp.unpause(); this.fp = null; } forceFlush(); }
public void flushForTesting() { if (this.fp != null) { this.fp.unpause(); this.fp = null; } forceFlush(); }
/** * Called before LocalRegion clears the contents of its entries map */ void prepareForClose(LocalRegion region, DiskRegion dr) { // logger.info(LocalizedStrings.DEBUG, "DEBUG prepareForClose dr=" + // dr.getName()); if (dr.isBackup()) { // logger.info(LocalizedStrings.DEBUG, "DEBUG prepareForClose dr=" + // dr.getName()); // Need to flush any async ops done on dr. // The easiest way to do this is to flush the entire async queue. forceFlush(); } }
public void forceFlush() { getDiskStore().forceFlush(); }
public void forceFlush() { getDiskStore().forceFlush(); }
public void prepareForClose() { forceFlush(); persistentOplogs.prepareForClose(); closeCompactor(true); }
public void prepareForClose() { forceFlush(); persistentOplogs.prepareForClose(); closeCompactor(true); }
private void stopAsyncFlusher() { this.stoppingFlusher = true; do { // Need to keep looping as long as we have more threads // that are already pending a put on the asyncQueue. // New threads will fail because stoppingFlusher has been set. // See bug 41141. forceFlush(); } while (this.pendingAsyncEnqueue.get() > 0); synchronized (asyncMonitor) { this.stopFlusher = true; this.asyncMonitor.notifyAll(); } while (!this.flusherThreadTerminated) { try { this.flusherThread.join(100); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); getCache().getCancelCriterion().checkCancelInProgress(ie); } } }
/** * */ public final void flushAndSync(boolean noCompactorLock) { forceFlush(); for (Oplog oplog : getPersistentOplogSet(null).getAllOplogs()) { oplog.flushAllAndSync(true); } }
protected void stopAsyncFlusher() { // logger.info(LocalizedStrings.DEBUG, "DEBUG stopAsyncFlusher immediately=" // + immediately); this.stoppingFlusher = true; do { // Need to keep looping as long as we have more threads // that are already pending a put on the asyncQueue. // New threads will fail because stoppingFlusher has been set. // See bug 41141. forceFlush(); } while (this.pendingAsyncEnqueue.get() > 0); // logger.info(LocalizedStrings.DEBUG, "DEBUG " // + this.owner.getFullPath() // + " stopAsyncFlusher immediately=" + immediately); synchronized (asyncMonitor) { this.stopFlusher = true; this.asyncMonitor.notifyAll(); } while (!this.flusherThreadTerminated) { try { // check if cache is going down and in that case also terminate the // flusher thread. getCache().getCancelCriterion().checkCancelInProgress(null); this.flusherThread.join(100); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); getCache().getCancelCriterion().checkCancelInProgress(ie); } } }
/** * Flush all async queue data, and fsync all oplogs to disk. */ public final void flushAndSync() { forceFlush(); acquireCompactorWriteLock(); try { for (Oplog oplog : getPersistentOplogSet(null).getAllOplogs()) { oplog.flushAllAndSync(); } } finally { releaseCompactorWriteLock(); } }
/** * @since 5.1 */ public void forceRolling(DiskRegion dr) { if (!dr.isBackup()) return; if (!dr.isSync() && this.maxAsyncItems == 0 && getTimeInterval() == 0) { forceFlush(); } acquireReadLock(dr); try { PersistentOplogSet oplogSet = getPersistentOplogSet(dr); oplogSet.forceRoll(dr); } finally { releaseReadLock(dr); } }
/** * @since 5.1 */ public void forceRolling(DiskRegion dr) { if (!dr.isBackup()) return; if (!dr.isSync() && this.maxAsyncItems == 0 && getTimeInterval() == 0) { forceFlush(); } acquireReadLock(dr); try { PersistentOplogSet oplogSet = getPersistentOplogSet(dr); oplogSet.forceRoll(dr); } finally { releaseReadLock(dr); } }
try { long numEntries = 0; dsImpl.forceFlush();
try { long numEntries = 0; dsImpl.forceFlush();
try { long numEntries = 0; dsImpl.forceFlush();
public void testBug41770() throws InterruptedException { DiskRegionProperties props = new DiskRegionProperties(); props.setRegionName("testBug41770"); props.setOverflow(false); props.setRolling(false); props.setDiskDirs(dirs); props.setPersistBackup(true); region = DiskRegionHelperFactory.getAsyncPersistOnlyRegion(cache, props); // Install a listener then gets called when the async flusher threads // finds an entry to flush LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = true; Bug41770CacheObserverAdapter co = new Bug41770CacheObserverAdapter(); CacheObserverHolder.setInstance(co); try { region.create("KEY", "VALUE1"); ((LocalRegion)region).getDiskStore().forceFlush(); assertEquals (true, co.waitForCompletion()); // we should now have two creates in our oplog. region.close(); // do a recovery it will fail with an assertion if this bug is not fixed region = DiskRegionHelperFactory.getAsyncPersistOnlyRegion(cache, props); } finally { LocalRegion.ISSUE_CALLBACKS_TO_CACHE_OBSERVER = false; CacheObserverHolder.setInstance(new CacheObserverAdapter()); } }