@Override public boolean containsKey(Object key) { return this.region.containsKey(key); }
@Override public boolean containsKey(Object key) { return this.region.containsKey(key); }
@Override public boolean containsKey(Object key) { return this.region.containsKey(key); }
public Object call() { for (Object key: keys) { assertTrue("expected to find an entry for "+key, TestRegion.containsKey(key)); assertTrue("expected to find entry invalid for "+key, !TestRegion.containsValue(key)); } return null; } });
public Object call() { for (int i=0; i<10; i++) { assertTrue("expected to find an entry for Object"+i, TestRegion.containsKey("Object"+i)); assertTrue("expected to find entry invalid for Object"+i, !TestRegion.containsValue("Object"+i)); } return null; } });
public final boolean containsKey(Object key) { try { operationStart(); return containsKey(key, null); } finally { operationCompleted(); } }
public void run2() throws CacheException { final LocalRegion region = (LocalRegion) getRootRegion().getSubregion(name); // wait for a while for us to have the correct number of entries WaitCriterion ev = new WaitCriterion() { public boolean done() { return region.size() == 3; } public String description() { return "waiting for region to be size 3"; } }; DistributedTestCase.waitForCriterion(ev, 10 * 1000, 200, true); // assertEquals(3, region.size()); assertTrue(region.containsKey("k1")); assertTrue(region.containsKey("k2")); assertTrue(region.containsKey("k3")); assertEquals("v1", region.getEntry("k1").getValue()); assertEquals("v2", region.getEntry("k2").getValue()); assertEquals("v3", region.getEntry("k3").getValue()); } };
public void run2() throws CacheException { final LocalRegion region = (LocalRegion) getRootRegion().getSubregion(name); // wait for a while for us to have the correct number of entries WaitCriterion ev = new WaitCriterion() { public boolean done() { return region.size() == 3; } public String description() { return "waiting for region to be size 3"; } }; DistributedTestCase.waitForCriterion(ev, 10 * 1000, 200, true); // assertEquals(3, region.size()); assertTrue(region.containsKey("k1")); assertTrue(region.containsKey("k2")); assertTrue(region.containsKey("k3")); assertEquals("v1", region.getEntry("k1").getValue()); assertEquals("v2", region.getEntry("k2").getValue()); assertEquals("v3", region.getEntry("k3").getValue()); } };
private void checkInvalid(Region r, int start, int end) { LocalRegion region = (LocalRegion) r; for(int i = start; i < end ; i++) { assertTrue(region.containsKey(i)); assertNull(region.get(i)); } }
private boolean containsKeyForReplicateTable() throws StandardException { boolean ret; if (this.txState != null) { ret = this.baseRegion.txContainsKey(getRegionKey( this.init_startKeyValue), null, this.txState, true); } else { ret = this.baseRegion.containsKey( getRegionKey(this.init_startKeyValue)); } if (!ret) { failedKey = this.init_startKeyValue; } return ret; }
private boolean containsKeyForReplicateTable() throws StandardException { boolean ret; if (this.txState != null) { ret = this.baseRegion.txContainsKey(getRegionKey( this.init_startKeyValue), null, this.txState, true); } else { ret = this.baseRegion.containsKey( getRegionKey(this.init_startKeyValue)); } if (!ret) { failedKey = this.init_startKeyValue; } return ret; }
private boolean containsKeyForReplicateTable() throws StandardException { boolean ret; if (this.txState != null) { ret = this.baseRegion.txContainsKey(getRegionKey( this.init_startKeyValue), null, this.txState, true); } else { ret = this.baseRegion.containsKey( getRegionKey(this.init_startKeyValue)); } if (!ret) { failedKey = this.init_startKeyValue; } return ret; }
public void run() { try { for (int i=0; i<numEntries; i++) { CCRegion.destroy("cckey" + i); assertTrue("entry should not exist", !CCRegion.containsKey("cckey"+i)); assertTrue("entry should not contain a value", !CCRegion.containsValueForKey("cckey"+i)); } long count = CCRegion.getTombstoneCount(); assertEquals("expected "+numEntries+" tombstones", numEntries, count); assertTrue("region should not contain a tombstone", !CCRegion.containsValue(Token.TOMBSTONE)); if (CCRegion.getScope().isDistributedNoAck()) { sendSerialMessageToAll(); // flush the ops } } catch (CacheException e) { fail("while performing destroy operations", e); } // OSProcess.printStacks(0, getLogWriter(), false); } });
/** * Process an interest request consisting of a single key * * @param region * the region * @param entryKey * the key * @param policy * the policy * @throws IOException */ private static void handleSingleton(LocalRegion region, Object entryKey, InterestResultPolicy policy, ServerConnection servConn) throws IOException { ArrayList keyList = new ArrayList(1); if (region != null) { if (region.containsKey(entryKey) || (sendTombstonesInRIResults(servConn, policy) && region.containsTombstone(entryKey))) { appendInterestResponseKey(region, entryKey, entryKey, keyList, "individual", servConn); } } // Send the last chunk (the only chunk for individual and list keys) // always send it back, even if the list is of zero size. sendRegisterInterestResponseChunk(region, entryKey, keyList, true, servConn); }
/** * Process an interest request consisting of a single key * * @param region * the region * @param entryKey * the key * @param policy * the policy * @throws IOException */ private static void handleSingleton(LocalRegion region, Object entryKey, InterestResultPolicy policy, ServerConnection servConn) throws IOException { ArrayList keyList = new ArrayList(1); if (region != null) { if (region.containsKey(entryKey) || (sendTombstonesInRIResults(servConn, policy) && region.containsTombstone(entryKey))) { appendInterestResponseKey(region, entryKey, entryKey, keyList, "individual", servConn); } } // Send the last chunk (the only chunk for individual and list keys) // always send it back, even if the list is of zero size. sendRegisterInterestResponseChunk(region, entryKey, keyList, true, servConn); }
public static void createEntries() { try { LocalRegion r1 = (LocalRegion)cache.getRegion(Region.SEPARATOR + REGION_NAME); if (!r1.containsKey("key-1")) { r1.create("key-1", "key-1"); } if (!r1.containsKey("key-2")) { r1.create("key-2", "key-2"); } assertEquals(r1.getEntry("key-1").getValue(), "key-1"); assertEquals(r1.getEntry("key-2").getValue(), "key-2"); } catch (Exception ex) { fail("failed while createEntries()", ex); } }
public static void createEntries() { try { LocalRegion r1 = (LocalRegion)cache.getRegion("/" + REGION_NAME); for(int i=1 ; i<6; i++){ if (!r1.containsKey("key-"+i)) { r1.create("key-"+i, "key-"+i); } assertEquals(r1.getEntry("key-"+i).getValue(), "key-"+i); } } catch (Exception ex) { fail("failed while createEntries()", ex); } }
replyVal = r.containsValueForKey(this.key); } else { replyVal = r.containsKey(this.key);
/** * Handles both RR and PR cases */ @SuppressWarnings("rawtypes") @edu.umd.cs.findbugs.annotations.SuppressWarnings(value="NP_NULL_PARAM_DEREF", justification="Null value handled in sendNewRegisterInterestResponseChunk()") private static void handleKVSingleton(LocalRegion region, Object entryKey, boolean serializeValues, ServerConnection servConn) throws IOException { VersionedObjectList values = new VersionedObjectList(maximumChunkSize, true, region == null ? true : region.getAttributes() .getConcurrencyChecksEnabled(), serializeValues); if (region != null) { if (region.containsKey(entryKey) || region.containsTombstone(entryKey)) { EntryEventImpl versionHolder = EntryEventImpl.createVersionTagHolder(); ClientProxyMembershipID id = servConn == null ? null : servConn.getProxyID(); // From Get70.getValueAndIsObject() Object data = region.get(entryKey, null, true, true, true, id, versionHolder, true, false); VersionTag vt = versionHolder.getVersionTag(); updateValues(values, entryKey, data, vt); } } // Send the last chunk (the only chunk for individual and list keys) // always send it back, even if the list is of zero size. sendNewRegisterInterestResponseChunk(region, entryKey, values, true, servConn); }
replyVal = r.containsValueForKey(this.key); } else { replyVal = r.containsKey(this.key);