@Override public String toString() { String cname = getClass().getName().substring( getClass().getPackage().getName().length() + 1); final StringBuilder sb = new StringBuilder(cname); sb.append('@').append(Integer.toHexString(System.identityHashCode(this))); sb.append(" processorId=").append(getProcessorId()); sb.append(" sender=").append(getSender()); return sb.toString(); }
public Set putOutgoingUserData(final DistributionMessage message) { if (message.forAll() || message.getRecipients().length == 0) { // do nothing return null; } else { throw new RuntimeException(LocalizedStrings.LonerDistributionManager_LONER_TRIED_TO_SEND_MESSAGE_TO_0.toLocalizedString(message.getRecipientsDescription())); } } public InternalDistributedSystem getSystem() {
@Override public void fromData(DataInput in) throws IOException, ClassNotFoundException { super.fromData(in); windowId = in.readInt(); }
/** * If true then this message most be sent on an ordered channel. * If false then it can be unordered. * @since 5.5 */ public boolean orderedDelivery(boolean threadOwnsResources) { final int processorType = getProcessorType(); switch (processorType) { case DistributionManager.SERIAL_EXECUTOR: case DistributionManager.PARTITIONED_REGION_EXECUTOR: return true; // need to use ordered connections for StateFlush when // constainsRegionContentChange is true case DistributionManager.REGION_FUNCTION_EXECUTION_EXECUTOR: // allow nested distributed functions to be executed from within the // execution of a function; this is required particularly for GemFireXD // TODO: this can later be adjusted to use a separate property // always make it ordered with threadOwnsResources else it uses // shared resources for unordered connections // return containsRegionContentChange(); default: return threadOwnsResources || containsRegionContentChange(); } }
public void run() { try { scheduleAction(dm); } finally { if (receiver != null && containsRegionContentChange()) { receiver.incMessagesReceived(); } } }
/** * This is to avoid stopping the processing of messages if an exception is * received. */ @Override protected final void processException(DistributionMessage msg, ReplyException ex) { processExceptionFromMember(msg.getSender(), ex); }
/** * sets the breadcrumbs for this message into the current thread's name */ public void setBreadcrumbsInReceiver() { if (Breadcrumbs.ENABLED) { String sender = null; String procId = ""; long pid = getProcessorId(); if (pid != 0) { procId = " processorId=" + pid; } if (Thread.currentThread().getName().startsWith("P2P Message Reader")) { sender = procId; } else { sender = "sender=" + getSender() + procId; } if (sender.length() > 0) { Breadcrumbs.setReceiveSide(sender); } Object evID = getEventID(); if (evID != null) { Breadcrumbs.setEventId(evID); } } }
&& getProcessorType() == DistributionManager.SERIAL_EXECUTOR && !isPreciousThread(); boolean forceInline = this.acker != null || getInlineProcess() || Connection.isDominoThread(); if (inlineProcess && !forceInline && isSharedReceiver()) { if (mayAddToMultipleSerialGateways(dm)) { inlineProcess = false; dm.getStats().incNumSerialThreads(1); try { scheduleAction(dm); } finally { dm.getStats().incNumSerialThreads(-1); getExecutor(dm).execute(new SizeableRunnable(this.getBytesRead()) { public void run() { scheduleAction(dm); logger.warn(LocalizedMessage.create(LocalizedStrings.DistributionMessage_0__SCHEDULE_REJECTED, this.toString()), ex);
&& getProcessorType() == DistributionManager.SERIAL_EXECUTOR && !isPreciousThread(); inlineProcess |= this.getInlineProcess(); inlineProcess |= ConnectionTable.isDominoThread(); inlineProcess |= this.acker != null; dm.getStats().incNumSerialThreads(1); try { scheduleAction(dm); } finally { dm.getStats().incNumSerialThreads(-1); getExecutor(dm).execute(new SizeableRunnable(this.getBytesRead()) { public void run() { try { if (receiver != null && containsRegionContentChange()) { receiver.incMessagesReceived(); dm.logger.warning(LocalizedStrings.DistributionMessage_0__SCHEDULE_REJECTED, this.toString(), ex);
if ((msg instanceof DirectReplyMessage) && msg.isDirectAck() && msg.getProcessorId() <= 0) { ((DirectReplyMessage)msg).registerProcessor(); InternalDistributedMember[] destinations = msg.getRecipients(); boolean allDestinations = msg.forAll(); if (msg.getMulticast() || allDestinations) { useMcast = services.getManager().isMulticastAllowed(); String recips = useMcast? "multicast" : Arrays.toString(msg.getRecipients()); logger.debug("sending via JGroups: [{}] recipients: {}", msg, recips); if (msg.forAll()) { return Collections.emptySet();
@Override public String toString() { String cname = getShortClassName(); final StringBuilder sb = new StringBuilder(cname); sb.append('@').append(Integer.toHexString(System.identityHashCode(this))); sb.append(" processorId=").append(getProcessorId()); sb.append(" sender=").append(getSender()); return sb.toString(); }
boolean allDestinations = msg.forAll(); && this.shutdownInProgress) { return new HashSet(Arrays.asList(msg.getRecipients())); msg.setSender(address); msg.setBreadcrumbsInSender(); Breadcrumbs.setProblem(null); useMcast = (msg.getMulticast() || allDestinations);
@Override public void toData(DataOutput out) throws IOException { super.toData(out); out.writeInt(this.processorId); }
/** * Process an incoming distribution message. * This includes scheduling it correctly based on the message's * nioPriority (executor type) */ public void handleIncomingDMsg(DistributionMessage message) { /* disabled - not being used if (message instanceof OutgoingMessageWrapper) { putOutgoing(((OutgoingMessageWrapper)message).getMessage()); return; } */ // long latency = message.getLatency(); // this.stats.incMessageTransitTime(latency * 1000000L); // message.resetTimestamp(); stats.incReceivedMessages(1L); stats.incReceivedBytes(message.getBytesRead()); stats.incMessageChannelTime(message.resetTimestamp()); // message.setRecipient(DistributionManager.this.getId()); if (logger.isDebugEnabled()) { logger.debug("Received message '{}' from <{}>", message, message.getSender()); } scheduleIncomingMessage(message); }
long startTime = DistributionStats.getStatTime(); Set result = channel.send(message.getRecipients(), message, DistributionManager.this, this.stats); endTime = NanoTimer.getTime(); boolean sentToAll = message.forAll(); if (DistributionStats.enableClockStats) { stats.incSentMessagesTime(endTime-startTime); stats.incDistributeMessageTime(endTime - message.getTimestamp());
((tssFlags & ConnectionTable.IS_READER_TSS_MASK) != 0); msg.setProcessorType(isReaderThread); boolean interrupted = false; directMsg = null; if (directMsg != null || msg.getProcessorId() > 0) { ackTimeout = (int)(ackWaitThreshold * 1000); if (msg.isSevereAlertCompatible() || ReplyProcessor21.isSevereAlertProcessingForced()) { ackSDTimeout = (int)(ackSAThreshold * 1000); if (ReplyProcessor21.getShortSevereAlertProcessing()) { final boolean orderedMsg = msg.orderedDelivery(threadOwnsResources) || ((tssFlags & ConnectionTable.SHOULD_DOMINO_TSS_MASK) != 0); allCons.addAll(cons); if (directReply && msg.getProcessorId() > 0) { // no longer a direct-reply message? directReply = false;
/** * sets breadcrumbs in a thread that is sending a message to another member */ public void setBreadcrumbsInSender() { if (Breadcrumbs.ENABLED) { String procId = ""; long pid = getProcessorId(); if (pid != 0) { procId = "processorId=" + pid; } if (this.recipients != null && this.recipients.length <= 10) { // set a limit on recipients Breadcrumbs.setSendSide(procId + " recipients="+Arrays.toString(this.recipients)); } else { if (procId.length() > 0) { Breadcrumbs.setSendSide(procId); } } Object evID = getEventID(); if (evID != null) { Breadcrumbs.setEventId(evID); } } }
int bytesWritten = 0; boolean retry = false; final boolean orderedMsg = msg.orderedDelivery() || Connection.isDominoThread(); directMsg = null; if (directMsg != null || msg.getProcessorId() > 0) { ackTimeout = (int)(ackWaitThreshold * 1000); if (msg.isSevereAlertCompatible() || ReplyProcessor21.isSevereAlertProcessingForced()) { ackSDTimeout = (int)(ackSAThreshold * 1000); if (ReplyProcessor21.getShortSevereAlertProcessing()) { ConnectExceptions ce = getConnections(mgr, msg, destinations, orderedMsg, retry, ackTimeout, ackSDTimeout, cons); if (directReply && msg.getProcessorId() > 0) { // no longer a direct-reply message? directReply = false;
@Override public Set<InternalDistributedMember> send(DistributionMessage m) throws NotSerializableException { return send(m.getRecipients(), m, this.services.getStatistics()); }
boolean allDestinations = msg.forAll(); msg.setSender(myMemberId); msg.setBreadcrumbsInSender(); Breadcrumbs.setProblem(null); useMcast = !disableMulticastForRollingUpgrade && (msg.getMulticast() || allDestinations); boolean sendViaJGroups = isForceUDPCommunications() || msg.sendViaJGroups();