use of org.apache.geode.distributed.internal.ReplyProcessor21 in project geode by apache.
the class ServerInterestRegistrationMessage method sendInterestChange.
static void sendInterestChange(DM 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();
}
}
use of org.apache.geode.distributed.internal.ReplyProcessor21 in project geode by apache.
the class TXLockServiceImpl method updateParticipants.
@Override
public void updateParticipants(TXLockId txLockId, final Set updatedParticipants) {
synchronized (this.txLockIdList) {
if (!this.txLockIdList.contains(txLockId)) {
throw new IllegalArgumentException(LocalizedStrings.TXLockServiceImpl_INVALID_TXLOCKID_NOT_FOUND_0.toLocalizedString(txLockId));
}
}
if (updatedParticipants == null) {
throw new IllegalArgumentException(LocalizedStrings.TXLockServiceImpl_INVALID_UPDATEDPARTICIPANTS_NULL.toLocalizedString());
}
if (updatedParticipants.isEmpty()) {
return;
}
if (!this.recovering) {
// Serializable grantorId = this.dlock.getLockGrantorId();
if (this.dlock.isLockGrantor()) {
// Don't need to send a message (or wait for a reply)
// logger.info("DEBUG: [TXLockServiceImpl.updateParticipants] this VM is the Grantor");
TXLockUpdateParticipantsMessage.updateParticipants(this.dlock, txLockId, updatedParticipants);
} else {
// not lock grantor
LockGrantorId lockGrantorId = txLockId.getLockGrantorId();
if (lockGrantorId == null || !this.dlock.isLockGrantorId(lockGrantorId)) {
// grantor is gone so we cannot update him
return;
}
InternalDistributedMember grantorId = lockGrantorId.getLockGrantorMember();
// logger.info("DEBUG: [TXLockServiceImpl.updateParticipants] sending update message to
// Grantor " + grantorId);
ReplyProcessor21 processor = new ReplyProcessor21(this.dlock.getDistributionManager(), grantorId);
TXLockUpdateParticipantsMessage dlup = new TXLockUpdateParticipantsMessage(txLockId, this.dlock.getName(), updatedParticipants, processor.getProcessorId());
dlup.setRecipient(grantorId);
this.dlock.getDistributionManager().putOutgoing(dlup);
// for() loop removed for bug 36983 - you can't loop on waitForReplies()
this.dlock.getDistributionManager().getCancelCriterion().checkCancelInProgress(null);
try {
processor.waitForRepliesUninterruptibly();
} catch (ReplyException e) {
e.handleAsUnexpected();
}
}
// not lock grantor
}
// not recovering
}
use of org.apache.geode.distributed.internal.ReplyProcessor21 in project geode by apache.
the class FilterProfile method sendFilterProfileOperation.
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();
}
}
use of org.apache.geode.distributed.internal.ReplyProcessor21 in project geode by apache.
the class GemFireCacheImpl method sendAddCacheServerProfileMessage.
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();
}
}
}
use of org.apache.geode.distributed.internal.ReplyProcessor21 in project geode by apache.
the class PartitionedRegion method sendInvalidateRegionMessage.
private void sendInvalidateRegionMessage(RegionEventImpl event) {
final int retryAttempts = calcRetry();
Throwable thr = null;
int count = 0;
while (count <= retryAttempts) {
try {
count++;
Set recipients = getRegionAdvisor().adviseDataStore();
ReplyProcessor21 response = InvalidatePartitionedRegionMessage.send(recipients, this, event);
response.waitForReplies();
thr = null;
break;
} catch (ReplyException e) {
thr = e;
if (!this.isClosed && !this.isDestroyed) {
if (logger.isDebugEnabled()) {
logger.debug("Invalidating partitioned region caught exception", e);
}
}
} catch (InterruptedException e) {
thr = e;
if (!cache.getCancelCriterion().isCancelInProgress()) {
if (logger.isDebugEnabled()) {
logger.debug("Invalidating partitioned region caught exception", e);
}
}
}
}
if (thr != null) {
PartitionedRegionDistributionException e = new PartitionedRegionDistributionException(LocalizedStrings.PartitionedRegion_INVALIDATING_REGION_CAUGHT_EXCEPTION.toLocalizedString(count));
if (logger.isDebugEnabled()) {
logger.debug(e.getMessage(), e);
}
throw e;
}
}
Aggregations