/** * Used by tests to force everything out to disk. */ public void forceFlush() { if (this.diskRegion != null) { this.diskRegion.flushForTesting(); } }
/** * Used by tests to force everything out to disk. */ public void forceFlush() { if (this.diskRegion != null) { this.diskRegion.flushForTesting(); } }
public void run() { ((LocalRegion)region).getDiskRegion().flushForTesting(); synchronized (region) { region.notify(); hasBeenNotified = true; } }
/** * Flushing all pending writes to disk. */ private static void flush(Region region) { ((LocalRegion)region).getDiskRegion().flushForTesting(); }
/** * force a flush on the region * */ void forceFlush() { ((LocalRegion)region).getDiskRegion().flushForTesting(); }
public void run() { ((LocalRegion)region).getDiskRegion().flushForTesting(); synchronized (region) { region.notify(); hasBeenNotified = true; } }
protected void validatePut(Region region) { // flush data to disk ((LocalRegion)region).getDiskRegion().flushForTesting(); try { ((LocalRegion)region).getValueOnDisk("testKey"); } catch (Exception ex) { ex.printStackTrace(); fail("Failed to get the value on disk"); } }
((LocalRegion)region).getDiskRegion().pauseFlusherForTesting(); region.put("Key", "Value1"); ((LocalRegion)region).getDiskRegion().flushForTesting(); try { Assert.assertEquals("Value2", region.get("Key"));
void getAfterFlush(final Region region) { alreadyComeHere = false; CacheObserverHolder.setInstance(new CacheObserverAdapter() { public void afterWritingBytes() { if (!alreadyComeHere) { region.get("key"); } alreadyComeHere = true; } }); ((LocalRegion)region).getDiskRegion().pauseFlusherForTesting(); region.put("Key", "Value1"); ((LocalRegion)region).getDiskRegion().flushForTesting(); try { Assert.assertEquals("Value1", getValueOnDisk(region)); } catch (EntryNotFoundException e) { logWriter.error("Exception occured", e); fail("Entry not found although was supposed to be there"); } }
((LocalRegion)region).getDiskRegion().pauseFlusherForTesting(); region.put("Key", "Value1"); ((LocalRegion)region).getDiskRegion().flushForTesting(); try { Assert.assertEquals("Value1", getValueOnDisk(region));
((LocalRegion)region).getDiskRegion().pauseFlusherForTesting(); region.put("Key", "Value1"); ((LocalRegion)region).getDiskRegion().flushForTesting(); synchronized (region) { try {
((LocalRegion)region).getDiskRegion().pauseFlusherForTesting(); region.put("Key", "Value1"); ((LocalRegion)region).getDiskRegion().flushForTesting(); synchronized (region) { try {
((LocalRegion)region).getDiskRegion().pauseFlusherForTesting(); region.put("Key", "Value1"); ((LocalRegion)region).getDiskRegion().flushForTesting(); boolean entryNotFound = false; Object v = null;
((LocalRegion)region).getDiskRegion().pauseFlusherForTesting(); region.put("Key", "Value1"); ((LocalRegion)region).getDiskRegion().flushForTesting(); boolean entryNotFound = false; Object v = null;
void clearBeforeFlush(final Region region) { ((LocalRegion)region).getDiskRegion().pauseFlusherForTesting(); region.put("Key", "Value1"); region.clear(); ((LocalRegion)region).getDiskRegion().flushForTesting(); boolean entryNotFound = false; try { getValueOnDisk(region); } catch (EntryNotFoundException e) { entryNotFound = true; } if (!entryNotFound) { fail("EntryNotFoundException was expected but did not get it"); } entryNotFound = false; Object obj = ((LocalRegion)region).basicGetEntry("Key"); if (obj == null) { entryNotFound = true; } if (!entryNotFound) { fail("EntryNotFoundException was expected but did not get it"); } }
void clearAfterFlush(final Region region) { ((LocalRegion)region).getDiskRegion().pauseFlusherForTesting(); region.put("Key", "Value1"); ((LocalRegion)region).getDiskRegion().flushForTesting(); region.clear(); boolean entryNotFound = false; try { getValueOnDisk(region); } catch (EntryNotFoundException e) { entryNotFound = true; } if (!entryNotFound) { fail("EntryNotFoundException was expected but did not get it"); } entryNotFound = false; Object obj = ((LocalRegion)region).basicGetEntry("Key"); if (obj == null) { entryNotFound = true; } if (!entryNotFound) { fail("EntryNotFoundException was expected but did not get it"); } }
assertNotNull(lruStats); dr.flushForTesting(); dr.flushForTesting(); assertEquals(total - 1, diskStats.getNumEntriesInVM()); Object value = region.get(new Integer(0)); dr.flushForTesting();
dr.flushForTesting(); long size1 =0; for(DirectoryHolder dh:dr.getDirectories()) {