Search in sources :

Example 16 with EntrySnapshot

use of org.apache.geode.internal.cache.EntrySnapshot 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

EntrySnapshot (org.apache.geode.internal.cache.EntrySnapshot)16 Region (org.apache.geode.cache.Region)7 RegionEntry (org.apache.geode.internal.cache.RegionEntry)7 VersionTag (org.apache.geode.internal.cache.versions.VersionTag)7 LocalRegion (org.apache.geode.internal.cache.LocalRegion)6 Entry (org.apache.geode.cache.Region.Entry)4 PartitionedRegion (org.apache.geode.internal.cache.PartitionedRegion)4 Test (org.junit.Test)4 NonTXEntry (org.apache.geode.internal.cache.LocalRegion.NonTXEntry)3 ArrayList (java.util.ArrayList)2 Iterator (java.util.Iterator)2 NonLocalRegionEntry (org.apache.geode.internal.cache.NonLocalRegionEntry)2 PartitionedRegionDataStore (org.apache.geode.internal.cache.PartitionedRegionDataStore)2 Tombstone (org.apache.geode.internal.cache.Token.Tombstone)2 SerializableRunnable (org.apache.geode.test.dunit.SerializableRunnable)2 DistributedTest (org.apache.geode.test.junit.categories.DistributedTest)2 UnitTest (org.apache.geode.test.junit.categories.UnitTest)2 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1