public void quorumLost(Set<InternalDistributedMember> failures, List<InternalDistributedMember> remaining) { for (ProxyListener listener : proxyListeners) { listener.quorumLost(system.getDistributionManager(), failures, remaining); } }
/** * Sends a message and does not wait for a response. * * <p> * Actually, it's the message implementation that determines if it's sync or async, not this call. */ private void sendAsync(DistributionMessage msg) { if (system != null) { system.getDistributionManager().putOutgoing(msg); } }
public void memberDeparted(InternalDistributedMember id, boolean crashed) { for (ProxyListener listener : proxyListeners) { listener.memberDeparted(system.getDistributionManager(), id, crashed); } }
/** * Sends a message and does not wait for a response */ void sendAsync(DistributionMessage msg) { if (system != null) { system.getDistributionManager().putOutgoing(msg); } }
public static void compactAllDiskStores(List args) throws AdminException { InternalDistributedSystem ads = getAdminCnx(); 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); } } }
@Override public boolean isPresent() { InternalDistributedSystem sys = InternalDistributedSystem.getAnyInstance(); if (sys == null) { throw new IllegalStateException( "isPresent requires a connection to the distributed system."); } DistributionManager dm = sys.getDistributionManager(); return dm.isRolePresent(this); }
@Override public int getCount() { InternalDistributedSystem sys = InternalDistributedSystem.getAnyInstance(); if (sys == null) { throw new IllegalStateException( "getCount requires a connection to the distributed system."); } DistributionManager dm = sys.getDistributionManager(); return dm.getRoleCount(this); }
public HighPriorityAckedMessage() { super(); InternalDistributedSystem ds = InternalDistributedSystem.getAnyInstance(); if (ds != null) { this.originDm = (ClusterDistributionManager) ds.getDistributionManager(); } if (this.originDm != null) { this.id = this.originDm.getDistributionManagerId(); } }
@Override public void cacheCreated(InternalCache cache) { InternalDistributedSystem system = (InternalDistributedSystem) cache.getDistributedSystem(); DistributionManager dm = system.getDistributionManager(); initialize(cache, dm); }
/** * If we are connected to a distributed system, send a message to other members telling them about * a newly-registered serializer. */ private static void sendRegistrationMessage(DataSerializer s) { InternalDistributedSystem system = InternalDistributedSystem.getConnectedInstance(); if (system != null) { RegistrationMessage m = new RegistrationMessage(s); system.getDistributionManager().putOutgoing(m); } }
protected void deliverInterestChange(ClientProxyMembershipID proxyID, ClientInterestMessageImpl message) { DistributionManager dm = ((InternalDistributedSystem) this.getCache().getDistributedSystem()) .getDistributionManager(); ServerInterestRegistrationMessage.sendInterestChange(dm, proxyID, message); }
public static RemoteCommitResponse send(Cache cache, int txUniqId, InternalDistributedMember onBehalfOfClientMember, DistributedMember recipient) { final InternalDistributedSystem system = (InternalDistributedSystem) cache.getDistributedSystem(); final Set<DistributedMember> recipients = Collections.singleton(recipient); RemoteCommitResponse p = new RemoteCommitResponse(system, recipients); TXMessage msg = new TXRemoteCommitMessage(txUniqId, onBehalfOfClientMember, p); msg.setRecipients(recipients); system.getDistributionManager().putOutgoing(msg); return p; }
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; }
@Before public void setUp() throws Exception { when(ids.getLogWriter()).thenReturn(lw); when(ids.getDistributionManager()).thenReturn(dm); }
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); }
@Test public void waitForRemoteResponseWithMemberDepartedThrowsException() throws Exception { doNothing().when(replyProcessor).waitForRepliesUninterruptibly(); replyProcessor.memberDeparted(system.getDistributionManager(), recipient, false); assertThatThrownBy(() -> replyProcessor.waitForRemoteResponse()) .isInstanceOf(RemoteOperationException.class).hasMessageContaining("memberDeparted event"); verify(replyProcessor, times(1)).waitForRepliesUninterruptibly(); }
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; }
/** * @return the response */ public static FetchKeysResponse send(LocalRegion currRegion, DistributedMember target) { FetchKeysResponse response = new FetchKeysResponse(currRegion.getSystem(), (InternalDistributedMember) target); RemoteFetchKeysMessage msg = new RemoteFetchKeysMessage((InternalDistributedMember) target, currRegion.getFullPath(), response); currRegion.getSystem().getDistributionManager().putOutgoing(msg); return response; }
@Test public void whenMemberDepartedThatWeAreWaitingForExceptionIsSet() { replyProcessor.memberDeparted(system.getDistributionManager(), recipient, false); assertThat(replyProcessor.getMemberDepartedException()) .hasMessageContaining("memberDeparted event"); }