use of org.apache.geode.distributed.internal.ReplyException in project geode by apache.
the class InterestEventMessage method operateOnPartitionedRegion.
@Override
protected boolean operateOnPartitionedRegion(final DistributionManager dm, PartitionedRegion r, long startTime) throws ForceReattemptException {
if (logger.isTraceEnabled(LogMarker.DM)) {
logger.debug("InterestEventMessage operateOnPartitionedRegion: {}", r.getFullPath());
}
PartitionedRegionDataStore ds = r.getDataStore();
if (ds != null) {
try {
ds.handleInterestEvent(this.event);
r.getPrStats().endPartitionMessagesProcessing(startTime);
InterestEventReplyMessage.send(getSender(), getProcessorId(), dm);
} catch (Exception e) {
sendReply(getSender(), getProcessorId(), dm, new ReplyException(new ForceReattemptException("Caught exception during interest registration processing:", e)), r, startTime);
return false;
}
} else {
throw new InternalError("InterestEvent message was sent to a member with no storage.");
}
// response
return false;
}
use of org.apache.geode.distributed.internal.ReplyException in project geode by apache.
the class FinishBackupRequest method send.
public static Map<DistributedMember, Set<PersistentID>> send(DM dm, Set recipients, File targetDir, File baselineDir, boolean abort) {
FinishBackupRequest request = new FinishBackupRequest(targetDir, baselineDir, abort);
request.setRecipients(recipients);
FinishBackupReplyProcessor replyProcessor = new FinishBackupReplyProcessor(dm, recipients);
request.msgId = replyProcessor.getProcessorId();
dm.putOutgoing(request);
try {
replyProcessor.waitForReplies();
} catch (ReplyException e) {
if (!(e.getCause() instanceof CancelException)) {
throw e;
}
} catch (InterruptedException e) {
e.printStackTrace();
}
AdminResponse response = request.createResponse((DistributionManager) dm);
response.setSender(dm.getDistributionManagerId());
replyProcessor.process(response);
return replyProcessor.results;
}
use of org.apache.geode.distributed.internal.ReplyException in project geode by apache.
the class FlushToDiskRequest method send.
public static void send(DM dm, Set recipients) {
FlushToDiskRequest request = new FlushToDiskRequest();
request.setRecipients(recipients);
FlushToDiskProcessor replyProcessor = new FlushToDiskProcessor(dm, recipients);
request.msgId = replyProcessor.getProcessorId();
dm.putOutgoing(request);
try {
replyProcessor.waitForReplies();
} catch (ReplyException e) {
if (!(e.getCause() instanceof CancelException)) {
throw e;
}
} catch (InterruptedException e) {
logger.debug(e);
}
AdminResponse response = request.createResponse((DistributionManager) dm);
response.setSender(dm.getDistributionManagerId());
replyProcessor.process(response);
}
use of org.apache.geode.distributed.internal.ReplyException in project geode by apache.
the class NonGrantorDestroyedProcessor method send.
////////// Public static entry point /////////
/**
*
* Send a message to grantor telling him that we've shutdown the named lock service for this
* member.
* <p>
* Caller should loop, getting the grantor, calling <code>send</code>, and checking
* <code>informedGrantor()</code> until the grantor has acknowledged being informed.
*/
static boolean send(String serviceName, LockGrantorId theLockGrantorId, DM dm) {
InternalDistributedMember recipient = theLockGrantorId.getLockGrantorMember();
NonGrantorDestroyedProcessor processor = new NonGrantorDestroyedProcessor(dm, recipient);
NonGrantorDestroyedMessage.send(serviceName, recipient, dm, processor);
try {
processor.waitForRepliesUninterruptibly();
} catch (ReplyException e) {
e.handleAsUnexpected();
}
return processor.informedGrantor();
}
use of org.apache.geode.distributed.internal.ReplyException in project geode by apache.
the class DeposeGrantorProcessor method send.
////////// Public static entry point /////////
/**
* Send a message to oldGrantor telling him that he is deposed by newGrantor. Send does not
* complete until an ack is received or the oldGrantor leaves the system.
*/
static void send(String serviceName, InternalDistributedMember oldGrantor, InternalDistributedMember newGrantor, long newGrantorVersion, int newGrantorSerialNumber, DM dm) {
final InternalDistributedMember elder = dm.getId();
if (elder.equals(oldGrantor)) {
doOldGrantorWork(serviceName, elder, newGrantor, newGrantorVersion, newGrantorSerialNumber, dm, null);
} else {
DeposeGrantorProcessor processor = new DeposeGrantorProcessor(dm, oldGrantor);
DeposeGrantorMessage.send(serviceName, oldGrantor, newGrantor, newGrantorVersion, newGrantorSerialNumber, dm, processor);
try {
processor.waitForRepliesUninterruptibly();
} catch (ReplyException e) {
e.handleAsUnexpected();
}
}
}
Aggregations