@Override public String getNameForStats() { return getFullPath(); }
private static String calcFullPath(String regionName, LocalRegion parentRegion) { StringBuilder buf = null; if (parentRegion == null) { buf = new StringBuilder(regionName.length() + 1); } else { String parentFull = parentRegion.getFullPath(); buf = new StringBuilder(parentFull.length() + regionName.length() + 1); buf.append(parentFull); } buf.append(SEPARATOR).append(regionName); return buf.toString(); }
private ClientTombstoneMessage(TOperation op, LocalRegion region, Object removalInformation, EventID eventId) { super(EnumListenerEvent.AFTER_TOMBSTONE_EXPIRATION, null, eventId); this.op = op; this.removalInformation = removalInformation; setRegionName(region.getFullPath()); // fix for bug #45962 - tombstone message must have the // region name }
void releaseBeforeGetInitialImageLatch() { if (logger.isDebugEnabled()) { logger.debug("Releasing Initialization Latch (before initial image) for {}", getFullPath()); } releaseLatch(this.getInitializationLatchBeforeGetInitialImage()); }
void releaseAfterGetInitialImageLatch() { if (logger.isDebugEnabled()) { logger.debug("Releasing Initialization Latch (after initial image) for {}", getFullPath()); } releaseLatch(this.getInitializationLatchAfterGetInitialImage()); }
/** * Populate the indexes with region entries */ private void populateOQLIndexes(Set<Index> indexes) { logger.info("Loading data into the indexes"); try { this.indexManager.populateIndexes(indexes); } catch (MultiIndexCreationException ex) { logger.info("Failed to update index on region {}: {}", this.getFullPath(), ex.getMessage()); } }
public void processStopCq(String serverCqName) { ServerCQ cq = (ServerCQ) this.cqs.get(serverCqName); if (cq != null) { try { cq.stop(); } catch (Exception ex) { if (logger.isDebugEnabled()) { logger.debug( "Unable to stop the CQ with the filterProfile, on region {} for CQ {}, Error : {}", this.region.getFullPath(), serverCqName, ex.getMessage(), ex); } } } }
private static String getGraphNameFromOwner(Object owner, Object key) { String ownerName; if (owner instanceof LocalRegion) { ownerName = ((LocalRegion) owner).getFullPath(); } else if (owner instanceof PlaceHolderDiskRegion) { ownerName = ((PlaceHolderDiskRegion) owner).getName(); } else { ownerName = owner.toString(); } return getGraphName(ownerName, key); }
/** must be holding destroy lock */ void reinitialize_destroy(RegionEventImpl event) throws CacheWriterException, TimeoutException { final boolean cacheWrite = !event.originRemote; // register this region as reinitializing this.cache.regionReinitializing(getFullPath()); basicDestroyRegion(event, cacheWrite, false/* lock */, true); }
@Override public String toString() { return "region=" + this.region.getFullPath() + ", key=" + getKey() + " value=" + getValue(); }
private void sendProfileOperation(Long clientID, operationType opType, Object interest, boolean updatesAsInvalidates) { if (this.region == null || !(this.region instanceof PartitionedRegion)) { return; } OperationMessage msg = new OperationMessage(); msg.regionName = this.region.getFullPath(); msg.clientID = clientID; msg.opType = opType; msg.interest = interest; msg.updatesAsInvalidates = updatesAsInvalidates; sendFilterProfileOperation(msg); }
@Override public CacheStatistics getStatistics() { LocalRegion lr = this.region; if (!lr.statisticsEnabled) { throw new StatisticsDisabledException( String.format("Statistics disabled for region '%s'", lr.getFullPath())); } return new CacheStatisticsImpl(getCheckedRegionEntry(), lr); }
@Override public CacheStatistics getStatistics() throws StatisticsDisabledException { checkEntryDestroyed(); if (!regionEntry.hasStats() || !region.statisticsEnabled) { throw new StatisticsDisabledException( String.format("Statistics disabled for region ' %s '", region.getFullPath())); } return new CacheStatisticsImpl(this.regionEntry, region); }
@Override public void invalidate(EntryEventImpl event) { recordTXOperation(ServerRegionOperation.INVALIDATE, event.getKey(), event); InvalidateOp.execute(this.pool, this.region.getFullPath(), event); }
@Override public CacheStatistics getStatistics() { // prefer entry destroyed exception over statistics disabled exception basicGetEntry(); if (!LocalRegion.this.statisticsEnabled) { throw new StatisticsDisabledException( String.format("Statistics disabled for region '%s'", getFullPath())); } return new CacheStatisticsImpl(this.basicGetEntry(), LocalRegion.this); }
public GetEntryOpImpl(LocalRegion region, Object key) { super(MessageType.GET_ENTRY, 2); this.region = region; this.key = key; getMessage().addStringPart(region.getFullPath()); getMessage().addStringOrObjPart(key); }
@Test public void testExecuteWithRegions() throws Exception { when(cache.rootRegions()).thenReturn(regions); when(region.getFullPath()).thenReturn("/MyRegion"); when(region.getParentRegion()).thenReturn(null); when(region.subregions(true)).thenReturn(subregions); when(region.subregions(false)).thenReturn(subregions); when(region.getAttributes()).thenReturn(regionAttributes); when(regionAttributes.getDataPolicy()).thenReturn(mock(DataPolicy.class)); when(regionAttributes.getScope()).thenReturn(mock(Scope.class)); regions.add(region); getRegionsFunction.execute(functionContext); }
@Override protected boolean operateOnRegion(ClusterDistributionManager dm, LocalRegion r, long startTime) throws CacheException, RemoteOperationException { if (logger.isTraceEnabled(LogMarker.DM_VERBOSE)) { logger.trace(LogMarker.DM_VERBOSE, "RemoteClearMessage operateOnRegion: {}", r.getFullPath()); } r.waitOnInitialization(); // bug #43371 - accessing a region before it's initialized r.clear(); RemoteClearReplyMessage.send(getSender(), getProcessorId(), getReplySender(dm)); // Unless there was an exception thrown, this message handles sending the response return false; }
/** * @return the response */ public static FetchKeysResponse send(LocalRegion currRegion, DistributedMember target) { FetchKeysResponse response = new FetchKeysResponse(currRegion.getSystem(), (InternalDistributedMember) target); RemoteFetchKeysMessage msg = new RemoteFetchKeysMessage((InternalDistributedMember) target, currRegion.getFullPath(), response); currRegion.getSystem().getDistributionManager().putOutgoing(msg); return response; }
void initialize(LocalRegion theRegion, Object theKey, Object theCallbackArg) { this.region = theRegion; this.regionName = theRegion.getFullPath(); this.key = theKey; this.aCallbackArgument = theCallbackArg; RegionAttributes attrs = theRegion.getAttributes(); Scope scope = attrs.getScope(); if (scope.isDistributed()) { this.advisor = ((CacheDistributionAdvisee) this.region).getCacheDistributionAdvisor(); this.distributionManager = theRegion.getDistributionManager(); this.timeout = getSearchTimeout(); this.advisor.addMembershipListener(this); } }