use of org.apache.geode.internal.cache.tier.sockets.Message in project geode by apache.
the class PutAll70 method writeReplyWithRefreshMetadata.
private void writeReplyWithRefreshMetadata(Message origMsg, VersionedObjectList response, ServerConnection servConn, PartitionedRegion pr, byte nwHop) throws IOException {
Message replyMsg = servConn.getReplyMessage();
servConn.getCache().getCancelCriterion().checkCancelInProgress(null);
replyMsg.setMessageType(MessageType.REPLY);
replyMsg.setNumberOfParts(2);
replyMsg.setTransactionId(origMsg.getTransactionId());
replyMsg.addBytesPart(new byte[] { pr.getMetadataVersion(), nwHop });
if (response != null) {
response.clearObjects();
replyMsg.addObjPart(response);
}
replyMsg.send(servConn);
pr.getPrStats().incPRMetaDataSentCount();
if (logger.isTraceEnabled()) {
logger.trace("{}: rpl with REFRESH_METADATA tx: {}", servConn.getName(), origMsg.getTransactionId());
}
}
use of org.apache.geode.internal.cache.tier.sockets.Message in project geode by apache.
the class Invalidate70 method writeReplyWithRefreshMetadata.
@Override
protected void writeReplyWithRefreshMetadata(Message origMsg, ServerConnection servConn, PartitionedRegion pr, byte nwHop, VersionTag versionTag) throws IOException {
Message replyMsg = servConn.getReplyMessage();
servConn.getCache().getCancelCriterion().checkCancelInProgress(null);
replyMsg.setMessageType(MessageType.REPLY);
int flags = 0;
int numParts = 2;
if (versionTag != null) {
flags |= InvalidateOp.HAS_VERSION_TAG;
numParts++;
}
replyMsg.setNumberOfParts(numParts);
replyMsg.setTransactionId(origMsg.getTransactionId());
replyMsg.addIntPart(flags);
if (versionTag != null) {
replyMsg.addObjPart(versionTag);
}
replyMsg.addBytesPart(new byte[] { pr.getMetadataVersion(), nwHop });
pr.getPrStats().incPRMetaDataSentCount();
replyMsg.send(servConn);
if (logger.isTraceEnabled()) {
logger.trace("{}: rpl with REFRESH_METADATA tx: {}", servConn.getName(), origMsg.getTransactionId());
}
}
use of org.apache.geode.internal.cache.tier.sockets.Message in project geode by apache.
the class Destroy65 method writeReplyWithRefreshMetadata.
protected void writeReplyWithRefreshMetadata(Message origMsg, ServerConnection servConn, PartitionedRegion pr, boolean entryNotFoundForRemove, byte nwHop, VersionTag tag) throws IOException {
Message replyMsg = servConn.getReplyMessage();
servConn.getCache().getCancelCriterion().checkCancelInProgress(null);
replyMsg.setMessageType(MessageType.REPLY);
replyMsg.setNumberOfParts(2);
replyMsg.setTransactionId(origMsg.getTransactionId());
replyMsg.addBytesPart(new byte[] { pr.getMetadataVersion(), nwHop });
pr.getPrStats().incPRMetaDataSentCount();
replyMsg.addIntPart(entryNotFoundForRemove ? 1 : 0);
replyMsg.send(servConn);
if (logger.isTraceEnabled()) {
logger.trace("{}: rpl with REFRESH_METADATA tx: {}", servConn.getName(), origMsg.getTransactionId());
}
}
use of org.apache.geode.internal.cache.tier.sockets.Message in project geode by apache.
the class GatewayReceiverCommand method writeReply.
private void writeReply(Message msg, ServerConnection servConn, int batchId, int numberOfEvents) throws IOException {
Message replyMsg = servConn.getResponseMessage();
replyMsg.setMessageType(MessageType.REPLY);
replyMsg.setTransactionId(msg.getTransactionId());
replyMsg.setNumberOfParts(2);
replyMsg.addIntPart(batchId);
replyMsg.addIntPart(numberOfEvents);
replyMsg.setTransactionId(msg.getTransactionId());
replyMsg.send(servConn);
servConn.setAsTrue(Command.RESPONDED);
if (logger.isDebugEnabled()) {
logger.debug("{}: rpl tx: {} batchId {} numberOfEvents: {}", servConn.getName(), msg.getTransactionId(), batchId, numberOfEvents);
}
}
use of org.apache.geode.internal.cache.tier.sockets.Message in project geode by apache.
the class Get70 method writeResponseWithRefreshMetadata.
private void writeResponseWithRefreshMetadata(@Unretained Object data, Object callbackArg, Message origMsg, boolean isObject, ServerConnection servConn, PartitionedRegion pr, byte nwHop, VersionTag versionTag, boolean keyNotPresent) throws IOException {
Message responseMsg = servConn.getResponseMessage();
responseMsg.setMessageType(MessageType.RESPONSE);
responseMsg.setTransactionId(origMsg.getTransactionId());
int numParts = 3;
int flags = 0;
if (callbackArg != null) {
numParts++;
flags |= GetOp.HAS_CALLBACK_ARG;
}
if (versionTag != null) {
numParts++;
flags |= GetOp.HAS_VERSION_TAG;
}
if (keyNotPresent) {
flags |= GetOp.KEY_NOT_PRESENT;
} else if (data == null && isObject) {
flags |= GetOp.VALUE_IS_INVALID;
}
// logger.debug("returning flags " + Integer.toBinaryString(flags));
responseMsg.setNumberOfParts(numParts);
responseMsg.addPartInAnyForm(data, isObject);
responseMsg.addIntPart(flags);
if (callbackArg != null) {
responseMsg.addObjPart(callbackArg);
}
if (versionTag != null) {
responseMsg.addObjPart(versionTag);
}
responseMsg.addBytesPart(new byte[] { pr.getMetadataVersion(), nwHop });
servConn.getCache().getCancelCriterion().checkCancelInProgress(null);
responseMsg.send(servConn);
origMsg.clearParts();
}
Aggregations