InitialImageOperation { protected static LocalRegion getGIIRegion(final ClusterDistributionManager dm, final String regionPath, final boolean targetReinitialized) { final boolean isDebugEnabled = logger.isDebugEnabled(); LocalRegion lclRgn = null; final InitializationLevel initLevel = targetReinitialized ? AFTER_INITIAL_IMAGE : ANY_INIT; final InitializationLevel oldLevel = LocalRegion.setThreadInitLevelRequirement(initLevel); try { if (isDebugEnabled) { logger.debug("RequestImageMessage: attempting to get region reference for {}, initLevel={}", regionPath, initLevel); } InternalCache cache = dm.getExistingCache(); lclRgn = cache == null ? null : (LocalRegion) cache.getRegion(regionPath); if (lclRgn != null && !lclRgn.isUsedForPartitionedRegionBucket() && targetReinitialized && !lclRgn.reinitialized_new()) { lclRgn = null; if (isDebugEnabled) { logger.debug( "GII message process: Found region, but wasn't reinitialized, so assuming region destroyed and recreated"); } } } finally { LocalRegion.setThreadInitLevelRequirement(oldLevel); } if (lclRgn == null || !lclRgn.isInitialized()) { if (isDebugEnabled) { logger.debug("{}, nothing to do", (lclRgn == null ? "region not found" : "region not initialized yet")); } return null; } if (lclRgn.getScope().isLocal()) { if (isDebugEnabled) { logger.debug("local scope region, nothing to do"); } return null; } return lclRgn; } InitialImageOperation(DistributedRegion region, RegionMap entries); static void setInhibitStateFlush(boolean inhibitIt); void synchronizeWith(InternalDistributedMember target, VersionSource lostMemberVersionID,
      InternalDistributedMember lostMember); static void beforeGetInitialImage(DistributedRegion region); static GIITestHook getGIITestHookForCheckingPurpose(final GIITestHookType type); static void setGIITestHook(final GIITestHook callback); static void resetGIITestHook(final GIITestHookType type, final boolean setNull); static void resetAllGIITestHooks(); @MutableForTesting
  static volatile boolean abortTest; @MutableForTesting
  static int CHUNK_SIZE_IN_BYTES; @MutableForTesting
  static int CHUNK_PERMITS; @MutableForTesting
  static int MAXIMUM_UNFINISHED_OPERATIONS; @MutableForTesting
  static final int MAX_PARALLEL_GIIS; @MutableForTesting
  static volatile int slowImageProcessing; @MutableForTesting
  static volatile int slowImageSleeps; @MutableForTesting
  static boolean VMOTION_DURING_GII; static final boolean TRACE_GII; @MutableForTesting
  static boolean FORCE_FULL_GII; }
@Test public void getsRegionFromCacheFromDM() { LocalRegion value = InitialImageOperation.getGIIRegion(dm, path, false); assertThat(value).isSameAs(region); }