Search in sources :

Example 56 with RegionEntry

use of org.apache.geode.internal.cache.RegionEntry in project geode by apache.

the class NewWANConcurrencyCheckForDestroyDUnitTest method getVersionTimestampAfterOp.

/*
   * For VM3 in ds 2.
   */
public static long getVersionTimestampAfterOp() {
    Region region = cache.getRegion("repRegion");
    assertEquals(1, region.size());
    region.destroy("testKey");
    Region.Entry entry = ((LocalRegion) region).getEntry("testKey", /* null, */
    true);
    RegionEntry re = ((EntrySnapshot) entry).getRegionEntry();
    LogWriterUtils.getLogWriter().fine("RegionEntry for testKey: " + re.getKey() + " " + re.getValueInVM((LocalRegion) region));
    assertTrue(re.getValueInVM((LocalRegion) region) instanceof Tombstone);
    VersionTag tag = re.getVersionStamp().asVersionTag();
    return tag.getVersionTimeStamp();
}
Also used : Tombstone(org.apache.geode.internal.cache.Token.Tombstone) VersionTag(org.apache.geode.internal.cache.versions.VersionTag) LocalRegion(org.apache.geode.internal.cache.LocalRegion) Region(org.apache.geode.cache.Region) RegionEntry(org.apache.geode.internal.cache.RegionEntry) LocalRegion(org.apache.geode.internal.cache.LocalRegion) EntrySnapshot(org.apache.geode.internal.cache.EntrySnapshot)

Aggregations

RegionEntry (org.apache.geode.internal.cache.RegionEntry)56 Test (org.junit.Test)32 LocalRegion (org.apache.geode.internal.cache.LocalRegion)20 UnitTest (org.apache.geode.test.junit.categories.UnitTest)15 Iterator (java.util.Iterator)13 Region (org.apache.geode.cache.Region)13 VM (org.apache.geode.test.dunit.VM)13 DistributedTest (org.apache.geode.test.junit.categories.DistributedTest)11 VersionTag (org.apache.geode.internal.cache.versions.VersionTag)10 Host (org.apache.geode.test.dunit.Host)9 SerializableRunnable (org.apache.geode.test.dunit.SerializableRunnable)9 Map (java.util.Map)8 PartitionedRegion (org.apache.geode.internal.cache.PartitionedRegion)8 CacheException (org.apache.geode.cache.CacheException)7 EntrySnapshot (org.apache.geode.internal.cache.EntrySnapshot)7 CloseableIterator (org.apache.geode.internal.cache.persistence.query.CloseableIterator)7 HashMap (java.util.HashMap)6 HashSet (java.util.HashSet)5 Entry (java.util.Map.Entry)5 Cache (org.apache.geode.cache.Cache)5