@Override public void visit(Integer bucketId, Region buk) { try { LocalRegion lbuk = (LocalRegion) buk; lbuk.waitForData(); int size = lbuk.size(); int keySetSize = (new HashSet(lbuk.keySet())).size(); if (size != keySetSize) { if (logger.isDebugEnabled()) { logger.debug( "Size is not consistent with keySet size! size={} but keySet size={} region={}", size, keySetSize, lbuk); } } lbuk.dumpBackingMap(); } catch (CacheRuntimeException ignore) { } } });
@Override protected boolean operateOnRegion(ClusterDistributionManager dm, LocalRegion r, long startTime) throws RemoteOperationException { if (!(r instanceof PartitionedRegion)) { // prs already wait on initialization r.waitOnInitialization(); // bug #43371 - accessing a region before it's initialized } Set<?> keys = r.keySet(); try { RemoteFetchKeysReplyMessage.send(getSender(), processorId, dm, keys); } catch (IOException io) { if (logger.isDebugEnabled()) { logger.debug("Caught exception while sending keys: {}", io.getMessage(), io); throw new RemoteOperationException( "Unable to send response to fetch keys request", io); } } return false; }
/** * Process an interest request of type ALL_KEYS * * @param region the region * @param policy the policy */ private static void handleAllKeys(LocalRegion region, InterestResultPolicy policy, ServerConnection servConn) throws IOException { List keyList = new ArrayList(MAXIMUM_CHUNK_SIZE); if (region != null) { for (Object entryKey : region.keySet(sendTombstonesInRIResults(servConn, policy))) { appendInterestResponseKey(region, "ALL_KEYS", entryKey, keyList, 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, "ALL_KEYS", keyList, true, servConn); }
/** * Process an interest request of type {@link InterestType#REGULAR_EXPRESSION} */ private static void handleRegEx(LocalRegion region, String regex, InterestResultPolicy policy, ServerConnection servConn) throws IOException { if (region instanceof PartitionedRegion) { // too bad java doesn't provide another way to do this... handleRegExPR((PartitionedRegion) region, regex, policy, servConn); return; } List keyList = new ArrayList(MAXIMUM_CHUNK_SIZE); // Handle the regex pattern if (region != null) { Pattern keyPattern = Pattern.compile(regex); for (Object entryKey : region.keySet(sendTombstonesInRIResults(servConn, policy))) { if (!(entryKey instanceof String)) { // key is not a String, cannot apply regex to this entry continue; } if (!keyPattern.matcher((String) entryKey).matches()) { // key does not match the regex, this entry should not be returned. continue; } appendInterestResponseKey(region, regex, entryKey, keyList, 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, regex, keyList, true, servConn); }
for (Object key : region.keySet(true)) { VersionTagHolder versionHolder = createVersionTagHolder(); if (keyPattern != null) {
/** * @param rgnEvent the RegionEvent for region invalidation */ protected void invalidateAllEntries(RegionEvent rgnEvent) { Operation operation = Operation.LOCAL_INVALIDATE; if (rgnEvent.getOperation().isDistributed()) { operation = Operation.INVALIDATE; } // if this is a local invalidation, then set local invalid flag on event // so LOCAL_INVALID tokens is used (even though each individual entry // invalidation is not distributed). // region operation so it is ok to ignore tx state for (Object keyObject : keySet()) { try { // EventID will not be generated by this constructor @Released EntryEventImpl event = EntryEventImpl.create(this, operation, keyObject, null, null, rgnEvent.isOriginRemote(), rgnEvent.getDistributedMember()); try { event.setLocalInvalid(!rgnEvent.getOperation().isDistributed()); basicInvalidate(event, false); } finally { event.release(); } } catch (EntryNotFoundException ignore) { // ignore } } }