void pauseFlush() { ((LocalRegion)region).getDiskRegion().pauseFlusherForTesting(); this.flushCount = getCurrentFlushCount(); }
((LocalRegion)region).getDiskRegion().pauseFlusherForTesting(); region.put("Key", "Value1"); ((LocalRegion)region).getDiskRegion().flushForTesting();
((LocalRegion)region).getDiskRegion().pauseFlusherForTesting(); region.put("Key", "Value1"); ((LocalRegion)region).getDiskRegion().flushForTesting();
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();
((LocalRegion)region).getDiskRegion().pauseFlusherForTesting(); region.put("Key", "Value1"); ((LocalRegion)region).getDiskRegion().flushForTesting();
((LocalRegion)region).getDiskRegion().pauseFlusherForTesting(); region.put("Key", "Value1"); ((LocalRegion)region).getDiskRegion().flushForTesting();
((LocalRegion)region).getDiskRegion().pauseFlusherForTesting(); region.put("Key", "Value1"); ((LocalRegion)region).getDiskRegion().flushForTesting();
((LocalRegion)region).getDiskRegion().pauseFlusherForTesting();
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"); } }
public void afterWritingBytes() { if (!alreadyComeHere) { DiskEntry de = (DiskEntry)((LocalRegion)region).basicGetEntry("Key"); if (de == null) return; // this is caused by the first flush DiskId id = de.getDiskId(); long oldOplogId = id.getOplogId(); long oldOplogOffset = id.getOffsetInOplog(); ((LocalRegion)region).getDiskRegion().pauseFlusherForTesting(); // region.getCache().getLogger().info("putting value2"); region.put("Key", "Value2"); id = ((DiskEntry)(((LocalRegion)region).basicGetEntry("Key"))) .getDiskId(); long newOplogId = id.getOplogId(); long newOplogOffset = id.getOffsetInOplog(); id.setOplogId(oldOplogId); id.setOffsetInOplog(oldOplogOffset); Assert.assertEquals("Value1", ((LocalRegion)region).getDiskRegion() .getNoBuffer(id)); id.setOplogId(newOplogId); id.setOffsetInOplog(newOplogOffset); } alreadyComeHere = true; } });