@Override public String toString() { return mbr.toString(); } });
@Override public String getId() { return toString(); }
@Override // GemStoneAddition public String toString() { // fix for 31198 String vmName = null; try { vmName = getName(); } catch (OperationCancelledException e) { // ignore and leave name equal to null } if (vmName == null || vmName.length() == 0) { return this.id.toString(); } return vmName; }
/** * Creates and registers the MBean to manage this resource */ private void initializeMBean(SystemMemberCacheImpl cache) throws AdminException { GemFireVM vm = cache.getVM(); this.mbeanName = new StringBuffer("GemFire.Cache:").append("name=") .append(MBeanUtil.makeCompliantMBeanNameProperty(cache.getName())).append(",id=") .append(this.getBridgeId()).append(",owner=") .append(MBeanUtil.makeCompliantMBeanNameProperty(vm.getId().toString())) .append(",type=CacheServer").toString(); this.objectName = MBeanUtil.createMBean(this); }
/** Create and register the MBean to manage this resource */ private void initializeMBean(SystemMemberCacheImpl cache) throws org.apache.geode.admin.AdminException { GemFireVM vm = cache.getVM(); this.mbeanName = new StringBuffer("GemFire.Cache:").append("path=") .append(MBeanUtil.makeCompliantMBeanNameProperty(getFullPath())).append(",name=") .append(MBeanUtil.makeCompliantMBeanNameProperty(cache.getName())).append(",id=") .append(cache.getId()).append(",owner=") .append(MBeanUtil.makeCompliantMBeanNameProperty(vm.getId().toString())) .append(",type=Region").toString(); this.objectName = MBeanUtil.createMBean(this); }
/** Create and register the MBean to manage this resource */ private void initializeMBean() throws org.apache.geode.admin.AdminException { this.mbeanName = new StringBuffer("GemFire.Cache:").append("name=") .append(MBeanUtil.makeCompliantMBeanNameProperty(getName())).append(",id=").append(getId()) .append(",owner=").append(MBeanUtil.makeCompliantMBeanNameProperty(vm.getId().toString())) .append(",type=Cache").toString(); this.objectName = MBeanUtil.createMBean(this, addDynamicAttributes(MBeanUtil.lookupManagedBean(this))); }
/** * Updates this SystemMember instance using the corresponding InternalDistributedMember * * @param member InternalDistributedMember instance to update this SystemMember * * @since GemFire 6.5 */ private void updateByInternalDistributedMember(InternalDistributedMember member) { if (member != null) { this.internalId = member; this.id = this.internalId.toString(); this.host = this.internalId.getHost(); this.name = this.internalId.getName(); if (this.name == null || DistributionConfig.DEFAULT_NAME.equals(this.name)) { /* * name could be null & referring to description of a fix for 32877 */ this.name = this.id; } } }
private String getMemberIdAsString() { String memberIdAsString = null; InternalDistributedMember idm = (InternalDistributedMember) getDistributedMember(); if (getClientVersion().compareTo(Version.GFE_90) < 0) { memberIdAsString = idm.toString(); } else { StringBuilder sb = new StringBuilder(); idm.addFixedToString(sb); memberIdAsString = sb.toString(); } return memberIdAsString; }
private void logSuspectRequests(SuspectMembersMessage incomingRequest, InternalDistributedMember sender) { for (SuspectRequest req : incomingRequest.getMembers()) { String who = sender.equals(localAddress) ? "myself" : sender.toString(); logger.info("received suspect message from {} for {}: {}", who, req.getSuspectMember(), req.getReason()); } }
PrepareBackup createPrepareBackup(InternalDistributedMember member, InternalCache cache, Properties properties) { String memberId = cleanSpecialCharacters(member.toString()); BackupWriter backupWriter = BackupWriterFactory.getFactoryForType(properties.getProperty(TYPE)) .createWriter(properties, memberId); return new PrepareBackup(member, cache, backupWriter); }
String senderId = getSender().toString(); addSenderInfo(t, senderId);
for (Member member : this.members.values()) { allBucketIds.addAll(member.getBuckets()); int memberIdLength = member.getDistributedMember().toString().length(); if (longestMemberId < memberIdLength) { longestMemberId = memberIdLength;
@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); }
protected ConfigurationResponse requestConfigurationFromOneLocator( InternalDistributedMember locator, Set<String> groups) { ConfigurationResponse configResponse = null; try { ResultCollector resultCollector = FunctionService.onMember(locator).setArguments(groups) .execute(GET_CLUSTER_CONFIG_FUNCTION); Object result = ((ArrayList) resultCollector.getResult()).get(0); if (result instanceof ConfigurationResponse) { configResponse = (ConfigurationResponse) result; configResponse.setMember(locator); } else { logger.error("Received invalid result from {}: {}", locator.toString(), result); if (result instanceof Throwable) { // log the stack trace. logger.error(result.toString(), result); } } } catch (FunctionException fex) { // Rethrow unless we're possibly reconnecting if (!(fex.getCause() instanceof LockServiceDestroyedException || fex.getCause() instanceof FunctionInvocationTargetException)) { throw fex; } } return configResponse; }
if (!pr.getRegionIdentifier().equals(regionId)) { logger.warn("{} is using PRID {} for {} but this process maps that PRID to {}", new Object[] {sender.toString(), prId, pr.getRegionIdentifier()});
/** * Read current {@link #DMid} and return it * * @return current DMid */ private static String getId() { synchronized (DmidMutex) { InternalDistributedSystem ids = InternalDistributedSystem.getAnyInstance(); if (ids == null) { throw new DistributedSystemDisconnectedException("No distributed system"); } if (ids == IdsForId) { return DMid; } IdsForId = ids; DistributionManager dm = ids.getDistributionManager(); DMid = dm.getId().toString(); return DMid; } }
/** * Sets the <code>GemFireVM</code> that underlies this <code>SystemMember</code>. This method is * used when a member, such as a cache server, is started by the admin API. */ void setGemFireVM(GemFireVM vm) throws AdminException { this.vm = vm; if (vm != null) { this.internalId = vm.getId(); this.id = this.internalId.toString(); this.name = vm.getName(); this.host = InetAddressUtil.toString(vm.getHost()); } else { this.internalId = null; this.id = null; // leave this.name set to what it is (how come?) this.host = this.getHost(); } if (DistributionConfig.DEFAULT_NAME.equals(this.name)) { // Fix bug 32877 this.name = this.id; } if (vm != null) { this.refreshConfig(); } }