use of org.apache.geode.internal.cache.ForceReattemptException in project geode by apache.
the class GetMessage method send.
/**
* Sends a PartitionedRegion {@link org.apache.geode.cache.Region#get(Object)} message
*
* @param recipient the member that the get message is sent to
* @param r the PartitionedRegion for which get was performed upon
* @param key the object to which the value should be feteched
* @param requestingClient the client cache that requested this item
* @return the processor used to fetch the returned value associated with the key
* @throws ForceReattemptException if the peer is no longer available
*/
public static GetResponse send(InternalDistributedMember recipient, PartitionedRegion r, final Object key, final Object aCallbackArgument, ClientProxyMembershipID requestingClient, boolean returnTombstones) throws ForceReattemptException {
Assert.assertTrue(recipient != null, "PRDistribuedGetReplyMessage NULL reply message");
GetResponse p = new GetResponse(r.getSystem(), Collections.singleton(recipient), key);
GetMessage m = new GetMessage(recipient, r.getPRId(), p, key, aCallbackArgument, requestingClient, returnTombstones);
Set failures = r.getDistributionManager().putOutgoing(m);
if (failures != null && failures.size() > 0) {
throw new ForceReattemptException(LocalizedStrings.GetMessage_FAILED_SENDING_0.toLocalizedString(m));
}
return p;
}
use of org.apache.geode.internal.cache.ForceReattemptException 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.internal.cache.ForceReattemptException in project geode by apache.
the class InvalidateMessage method send.
/**
* Sends an InvalidateMessage {@link org.apache.geode.cache.Region#invalidate(Object)}message to
* the recipient
*
* @param recipient the recipient of the message
* @param r the PartitionedRegion for which the invalidate was performed
* @param event the event causing this message
* @return the InvalidateResponse processor used to await the potential
* {@link org.apache.geode.cache.CacheException}
* @throws ForceReattemptException if the peer is no longer available
*/
public static InvalidateResponse send(DistributedMember recipient, PartitionedRegion r, EntryEventImpl event) throws ForceReattemptException {
// Assert.assertTrue(recipient != null, "InvalidateMessage NULL recipient"); recipient may be
// null for remote notifications
Set recipients = Collections.singleton(recipient);
InvalidateResponse p = new InvalidateResponse(r.getSystem(), recipients, event.getKey());
InvalidateMessage m = new InvalidateMessage(recipients, false, r.getPRId(), p, event);
Set failures = r.getDistributionManager().putOutgoing(m);
if (failures != null && failures.size() > 0) {
throw new ForceReattemptException(LocalizedStrings.InvalidateMessage_FAILED_SENDING_0.toLocalizedString(m));
}
return p;
}
use of org.apache.geode.internal.cache.ForceReattemptException in project geode by apache.
the class ManageBackupBucketMessage method send.
/**
* Sends a PartitionedRegion manage bucket request to the recipient
*
* @param recipient the member to which the bucket manage request is sent
* @param r the PartitionedRegion to which the bucket belongs
* @param bucketId the unique identifier of the bucket
* @param isRebalance true if directed by full rebalance operation
* @param replaceOfflineData
* @param moveSource If this is a bucket move.
* @param forceCreation ignore checks which may cause the bucket not to be created
* @return the processor used to fetch the returned Node if any
* @throws ForceReattemptException if the peer is no longer available
*/
public static NodeResponse send(InternalDistributedMember recipient, PartitionedRegion r, int bucketId, boolean isRebalance, boolean replaceOfflineData, InternalDistributedMember moveSource, boolean forceCreation) throws ForceReattemptException {
Assert.assertTrue(recipient != null, "ManageBucketMessage NULL recipient");
NodeResponse p = new NodeResponse(r.getSystem(), recipient);
ManageBackupBucketMessage m = new ManageBackupBucketMessage(recipient, r.getPRId(), p, bucketId, isRebalance, replaceOfflineData, moveSource, forceCreation);
p.enableSevereAlertProcessing();
Set failures = r.getDistributionManager().putOutgoing(m);
if (failures != null && failures.size() > 0) {
throw new ForceReattemptException("Failed sending <" + m + ">");
}
return p;
}
use of org.apache.geode.internal.cache.ForceReattemptException in project geode by apache.
the class ManageBucketMessage method send.
/**
* Sends a PartitionedRegion manage bucket request to the recipient
*
* @param recipient the member to which the bucket manage request is sent
* @param r the PartitionedRegion to which the bucket belongs
* @param bucketId the unique identifier of the bucket
* @param bucketSize the size in bytes of the bucket
* @param forceCreation inform the recipient to accept the bucket appropriately ignoring maximums
* @return the processor used to fetch the returned Node if any
* @throws ForceReattemptException if the peer is no longer available
*/
public static NodeResponse send(InternalDistributedMember recipient, PartitionedRegion r, int bucketId, int bucketSize, boolean forceCreation) throws ForceReattemptException {
Assert.assertTrue(recipient != null, "ManageBucketMessage NULL recipient");
NodeResponse p = new NodeResponse(r.getSystem(), recipient);
ManageBucketMessage m = new ManageBucketMessage(recipient, r.getPRId(), p, bucketId, bucketSize, forceCreation);
p.enableSevereAlertProcessing();
Set failures = r.getDistributionManager().putOutgoing(m);
if (failures != null && failures.size() > 0) {
throw new ForceReattemptException(LocalizedStrings.ManageBucketMessage_FAILED_SENDING_0.toLocalizedString(m));
}
return p;
}
Aggregations