public boolean done() { // getLogWriter().warning("checking member id " + system.getMemberId() + // " for member " + system.getDistributedMember() + " hash " + // System.identityHashCode(system.getDistributedMember())); return !system.getMemberId().contains("):0:"); }
public void run() { String myId = getSystem().getMemberId(); assertEquals(id[0], myId); } });
/** * Gets the ID of the member in the GemFire distributed system as determined and assigned by GemFire when the member * process joins the distributed system. Note, this call only works if the API is used in-process. * * @return a String value indicating the ID of the member in the GemFire distributed system. */ public String getMemberId() { final InternalDistributedSystem distributedSystem = InternalDistributedSystem.getConnectedInstance(); return (distributedSystem != null ? distributedSystem.getMemberId() : null); }
private static Object getSource() { Object source = SOURCE.get(); if(source == null) { source = InternalDistributedSystem.getAnyInstance().getMemberId(); } return source; }
/** * Gets the ID of the member in the GemFire distributed system as determined and assigned by GemFire when the member * process joins the distributed system. Note, this call only works if the API is used in-process. * * @return a String value indicating the ID of the member in the GemFire distributed system. */ public String getMemberId() { final InternalDistributedSystem distributedSystem = InternalDistributedSystem.getConnectedInstance(); return (distributedSystem != null ? distributedSystem.getMemberId() : null); }
private static Object getSource() { Object source = SOURCE.get(); if(source == null) { source = InternalDistributedSystem.getAnyInstance().getMemberId(); } return source; }
public void run() { String myId = getSystem().getMemberId(); assertEquals(id[0], myId); } });
private static Object getDest() { return InternalDistributedSystem.getAnyInstance().getMemberId(); }
private static Object getDest() { return InternalDistributedSystem.getAnyInstance().getMemberId(); }
private static String getServerMessage(String msg) { // To fix bug 44679 add a description of the member the server is on. // Do this without changing how this class gets serialized so that old // clients will still work. InternalDistributedSystem ids = InternalDistributedSystem.getAnyInstance(); if (ids != null) { if (msg != null) { return "remote server on " + ids.getMemberId() + ": " + msg; } else { return "remote server on " + ids.getMemberId(); } } else { if (msg != null) { return "remote server on unknown location: " + msg; } else { return "remote server on unknown location"; } } }
public SessionsVTI.SessionInfo getSessionInfo() { final SessionsVTI.SessionInfo info = new SessionsVTI.SessionInfo(); StringBuilder sb = new StringBuilder(); sb.append("InitialLoad=").append(this.initialLoad) .append(SanityManager.lineSeparator); sb.append("CurrentLoad=").append(this.probe.getLoad(this)) .append(SanityManager.lineSeparator); info.memberid = getSystem().getMemberId(); info.hostname = getHostName(); info.serverListeningPort = getPort(); info.networkInterfaceInfo = sb.toString(); fillServerSessionInfo(info); return info; }
@Override protected void execute() throws Exception { GemFireCacheImpl gemFireCache = GemFireCacheImpl.getExisting(); InternalDistributedSystem ids = gemFireCache.getDistributedSystem(); String memberId = ids.getMemberId(); Map logDetailsMap = new HashMap(); logDetailsMap.put("id", memberId); logDetailsMap.put("name", ids.getName()); logDetailsMap.put("userDir", this.logDirectory); logDetailsMap.put("logFile", this.logFileName); logDetailsMap.put("logData", LogFileUtils.getLog(this.logDirectory, this.logFileName, this.offset, this.byteLength)); lastResult(logDetailsMap); }
public SessionsVTI.SessionInfo getSessionInfo() { final SessionsVTI.SessionInfo info = new SessionsVTI.SessionInfo(); StringBuilder sb = new StringBuilder(); sb.append("InitialLoad=").append(this.initialLoad) .append(SanityManager.lineSeparator); sb.append("CurrentLoad=").append(this.probe.getLoad(this)) .append(SanityManager.lineSeparator); info.memberid = getSystem().getMemberId(); info.hostname = getHostName(); info.serverListeningPort = getPort(); info.networkInterfaceInfo = sb.toString(); fillServerSessionInfo(info); return info; }
protected static String getMemberId() { final InternalDistributedSystem system = InternalDistributedSystem.getAnyInstance(); WaitCriterion w = new WaitCriterion() { public String description() { return "bridge never finished connecting"; } public boolean done() { // getLogWriter().warning("checking member id " + system.getMemberId() + // " for member " + system.getDistributedMember() + " hash " + // System.identityHashCode(system.getDistributedMember())); return !system.getMemberId().contains("):0:"); } }; int waitMillis = 5000; int interval = 100; boolean throwException = true; waitForCriterion(w, waitMillis, interval, throwException); return system.getMemberId(); }
public void execute(FunctionContext context) { Log.getLogWriter().info("Invoking execute in Inline function"); String memberID = ((InternalDistributedSystem)InternalDistributedSystem .getAnyInstance()).getMemberId(); ArrayList list = new ArrayList(); list.add(memberID); context.getResultSender().sendResult(list); list.clear(); context.getResultSender().lastResult(list);// Send an empty list }
public void execute(FunctionContext context) { Log.getLogWriter().info("Invoking execute in Inline function"); String memberID = ((InternalDistributedSystem)InternalDistributedSystem .getAnyInstance()).getMemberId(); ArrayList list = new ArrayList(); list.add(memberID); context.getResultSender().sendResult(list); list.clear(); context.getResultSender().lastResult(list);// Send an empty list }
public void execute(FunctionContext context) { ArrayList<String> list = new ArrayList<String>(); RegionFunctionContext prContext = (RegionFunctionContext)context; LocalDataSet localDataSet = (LocalDataSet)PartitionRegionHelper .getLocalDataForContext(prContext); PartitionedRegion pr = (PartitionedRegion)prContext.getDataSet(); String localNodeId = InternalDistributedSystem.getAnyInstance() .getMemberId(); Set localBucketSet = localDataSet.getBucketSet(); List primaryBucketList = pr.getLocalPrimaryBucketsListTestOnly(); if (primaryBucketList.containsAll(localBucketSet)) { // hydra.Log.getLogWriter().info("localBucketSet is "+localBucketSet+ " // primaryBucketList is "+primaryBucketList); list.add(localNodeId); } else { throw new TestException( "Function execution with optimizeForWrite as true operated on buckets " + localBucketSet + " but primary buckets on this node are " + primaryBucketList); } prContext.getResultSender().lastResult(list); }
public SessionsVTI.SessionInfo getSessionInfo() { final SessionsVTI.SessionInfo info = new SessionsVTI.SessionInfo(); String infoString = "InitialLoad=" + this.initialLoad + SanityManager.lineSeparator + "CurrentLoad=" + this.probe.getLoad(this) + SanityManager.lineSeparator; info.memberid = getSystem().getMemberId(); info.hostname = getHostName(); info.serverListeningPort = getPort(); info.networkInterfaceInfo = infoString; fillServerSessionInfo(info); return info; }
protected void initializeDistributedSystem(DistributedSystem distributedSystem) { InternalDistributedSystem ids = (InternalDistributedSystem) distributedSystem; setMemberId(ids.getMemberId()); DistributionConfig config = ids.getConfig(); setMemberName(config.getName()); setMcastPort(config.getMcastPort()); setMcastAddress(config.getMcastAddress()); String bindAddress = config.getBindAddress(); setBindAddress(bindAddress); setLocators(config.getLocators()); setUpTime(System.currentTimeMillis() - ids.getStartTime()); try { setHostAddress((bindAddress != null && bindAddress.length() > 0) ? InetAddress.getByName(bindAddress) : SocketCreator.getLocalHost()); } catch (IOException e) {/*ignore - leave null host address*/} }
protected void initializeDistributedSystem(DistributedSystem distributedSystem) { InternalDistributedSystem ids = (InternalDistributedSystem) distributedSystem; setMemberId(ids.getMemberId()); DistributionConfig config = ids.getConfig(); setMemberName(config.getName()); setMcastPort(config.getMcastPort()); setMcastAddress(config.getMcastAddress()); String bindAddress = config.getBindAddress(); setBindAddress(bindAddress); setLocators(config.getLocators()); setUpTime(System.currentTimeMillis() - ids.getStartTime()); try { setHostAddress((bindAddress != null && bindAddress.length() > 0) ? InetAddress.getByName(bindAddress) : SocketCreator.getLocalHost()); } catch (IOException e) {/*ignore - leave null host address*/} }