/** * Block until you can read a message. Returns null if the message was a message chunk. * * @return the message, or null if we only received a chunk of the message */ DistributionMessage readMessage(Header header) throws IOException, ClassNotFoundException { ByteBuffer nioInputBuffer = readAtLeast(header.messageLength); Assert.assertTrue(nioInputBuffer.remaining() >= header.messageLength); this.getStats().incMessagesBeingReceived(true, header.messageLength); long startSer = this.getStats().startMsgDeserialization(); int position = nioInputBuffer.position(); int limit = nioInputBuffer.limit(); try { byteBufferInputStream.setBuffer(nioInputBuffer); ReplyProcessor21.initMessageRPId(); // dumpState("readMessage ready to deserialize", null, nioInputBuffer, position, limit); return (DistributionMessage) InternalDataSerializer.readDSFID(byteBufferInputStream); } catch (RuntimeException e) { throw e; } catch (IOException e) { throw e; } finally { this.getStats().endMsgDeserialization(startSer); this.getStats().decMessagesBeingReceived(header.messageLength); ioFilter.doneReading(nioInputBuffer); } }
private static void endDeserialization(long start, int bytes) { DMStats stats = InternalDistributedSystem.getDMStats(); if (stats != null) { stats.endDeserialization(start, bytes); } }
@Override protected synchronized Object basicGetObject() { DMStats stats = InternalDataSerializer.getDMStats(null); long start = stats.startPdxInstanceDeserialization(); try { return super.basicGetObject(); } finally { stats.endPdxInstanceDeserialization(start); } }
try { final DMStats stats = this.owner.getConduit().getStats(); final long threadStart = stats.startAsyncThread(); try { stats.incAsyncQueues(1); stats.incAsyncThreads(1); long flushStart = stats.startAsyncQueueFlush(); try { long curQueuedBytes = this.queuedBytes; "Queued bytes {} exceeds max of {}, asking slow receiver {} to disconnect.", curQueuedBytes, this.asyncMaxQueueSize, this.remoteAddr); stats.incAsyncQueueSizeExceeded(1); disconnectSlowReceiver(); return; stats.endAsyncQueueFlush(flushStart); stats.incAsyncQueueSize(-this.queuedBytes); this.queuedBytes = 0; stats.endAsyncThread(threadStart); stats.incAsyncThreads(-1); stats.incAsyncQueues(-1); if (logger.isDebugEnabled()) { logger.debug("runMessagePusher terminated id={} from {}/{}", conduitIdStr, remoteAddr,
if (DistributionStats.enableClockStats) { time = DistributionStats.getStatTime(); dm.getStats().incMessageProcessingScheduleTime(time - getTimestamp()); } finally { if (doDecMessagesBeingReceived) { dm.getStats().decMessagesBeingReceived(this.bytesRead); dm.getStats().incProcessedMessages(1L); if (DistributionStats.enableClockStats) { dm.getStats().incProcessedMessagesTime(time);
long startSer = theStats.startMsgSerialization(); Message jmsg = createJGMessage(msg, local, Version.CURRENT_ORDINAL); theStats.endMsgSerialization(startSer); jmsg.setFlag(Message.Flag.NO_RELIABILITY); theStats.incSentBytes(jmsg.getLength()); logger.trace("Sending JGroups message: {}", jmsg); myChannel.send(jmsg); long startSer = theStats.startMsgSerialization(); boolean firstMessage = true; for (GMSMember mbr : calculatedMembers) { messages.put(version, jmsg); if (firstMessage) { theStats.incSentBytes(jmsg.getLength()); firstMessage = false; theStats.endMsgSerialization(startSer); Collections.shuffle(calculatedMembers); int i = 0;
byte[] buf = jgmsg.getRawBuffer(); try { long start = services.getStatistics().startMsgDeserialization(); services.getStatistics().endMsgDeserialization(start); } catch (ClassNotFoundException | IOException | RuntimeException e) { problem = e;
if (this.finishedConnecting) { if (this.isReceiver) { stats.decReceivers(); } else { stats.decSenders(this.sharedResource, this.preserveOrder);
long readAckStart = 0; if (stats != null) { readAckStart = stats.startReplyWait(); } finally { if (stats != null) { stats.endReplyWait(readAckStart, startTime);
setMessageFlags(gfmsg, msg); try { long start = services.getStatistics().startMsgSerialization(); HeapDataOutputStream out_stream = new HeapDataOutputStream(Version.fromOrdinalOrCurrent(version)); services.getStatistics().endMsgSerialization(start); } catch (IOException | GemFireIOException ex) { logger.warn("Error serializing message", ex);
this.stats.endMsgSerialization(this.serStartTime); for (Iterator it = this.cons.iterator(); it.hasNext();) { Connection con = (Connection) it.next();
private void postWait() { waiting = false; removeListener(); final DistributionManager mgr = getDistributionManager(); mgr.getStats().endReplyWait(this.statStart, this.initTime); mgr.getCancelCriterion().checkCancelInProgress(null); }
DataInputStream dis = v == null ? new DataInputStream(this.is) : new VersionedDataInputStream(this.is, v); long startSer = this.stats.startMsgDeserialization(); setResult((DistributionMessage) InternalDataSerializer.readDSFID(dis)); this.stats.endMsgDeserialization(startSer); } catch (VirtualMachineError err) { SystemFailure.initiateFailure(err);
private void readMessage(ByteBuffer peerDataBuffer) { if (messageType == NORMAL_MSG_TYPE) { this.owner.getConduit().getStats().incMessagesBeingReceived(true, messageLength); ByteBufferInputStream bbis = remoteVersion == null ? new ByteBufferInputStream(peerDataBuffer) long startSer = this.owner.getConduit().getStats().startMsgDeserialization(); msg = (DistributionMessage) InternalDataSerializer.readDSFID(bbis); this.owner.getConduit().getStats().endMsgDeserialization(startSer); if (bbis.available() != 0) { logger.warn("Message deserialization of {} did not read {} bytes.", this.owner.getConduit().getStats().incMessagesBeingReceived(md.size() == 0, messageLength); try { this.owner.getConduit().getStats().incMessagesBeingReceived(md.size() == 0, messageLength); try { msg = md.getMessage(); } catch (ClassNotFoundException ex) { this.owner.getConduit().getStats().decMessagesBeingReceived(md.size()); failureMsg = "ClassNotFound deserializing message"; failureEx = ex; logger.fatal("ClassNotFound deserializing message: {}", ex.toString()); } catch (IOException ex) { this.owner.getConduit().getStats().decMessagesBeingReceived(md.size()); failureMsg = "IOException deserializing message";