diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java index 1cf044e447a69..52c9016702d9b 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java @@ -186,86 +186,11 @@ public TcpClientDiscoverySpi() { sockTimeout = DFLT_SOCK_TIMEOUT; } - /** {@inheritDoc} */ - @Override public long getSocketTimeout() { - return sockTimeout; - } - - /** {@inheritDoc} */ - @Override public long getAckTimeout() { - return ackTimeout; - } - - /** {@inheritDoc} */ - @Override public long getNetworkTimeout() { - return netTimeout; - } - - /** {@inheritDoc} */ - @Override public int getThreadPriority() { - return threadPri; - } - - /** {@inheritDoc} */ - @Override public long getHeartbeatFrequency() { - return hbFreq; - } - - /** {@inheritDoc} */ - @Override public String getIpFinderFormatted() { - return ipFinder.toString(); - } - /** {@inheritDoc} */ @Override public int getMessageWorkerQueueSize() { return msgWorker.queueSize(); } - /** {@inheritDoc} */ - @Override public long getNodesJoined() { - return stats.joinedNodesCount(); - } - - /** {@inheritDoc} */ - @Override public long getNodesLeft() { - return stats.leftNodesCount(); - } - - /** {@inheritDoc} */ - @Override public long getNodesFailed() { - return stats.failedNodesCount(); - } - - /** {@inheritDoc} */ - @Override public long getAvgMessageProcessingTime() { - return stats.avgMessageProcessingTime(); - } - - /** {@inheritDoc} */ - @Override public long getMaxMessageProcessingTime() { - return stats.maxMessageProcessingTime(); - } - - /** {@inheritDoc} */ - @Override public int getTotalReceivedMessages() { - return stats.totalReceivedMessages(); - } - - /** {@inheritDoc} */ - @Override public Map getReceivedMessages() { - return stats.receivedMessages(); - } - - /** {@inheritDoc} */ - @Override public int getTotalProcessedMessages() { - return stats.totalProcessedMessages(); - } - - /** {@inheritDoc} */ - @Override public Map getProcessedMessages() { - return stats.processedMessages(); - } - /** {@inheritDoc} */ @Override public void spiStart(@Nullable String gridName) throws IgniteSpiException { startStopwatch(); diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java index 6bad0f2a26b5f..2123afc89c680 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java @@ -520,101 +520,11 @@ public void setDebugMessageHistory(int debugMsgHist) { } } - /** {@inheritDoc} */ - @Override public long getSocketTimeout() { - return sockTimeout; - } - - /** {@inheritDoc} */ - @Override public long getAckTimeout() { - return ackTimeout; - } - - /** {@inheritDoc} */ - @Override public long getNetworkTimeout() { - return netTimeout; - } - - /** {@inheritDoc} */ - @Override public int getThreadPriority() { - return threadPri; - } - - /** {@inheritDoc} */ - @Override public long getHeartbeatFrequency() { - return hbFreq; - } - - /** {@inheritDoc} */ - @Override public String getIpFinderFormatted() { - return ipFinder.toString(); - } - /** {@inheritDoc} */ @Override public int getMessageWorkerQueueSize() { return msgWorker.queueSize(); } - /** {@inheritDoc} */ - @Override public long getNodesJoined() { - return stats.joinedNodesCount(); - } - - /** {@inheritDoc} */ - @Override public long getNodesLeft() { - return stats.leftNodesCount(); - } - - /** {@inheritDoc} */ - @Override public long getNodesFailed() { - return stats.failedNodesCount(); - } - - /** {@inheritDoc} */ - @Override public long getPendingMessagesRegistered() { - return stats.pendingMessagesRegistered(); - } - - /** {@inheritDoc} */ - @Override public long getPendingMessagesDiscarded() { - return stats.pendingMessagesDiscarded(); - } - - /** {@inheritDoc} */ - @Override public long getAvgMessageProcessingTime() { - return stats.avgMessageProcessingTime(); - } - - /** {@inheritDoc} */ - @Override public long getMaxMessageProcessingTime() { - return stats.maxMessageProcessingTime(); - } - - /** {@inheritDoc} */ - @Override public int getTotalReceivedMessages() { - return stats.totalReceivedMessages(); - } - - /** {@inheritDoc} */ - @Override public Map getReceivedMessages() { - return stats.receivedMessages(); - } - - /** {@inheritDoc} */ - @Override public int getTotalProcessedMessages() { - return stats.totalProcessedMessages(); - } - - /** {@inheritDoc} */ - @Override public Map getProcessedMessages() { - return stats.processedMessages(); - } - - /** {@inheritDoc} */ - @Override public long getCoordinatorSinceTimestamp() { - return stats.coordinatorSinceTimestamp(); - } - /** {@inheritDoc} */ @Nullable @Override public UUID getCoordinator() { TcpDiscoveryNode crd = resolveCoordinator(); diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiAdapter.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiAdapter.java index 5bfd37866c80c..d5ea9f29145b9 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiAdapter.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiAdapter.java @@ -359,6 +359,168 @@ public void setTopHistorySize(int topHistSize) { return F.asList(ipFinder); } + /** + * Gets socket timeout. + * + * @return Socket timeout. + */ + public long getSocketTimeout() { + return sockTimeout; + } + + /** + * Gets message acknowledgement timeout. + * + * @return Message acknowledgement timeout. + */ + public long getAckTimeout() { + return ackTimeout; + } + + /** + * Gets network timeout. + * + * @return Network timeout. + */ + public long getNetworkTimeout() { + return netTimeout; + } + + /** + * Gets thread priority. All threads within SPI will be started with it. + * + * @return Thread priority. + */ + public int getThreadPriority() { + return threadPri; + } + + /** + * Gets delay between heartbeat messages sent by coordinator. + * + * @return Time period in milliseconds. + */ + public long getHeartbeatFrequency() { + return hbFreq; + } + + /** + * Gets {@link org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder} (string representation). + * + * @return IPFinder (string representation). + */ + public String getIpFinderFormatted() { + return ipFinder.toString(); + } + + /** + * Gets joined nodes count. + * + * @return Nodes joined count. + */ + public long getNodesJoined() { + return stats.joinedNodesCount(); + } + + /** + * Gets left nodes count. + * + * @return Left nodes count. + */ + public long getNodesLeft() { + return stats.leftNodesCount(); + } + + /** + * Gets failed nodes count. + * + * @return Failed nodes count. + */ + public long getNodesFailed() { + return stats.failedNodesCount(); + } + + /** + * Gets pending messages registered count. + * + * @return Pending messages registered count. + */ + public long getPendingMessagesRegistered() { + return stats.pendingMessagesRegistered(); + } + + /** + * Gets pending messages discarded count. + * + * @return Pending messages registered count. + */ + public long getPendingMessagesDiscarded() { + return stats.pendingMessagesDiscarded(); + } + + /** + * Gets avg message processing time. + * + * @return Avg message processing time. + */ + public long getAvgMessageProcessingTime() { + return stats.avgMessageProcessingTime(); + } + + /** + * Gets max message processing time. + * + * @return Max message processing time. + */ + public long getMaxMessageProcessingTime() { + return stats.maxMessageProcessingTime(); + } + + /** + * Gets total received messages count. + * + * @return Total received messages count. + */ + public int getTotalReceivedMessages() { + return stats.totalReceivedMessages(); + } + + /** + * Gets received messages counts (grouped by type). + * + * @return Map containing message types and respective counts. + */ + public Map getReceivedMessages() { + return stats.receivedMessages(); + } + + /** + * Gets total processed messages count. + * + * @return Total processed messages count. + */ + public int getTotalProcessedMessages() { + return stats.totalProcessedMessages(); + } + + /** + * Gets processed messages counts (grouped by type). + * + * @return Map containing message types and respective counts. + */ + public Map getProcessedMessages() { + return stats.processedMessages(); + } + + /** + * Gets time local node has been coordinator since. + * + * @return Time local node is coordinator since. + */ + public long getCoordinatorSinceTimestamp() { + return stats.coordinatorSinceTimestamp(); + } + /** {@inheritDoc} */ @Override protected void onContextInitialized0(IgniteSpiContext spiCtx) throws IgniteSpiException { super.onContextInitialized0(spiCtx);