logger.debug("Recipients for SerialAckedMessage are {}", recipients); rp = new ReplyProcessor21(originDm, recipients); processorId = rp.getProcessorId(); setRecipients(recipients);
/** * Send a profile update to a set of members. * * @param recipients the set of members to be notified * @param dm the distribution manager used to send the message * @param prId the unique partitioned region identifier * @param bucketId the unique bucket identifier * @param bp the updated bucket profile to send * @param requireAck whether or not to expect a reply * @return an instance of reply processor if requireAck is true on which the caller can wait until * the event has finished. */ public static ReplyProcessor21 send(Set recipients, DistributionManager dm, int prId, int bucketId, BucketProfile bp, boolean requireAck) { if (recipients.isEmpty()) { return null; } ReplyProcessor21 rp = null; int procId = 0; if (requireAck) { rp = new ReplyProcessor21(dm, recipients); procId = rp.getProcessorId(); } BucketProfileUpdateMessage m = new BucketProfileUpdateMessage(recipients, prId, procId, bucketId, bp); dm.putOutgoing(m); return rp; }
/** * Send a profile update to a set of members. * * @param recipients the set of members to be notified * @param dm the distribution manager used to send the message * @param prId the unique partitioned region identifier * @param profiles bucked id to profile map * @return an instance of reply processor if requireAck is true on which the caller can wait until * the event has finished. */ public static ReplyProcessor21 send(Set recipients, DistributionManager dm, int prId, Map<Integer, BucketAdvisor.BucketProfile> profiles) { if (recipients.isEmpty()) { return null; } ReplyProcessor21 rp = null; int procId = 0; rp = new ReplyProcessor21(dm, recipients); procId = rp.getProcessorId(); AllBucketProfilesUpdateMessage m = new AllBucketProfilesUpdateMessage(recipients, prId, procId, profiles); dm.putOutgoing(m); return rp; }
private void sendAddCacheServerProfileMessage() { Set otherMembers = this.dm.getOtherDistributionManagerIds(); AddCacheServerProfileMessage message = new AddCacheServerProfileMessage(); message.operateOnLocalCache(this); if (!otherMembers.isEmpty()) { if (logger.isDebugEnabled()) { logger.debug("Sending add cache server profile message to other members."); } ReplyProcessor21 replyProcessor = new ReplyProcessor21(this.dm, otherMembers); message.setRecipients(otherMembers); message.processorId = replyProcessor.getProcessorId(); this.dm.putOutgoing(message); // Wait for replies. try { replyProcessor.waitForReplies(); } catch (InterruptedException ignore) { Thread.currentThread().interrupt(); } } }
/** * send the message and wait for replies * * @param recipients the destination manager ids * @param multicast whether to use multicast or unicast * @throws InterruptedException if the operation is interrupted (as by shutdown) * @throws ReplyException if an exception was sent back by another manager */ public void send(Set recipients, boolean multicast) throws InterruptedException, ReplyException { if (Thread.interrupted()) { throw new InterruptedException(); } this.op = operationType.DRAIN_POOL; Set recips = new HashSet(recipients); DistributedMember me = originDm.getDistributionManagerId(); if (recips.contains(me)) { recips.remove(me); } rp = new ReplyProcessor21(originDm, recips); processorId = rp.getProcessorId(); setRecipients(recips); setMulticast(multicast); originDm.putOutgoing(this); rp.waitForReplies(); }
static void sendInterestChange(DistributionManager dm, ClientProxyMembershipID clientId, ClientInterestMessageImpl clientInterestMessage) { ServerInterestRegistrationMessage registrationMessage = new ServerInterestRegistrationMessage(clientId, clientInterestMessage); Set recipients = dm.getOtherDistributionManagerIds(); registrationMessage.setRecipients(recipients); ReplyProcessor21 replyProcessor = new ReplyProcessor21(dm, recipients); registrationMessage.processorId = replyProcessor.getProcessorId(); dm.putOutgoing(registrationMessage); try { replyProcessor.waitForReplies(); } catch (InterruptedException ignore) { Thread.currentThread().interrupt(); } }
private void sendRemoveCacheServerProfileMessage() { Set otherMembers = this.dm.getOtherDistributionManagerIds(); RemoveCacheServerProfileMessage message = new RemoveCacheServerProfileMessage(); message.operateOnLocalCache(this); // Remove this while loop when we release GEODE 2.0 // This block prevents sending a message to old members that do not know about // the RemoveCacheServerProfileMessage Iterator memberIterator = otherMembers.iterator(); while (memberIterator.hasNext()) { InternalDistributedMember member = (InternalDistributedMember) memberIterator.next(); if (Version.GEODE_150.compareTo(member.getVersionObject()) > 0) { memberIterator.remove(); } } if (!otherMembers.isEmpty()) { if (logger.isDebugEnabled()) { logger.debug("Sending remove cache server profile message to other members."); } ReplyProcessor21 replyProcessor = new ReplyProcessor21(this.dm, otherMembers); message.setRecipients(otherMembers); message.processorId = replyProcessor.getProcessorId(); this.dm.putOutgoing(message); // Wait for replies. try { replyProcessor.waitForReplies(); } catch (InterruptedException ignore) { Thread.currentThread().interrupt(); } } }
+ recipients); ReplyProcessor21 processor = new ReplyProcessor21(dm, recipients); DestroyLuceneIndexMessage message = new DestroyLuceneIndexMessage(recipients, processor.getProcessorId(), regionPath, indexName);
private void sendFilterProfileOperation(OperationMessage msg) { Set recipients = ((DistributionAdvisee) this.region).getDistributionAdvisor().adviseProfileUpdate(); msg.setRecipients(recipients); ReplyProcessor21 rp = new ReplyProcessor21(this.region.getDistributionManager(), recipients); msg.processorId = rp.getProcessorId(); this.region.getDistributionManager().putOutgoing(msg); try { rp.waitForReplies(); } catch (InterruptedException ignore) { Thread.currentThread().interrupt(); } }
public static void send(Set<InternalDistributedMember> recipients, DistributionManager dm, String regionPath) throws ReplyException { ReplyProcessor21 processor = new ReplyProcessor21(dm, recipients); MembershipFlushRequest msg = new MembershipFlushRequest(regionPath, processor.getProcessorId()); msg.setRecipients(recipients); dm.putOutgoing(msg); processor.waitForRepliesUninterruptibly(); }
public static void send(Set<InternalDistributedMember> members, DistributionManager dm, String regionPath) throws ReplyException { ReplyProcessor21 processor = new ReplyProcessor21(dm, members); ReleaseClearLockMessage msg = new ReleaseClearLockMessage(regionPath, processor.getProcessorId()); msg.setRecipients(members); dm.putOutgoing(msg); processor.waitForRepliesUninterruptibly(); }
public static void send(Set<InternalDistributedMember> members, DistributionManager dm, String regionPath, PersistentMemberID oldId, PersistentMemberID newId) throws ReplyException { ReplyProcessor21 processor = new ReplyProcessor21(dm, members); PrepareNewPersistentMemberMessage msg = new PrepareNewPersistentMemberMessage(regionPath, oldId, newId, processor.getProcessorId()); msg.setRecipients(members); dm.putOutgoing(msg); processor.waitForRepliesUninterruptibly(); }
public static void send(Set<InternalDistributedMember> members, DistributionManager dm, String regionPath, PersistentMemberID id, PersistentMemberID initializingId) throws ReplyException { if (id == null && initializingId == null) { // no need to do anything return; } ReplyProcessor21 processor = new ReplyProcessor21(dm, members); RemovePersistentMemberMessage msg = new RemovePersistentMemberMessage(regionPath, id, initializingId, processor.getProcessorId()); msg.setRecipients(members); dm.putOutgoing(msg); processor.waitForRepliesUninterruptibly(); }
/** * Send this message to the bucket primary, after the * {@link ReplyProcessor21#waitForRepliesUninterruptibly()} returns, all updates from the primary * should be complete. Use this from a host of a backup bucket (aka secondary) when the update * operations originating from the primary {@link Scope#DISTRIBUTED_NO_ACK do not require an * acknowldgement} * * @return a processor on which to wait for the flush operation to complete */ public static ReplyProcessor21 send(InternalDistributedMember primary, PartitionedRegion p, int bucketId) { ReplyProcessor21 reply = new ReplyProcessor21(p.getDistributionManager(), primary); FlushMessage fm = new FlushMessage(p.getPRId(), bucketId, reply.getProcessorId(), primary); p.getDistributionManager().putOutgoing(fm); return reply; }
public static void send(ClusterDistributionManager dm) throws InterruptedException { long viewId = dm.getMembershipManager().getView().getViewId(); ReplyProcessor21 rp = new ReplyProcessor21(dm, dm.getOtherDistributionManagerIds()); rp.enableSevereAlertProcessing(); dm.putOutgoing(new WaitForViewInstallation(viewId, rp.getProcessorId())); try { rp.waitForReplies(); } catch (ReplyException e) { if (e.getCause() != null && !(e.getCause() instanceof CancelException)) { if (logger.isDebugEnabled()) { logger.debug("Reply to WaitForViewInstallation received odd exception", e.getCause()); } } } // this isn't necessary for TXFailoverCommand, which is the only use of this // message right now. TXFailoverCommand performs messaging to all servers, // which will force us to wait for the view containing the crash of another // server to be processed. // dm.waitForViewInstallation(viewId); }
gr.requestingMember = dm.getDistributionManagerId(); gr.setRecipient(target); ReplyProcessor21 processor = new ReplyProcessor21(dm, target); gr.processorId = processor.getProcessorId(); gr.channelState = dm.getMembershipManager().getMessageState(target, false);
public static ReplyProcessor21 send(Set recipients, PartitionedRegion r, RegionEventImpl event) { ReplyProcessor21 response = new ReplyProcessor21(r.getSystem(), recipients); InvalidatePartitionedRegionMessage msg = new InvalidatePartitionedRegionMessage(recipients, event.getCallbackArgument(), r, response); msg.setTransactionDistributed(r.getCache().getTxManager().isDistributed()); r.getSystem().getDistributionManager().putOutgoing(msg); return response; }
public static void send(DistributionManager dm) { Set recipients = dm.getOtherDistributionManagerIds(); ReplyProcessor21 replyProcessor = new ReplyProcessor21(dm, recipients); CheckTypeRegistryState msg = new CheckTypeRegistryState(replyProcessor.getProcessorId()); msg.setRecipients(recipients); dm.putOutgoing(msg); try { replyProcessor.waitForReplies(); } catch (ReplyException e) { if (e.getCause() instanceof PdxInitializationException) { throw new PdxInitializationException( "Bad PDX configuration on member " + e.getSender() + ": " + e.getCause().getMessage(), e.getCause()); } else { throw new InternalGemFireError("Unexpected exception", e); } } catch (InterruptedException e) { throw new InternalGemFireError("Unexpected exception", e); } }
/** * Sends a message to make the recipient primary for the bucket. * * * @param newPrimary the member to to become primary * @param pr the PartitionedRegion of the bucket * @param bid the bucket to become primary for */ public static void send(Collection<InternalDistributedMember> acceptedMembers, InternalDistributedMember newPrimary, PartitionedRegion pr, int bid) { Assert.assertTrue(newPrimary != null, "VolunteerPrimaryBucketMessage NULL recipient"); ReplyProcessor21 response = new ReplyProcessor21(pr.getSystem(), acceptedMembers); EndBucketCreationMessage msg = new EndBucketCreationMessage(acceptedMembers, pr.getPRId(), response, bid, newPrimary); msg.setTransactionDistributed(pr.getCache().getTxManager().isDistributed()); pr.getDistributionManager().putOutgoing(msg); }
/** * Sends a DestroyRegionOnDataStoreMessage requesting that another VM destroy an existing region * */ public static void send(InternalDistributedMember recipient, PartitionedRegion r, Object callbackArg) { DistributionManager dm = r.getDistributionManager(); ReplyProcessor21 rp = new ReplyProcessor21(dm, recipient); int procId = rp.getProcessorId(); DestroyRegionOnDataStoreMessage m = new DestroyRegionOnDataStoreMessage(recipient, r.getPRId(), rp, callbackArg); m.setTransactionDistributed(r.getCache().getTxManager().isDistributed()); r.getDistributionManager().putOutgoing(m); rp.waitForRepliesUninterruptibly(); }