You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2020/03/04 12:22:05 UTC
[ignite] branch master updated: IGNITE-12735 Possible NPE during
export of communication metrics is fixed
This is an automated email from the ASF dual-hosted git repository.
agura pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/master by this push:
new bd5529e IGNITE-12735 Possible NPE during export of communication metrics is fixed
bd5529e is described below
commit bd5529ea8c264d516613c8472a6ef53de0ea3aed
Author: Andrey Gura <ag...@apache.org>
AuthorDate: Mon Mar 2 17:40:18 2020 +0300
IGNITE-12735 Possible NPE during export of communication metrics is fixed
---
.../managers/communication/GridIoManager.java | 32 +++++++++++-----------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
index 898245e..5d4cc9a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
@@ -385,22 +385,6 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
sysLsnrs = new GridMessageListener[GridTopic.values().length];
}
- MetricRegistry ioMetric = ctx.metric().registry(COMM_METRICS);
-
- CommunicationSpi spi = ctx.config().getCommunicationSpi();
-
- ioMetric.register(OUTBOUND_MSG_QUEUE_CNT, spi::getOutboundMessagesQueueSize,
- "Outbound messages queue size.");
-
- ioMetric.register(SENT_MSG_CNT, spi::getSentMessagesCount, "Sent messages count.");
-
- ioMetric.register(SENT_BYTES_CNT, spi::getSentBytesCount, "Sent bytes count.");
-
- ioMetric.register(RCVD_MSGS_CNT, spi::getReceivedMessagesCount,
- "Received messages count.");
-
- ioMetric.register(RCVD_BYTES_CNT, spi::getReceivedBytesCount, "Received bytes count.");
-
retryCnt = ctx.config().getNetworkSendRetryCount();
netTimeoutMs = (int)ctx.config().getNetworkTimeout();
}
@@ -434,6 +418,22 @@ public class GridIoManager extends GridManagerAdapter<CommunicationSpi<Serializa
@Override public void start() throws IgniteCheckedException {
startSpi();
+ MetricRegistry ioMetric = ctx.metric().registry(COMM_METRICS);
+
+ CommunicationSpi spi = ctx.config().getCommunicationSpi();
+
+ ioMetric.register(OUTBOUND_MSG_QUEUE_CNT, spi::getOutboundMessagesQueueSize,
+ "Outbound messages queue size.");
+
+ ioMetric.register(SENT_MSG_CNT, spi::getSentMessagesCount, "Sent messages count.");
+
+ ioMetric.register(SENT_BYTES_CNT, spi::getSentBytesCount, "Sent bytes count.");
+
+ ioMetric.register(RCVD_MSGS_CNT, spi::getReceivedMessagesCount,
+ "Received messages count.");
+
+ ioMetric.register(RCVD_BYTES_CNT, spi::getReceivedBytesCount, "Received bytes count.");
+
getSpi().setListener(commLsnr = new CommunicationListenerEx<Serializable>() {
@Override public void onMessage(UUID nodeId, Serializable msg, IgniteRunnable msgC) {
try {