@Override public InternalDistributedSystem getInternalDistributedSystem() { return delegate.getInternalDistributedSystem(); }
@Override public InternalDistributedSystem getSystem() { return this.cache.getInternalDistributedSystem(); }
/** * Returns a set of all the members of the distributed system including locators. */ @SuppressWarnings("unchecked") public static Set<DistributedMember> getAllMembers(InternalCache cache) { return getAllMembers(cache.getInternalDistributedSystem()); }
/** return the argument, or if null the DistributedMember id of this vm */ private DistributedMember getMember(DistributedMember mbr) { if (mbr == null) { return this.cache.getInternalDistributedSystem().getDistributedMember(); } else { return null; } }
/** * Returns the member id of my distributed system * * @since GemFire 5.0 */ @Override public InternalDistributedMember getMyId() { return this.cache.getInternalDistributedSystem().getDistributedMember(); }
@Override public InternalDistributedSystem getSystem() { return getCache().getInternalDistributedSystem(); }
@Override public InternalDistributedSystem getSystem() { return this.partitionedRegion.getCache().getInternalDistributedSystem(); }
private void releaseUDPMessaging(boolean release) { if (release) { InternalDistributedSystem sys = cache.getInternalDistributedSystem(); if (sys != null) { sys.getDistributionManager().releaseUDPMessagingForCurrentThread(); } } }
public static long calculateNow(InternalCache cache) { if (cache != null) { // Use cache.cacheTimeMillis here. See bug 52267. InternalDistributedSystem ids = cache.getInternalDistributedSystem(); if (ids != null) { return ids.getClock().cacheTimeMillis(); } } return 0L; }
public PeerTypeRegistration(InternalCache cache) { this.cache = cache; int distributedSystemId = cache.getInternalDistributedSystem().getDistributionManager().getDistributedSystemId(); if (distributedSystemId == -1) { distributedSystemId = 0; } this.dsId = distributedSystemId << 24; this.maxTypeId = 0xFFFFFF; }
/** * Check to see if the current member is a loner and we can't tell if the user wants a peer or a * client type registry. * * @return true if this member is a loner and we can't determine what type of registry they want. */ static boolean isIndeterminateLoner(InternalCache cache) { boolean isLoner = cache.getInternalDistributedSystem().isLoner(); boolean pdxConfigured = cache.getPdxPersistent(); return isLoner && !pdxConfigured/* && !hasGateways */; }
@Override public long cacheTimeMillis() { return this.cache.getInternalDistributedSystem().getClock().cacheTimeMillis(); }
public void initDLockService() { InternalDistributedSystem ds = this.sender.getCache().getInternalDistributedSystem(); String dlsName = getDLockServiceName(); this.lockService = DistributedLockService.getServiceNamed(dlsName); if (this.lockService == null) { this.lockService = DLockService.create(dlsName, ds, true, true, true); } Assert.assertTrue(this.lockService != null); if (logger.isDebugEnabled()) { logger.debug("{}: Obtained DistributedLockService: {}", this, this.lockService); } }
/** * For bug #43690 we cannot use shared sockets when doing pdx type registration */ private boolean useUDPMessagingIfNecessary() { boolean result = false; InternalDistributedSystem sys = cache.getInternalDistributedSystem(); if (sys != null && !sys.threadOwnsResources()) { sys.getDistributionManager().forceUDPMessagingForCurrentThread(); result = true; } return result; }
public PersistentID getPersistentID() { InetAddress host = cache.getInternalDistributedSystem().getDistributedMember().getInetAddress(); String dir = getDiskDirs()[0].getAbsolutePath(); return new PersistentMemberPattern(host, dir, this.diskStoreID.toUUID(), 0); }
private static InternalDistributedMember getInternalDistributedMember(MemberVM memberVM) { return memberVM.getVM().invoke( () -> ClusterStartupRule.getCache().getInternalDistributedSystem().getDistributedMember()); }
@Before public void setUp() throws Exception { cache = mock(InternalCache.class); distributionManager = mock(DistributionManager.class); InternalDistributedSystem distributedSystem = mock(InternalDistributedSystem.class); InternalDistributedMember distributedMember = mock(InternalDistributedMember.class); when(cache.getDistributionManager()).thenReturn(distributionManager); when(distributedSystem.getDistributedMember()).thenReturn(distributedMember); when(cache.getInternalDistributedSystem()).thenReturn(distributedSystem); when(distributedMember.toString()).thenReturn("member"); when(distributionManager.addAllMembershipListenerAndGetAllIds(any())) .thenReturn(new HashSet<>(Arrays.asList(sender))); backupService = new BackupService(cache); }
@Override public VersionSource getVersionMember() { if (this.getDataPolicy().withPersistence()) { return getDiskStore().getDiskStoreID(); } else { return this.cache.getInternalDistributedSystem().getDistributedMember(); } }
public PersistentMemberID generatePersistentID(DiskRegionView dr) { File firstDir = getInfoFileDir().getDir(); InternalDistributedSystem ids = getCache().getInternalDistributedSystem(); InternalDistributedMember memberId = ids.getDistributionManager().getDistributionManagerId(); // NOTE - do NOT use DM.cacheTimeMillis here. See bug #49920 long timestamp = System.currentTimeMillis(); return new PersistentMemberID(getDiskStoreID(), memberId.getInetAddress(), firstDir.getAbsolutePath(), memberId.getName(), timestamp, (short) 0); }
private void checkAllowed(boolean hasGatewaySender, boolean hasPersistentRegion) { if (hasPersistentRegion && !cache.getPdxPersistent()) { throw new PdxInitializationException( "The PDX metadata must be persistent in a member that has persistent data. See CacheFactory.setPdxPersistent."); } int distributedSystemId = cache.getInternalDistributedSystem().getDistributionManager().getDistributedSystemId(); if (hasGatewaySender && distributedSystemId == -1) { throw new PdxInitializationException( "When using PDX with a WAN gateway sender, you must set the distributed-system-id gemfire property for your distributed system. See the javadocs for DistributedSystem."); } }