@Override protected void appendFields(final StringBuilder sb) { super.appendFields(sb); if (this.region != null) { sb.append(";region=").append(this.region.getFullPath()); } sb.append(";bucketIds=").append(this.bucketBitSet); final Set<Object> routingObjects = this.routingObjects; if (routingObjects != null && routingObjects.size() > 0) { sb.append(";routingObjects=").append(routingObjects); } sb.append(";ncjMetaData=").append(this.ncjMetaData); }
/** * @see AbstractOperationMessage#computeCompressedShort(short) */ @Override protected short computeCompressedShort(short flags) { flags = super.computeCompressedShort(flags); if (this.bucketBitSet != null) { flags |= HAS_BUCKET_BITSET; } return flags; }
protected final void executeOnMember(InternalDistributedSystem sys, DM dm, InternalDistributedMember member, boolean toSelf, boolean enableStreaming) throws StandardException, SQLException { // validate TX and heap critical members validateExecution(member); // send to others first if (this.processor == null) { // clear previously failed nodes since those may become available in next // round of retry this.failedNodes = null; setProcessor(createReplyProcessor(dm, member)); } if (!toSelf) { setRecipient(member); this.processor.registerProcessor(); } else { // processing in self will happen in the same thread in // beforeWaitForReplies setRecipients(Collections.emptySet()); } this.send(sys, dm, this.processor, false, toSelf); }
public int getNumRecipients() { if (!forAll()) { final InternalDistributedMember[] recipients = getRecipients(); return recipients != null ? recipients.length : 0; } return -1; // indicates that message sent to all members }
if (requiresTXFlushBeforeExecution()) { final TXStateInterface tx = getTXState(); if (tx != null) { msg.setPossibleDuplicate(isPossibleDuplicate); try { if (msg.containsRegionContentChange() && (advisor = msg.getDistributionAdvisor()) != null) { viewVersion = advisor.startOperation(); if (TXStateProxy.LOG_VERSIONS) { msg.executeFunction(enableStreaming); T result = collector.getResult(); if (rs != null) { rs.setup(result, msg.getNumRecipients()); final boolean retry = msg.isHA(); if (retry && retryCnt > 0 && GemFireXDUtils.retryToBeDone(e, messageRetryCount)) { if (msg.optimizeForWrite() && msg.isTransactional()) { throw StandardException.newException( SQLState.DATA_CONTAINER_CLOSED, e, msg = msg.clone(); msg.reset();
SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_RSITER, "GfxdFuntionMessage: sending last result to recipient " + getSenderForReply() + " with " + getTXState() + ": " + oneResult); checkAllBucketsHosted(); GfxdFunctionReplyMessage replyMsg = new GfxdFunctionReplyMessage(oneResult, this.replySequenceId, true, this.processorId, this, sendTXChanges, finishTXRead); putReply(replyMsg); this.replySequenceId = TERMINAL_REPLY_SEQID;
if ((txProxy = getTXProxy()) != null && !txProxy.skipBatchFlushOnCoordinator() && requiresTXFlushAfterExecution()) { setReplyTXState(txProxy); if (isHA() && !Misc.initialDDLReplayDone() "Node is in a transient state while executing " + toString()); execute(); } catch (GemFireCheckedException ex) { throw ex; } catch (Exception ex) { if (GemFireXDUtils.TraceQuery | GemFireXDUtils.TraceNCJ) { SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_QUERYDISTRIB, toString() + ".processMessage: exception caught", ex);
public GfxdFunctionReplyMessageProcessor(DM dm, Set<DistributedMember> members, GfxdFunctionMessage<T> msg) { super(dm, members, false); this.userCollector = msg.userCollector; this.recordStats = msg.timeStatsEnabled; this.replyReceivedMsgs = msg.replyReceivedMsgs; this.allowExecutionOnAdminMembers = msg.allowExecutionOnAdminMembers(); this.isDirectReplyMessage = (msg instanceof DirectReplyMessage && ((DirectReplyMessage)msg).supportsDirectAck()); if (msg.requiresSync()) { this.latch = new StoppableCountDownLatch(dm.getCancelCriterion(), 1); } else { this.latch = null; } this.helper = new GfxdResultCollectorHelper(); }
public final T executeFunction(final boolean enableStreaming, boolean isPossibleDuplicate, final AbstractGemFireResultSet rs, final boolean orderedReplies) throws StandardException, SQLException { return executeFunction(enableStreaming, isPossibleDuplicate, rs, orderedReplies, true); }
setAllAreNonPartitionedRegion(rs, isVTIInvolved); if (isVTIInvolved) { functionMsg.setSendToAllReplicates(includeAdminForVTI()); .setHasSetOperatorNode(true, this.qInfo.hasIntersectOrExceptNode()); result = functionMsg.executeFunction(enableStreaming, isPossibleDuplicate, rs, this.orderedReplies); if (stats != null) { setAllAreNonPartitionedRegion(rs, isVTIInvolved); if (isVTIInvolved) { functionMsg.setSendToAllReplicates(includeAdminForVTI()); .setHasSetOperatorNode(true, this.qInfo.hasIntersectOrExceptNode()); result = functionMsg.executeFunction(enableStreaming, isPossibleDuplicate, rs, this.orderedReplies);
if (requiresTXFlushBeforeExecution()) { final TXStateInterface tx = getTXState(); if (tx != null) { msg.setPossibleDuplicate(isPossibleDuplicate); try { if (msg.containsRegionContentChange() && (advisor = msg.getDistributionAdvisor()) != null) { viewVersion = advisor.startOperation(); if (TXStateProxy.LOG_VERSIONS) { msg.executeFunction(enableStreaming); T result = collector.getResult(); if (rs != null) { rs.setup(result, msg.getNumRecipients()); final boolean retry = msg.isHA(); if (retry && retryCnt > 0 && GemFireXDUtils.retryToBeDone(e, messageRetryCount)) { if (msg.optimizeForWrite() && msg.isTransactional()) { throw StandardException.newException( SQLState.DATA_CONTAINER_CLOSED, e, msg = msg.clone(); msg.reset();
SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_RSITER, "GfxdFuntionMessage: sending last result to recipient " + getSenderForReply() + " with " + getTXState() + ": " + oneResult); checkAllBucketsHosted(); GfxdFunctionReplyMessage replyMsg = new GfxdFunctionReplyMessage(oneResult, this.replySequenceId, true, this.processorId, this, sendTXChanges, finishTXRead); putReply(replyMsg); this.replySequenceId = TERMINAL_REPLY_SEQID;
if ((txProxy = getTXProxy()) != null && !txProxy.skipBatchFlushOnCoordinator() && requiresTXFlushAfterExecution()) { setReplyTXState(txProxy); if (isHA() && !Misc.initialDDLReplayDone() "Node is in a transient state while executing " + toString()); execute(); } catch (GemFireCheckedException ex) { throw ex; } catch (Exception ex) { if (GemFireXDUtils.TraceQuery | GemFireXDUtils.TraceNCJ) { SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_QUERYDISTRIB, toString() + ".processMessage: exception caught", ex);
public GfxdFunctionReplyMessageProcessor(DM dm, InternalDistributedMember member, GfxdFunctionMessage<T> msg) { super(dm, member, false); this.userCollector = msg.userCollector; this.recordStats = msg.timeStatsEnabled; this.replyReceivedMsgs = msg.replyReceivedMsgs; this.allowExecutionOnAdminMembers = msg.allowExecutionOnAdminMembers(); this.isDirectReplyMessage = (msg instanceof DirectReplyMessage && ((DirectReplyMessage)msg).supportsDirectAck()); if (msg.requiresSync()) { this.latch = new StoppableCountDownLatch(dm.getCancelCriterion(), 1); } else { this.latch = null; } this.helper = new GfxdResultCollectorHelper(); }
public final T executeFunction(final boolean enableStreaming, boolean isPossibleDuplicate, final AbstractGemFireResultSet rs, final boolean orderedReplies) throws StandardException, SQLException { return executeFunction(enableStreaming, isPossibleDuplicate, rs, orderedReplies, true); }
public int getNumRecipients() { if (!forAll()) { final InternalDistributedMember[] recipients = getRecipients(); return recipients != null ? recipients.length : 0; } return -1; // indicates that message sent to all members }
setAllAreNonPartitionedRegion(rs, isVTIInvolved); if (isVTIInvolved) { functionMsg.setSendToAllReplicates(includeAdminForVTI()); .setHasSetOperatorNode(true, this.qInfo.hasIntersectOrExceptNode()); result = functionMsg.executeFunction(enableStreaming, isPossibleDuplicate, rs, this.orderedReplies); if (stats != null) { setAllAreNonPartitionedRegion(rs, isVTIInvolved); if (isVTIInvolved) { functionMsg.setSendToAllReplicates(includeAdminForVTI()); .setHasSetOperatorNode(true, this.qInfo.hasIntersectOrExceptNode()); result = functionMsg.executeFunction(enableStreaming, isPossibleDuplicate, rs, this.orderedReplies);
if (requiresTXFlushBeforeExecution()) { final TXStateInterface tx = getTXState(); if (tx != null) { msg.setPossibleDuplicate(isPossibleDuplicate); try { if (msg.containsRegionContentChange() && (advisor = msg.getDistributionAdvisor()) != null) { viewVersion = advisor.startOperation(); if (TXStateProxy.LOG_VERSIONS) { msg.executeFunction(enableStreaming); T result = collector.getResult(); if (rs != null) { rs.setup(result, msg.getNumRecipients()); final boolean retry = msg.isHA(); if (retry && retryCnt > 0 && GemFireXDUtils.retryToBeDone(e, messageRetryCount)) { if (msg.optimizeForWrite() && msg.isTransactional()) { throw StandardException.newException( SQLState.DATA_CONTAINER_CLOSED, e, msg = msg.clone(); msg.reset();
protected final void executeOnMember(InternalDistributedSystem sys, DM dm, InternalDistributedMember member, boolean toSelf, boolean enableStreaming) throws StandardException, SQLException { // validate TX and heap critical members validateExecution(member); // send to others first if (this.processor == null) { // clear previously failed nodes since those may become available in next // round of retry this.failedNodes = null; setProcessor(createReplyProcessor(dm, member)); } if (!toSelf) { setRecipient(member); this.processor.registerProcessor(); } else { // processing in self will happen in the same thread in // beforeWaitForReplies setRecipients(Collections.emptySet()); } this.send(sys, dm, this.processor, false, toSelf); }
SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_RSITER, "GfxdFuntionMessage: sending last result to recipient " + getSenderForReply() + " with " + getTXState() + ": " + oneResult); checkAllBucketsHosted(); GfxdFunctionReplyMessage replyMsg = new GfxdFunctionReplyMessage(oneResult, this.replySequenceId, true, this.processorId, this, sendTXChanges, finishTXRead); putReply(replyMsg); this.replySequenceId = TERMINAL_REPLY_SEQID;