Search in sources :

Example 26 with ReplyProcessor21

use of org.apache.geode.distributed.internal.ReplyProcessor21 in project geode by apache.

the class UpdateAttributesProcessor method sendProfileUpdate.

public void sendProfileUpdate(boolean exchangeProfiles) {
    DM mgr = this.advisee.getDistributionManager();
    DistributionAdvisor advisor = this.advisee.getDistributionAdvisor();
    this.profileExchange = exchangeProfiles;
    if (!exchangeProfiles) {
        if (this.removeProfile) {
            if (!advisor.isInitialized()) {
                // never got initialized.
                return;
            }
        } else if (advisor.initializationGate()) {
            // it just did the profile exchange so we are done
            return;
        }
    }
    final Set recipients;
    if (this.removeProfile) {
        recipients = advisor.adviseProfileRemove();
    } else if (exchangeProfiles) {
        recipients = advisor.adviseProfileExchange();
    } else {
        recipients = advisor.adviseProfileUpdate();
    }
    if (recipients.isEmpty()) {
        return;
    }
    ReplyProcessor21 processor = null;
    // Scope scope = this.region.scope;
    // always require an ack to prevent misordering of messages
    InternalDistributedSystem system = this.advisee.getSystem();
    processor = new UpdateAttributesReplyProcessor(system, recipients);
    UpdateAttributesMessage message = getUpdateAttributesMessage(processor, recipients);
    mgr.putOutgoing(message);
    this.processor = processor;
}
Also used : DistributionAdvisor(org.apache.geode.distributed.internal.DistributionAdvisor) Set(java.util.Set) DM(org.apache.geode.distributed.internal.DM) InternalDistributedSystem(org.apache.geode.distributed.internal.InternalDistributedSystem) ReplyProcessor21(org.apache.geode.distributed.internal.ReplyProcessor21)

Example 27 with ReplyProcessor21

use of org.apache.geode.distributed.internal.ReplyProcessor21 in project geode by apache.

the class PrepareNewPersistentMemberMessage method send.

public static void send(Set<InternalDistributedMember> members, DM 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();
}
Also used : ReplyProcessor21(org.apache.geode.distributed.internal.ReplyProcessor21)

Example 28 with ReplyProcessor21

use of org.apache.geode.distributed.internal.ReplyProcessor21 in project geode by apache.

the class RemovePersistentMemberMessage method send.

public static void send(Set<InternalDistributedMember> members, DM 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();
}
Also used : ReplyProcessor21(org.apache.geode.distributed.internal.ReplyProcessor21)

Aggregations

ReplyProcessor21 (org.apache.geode.distributed.internal.ReplyProcessor21)28 HashSet (java.util.HashSet)11 Set (java.util.Set)10 DM (org.apache.geode.distributed.internal.DM)7 InternalDistributedMember (org.apache.geode.distributed.internal.membership.InternalDistributedMember)7 ReplyException (org.apache.geode.distributed.internal.ReplyException)5 InternalDistributedSystem (org.apache.geode.distributed.internal.InternalDistributedSystem)4 PartitionedRegion (org.apache.geode.internal.cache.PartitionedRegion)4 HashMap (java.util.HashMap)2 Map (java.util.Map)2 CopyOnWriteArraySet (java.util.concurrent.CopyOnWriteArraySet)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 CancelException (org.apache.geode.CancelException)2 BucketAdvisor (org.apache.geode.internal.cache.BucketAdvisor)2 BucketProfile (org.apache.geode.internal.cache.BucketAdvisor.BucketProfile)2 ConcurrentHashSet (org.apache.geode.internal.concurrent.ConcurrentHashSet)2 Serializable (java.io.Serializable)1 ArrayList (java.util.ArrayList)1 TreeSet (java.util.TreeSet)1 ForcedDisconnectException (org.apache.geode.ForcedDisconnectException)1