public ReliableCacheReplyProcessor(InternalDistributedSystem system, Collection initMembers, Set departedMembers) { super(system, initMembers); this.dm = system.getDistributionManager(); this.failedMembers = departedMembers; }
/** * Sends a message and does not wait for a response */ void sendAsync(DistributionMessage msg) { if (system != null) { system.getDistributionManager().putOutgoing(msg); } }
protected Set<?> invokeShutDownAllMembers( final InternalDistributedSystem ads, long timeout) throws Exception { return AdminDistributedSystemImpl.shutDownAllMembers( ads.getDistributionManager(), timeout); }
public void run() { InternalDistributedSystem ds = getSystem(); int retry = 100; while (retry-- > 0 && ds.getDistributionManager().getAdminMemberSet().size() > 0) { pause(100); } assertEquals(new HashSet(), ds.getDistributionManager().getOtherNormalDistributionManagerIds()); assertEquals(0, ds.getDistributionManager().getAdminMemberSet().size()); } };
public void compactAllDiskStores(String cmd, List<String> args) throws AdminException { InternalDistributedSystem ads = getAdminCnx(cmd, args); Map<DistributedMember, Set<PersistentID>> status = AdminDistributedSystemImpl .compactAllDiskStores(ads.getDistributionManager()); System.out.println("Compaction complete."); System.out.println("The following disk stores compacted some files:"); for (Set<PersistentID> memberStores : status.values()) { for (PersistentID store : memberStores) { System.out.println("\t" + store); } } }
public static void listMissingDiskStores() throws AdminException { InternalDistributedSystem ads = getAdminCnx(); Set s = AdminDistributedSystemImpl.getMissingPersistentMembers(ads.getDistributionManager()); if (s.isEmpty()) { System.out.println("The distributed system did not have any missing disk stores"); } else { for (Object o: s) { System.out.println(o); } } }
/** * Returns a set of all the members of the distributed system for the given groups. */ public static Set<DistributedMember> getDistributedMembersByGroup(Cache cache, String[] groups) { Set<DistributedMember> groupMembers = new HashSet<DistributedMember>(); for(String group : groups){ groupMembers.addAll(((InternalDistributedSystem)cache.getDistributedSystem()).getDistributionManager().getGroupMembers(group)); } return groupMembers; }
/** * Returns the current membership Set for this member. * @param cache * @return membership Set. */ public static Set getMembershipSet(GemFireCacheImpl cache) { return cache.getDistributedSystem().getDistributionManager() .getDistributionManagerIds(); }
public void run() { assertFalse(OutOfOffHeapMemoryDUnitTest.cache.get().isClosed()); assertTrue(OutOfOffHeapMemoryDUnitTest.system.get().isConnected()); int countMembersPlusLocator = count+2; // add one for locator int countOtherMembers = count-1; // subtract one for self assertEquals(countMembersPlusLocator, ((InternalDistributedSystem)OutOfOffHeapMemoryDUnitTest. system.get()).getDistributionManager().getDistributionManagerIds().size()); assertEquals(countOtherMembers, ((DistributedRegion)OutOfOffHeapMemoryDUnitTest. cache.get().getRegion(name)).getDistributionAdvisor().getNumProfiles()); } });
public boolean isPresent() { InternalDistributedSystem sys = InternalDistributedSystem.getAnyInstance(); if (sys == null) { throw new IllegalStateException(LocalizedStrings.InternalRole_ISPRESENT_REQUIRES_A_CONNECTION_TO_THE_DISTRIBUTED_SYSTEM.toLocalizedString()); } DM dm = sys.getDistributionManager(); return dm.isRolePresent(this); }
protected void deliverInterestChange(ClientProxyMembershipID proxyID, ClientInterestMessageImpl message) { DM dm = ((InternalDistributedSystem)this.getCache() .getDistributedSystem()).getDistributionManager(); ServerInterestRegistrationMessage.sendInterestChange(dm, proxyID, message); }
/** * Returns a modifiable set of all members that are part of Distributed * System including self and admin members. */ @SuppressWarnings("unchecked") public static Set<DistributedMember> getAllDSMembers() { Set<DistributedMember> members = new THashSet(Misc.getDistributedSystem() .getDistributionManager().getDistributionManagerIdsIncludingAdmin()); final DistributedMember myId = Misc.getMyId(); members.add(myId); return members; }
public void run() { DM dm = getSystem().getDistributionManager(); assertEquals("For DM " + dm.getId(), 3, dm.getOtherNormalDistributionManagerIds().size()); FirstMessage message = new FirstMessage(); dm.putOutgoing(message); } });
public Object call() throws Exception { InternalDistributedSystem ds = (InternalDistributedSystem) getCache().getDistributedSystem(); AdminDistributedSystemImpl.shutDownAllMembers(ds.getDistributionManager(), 600000); return null; } });
/** * Returns a modifiable set of all members that are part of Distributed * System including self and admin members. */ @SuppressWarnings("unchecked") public static Set<DistributedMember> getAllDSMembers() { Set<DistributedMember> members = new THashSet(Misc.getDistributedSystem() .getDistributionManager().getDistributionManagerIdsIncludingAdmin()); final DistributedMember myId = Misc.getMyId(); members.add(myId); return members; }
public static ReliableReplyProcessor21 send(Cache cache, int txUniqId,InternalDistributedMember onBehalfOfClientMember, DistributedMember recipient) { final InternalDistributedSystem system = (InternalDistributedSystem)cache.getDistributedSystem(); final Set recipients = Collections.singleton(recipient); ReliableReplyProcessor21 response = new ReliableReplyProcessor21(system, recipients); TXRemoteRollbackMessage msg = new TXRemoteRollbackMessage(txUniqId,onBehalfOfClientMember, response); msg.setRecipients(recipients); system.getDistributionManager().putOutgoing(msg); return response; }
private Execution getExecutionObject() { DistributedSystem ds = cache.getDistributedSystem(); InternalDistributedMember localVM = ((InternalDistributedSystem) ds) .getDistributionManager().getDistributionManagerId(); if (region == null) return FunctionService.onMembers(ds); else return FunctionService.onRegion(region); // TODO Add more types!!! }
public void _testGetDistributionManagerIds() { int systemCount = 0; for (int h = 0; h < Host.getHostCount(); h++) { Host host = Host.getHost(h); systemCount += host.getSystemCount(); } DM dm = getSystem().getDistributionManager(); systemCount += 1; assertEquals(systemCount, dm.getNormalDistributionManagerIds().size()); }
public PersistentMemberID generatePersistentID(DiskRegionView dr) { File firstDir = getInfoFileDir().getDir(); InternalDistributedSystem ids = getCache().getDistributedSystem(); InternalDistributedMember memberId = ids.getDistributionManager() .getDistributionManagerId(); //NOTE - do NOT use DM.cacheTimeMillis here. See bug #49920 long timestamp = System.currentTimeMillis(); PersistentMemberID id = new PersistentMemberID(getDiskStoreID(), memberId.getInetAddress(), firstDir.getAbsolutePath(), memberId.getName(), timestamp, (short) 0); return id; }
public static IdentityUpdateResponse send(Set recipients, InternalDistributedSystem is, int currentPRId) { Assert.assertTrue(recipients != null, "IdentityUpdateMessage NULL recipients set"); IdentityRequestMessage.setLatestId(currentPRId); // set local value IdentityUpdateResponse p = new IdentityUpdateResponse(is, recipients); IdentityUpdateMessage m = new IdentityUpdateMessage(recipients, p.getProcessorId(), currentPRId); is.getDistributionManager().putOutgoing(m); // set remote values return p; }