You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ni...@apache.org on 2022/12/02 12:24:00 UTC
[ignite] branch master updated: IGNITE-18301 Removal of visor console (#10411)
This is an automated email from the ASF dual-hosted git repository.
nizhikov 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 b53f2b842c8 IGNITE-18301 Removal of visor console (#10411)
b53f2b842c8 is described below
commit b53f2b842c800b78aa63c438cd7a7140a7eba601
Author: Nikolay <ni...@apache.org>
AuthorDate: Fri Dec 2 15:23:50 2022 +0300
IGNITE-18301 Removal of visor console (#10411)
---
assembly/dependencies-apache-ignite-lgpl.xml | 3 -
assembly/dependencies-apache-ignite-slim.xml | 3 -
assembly/dependencies-apache-ignite.xml | 3 -
assembly/dependencies-visor-console.xml | 132 -
assembly/release-apache-ignite-hadoop.xml | 9 -
assembly/release-base.xml | 4 -
assembly/release-scala.xml | 51 -
bin/ignitevisorcmd.bat | 173 --
bin/ignitevisorcmd.sh | 144 -
bin/setup-hadoop.bat | 28 -
bin/setup-hadoop.sh | 63 -
config/visor-cmd/node_startup_by_ssh.sample.ini | 79 -
examples/pom.xml | 19 -
.../rest/JettyRestProcessorAbstractSelfTest.java | 564 ----
.../internal/plugin/IgniteLogInfoProviderImpl.java | 8 -
.../processors/rest/GridRestProcessor.java | 5 -
.../internal/visor/VisorCoordinatorNodeTask.java | 39 -
.../apache/ignite/internal/visor/VisorEither.java | 103 -
.../internal/visor/binary/VisorBinaryMetadata.java | 138 -
.../binary/VisorBinaryMetadataCollectorTask.java | 74 -
.../VisorBinaryMetadataCollectorTaskArg.java | 71 -
.../VisorBinaryMetadataCollectorTaskResult.java | 87 -
.../visor/binary/VisorBinaryMetadataField.java | 101 -
.../ignite/internal/visor/cache/VisorCache.java | 341 ---
.../visor/cache/VisorCacheAffinityNodeTask.java | 71 -
.../visor/cache/VisorCacheAffinityNodeTaskArg.java | 86 -
.../visor/cache/VisorCacheAggregatedMetrics.java | 628 -----
.../internal/visor/cache/VisorCacheClearTask.java | 146 --
.../visor/cache/VisorCacheClearTaskArg.java | 72 -
.../visor/cache/VisorCacheClearTaskResult.java | 85 -
.../internal/visor/cache/VisorCacheLoadTask.java | 102 -
.../visor/cache/VisorCacheLoadTaskArg.java | 101 -
.../visor/cache/VisorCacheLostPartitionsTask.java | 88 -
.../cache/VisorCacheLostPartitionsTaskArg.java | 81 -
.../cache/VisorCacheLostPartitionsTaskResult.java | 74 -
.../visor/cache/VisorCacheMetadataTask.java | 87 -
.../visor/cache/VisorCacheMetadataTaskArg.java | 72 -
.../internal/visor/cache/VisorCacheMetrics.java | 812 ------
.../cache/VisorCacheMetricsCollectorTask.java | 136 -
.../cache/VisorCacheMetricsCollectorTaskArg.java | 87 -
.../internal/visor/cache/VisorCacheModifyTask.java | 115 -
.../visor/cache/VisorCacheModifyTaskArg.java | 120 -
.../visor/cache/VisorCacheModifyTaskResult.java | 101 -
.../visor/cache/VisorCacheNamesCollectorTask.java | 90 -
.../cache/VisorCacheNamesCollectorTaskResult.java | 88 -
.../internal/visor/cache/VisorCacheNodesTask.java | 76 -
.../visor/cache/VisorCacheNodesTaskArg.java | 72 -
.../internal/visor/cache/VisorCachePartitions.java | 100 -
.../visor/cache/VisorCachePartitionsTask.java | 147 --
.../visor/cache/VisorCachePartitionsTaskArg.java | 72 -
.../visor/cache/VisorCacheRebalanceTask.java | 86 -
.../visor/cache/VisorCacheRebalanceTaskArg.java | 73 -
.../cache/VisorCacheResetLostPartitionsTask.java | 67 -
.../VisorCacheResetLostPartitionsTaskArg.java | 81 -
.../visor/cache/VisorCacheResetMetricsTask.java | 69 -
.../visor/cache/VisorCacheResetMetricsTaskArg.java | 72 -
.../visor/cache/VisorCacheSqlIndexMetadata.java | 115 -
.../visor/cache/VisorCacheSqlMetadata.java | 162 --
.../internal/visor/cache/VisorCacheStartTask.java | 112 -
.../visor/cache/VisorCacheStartTaskArg.java | 100 -
.../cache/VisorCacheToggleStatisticsTask.java | 72 -
.../cache/VisorCacheToggleStatisticsTaskArg.java | 87 -
.../internal/visor/cache/VisorMemoryMetrics.java | 352 ---
.../internal/visor/cache/VisorModifyCacheMode.java | 47 -
.../internal/visor/cache/VisorPartitionMap.java | 110 -
.../compute/VisorComputeMonitoringHolder.java | 121 -
.../compute/VisorComputeResetMetricsTask.java | 67 -
.../compute/VisorComputeToggleMonitoringTask.java | 112 -
.../VisorComputeToggleMonitoringTaskArg.java | 86 -
.../internal/visor/compute/VisorGatewayTask.java | 475 ----
.../internal/visor/debug/VisorThreadDumpTask.java | 77 -
.../visor/debug/VisorThreadDumpTaskResult.java | 88 -
.../internal/visor/debug/VisorThreadInfo.java | 348 ---
.../internal/visor/debug/VisorThreadLockInfo.java | 93 -
.../visor/debug/VisorThreadMonitorInfo.java | 100 -
.../visor/event/VisorGridDeploymentEvent.java | 106 -
.../visor/event/VisorGridDiscoveryEvent.java | 152 --
.../internal/visor/event/VisorGridEvent.java | 162 --
.../internal/visor/event/VisorGridEventsLost.java | 54 -
.../internal/visor/event/VisorGridJobEvent.java | 151 --
.../internal/visor/event/VisorGridTaskEvent.java | 151 --
.../ignite/internal/visor/file/VisorFileBlock.java | 144 -
.../internal/visor/file/VisorFileBlockTask.java | 89 -
.../internal/visor/file/VisorFileBlockTaskArg.java | 114 -
.../visor/file/VisorFileBlockTaskResult.java | 87 -
.../visor/file/VisorLatestTextFilesTask.java | 97 -
.../visor/file/VisorLatestTextFilesTaskArg.java | 86 -
.../ignite/internal/visor/igfs/VisorIgfs.java | 117 -
.../internal/visor/igfs/VisorIgfsEndpoint.java | 134 -
.../internal/visor/igfs/VisorIgfsFormatTask.java | 67 -
.../visor/igfs/VisorIgfsFormatTaskArg.java | 73 -
.../internal/visor/igfs/VisorIgfsMetrics.java | 270 --
.../ignite/internal/visor/igfs/VisorIgfsMode.java | 72 -
.../internal/visor/igfs/VisorIgfsProfiler.java | 88 -
.../visor/igfs/VisorIgfsProfilerClearTask.java | 70 -
.../visor/igfs/VisorIgfsProfilerClearTaskArg.java | 73 -
.../igfs/VisorIgfsProfilerClearTaskResult.java | 86 -
.../visor/igfs/VisorIgfsProfilerEntry.java | 284 --
.../internal/visor/igfs/VisorIgfsProfilerTask.java | 71 -
.../visor/igfs/VisorIgfsProfilerTaskArg.java | 73 -
.../igfs/VisorIgfsProfilerUniformityCounters.java | 233 --
.../visor/igfs/VisorIgfsResetMetricsTask.java | 67 -
.../visor/igfs/VisorIgfsResetMetricsTaskArg.java | 74 -
.../visor/igfs/VisorIgfsSamplingStateTask.java | 67 -
.../visor/igfs/VisorIgfsSamplingStateTaskArg.java | 87 -
.../ignite/internal/visor/log/VisorLogFile.java | 112 -
.../internal/visor/log/VisorLogSearchResult.java | 192 --
.../internal/visor/log/VisorLogSearchTask.java | 239 --
.../internal/visor/log/VisorLogSearchTaskArg.java | 114 -
.../visor/log/VisorLogSearchTaskResult.java | 92 -
.../ignite/internal/visor/misc/VisorAckTask.java | 75 -
.../internal/visor/misc/VisorAckTaskArg.java | 72 -
.../visor/misc/VisorChangeGridActiveStateTask.java | 67 -
.../misc/VisorChangeGridActiveStateTaskArg.java | 71 -
.../visor/misc/VisorLatestVersionTask.java | 63 -
.../ignite/internal/visor/misc/VisorNopTask.java | 98 -
.../visor/misc/VisorResolveHostNameTask.java | 107 -
.../visor/node/VisorAffinityTopologyVersion.java | 87 -
.../visor/node/VisorAtomicConfiguration.java | 101 -
.../visor/node/VisorBasicConfiguration.java | 551 ----
.../visor/node/VisorBinaryConfiguration.java | 131 -
.../visor/node/VisorBinaryTypeConfiguration.java | 150 --
.../visor/node/VisorCacheKeyConfiguration.java | 108 -
.../VisorCacheRebalanceCollectorJobResult.java | 91 -
.../node/VisorCacheRebalanceCollectorTask.java | 199 --
.../node/VisorCacheRebalanceCollectorTaskArg.java | 54 -
.../VisorCacheRebalanceCollectorTaskResult.java | 92 -
.../node/VisorClientConnectorConfiguration.java | 281 --
.../visor/node/VisorDataRegionConfiguration.java | 238 --
.../visor/node/VisorDataStorageConfiguration.java | 478 ----
.../visor/node/VisorExecutorConfiguration.java | 108 -
.../node/VisorExecutorServiceConfiguration.java | 269 --
.../visor/node/VisorGridConfiguration.java | 470 ----
.../visor/node/VisorHadoopConfiguration.java | 127 -
.../visor/node/VisorIgfsConfiguration.java | 320 ---
.../visor/node/VisorLifecycleConfiguration.java | 78 -
.../visor/node/VisorMemoryConfiguration.java | 167 --
.../visor/node/VisorMemoryPolicyConfiguration.java | 159 --
.../visor/node/VisorMetricsConfiguration.java | 100 -
.../visor/node/VisorMvccConfiguration.java | 94 -
.../visor/node/VisorNodeBaselineStatus.java | 47 -
.../node/VisorNodeConfigurationCollectorJob.java | 47 -
.../node/VisorNodeConfigurationCollectorTask.java | 35 -
.../visor/node/VisorNodeDataCollectorJob.java | 289 --
.../node/VisorNodeDataCollectorJobResult.java | 335 ---
.../visor/node/VisorNodeDataCollectorTask.java | 130 -
.../visor/node/VisorNodeDataCollectorTaskArg.java | 238 --
.../node/VisorNodeDataCollectorTaskResult.java | 346 ---
.../visor/node/VisorNodeEventsCollectorTask.java | 220 --
.../node/VisorNodeEventsCollectorTaskArg.java | 163 --
.../internal/visor/node/VisorNodeGcTask.java | 102 -
.../internal/visor/node/VisorNodeGcTaskResult.java | 85 -
.../internal/visor/node/VisorNodePingTask.java | 81 -
.../internal/visor/node/VisorNodePingTaskArg.java | 73 -
.../visor/node/VisorNodePingTaskResult.java | 99 -
.../internal/visor/node/VisorNodeRestartTask.java | 80 -
.../internal/visor/node/VisorNodeStopTask.java | 80 -
.../visor/node/VisorNodeSuppressedErrors.java | 89 -
.../visor/node/VisorNodeSuppressedErrorsTask.java | 110 -
.../node/VisorNodeSuppressedErrorsTaskArg.java | 74 -
.../visor/node/VisorPeerToPeerConfiguration.java | 104 -
.../node/VisorPersistentStoreConfiguration.java | 293 ---
.../visor/node/VisorRestConfiguration.java | 366 ---
.../visor/node/VisorSegmentationConfiguration.java | 144 -
.../visor/node/VisorServiceConfiguration.java | 175 --
.../internal/visor/node/VisorSpiDescription.java | 89 -
.../visor/node/VisorSpisConfiguration.java | 256 --
.../visor/node/VisorSqlConnectorConfiguration.java | 170 --
.../internal/visor/node/VisorSuppressedError.java | 147 --
.../visor/node/VisorTransactionConfiguration.java | 159 --
.../internal/visor/query/VisorQueryCancelTask.java | 74 -
.../visor/query/VisorQueryCancelTaskArg.java | 71 -
.../visor/query/VisorQueryCleanupTask.java | 134 -
.../visor/query/VisorQueryCleanupTaskArg.java | 75 -
.../visor/query/VisorQueryDetailMetrics.java | 205 --
.../VisorQueryDetailMetricsCollectorTask.java | 145 --
.../VisorQueryDetailMetricsCollectorTaskArg.java | 71 -
.../visor/query/VisorQueryFetchFirstPageTask.java | 107 -
.../internal/visor/query/VisorQueryField.java | 132 -
.../internal/visor/query/VisorQueryHolder.java | 171 --
.../internal/visor/query/VisorQueryMetrics.java | 125 -
.../visor/query/VisorQueryNextPageTask.java | 91 -
.../visor/query/VisorQueryNextPageTaskArg.java | 86 -
.../internal/visor/query/VisorQueryPingTask.java | 88 -
.../visor/query/VisorQueryPingTaskResult.java | 50 -
.../query/VisorQueryResetDetailMetricsTask.java | 73 -
.../visor/query/VisorQueryResetMetricsTask.java | 75 -
.../visor/query/VisorQueryResetMetricsTaskArg.java | 72 -
.../internal/visor/query/VisorQueryResult.java | 152 --
.../visor/query/VisorQueryScanRegexFilter.java | 60 -
.../internal/visor/query/VisorQueryTask.java | 91 -
.../internal/visor/query/VisorQueryTaskArg.java | 249 --
.../internal/visor/query/VisorQueryUtils.java | 519 ----
.../query/VisorRunningQueriesCollectorTask.java | 101 -
.../query/VisorRunningQueriesCollectorTaskArg.java | 71 -
.../internal/visor/query/VisorRunningQuery.java | 175 --
.../internal/visor/query/VisorScanQueryTask.java | 83 -
.../visor/query/VisorScanQueryTaskArg.java | 157 --
.../visor/service/VisorServiceDescriptor.java | 166 --
.../internal/visor/service/VisorServiceTask.java | 77 -
.../internal/visor/util/VisorEventMapper.java | 147 --
.../ignite/internal/visor/util/VisorMimeTypes.java | 1019 --------
.../ignite/internal/visor/util/VisorTaskUtils.java | 920 -------
.../visor/verify/VisorIdleAnalyzeTask.java | 124 -
.../visor/verify/VisorIdleAnalyzeTaskArg.java | 88 -
.../visor/verify/VisorIdleAnalyzeTaskResult.java | 76 -
.../main/resources/META-INF/classnames.properties | 899 +++----
...inaryConfigurationCustomSerializerSelfTest.java | 10 +-
.../cache/CacheGroupsMetricsRebalanceTest.java | 17 -
.../GridInternalTasksLoadBalancingSelfTest.java | 23 -
modules/visor-console-2.10/README.txt | 4 -
modules/visor-console-2.10/pom.xml | 180 --
modules/visor-console/licenses/apache-2.0.txt | 202 --
modules/visor-console/pom.xml | 170 --
.../ignite/visor/commands/VisorConsole.scala | 473 ----
.../visor/commands/ack/VisorAckCommand.scala | 143 -
.../visor/commands/alert/VisorAlertCommand.scala | 938 -------
.../commands/cache/VisorCacheClearCommand.scala | 131 -
.../visor/commands/cache/VisorCacheCommand.scala | 1032 --------
.../cache/VisorCacheLostPartitionsCommand.scala | 170 --
.../commands/cache/VisorCacheModifyCommand.scala | 413 ---
.../cache/VisorCacheRebalanceCommand.scala | 134 -
.../commands/cache/VisorCacheResetCommand.scala | 129 -
.../VisorCacheResetLostPartitionsCommand.scala | 132 -
.../commands/cache/VisorCacheScanCommand.scala | 237 --
.../commands/cache/VisorCacheStopCommand.scala | 136 -
.../cache/VisorCacheToggleStatisticsCommand.scala | 152 --
.../commands/common/VisorConsoleCommand.scala | 104 -
.../visor/commands/common/VisorTextTable.scala | 541 ----
.../config/VisorConfigurationCommand.scala | 461 ----
.../visor/commands/deploy/VisorDeployCommand.scala | 582 -----
.../commands/disco/VisorDiscoveryCommand.scala | 301 ---
.../visor/commands/events/VisorEventsCommand.scala | 474 ----
.../ignite/visor/commands/gc/VisorGcCommand.scala | 196 --
.../visor/commands/kill/VisorKillCommand.scala | 431 ---
.../visor/commands/node/VisorNodeCommand.scala | 379 ---
.../visor/commands/open/VisorOpenCommand.scala | 307 ---
.../visor/commands/ping/VisorPingCommand.scala | 217 --
.../visor/commands/start/VisorStartCommand.scala | 425 ---
.../visor/commands/tasks/VisorTasksCommand.scala | 1445 ----------
.../visor/commands/top/VisorTopologyCommand.scala | 449 ----
.../visor/commands/vvm/VisorVvmCommand.scala | 301 ---
.../main/scala/org/apache/ignite/visor/visor.scala | 2747 --------------------
.../apache/ignite/visor/VisorRuntimeBaseSpec.scala | 82 -
.../apache/ignite/visor/VisorTextTableSpec.scala | 45 -
.../ignite/visor/commands/VisorArgListSpec.scala | 72 -
.../commands/VisorFileNameCompleterSpec.scala | 58 -
.../visor/commands/ack/VisorAckCommandSpec.scala | 40 -
.../commands/alert/VisorAlertCommandSpec.scala | 153 --
.../cache/VisorCacheClearCommandSpec.scala | 101 -
.../commands/cache/VisorCacheCommandSpec.scala | 164 --
.../cache/VisorCacheResetCommandSpec.scala | 114 -
.../config/VisorConfigurationCommandSpec.scala | 50 -
.../commands/deploy/VisorDeployCommandSpec.scala | 34 -
.../commands/disco/VisorDiscoveryCommandSpec.scala | 85 -
.../commands/events/VisorEventsCommandSpec.scala | 62 -
.../visor/commands/gc/VisorGcCommandSpec.scala | 61 -
.../visor/commands/help/VisorHelpCommandSpec.scala | 73 -
.../visor/commands/kill/VisorKillCommandSpec.scala | 59 -
.../visor/commands/log/VisorLogCommandSpec.scala | 32 -
.../commands/mem/VisorMemoryCommandSpec.scala | 115 -
.../visor/commands/node/VisorNodeCommandSpec.scala | 42 -
.../visor/commands/open/VisorOpenCommandSpec.scala | 36 -
.../visor/commands/ping/VisorPingCommandSpec.scala | 38 -
.../commands/start/VisorStartCommandSpec.scala | 124 -
.../commands/tasks/VisorTasksCommandSpec.scala | 221 --
.../commands/top/VisorActivationCommandSpec.scala | 70 -
.../commands/top/VisorTopologyCommandSpec.scala | 62 -
.../visor/commands/vvm/VisorVvmCommandSpec.scala | 47 -
.../testsuites/VisorConsoleSelfTestSuite.scala | 93 -
modules/visor-plugins/licenses/apache-2.0.txt | 202 --
modules/visor-plugins/pom.xml | 86 -
.../visor-plugins/src/main/java/log4j2.properties | 31 -
.../ignite/visor/plugin/VisorExtensionPoint.java | 75 -
.../ignite/visor/plugin/VisorPluggableTab.java | 64 -
.../apache/ignite/visor/plugin/VisorPlugin.java | 53 -
.../ignite/visor/plugin/VisorPluginComponent.java | 30 -
.../visor/plugin/VisorPluginComponentsFactory.java | 49 -
.../ignite/visor/plugin/VisorPluginLogPanel.java | 26 -
.../ignite/visor/plugin/VisorPluginModel.java | 97 -
.../ignite/visor/plugin/VisorPluginNodesPanel.java | 49 -
.../visor/plugin/VisorSelectionListener.java | 32 -
.../ignite/visor/plugin/VisorTopologyListener.java | 53 -
.../apache/ignite/visor/plugin/package-info.java | 23 -
packaging/rpm/apache-ignite.spec | 5 -
pom.xml | 67 -
286 files changed, 433 insertions(+), 46750 deletions(-)
diff --git a/assembly/dependencies-apache-ignite-lgpl.xml b/assembly/dependencies-apache-ignite-lgpl.xml
index 44cd9ad26dd..0e1ec42f4a8 100644
--- a/assembly/dependencies-apache-ignite-lgpl.xml
+++ b/assembly/dependencies-apache-ignite-lgpl.xml
@@ -123,9 +123,6 @@
<exclude>${project.groupId}:ignite-extdata-logo</exclude>
<exclude>${project.groupId}:ignite-examples</exclude>
<exclude>${project.groupId}:ignite-indexing</exclude>
- <exclude>${project.groupId}:ignite-visor-console</exclude>
- <exclude>${project.groupId}:ignite-visor-console_2.10</exclude>
- <exclude>${project.groupId}:ignite-visor-plugins</exclude>
<exclude>${project.groupId}:ignite-codegen</exclude>
<exclude>${project.groupId}:ignite-appserver-test</exclude>
<exclude>${project.groupId}:ignite-websphere-test</exclude>
diff --git a/assembly/dependencies-apache-ignite-slim.xml b/assembly/dependencies-apache-ignite-slim.xml
index 2e1faefd414..eb81a4cdbcb 100644
--- a/assembly/dependencies-apache-ignite-slim.xml
+++ b/assembly/dependencies-apache-ignite-slim.xml
@@ -123,9 +123,6 @@
<exclude>${project.groupId}:ignite-extdata-logo</exclude>
<exclude>${project.groupId}:ignite-examples</exclude>
<exclude>${project.groupId}:ignite-indexing</exclude>
- <exclude>${project.groupId}:ignite-visor-console</exclude>
- <exclude>${project.groupId}:ignite-visor-console_2.10</exclude>
- <exclude>${project.groupId}:ignite-visor-plugins</exclude>
<exclude>${project.groupId}:ignite-hadoop</exclude>
<exclude>${project.groupId}:ignite-codegen</exclude>
<exclude>${project.groupId}:ignite-schedule</exclude>
diff --git a/assembly/dependencies-apache-ignite.xml b/assembly/dependencies-apache-ignite.xml
index d78936f1b87..695baee9108 100644
--- a/assembly/dependencies-apache-ignite.xml
+++ b/assembly/dependencies-apache-ignite.xml
@@ -124,9 +124,6 @@
<exclude>${project.groupId}:ignite-extdata-logo</exclude>
<exclude>${project.groupId}:ignite-examples</exclude>
<exclude>${project.groupId}:ignite-indexing</exclude>
- <exclude>${project.groupId}:ignite-visor-console</exclude>
- <exclude>${project.groupId}:ignite-visor-console_2.10</exclude>
- <exclude>${project.groupId}:ignite-visor-plugins</exclude>
<exclude>${project.groupId}:ignite-codegen</exclude>
<exclude>${project.groupId}:ignite-schedule</exclude>
<exclude>${project.groupId}:ignite-appserver-test</exclude>
diff --git a/assembly/dependencies-visor-console.xml b/assembly/dependencies-visor-console.xml
deleted file mode 100644
index 72cad404c4d..00000000000
--- a/assembly/dependencies-visor-console.xml
+++ /dev/null
@@ -1,132 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2
- http://maven.apache.org/xsd/assembly-1.1.2.xsd">
- <id>dependencies-visor-console</id>
-
- <formats>
- <format>dir</format>
- </formats>
-
- <includeBaseDirectory>false</includeBaseDirectory>
-
- <moduleSets>
- <moduleSet>
- <includes>
- <include>${project.groupId}:ignite-visor-console</include>
- </includes>
- <sources>
- <includeModuleDirectory>false</includeModuleDirectory>
- <fileSets>
- <fileSet>
- <directory>${basedir}</directory>
- <outputDirectory>/</outputDirectory>
- <includes>
- <include>licenses/**</include>
- </includes>
- </fileSet>
-
- <fileSet>
- <directory>${basedir}/target/licenses</directory>
- <outputDirectory>/licenses</outputDirectory>
- </fileSet>
-
- <fileSet>
- <directory>target/libs</directory>
- <outputDirectory>/visorcmd</outputDirectory>
- <excludes>
- <exclude>scala-*.jar</exclude>
- <exclude>spring-*.jar</exclude>
- </excludes>
- </fileSet>
-
- <fileSet>
- <directory>target/libs</directory>
- <outputDirectory>/visor-common</outputDirectory>
- <includes>
- <include>scala-*.jar</include>
- <include>spring-*.jar</include>
- </includes>
- </fileSet>
-
- <fileSet>
- <directory>target</directory>
- <outputDirectory>/visorcmd</outputDirectory>
- <includes>
- <include>*.jar</include>
- </includes>
- <excludes>
- <exclude>*-tests.jar</exclude>
- <exclude>*-javadoc.jar</exclude>
- <exclude>*-sources.jar</exclude>
- </excludes>
- </fileSet>
- </fileSets>
- </sources>
- </moduleSet>
-
- <moduleSet>
- <includes>
- <include>${project.groupId}:ignite-ssh</include>
- <include>${project.groupId}:ignite-spring</include>
- </includes>
- <sources>
- <includeModuleDirectory>false</includeModuleDirectory>
- <fileSets>
- <fileSet>
- <directory>${basedir}</directory>
- <outputDirectory>/</outputDirectory>
- <includes>
- <include>licenses/**</include>
- </includes>
- </fileSet>
-
- <fileSet>
- <directory>${basedir}/target/licenses</directory>
- <outputDirectory>/licenses</outputDirectory>
- </fileSet>
-
- <fileSet>
- <directory>target/libs</directory>
- <outputDirectory>/visor-common</outputDirectory>
- <excludes>
- <exclude>spring-jdbc-*.jar</exclude>
- </excludes>
- </fileSet>
-
- <fileSet>
- <directory>target</directory>
- <outputDirectory>/visor-common</outputDirectory>
- <includes>
- <include>*.jar</include>
- </includes>
- <excludes>
- <exclude>*-tests.jar</exclude>
- <exclude>*-javadoc.jar</exclude>
- <exclude>*-sources.jar</exclude>
- </excludes>
- </fileSet>
- </fileSets>
- </sources>
- </moduleSet>
- </moduleSets>
-</assembly>
diff --git a/assembly/release-apache-ignite-hadoop.xml b/assembly/release-apache-ignite-hadoop.xml
index 3f61ec927b6..940babbdc0e 100644
--- a/assembly/release-apache-ignite-hadoop.xml
+++ b/assembly/release-apache-ignite-hadoop.xml
@@ -74,20 +74,11 @@
</excludes>
</fileSet>
- <fileSet>
- <directory>bin</directory>
- <outputDirectory>/bin</outputDirectory>
- <includes>
- <include>**/*hadoop*.bat</include>
- </includes>
- </fileSet>
-
<fileSet>
<directory>bin</directory>
<outputDirectory>/bin</outputDirectory>
<fileMode>0755</fileMode>
<includes>
- <include>**/*hadoop*.sh</include>
<include>**/service.sh</include>
</includes>
</fileSet>
diff --git a/assembly/release-base.xml b/assembly/release-base.xml
index e3bdffe1b15..f2a05ecd840 100644
--- a/assembly/release-base.xml
+++ b/assembly/release-base.xml
@@ -59,10 +59,8 @@
<include>**/*.txt</include>
</includes>
<excludes>
- <exclude>**/*hadoop*.bat</exclude>
<exclude>igniterouter.bat</exclude>
<exclude>**/build-classpath.bat</exclude>
- <exclude>ignitevisorcmd.bat</exclude>
</excludes>
</fileSet>
@@ -74,11 +72,9 @@
<include>**/*.sh</include>
</includes>
<excludes>
- <exclude>**/*hadoop*.sh</exclude>
<exclude>igniterouter.sh</exclude>
<exclude>**/build-classpath.sh</exclude>
<exclude>**/service.sh</exclude>
- <exclude>ignitevisorcmd.sh</exclude>
</excludes>
</fileSet>
diff --git a/assembly/release-scala.xml b/assembly/release-scala.xml
deleted file mode 100644
index 0164fec3f53..00000000000
--- a/assembly/release-scala.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2
- http://maven.apache.org/xsd/assembly-1.1.2.xsd">
- <id>scala</id>
-
- <includeBaseDirectory>false</includeBaseDirectory>
-
- <formats>
- <format>dir</format>
- </formats>
-
- <fileSets>
- <fileSet>
- <directory>bin</directory>
- <outputDirectory>/</outputDirectory>
- <includes>
- <include>**/ignitevisorcmd.bat</include>
- <include>**/include/visorcmd/node_startup_by_ssh.sample.ini</include>
- </includes>
- </fileSet>
-
- <fileSet>
- <directory>bin</directory>
- <outputDirectory>/</outputDirectory>
- <fileMode>0755</fileMode>
- <includes>
- <include>**/ignitevisorcmd.sh</include>
- </includes>
- </fileSet>
- </fileSets>
-</assembly>
diff --git a/bin/ignitevisorcmd.bat b/bin/ignitevisorcmd.bat
deleted file mode 100644
index 062f819f2c2..00000000000
--- a/bin/ignitevisorcmd.bat
+++ /dev/null
@@ -1,173 +0,0 @@
-::
-:: Licensed to the Apache Software Foundation (ASF) under one or more
-:: contributor license agreements. See the NOTICE file distributed with
-:: this work for additional information regarding copyright ownership.
-:: The ASF licenses this file to You under the Apache License, Version 2.0
-:: (the "License"); you may not use this file except in compliance with
-:: the License. You may obtain a copy of the License at
-::
-:: http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing, software
-:: distributed under the License is distributed on an "AS IS" BASIS,
-:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-:: See the License for the specific language governing permissions and
-:: limitations under the License.
-::
-
-::
-:: Starts Ignite Visor Console.
-::
-
-@echo off
-Setlocal EnableDelayedExpansion
-
-if "%OS%" == "Windows_NT" setlocal
-
-:: Check JAVA_HOME.
-if defined JAVA_HOME goto checkJdk
- echo %0, ERROR:
- echo JAVA_HOME environment variable is not found.
- echo Please point JAVA_HOME variable to location of JDK 1.8 or later.
- echo You can also download latest JDK at http://java.com/download.
-goto error_finish
-
-:checkJdk
-:: Check that JDK is where it should be.
-if exist "%JAVA_HOME%\bin\java.exe" goto checkJdkVersion
- echo %0, ERROR:
- echo JAVA is not found in JAVA_HOME=%JAVA_HOME%.
- echo Please point JAVA_HOME variable to installation of JDK 1.8 or later.
- echo You can also download latest JDK at http://java.com/download.
-goto error_finish
-
-:checkJdkVersion
-set cmd="%JAVA_HOME%\bin\java.exe"
-for /f "tokens=* USEBACKQ" %%f in (`%cmd% -version 2^>^&1`) do (
- set var=%%f
- goto :LoopEscape
-)
-:LoopEscape
-
-for /f "tokens=1-3 delims= " %%a in ("%var%") do set JAVA_VER_STR=%%c
-set JAVA_VER_STR=%JAVA_VER_STR:"=%
-
-for /f "tokens=1,2 delims=." %%a in ("%JAVA_VER_STR%.x") do set MAJOR_JAVA_VER=%%a& set MINOR_JAVA_VER=%%b
-if %MAJOR_JAVA_VER% == 1 set MAJOR_JAVA_VER=%MINOR_JAVA_VER%
-
-if %MAJOR_JAVA_VER% LSS 8 (
- echo %0, ERROR:
- echo The version of JAVA installed in %JAVA_HOME% is incorrect.
- echo Please point JAVA_HOME variable to installation of JDK 1.8 or later.
- echo You can also download latest JDK at http://java.com/download.
- goto error_finish
-)
-
-:: Check IGNITE_HOME.
-:checkIgniteHome1
-if defined IGNITE_HOME goto checkIgniteHome2
- pushd "%~dp0"/..
- set IGNITE_HOME=%CD%
- popd
-
-:checkIgniteHome2
-:: Strip double quotes from IGNITE_HOME
-set IGNITE_HOME=%IGNITE_HOME:"=%
-
-:: remove all trailing slashes from IGNITE_HOME.
-if %IGNITE_HOME:~-1,1% == \ goto removeTrailingSlash
-if %IGNITE_HOME:~-1,1% == / goto removeTrailingSlash
-goto checkIgniteHome3
-
-:removeTrailingSlash
-set IGNITE_HOME=%IGNITE_HOME:~0,-1%
-goto checkIgniteHome2
-
-:checkIgniteHome3
-if exist "%IGNITE_HOME%\config" goto checkIgniteHome4
- echo %0, ERROR: Ignite installation folder is not found or IGNITE_HOME environment variable is not valid.
- echo Please create IGNITE_HOME environment variable pointing to location of
- echo Ignite installation folder.
- goto error_finish
-
-:checkIgniteHome4
-
-::
-:: Set SCRIPTS_HOME - base path to scripts.
-::
-set SCRIPTS_HOME=%IGNITE_HOME%\bin
-
-:: Remove trailing spaces
-for /l %%a in (1,1,31) do if /i "%SCRIPTS_HOME:~-1%" == " " set SCRIPTS_HOME=%SCRIPTS_HOME:~0,-1%
-
-if /i "%SCRIPTS_HOME%\" == "%~dp0" goto setProgName
- echo %0, WARN: IGNITE_HOME environment variable may be pointing to wrong folder: %IGNITE_HOME%
-
-:setProgName
-::
-:: Set program name.
-::
-set PROG_NAME=ignitevisorcmd.bat
-if "%OS%" == "Windows_NT" set PROG_NAME=%~nx0%
-
-::
-:: Set IGNITE_LIBS
-::
-call "%SCRIPTS_HOME%\include\setenv.bat"
-call "%SCRIPTS_HOME%\include\build-classpath.bat" &:: Will be removed in the binary release.
-set CP=%IGNITE_HOME%\bin\include\visor-common\*;%IGNITE_HOME%\bin\include\visorcmd\*;%IGNITE_LIBS%
-
-::
-:: Parse command line parameters.
-::
-call "%SCRIPTS_HOME%\include\parseargs.bat" %*
-if %ERRORLEVEL% neq 0 (
- echo Arguments parsing failed
- exit /b %ERRORLEVEL%
-)
-
-::
-:: JVM options. See http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp for more details.
-::
-:: ADD YOUR/CHANGE ADDITIONAL OPTIONS HERE
-::
-if "%JVM_OPTS_VISOR%" == "" set JVM_OPTS_VISOR=-Xms1g -Xmx1g
-
-::
-:: Uncomment to set preference to IPv4 stack.
-::
-:: set JVM_OPTS_VISOR=%JVM_OPTS_VISOR% -Djava.net.preferIPv4Stack=true
-
-::
-:: Assertions are disabled by default since version 3.5.
-:: If you want to enable them - set 'ENABLE_ASSERTIONS' flag to '1'.
-::
-set ENABLE_ASSERTIONS=1
-
-::
-:: Set '-ea' options if assertions are enabled.
-::
-if %ENABLE_ASSERTIONS% == 1 set JVM_OPTS_VISOR=%JVM_OPTS_VISOR% -ea
-
-::
-:: Program args.
-::
-if "%ARGS%" == "" set ARGS=%*
-
-::
-:: Final JVM_OPTS for Java 9+ compatibility
-::
-call "%SCRIPTS_HOME%\include\jvmdefaults.bat" %MAJOR_JAVA_VER% "%JVM_OPTS%" JVM_OPTS
-
-::
-:: Starts Visor console.
-::
-"%JAVA_HOME%\bin\java.exe" %JVM_OPTS_VISOR% -DIGNITE_PROG_NAME="%PROG_NAME%" ^
--DIGNITE_DEPLOYMENT_MODE_OVERRIDE=ISOLATED %QUIET% %JVM_XOPTS% -cp "%CP%" ^
- org.apache.ignite.visor.commands.VisorConsole %ARGS%
-
-:error_finish
-
-if not "%NO_PAUSE%" == "1" pause
-
-goto :eof
diff --git a/bin/ignitevisorcmd.sh b/bin/ignitevisorcmd.sh
deleted file mode 100755
index 75433089556..00000000000
--- a/bin/ignitevisorcmd.sh
+++ /dev/null
@@ -1,144 +0,0 @@
-#!/usr/bin/env bash
-if [ ! -z "${IGNITE_SCRIPT_STRICT_MODE:-}" ]
-then
- set -o nounset
- set -o errexit
- set -o pipefail
- set -o errtrace
- set -o functrace
-fi
-
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-# Remember command line parameters
-ARGS=$@
-
-#
-# Import common functions.
-#
-if [ "${IGNITE_HOME:-}" = "" ];
- then IGNITE_HOME_TMP="$(dirname "$(cd "$(dirname "$0")"; "pwd")")";
- else IGNITE_HOME_TMP=${IGNITE_HOME};
-fi
-
-#
-# Set SCRIPTS_HOME - base path to scripts.
-#
-SCRIPTS_HOME="${IGNITE_HOME_TMP}/bin"
-
-source "${SCRIPTS_HOME}"/include/functions.sh
-source "${SCRIPTS_HOME}"/include/jvmdefaults.sh
-
-#
-# Discover path to Java executable and check it's version.
-#
-checkJava
-
-#
-# Discover IGNITE_HOME environment variable.
-#
-setIgniteHome
-
-#
-# Parse command line parameters.
-#
-. "${SCRIPTS_HOME}"/include/parseargs.sh
-
-#
-# Set IGNITE_LIBS.
-#
-. "${SCRIPTS_HOME}"/include/setenv.sh
-. "${SCRIPTS_HOME}"/include/build-classpath.sh # Will be removed in the binary release.
-CP="${IGNITE_HOME}/bin/include/visor-common/*${SEP}${IGNITE_HOME}/bin/include/visorcmd/*${SEP}${IGNITE_LIBS}"
-
-#
-# JVM options. See http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp for more details.
-#
-# ADD YOUR/CHANGE ADDITIONAL OPTIONS HERE
-#
-JVM_OPTS="-Xms1g -Xmx1g -server ${JVM_OPTS}"
-
-# Mac OS specific support to display correct name in the dock.
-osname=`uname`
-
-if [ "${DOCK_OPTS:-}" == "" ]; then
- DOCK_OPTS="-Xdock:name=Visor - Ignite Shell Console"
-fi
-
-#
-# Uncomment to set preference for IPv4 stack.
-#
-# JVM_OPTS="${JVM_OPTS} -Djava.net.preferIPv4Stack=true"
-
-#
-# Assertions are disabled by default since version 3.5.
-# If you want to enable them - set 'ENABLE_ASSERTIONS' flag to '1'.
-#
-ENABLE_ASSERTIONS="1"
-
-#
-# Set '-ea' options if assertions are enabled.
-#
-if [ "${ENABLE_ASSERTIONS}" = "1" ]; then
- JVM_OPTS="${JVM_OPTS} -ea"
-fi
-
-#
-# Save terminal setting. Used to restore terminal on finish.
-#
-SAVED_STTY=`stty -g 2>/dev/null`
-
-#
-# Restores terminal.
-#
-function restoreSttySettings() {
- stty ${SAVED_STTY}
-}
-
-#
-# Trap that restores terminal in case script execution is interrupted.
-#
-trap restoreSttySettings INT
-
-#
-# Final JVM_OPTS for Java 9+ compatibility
-#
-JVM_OPTS=$(getJavaSpecificOpts $version "$JVM_OPTS")
-
-#
-# Start Visor console.
-#
-case $osname in
- Darwin*)
- "$JAVA" ${JVM_OPTS} ${QUIET} "${DOCK_OPTS}" \
- -DIGNITE_UPDATE_NOTIFIER=false -DIGNITE_HOME="${IGNITE_HOME}" -DIGNITE_PROG_NAME="$0" \
- -DIGNITE_DEPLOYMENT_MODE_OVERRIDE=ISOLATED ${JVM_XOPTS} -cp "${CP}" \
- org.apache.ignite.visor.commands.VisorConsole ${ARGS}
- ;;
- *)
- "$JAVA" ${JVM_OPTS} ${QUIET} -DIGNITE_UPDATE_NOTIFIER=false \
- -DIGNITE_HOME="${IGNITE_HOME}" -DIGNITE_PROG_NAME="$0" -DIGNITE_DEPLOYMENT_MODE_OVERRIDE=ISOLATED \
- ${JVM_XOPTS} -cp "${CP}" \
- org.apache.ignite.visor.commands.VisorConsole ${ARGS}
- ;;
-esac
-
-#
-# Restore terminal.
-#
-restoreSttySettings
diff --git a/bin/setup-hadoop.bat b/bin/setup-hadoop.bat
deleted file mode 100644
index a11ef8c7c6f..00000000000
--- a/bin/setup-hadoop.bat
+++ /dev/null
@@ -1,28 +0,0 @@
-::
-:: Licensed to the Apache Software Foundation (ASF) under one or more
-:: contributor license agreements. See the NOTICE file distributed with
-:: this work for additional information regarding copyright ownership.
-:: The ASF licenses this file to You under the Apache License, Version 2.0
-:: (the "License"); you may not use this file except in compliance with
-:: the License. You may obtain a copy of the License at
-::
-:: http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing, software
-:: distributed under the License is distributed on an "AS IS" BASIS,
-:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-:: See the License for the specific language governing permissions and
-:: limitations under the License.
-::
-
-::
-:: Run this script to configure Hadoop client to work with Ignite.
-::
-
-@echo off
-
-if "%OS%" == "Windows_NT" setlocal
-
-set MAIN_CLASS=org.apache.ignite.internal.processors.hadoop.HadoopSetup
-
-call "%~dp0\ignite.bat" %*
diff --git a/bin/setup-hadoop.sh b/bin/setup-hadoop.sh
deleted file mode 100755
index 8870c750ac6..00000000000
--- a/bin/setup-hadoop.sh
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/bin/bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-#
-# Run this script to configure Hadoop client to work with Ignite.
-#
-
-HADOOP_COMMON_HOME=
-
-if [ "$HADOOP_HOME" == "" ]; then
- #Try get all variables from /etc/default
- HADOOP_DEFAULTS=/etc/default/hadoop
-
- if [ -f $HADOOP_DEFAULTS ]; then
- . $HADOOP_DEFAULTS
- fi
-fi
-
-#
-# Import common functions.
-#
-if [ "${IGNITE_HOME}" = "" ]; then
- IGNITE_HOME_TMP="$(dirname "$(cd "$(dirname "$0")"; "pwd")")"
-else
- IGNITE_HOME_TMP=${IGNITE_HOME}
-fi
-
-#
-# Set SCRIPTS_HOME - base path to scripts.
-#
-SCRIPTS_HOME="${IGNITE_HOME_TMP}/bin"
-
-source "${SCRIPTS_HOME}"/include/functions.sh
-
-#
-# Discover IGNITE_HOME environment variable.
-#
-setIgniteHome
-
-#
-# Set utility environment.
-#
-export MAIN_CLASS=org.apache.ignite.internal.processors.hadoop.HadoopSetup
-
-#
-# Start utility.
-#
-. "${SCRIPTS_HOME}/ignite.sh" $@
diff --git a/config/visor-cmd/node_startup_by_ssh.sample.ini b/config/visor-cmd/node_startup_by_ssh.sample.ini
deleted file mode 100644
index 649e0c7ec5c..00000000000
--- a/config/visor-cmd/node_startup_by_ssh.sample.ini
+++ /dev/null
@@ -1,79 +0,0 @@
-;Licensed to the Apache Software Foundation (ASF) under one or more
-;contributor license agreements. See the NOTICE file distributed with
-;this work for additional information regarding copyright ownership.
-;The ASF licenses this file to You under the Apache License, Version 2.0
-;(the "License"); you may not use this file except in compliance with
-;the License. You may obtain a copy of the License at
-;
-;http://www.apache.org/licenses/LICENSE-2.0
-;
-;Unless required by applicable law or agreed to in writing, software
-;distributed under the License is distributed on an "AS IS" BASIS,
-;WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-;See the License for the specific language governing permissions and
-;limitations under the License.
-
-# ==================================================================
-# This is a sample file for Visor CMD to use with "start" command.
-# More info: https://ignite.apache.org/docs/latest/tools/visor-cmd
-# ==================================================================
-
-# Section with settings for host1:
-[host1]
-# IP address or host name:
-host=192.168.1.1
-
-# SSH port:
-port=2200
-
-# SSH login:
-uname=userName
-
-# SSH password:
-passwd=password
-
-# SSH key path:
-key=~/.ssh/id_rsa
-
-# Number of nodes to start:
-nodes=1
-
-# Ignite home path:
-igniteHome=/usr/lib/ignite
-
-# Ignite config path:
-cfg=examples/example-ignite.xml
-
-# Ignite node start script:
-script=bin/ignite.sh
-
-# Section with settings for host2:
-[host2]
-# IP address or host name:
-host=192.168.1.2
-
-# Section with default settings. Used if value not defined in host section.
-[defaults]
-# SSH port:
-port=22
-
-# SSH login:
-uname=userName
-
-# SSH password:
-passwd=password
-
-# SSH key path:
-key=~/.ssh/id_rsa
-
-# Number of nodes to start:
-nodes=3
-
-# Ignite home path:
-igniteHome=/usr/lib/ignite
-
-# Ignite config path:
-cfg=examples/example-ignite.xml
-
-# Ignite node start script:
-script=bin/ignite.sh
diff --git a/examples/pom.xml b/examples/pom.xml
index 488478c512c..730ba8e1203 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -211,25 +211,6 @@
</properties>
<profiles>
- <profile>
- <id>scala</id>
-
- <dependencies>
- <dependency>
- <groupId>org.scalatest</groupId>
- <artifactId>scalatest_2.11</artifactId>
- <version>${scala.test.version}</version>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>org.scala-lang</groupId>
- <artifactId>scala-library</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- </dependencies>
- </profile>
-
<profile>
<id>lgpl</id>
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
index f04687ba652..76f6588e81e 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.processors.rest;
import java.io.IOException;
import java.io.Serializable;
-import java.io.UnsupportedEncodingException;
import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;
@@ -64,77 +63,11 @@ import org.apache.ignite.internal.processors.cache.IgniteCacheProxy;
import org.apache.ignite.internal.processors.cache.query.GridCacheSqlIndexMetadata;
import org.apache.ignite.internal.processors.cache.query.GridCacheSqlMetadata;
import org.apache.ignite.internal.processors.rest.handlers.GridRestCommandHandler;
-import org.apache.ignite.internal.util.typedef.C1;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.P1;
import org.apache.ignite.internal.util.typedef.T2;
import org.apache.ignite.internal.util.typedef.internal.SB;
import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.cache.VisorCacheClearTask;
-import org.apache.ignite.internal.visor.cache.VisorCacheClearTaskArg;
-import org.apache.ignite.internal.visor.cache.VisorCacheConfigurationCollectorTask;
-import org.apache.ignite.internal.visor.cache.VisorCacheConfigurationCollectorTaskArg;
-import org.apache.ignite.internal.visor.cache.VisorCacheLoadTask;
-import org.apache.ignite.internal.visor.cache.VisorCacheLoadTaskArg;
-import org.apache.ignite.internal.visor.cache.VisorCacheMetadataTask;
-import org.apache.ignite.internal.visor.cache.VisorCacheMetadataTaskArg;
-import org.apache.ignite.internal.visor.cache.VisorCacheMetricsCollectorTask;
-import org.apache.ignite.internal.visor.cache.VisorCacheMetricsCollectorTaskArg;
-import org.apache.ignite.internal.visor.cache.VisorCacheNodesTask;
-import org.apache.ignite.internal.visor.cache.VisorCacheNodesTaskArg;
-import org.apache.ignite.internal.visor.cache.VisorCachePartitionsTask;
-import org.apache.ignite.internal.visor.cache.VisorCachePartitionsTaskArg;
-import org.apache.ignite.internal.visor.cache.VisorCacheRebalanceTask;
-import org.apache.ignite.internal.visor.cache.VisorCacheRebalanceTaskArg;
-import org.apache.ignite.internal.visor.cache.VisorCacheResetMetricsTask;
-import org.apache.ignite.internal.visor.cache.VisorCacheResetMetricsTaskArg;
-import org.apache.ignite.internal.visor.cache.VisorCacheStartTask;
-import org.apache.ignite.internal.visor.cache.VisorCacheStartTaskArg;
-import org.apache.ignite.internal.visor.cache.VisorCacheStopTask;
-import org.apache.ignite.internal.visor.cache.VisorCacheStopTaskArg;
-import org.apache.ignite.internal.visor.compute.VisorComputeCancelSessionsTask;
-import org.apache.ignite.internal.visor.compute.VisorComputeCancelSessionsTaskArg;
-import org.apache.ignite.internal.visor.compute.VisorComputeResetMetricsTask;
-import org.apache.ignite.internal.visor.compute.VisorComputeToggleMonitoringTask;
-import org.apache.ignite.internal.visor.compute.VisorComputeToggleMonitoringTaskArg;
-import org.apache.ignite.internal.visor.compute.VisorGatewayTask;
-import org.apache.ignite.internal.visor.debug.VisorThreadDumpTask;
-import org.apache.ignite.internal.visor.file.VisorFileBlockTask;
-import org.apache.ignite.internal.visor.file.VisorFileBlockTaskArg;
-import org.apache.ignite.internal.visor.file.VisorLatestTextFilesTask;
-import org.apache.ignite.internal.visor.file.VisorLatestTextFilesTaskArg;
-import org.apache.ignite.internal.visor.log.VisorLogSearchTask;
-import org.apache.ignite.internal.visor.log.VisorLogSearchTaskArg;
-import org.apache.ignite.internal.visor.misc.VisorAckTask;
-import org.apache.ignite.internal.visor.misc.VisorAckTaskArg;
-import org.apache.ignite.internal.visor.misc.VisorChangeGridActiveStateTask;
-import org.apache.ignite.internal.visor.misc.VisorChangeGridActiveStateTaskArg;
-import org.apache.ignite.internal.visor.misc.VisorLatestVersionTask;
-import org.apache.ignite.internal.visor.misc.VisorResolveHostNameTask;
-import org.apache.ignite.internal.visor.node.VisorNodeConfigurationCollectorTask;
-import org.apache.ignite.internal.visor.node.VisorNodeDataCollectorTask;
-import org.apache.ignite.internal.visor.node.VisorNodeDataCollectorTaskArg;
-import org.apache.ignite.internal.visor.node.VisorNodeEventsCollectorTask;
-import org.apache.ignite.internal.visor.node.VisorNodeEventsCollectorTaskArg;
-import org.apache.ignite.internal.visor.node.VisorNodeGcTask;
-import org.apache.ignite.internal.visor.node.VisorNodePingTask;
-import org.apache.ignite.internal.visor.node.VisorNodePingTaskArg;
-import org.apache.ignite.internal.visor.node.VisorNodeSuppressedErrorsTask;
-import org.apache.ignite.internal.visor.node.VisorNodeSuppressedErrorsTaskArg;
-import org.apache.ignite.internal.visor.query.VisorQueryCancelTask;
-import org.apache.ignite.internal.visor.query.VisorQueryCancelTaskArg;
-import org.apache.ignite.internal.visor.query.VisorQueryCleanupTask;
-import org.apache.ignite.internal.visor.query.VisorQueryCleanupTaskArg;
-import org.apache.ignite.internal.visor.query.VisorQueryDetailMetricsCollectorTask;
-import org.apache.ignite.internal.visor.query.VisorQueryDetailMetricsCollectorTaskArg;
-import org.apache.ignite.internal.visor.query.VisorQueryNextPageTask;
-import org.apache.ignite.internal.visor.query.VisorQueryNextPageTaskArg;
-import org.apache.ignite.internal.visor.query.VisorQueryResetMetricsTask;
-import org.apache.ignite.internal.visor.query.VisorQueryResetMetricsTaskArg;
-import org.apache.ignite.internal.visor.query.VisorQueryTask;
-import org.apache.ignite.internal.visor.query.VisorQueryTaskArg;
-import org.apache.ignite.internal.visor.query.VisorRunningQueriesCollectorTask;
-import org.apache.ignite.internal.visor.query.VisorRunningQueriesCollectorTaskArg;
import org.apache.ignite.lang.IgniteBiPredicate;
import org.apache.ignite.lang.IgnitePredicate;
import org.apache.ignite.lang.IgniteUuid;
@@ -2093,324 +2026,6 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces
assertResponseContainsError(ret, "Failed to find mandatory parameter in request: id");
}
- /**
- * Tests execution of Visor tasks via {@link VisorGatewayTask}.
- *
- * @throws Exception If failed.
- */
- @Test
- public void testVisorGateway() throws Exception {
- ClusterNode locNode = grid(1).localNode();
-
- final IgniteUuid cid = grid(1).context().cache().internalCache("person").context().dynamicDeploymentId();
-
- String ret = content(new VisorGatewayArgument(VisorCacheConfigurationCollectorTask.class)
- .forNode(locNode)
- .argument(VisorCacheConfigurationCollectorTaskArg.class)
- .collection(IgniteUuid.class, cid));
-
- info("VisorCacheConfigurationCollectorTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorCacheNodesTask.class)
- .forNode(locNode)
- .argument(VisorCacheNodesTaskArg.class, "person"));
-
- info("VisorCacheNodesTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorCachePartitionsTask.class)
- .forNode(locNode)
- .argument(VisorCachePartitionsTaskArg.class, "person"));
-
- info("VisorCachePartitionsTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorCacheLoadTask.class)
- .forNode(locNode)
- .argument(VisorCacheLoadTaskArg.class)
- .set(String.class, "person")
- .arguments(0, "null"));
-
- info("VisorCacheLoadTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorCacheRebalanceTask.class)
- .forNode(locNode)
- .argument(VisorCacheRebalanceTaskArg.class)
- .set(String.class, "person"));
-
- info("VisorCacheRebalanceTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorCacheMetadataTask.class)
- .forNode(locNode)
- .argument(VisorCacheMetadataTaskArg.class, "person"));
-
- info("VisorCacheMetadataTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorCacheResetMetricsTask.class)
- .forNode(locNode)
- .argument(VisorCacheResetMetricsTaskArg.class, "person"));
-
- info("VisorCacheResetMetricsTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorThreadDumpTask.class)
- .forNode(locNode));
-
- info("VisorThreadDumpTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorLatestTextFilesTask.class)
- .forNode(locNode)
- .argument(VisorLatestTextFilesTaskArg.class, "", ""));
-
- info("VisorLatestTextFilesTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorLatestVersionTask.class)
- .forNode(locNode));
-
- info("VisorLatestVersionTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorFileBlockTask.class)
- .forNode(locNode)
- .argument(VisorFileBlockTaskArg.class, "", 0L, 1, 0L));
-
- info("VisorFileBlockTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorNodePingTask.class)
- .forNode(locNode)
- .argument(VisorNodePingTaskArg.class, locNode.id()));
-
- info("VisorNodePingTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorNodeConfigurationCollectorTask.class)
- .forNode(locNode));
-
- info("VisorNodeConfigurationCollectorTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorComputeResetMetricsTask.class)
- .forNode(locNode));
-
- info("VisorComputeResetMetricsTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorQueryTask.class)
- .forNode(locNode)
- .argument(VisorQueryTaskArg.class, "person", "select * from Person",
- false, false, false, false, 1));
-
- info("VisorQueryTask result: " + ret);
-
- JsonNode res = jsonTaskResult(ret);
-
- final String qryId = res.get("result").get("queryId").asText();
-
- ret = content(new VisorGatewayArgument(VisorQueryNextPageTask.class)
- .forNode(locNode)
- .argument(VisorQueryNextPageTaskArg.class, qryId, 1));
-
- info("VisorQueryNextPageTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorQueryCleanupTask.class)
- .argument(VisorQueryCleanupTaskArg.class)
- .map(UUID.class, Set.class, F.asMap(locNode.id(), qryId)));
-
- info("VisorQueryCleanupTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorResolveHostNameTask.class)
- .forNode(locNode));
-
- info("VisorResolveHostNameTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorQueryCancelTask.class)
- .argument(VisorQueryCancelTaskArg.class, 0L));
-
- info("VisorResolveHostNameTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorQueryResetMetricsTask.class)
- .argument(VisorQueryResetMetricsTaskArg.class, "person"));
-
- info("VisorResolveHostNameTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorQueryCancelTask.class)
- .argument(VisorQueryCancelTaskArg.class, 0L));
-
- info("VisorResolveHostNameTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorQueryResetMetricsTask.class)
- .argument(VisorQueryResetMetricsTaskArg.class, "person"));
-
- info("VisorResolveHostNameTask result: " + ret);
-
- jsonTaskResult(ret);
-
- // Multinode tasks
-
- ret = content(new VisorGatewayArgument(VisorComputeCancelSessionsTask.class)
- .argument(VisorComputeCancelSessionsTaskArg.class)
- .set(IgniteUuid.class, IgniteUuid.randomUuid()));
-
- info("VisorComputeCancelSessionsTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorCacheMetricsCollectorTask.class)
- .argument(VisorCacheMetricsCollectorTaskArg.class, false)
- .collection(String.class, "person"));
-
- info("VisorCacheMetricsCollectorTask result: " + ret);
-
- ret = content(new VisorGatewayArgument(VisorCacheMetricsCollectorTask.class)
- .forNodes(grid(1).cluster().nodes())
- .argument(VisorCacheMetricsCollectorTaskArg.class, false)
- .collection(String.class, "person"));
-
- info("VisorCacheMetricsCollectorTask (with nodes) result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorLogSearchTask.class)
- .argument(VisorLogSearchTaskArg.class, ".", ".", "abrakodabra.txt", 1));
-
- info("VisorLogSearchTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorNodeGcTask.class));
-
- info("VisorNodeGcTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorAckTask.class)
- .argument(VisorAckTaskArg.class, "MSG"));
-
- info("VisorAckTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorNodeEventsCollectorTask.class)
- .argument(VisorNodeEventsCollectorTaskArg.class,
- "null", "null", "null", "taskName", "null"));
-
- info("VisorNodeEventsCollectorTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorNodeDataCollectorTask.class)
- .argument(VisorNodeDataCollectorTaskArg.class, false,
- "CONSOLE_" + UUID.randomUUID(), UUID.randomUUID(), false));
-
- info("VisorNodeDataCollectorTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorComputeToggleMonitoringTask.class)
- .argument(VisorComputeToggleMonitoringTaskArg.class, UUID.randomUUID(), false));
-
- info("VisorComputeToggleMonitoringTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorNodeSuppressedErrorsTask.class)
- .argument(VisorNodeSuppressedErrorsTaskArg.class)
- .map(UUID.class, Long.class, new HashMap()));
-
- info("VisorNodeSuppressedErrorsTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorCacheClearTask.class)
- .forNode(locNode)
- .argument(VisorCacheClearTaskArg.class, "person"));
-
- info("VisorCacheClearTask result: " + ret);
-
- jsonTaskResult(ret);
-
- // Spring XML to start cache via Visor task.
- final String START_CACHE =
- "<beans xmlns=\"http://www.springframework.org/schema/beans\"\n" +
- " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
- " xsi:schemaLocation=\"http://www.springframework.org/schema/beans\n" +
- " http://www.springframework.org/schema/beans/spring-beans-2.5.xsd\">\n" +
- " <bean id=\"cacheConfiguration\" class=\"org.apache.ignite.configuration.CacheConfiguration\">\n" +
- " <property name=\"cacheMode\" value=\"PARTITIONED\"/>\n" +
- " <property name=\"name\" value=\"c\"/>\n" +
- " </bean>\n" +
- "</beans>";
-
- ret = content(new VisorGatewayArgument(VisorCacheStartTask.class)
- .argument(VisorCacheStartTaskArg.class, false, "person2", START_CACHE));
-
- info("VisorCacheStartTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorCacheStopTask.class)
- .forNode(locNode)
- .argument(VisorCacheStopTaskArg.class, "c"));
-
- info("VisorCacheStopTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorQueryDetailMetricsCollectorTask.class)
- .argument(VisorQueryDetailMetricsCollectorTaskArg.class, 0));
-
- info("VisorQueryDetailMetricsCollectorTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorRunningQueriesCollectorTask.class)
- .argument(VisorRunningQueriesCollectorTaskArg.class, 0L));
-
- info("VisorQueryDetailMetricsCollectorTask result: " + ret);
-
- jsonTaskResult(ret);
-
- ret = content(new VisorGatewayArgument(VisorChangeGridActiveStateTask.class)
- .argument(VisorChangeGridActiveStateTaskArg.class, true));
-
- info("VisorQueryDetailMetricsCollectorTask result: " + ret);
-
- jsonTaskResult(ret);
- }
-
/**
* @throws Exception If failed.
*/
@@ -3896,185 +3511,6 @@ public abstract class JettyRestProcessorAbstractSelfTest extends JettyRestProces
}
}
- /**
- * Helper for build {@link VisorGatewayTask} arguments.
- */
- public static class VisorGatewayArgument extends HashMap<String, String> {
- /** Latest argument index. */
- private int idx = 3;
-
- /**
- * Construct helper object.
- *
- * @param cls Class of executed task.
- */
- public VisorGatewayArgument(Class cls) {
- super(F.asMap(
- "cmd", GridRestCommand.EXE.key(),
- "name", VisorGatewayTask.class.getName(),
- "p1", "null",
- "p2", cls.getName()
- ));
- }
-
- /**
- * Execute task on node.
- *
- * @param node Node.
- * @return This helper for chaining method calls.
- */
- public VisorGatewayArgument forNode(ClusterNode node) {
- put("p1", node != null ? node.id().toString() : null);
-
- return this;
- }
-
- /**
- * Prepare list of node IDs.
- *
- * @param nodes Collection of nodes.
- * @return This helper for chaining method calls.
- */
- public VisorGatewayArgument forNodes(Collection<ClusterNode> nodes) {
- put("p1", concat(F.transform(nodes, new C1<ClusterNode, UUID>() {
- /** {@inheritDoc} */
- @Override public UUID apply(ClusterNode node) {
- return node.id();
- }
- }).toArray(), ";"));
-
- return this;
- }
-
- /**
- * Add custom argument.
- *
- * @param vals Values.
- * @return This helper for chaining method calls.
- */
- public VisorGatewayArgument arguments(Object... vals) {
- for (Object val : vals)
- put("p" + idx++, String.valueOf(val));
-
- return this;
- }
-
- /**
- * Add string argument.
- *
- * @param val Value.
- * @return This helper for chaining method calls.
- */
- public VisorGatewayArgument argument(String val) {
- put("p" + idx++, String.class.getName());
- put("p" + idx++, val);
-
- return this;
- }
-
- /**
- * Add custom class argument.
- *
- * @param cls Class.
- * @param vals Values.
- * @return This helper for chaining method calls.
- */
- public VisorGatewayArgument argument(Class cls, Object... vals) {
- put("p" + idx++, cls.getName());
-
- for (Object val : vals)
- put("p" + idx++, val != null ? val.toString() : null);
-
- return this;
- }
-
- /**
- * Add collection argument.
- *
- * @param cls Class.
- * @param vals Values.
- * @return This helper for chaining method calls.
- */
- public VisorGatewayArgument collection(Class cls, Object... vals) {
- put("p" + idx++, Collection.class.getName());
- put("p" + idx++, cls.getName());
- put("p" + idx++, concat(vals, ";"));
-
- return this;
- }
-
- /**
- * Add set argument.
- *
- * @param cls Class.
- * @param vals Values.
- * @return This helper for chaining method calls.
- */
- public VisorGatewayArgument set(Class cls, Object... vals) {
- put("p" + idx++, Set.class.getName());
- put("p" + idx++, cls.getName());
- put("p" + idx++, concat(vals, ";"));
-
- return this;
- }
-
- /**
- * Add map argument.
- *
- * @param keyCls Key class.
- * @param valCls Value class.
- * @param map Map.
- */
- public VisorGatewayArgument map(Class keyCls, Class valCls, Map<?, ?> map) throws UnsupportedEncodingException {
- put("p" + idx++, Map.class.getName());
- put("p" + idx++, keyCls.getName());
- put("p" + idx++, valCls.getName());
-
- SB sb = new SB();
-
- boolean first = true;
-
- for (Map.Entry<?, ?> entry : map.entrySet()) {
- if (!first)
- sb.a(";");
-
- sb.a(entry.getKey());
-
- if (entry.getValue() != null)
- sb.a("=").a(entry.getValue());
-
- first = false;
- }
-
- put("p" + idx++, sb.toString());
-
- return this;
- }
-
- /**
- * Concat object with delimiter.
- *
- * @param vals Values.
- * @param delim Delimiter.
- */
- private static String concat(Object[] vals, String delim) {
- SB sb = new SB();
-
- boolean first = true;
-
- for (Object val : vals) {
- if (!first)
- sb.a(delim);
-
- sb.a(val);
-
- first = false;
- }
-
- return sb.toString();
- }
- }
-
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/plugin/IgniteLogInfoProviderImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/plugin/IgniteLogInfoProviderImpl.java
index 27fed709e3b..b8787718810 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/plugin/IgniteLogInfoProviderImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/plugin/IgniteLogInfoProviderImpl.java
@@ -144,7 +144,6 @@ public class IgniteLogInfoProviderImpl implements IgniteLogInfoProvider {
ackSecurity(log, ignite);
ackPerformanceSuggestions(log, igEx);
- ackVisorConsole(log);
ackClassPathContent(log);
ackNodeInfo(log, igEx);
}
@@ -533,13 +532,6 @@ public class IgniteLogInfoProviderImpl implements IgniteLogInfoProvider {
ctx.performance().logSuggestions(log, ignite.name());
}
- /**
- * Print info about visor commandline console.
- */
- void ackVisorConsole(IgniteLogger log) {
- U.quietAndInfo(log, "To start Console Management & Monitoring run ignitevisorcmd.{sh|bat}");
- }
-
/**
* Prints the list of {@code *.jar} and {@code *.class} files containing in the classpath.
*/
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
index b3221f7212f..8af0c7831b3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
@@ -83,7 +83,6 @@ import org.apache.ignite.internal.util.typedef.internal.SB;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.internal.util.worker.GridWorker;
import org.apache.ignite.internal.util.worker.GridWorkerFuture;
-import org.apache.ignite.internal.visor.compute.VisorGatewayTask;
import org.apache.ignite.internal.visor.util.VisorClusterGroupEmptyException;
import org.apache.ignite.lang.IgniteBiTuple;
import org.apache.ignite.lang.IgniteInClosure;
@@ -904,10 +903,6 @@ public class GridRestProcessor extends GridProcessorAdapter implements IgniteRes
GridRestTaskRequest taskReq = (GridRestTaskRequest)req;
name = taskReq.taskName();
- // We should extract task name wrapped by VisorGatewayTask.
- if (VisorGatewayTask.class.getName().equals(name))
- name = (String)taskReq.params().get(WRAPPED_TASK_IDX);
-
break;
case GET_OR_CREATE_CACHE:
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorCoordinatorNodeTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorCoordinatorNodeTask.java
deleted file mode 100644
index f744e9ead37..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorCoordinatorNodeTask.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.UUID;
-import org.apache.ignite.cluster.ClusterNode;
-
-/**
- * Base class for Visor tasks intended to execute job on coordinator node.
- */
-public abstract class VisorCoordinatorNodeTask<A, R> extends VisorOneNodeTask<A, R> {
- /** {@inheritDoc} */
- @Override protected Collection<UUID> jobNodes(VisorTaskArgument<A> arg) {
- ClusterNode crd = ignite.context().discovery().discoCache().oldestAliveServerNode();
-
- Collection<UUID> nids = new ArrayList<>(1);
-
- nids.add(crd == null ? ignite.localNode().id() : crd.id());
-
- return nids;
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorEither.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorEither.java
deleted file mode 100644
index f426e8aaea1..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorEither.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor;
-
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import org.apache.ignite.internal.util.typedef.internal.S;
-
-/**
- * Base class for Visor result with error.
- *
- * @param <T> Result type.
- */
-public class VisorEither<T> implements Externalizable {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Exception on execution. */
- private Throwable error;
-
- /** Result. */
- private T res;
-
- /**
- * Default constructor.
- */
- public VisorEither() {
- // No-op.
- }
-
- /**
- * @param error Exception on execution.
- */
- public VisorEither(Throwable error) {
- this.error = error;
- }
-
- /**
- * @param res Result.
- */
- public VisorEither(T res) {
- this.res = res;
- }
-
- /**
- * @return {@code true} If failed on execution.
- */
- public boolean failed() {
- return error != null;
- }
-
- /**
- * @return Exception on execution.
- */
- public Throwable getError() {
- return error;
- }
-
- /**
- * @return Result.
- */
- public T getResult() {
- return res;
- }
-
- /** {@inheritDoc} */
- @Override public void writeExternal(ObjectOutput out) throws IOException {
- boolean failed = failed();
-
- out.writeBoolean(failed);
- out.writeObject(failed ? error : res);
- }
-
- /** {@inheritDoc} */
- @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- if (in.readBoolean())
- error = (Throwable)in.readObject();
- else
- res = (T)in.readObject();
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorEither.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/binary/VisorBinaryMetadata.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/binary/VisorBinaryMetadata.java
deleted file mode 100644
index 6f7e6255745..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/binary/VisorBinaryMetadata.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.binary;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import org.apache.ignite.IgniteBinary;
-import org.apache.ignite.binary.BinaryType;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * Binary object metadata to show in Visor.
- */
-public class VisorBinaryMetadata extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Type name */
- private String typeName;
-
- /** Type Id */
- private int typeId;
-
- /** Affinity key field name. */
- private String affinityKeyFieldName;
-
- /** Filed list */
- private List<VisorBinaryMetadataField> fields;
-
- /**
- * @param binary Binary objects.
- * @return List of data transfer objects for binary objects metadata.
- */
- public static List<VisorBinaryMetadata> list(IgniteBinary binary) {
- List<VisorBinaryMetadata> res = new ArrayList<>();
-
- if (binary != null) {
- for (BinaryType binaryType : binary.types())
- res.add(new VisorBinaryMetadata(binary, binaryType));
- }
-
- return res;
- }
-
- /**
- * Default constructor.
- */
- public VisorBinaryMetadata() {
- // No-op.
- }
-
- /**
- * Default constructor.
- */
- public VisorBinaryMetadata(IgniteBinary binary, BinaryType binaryType) {
- typeName = binaryType.typeName();
- typeId = binary.typeId(typeName);
- affinityKeyFieldName = binaryType.affinityKeyFieldName();
-
- Collection<String> binaryTypeFields = binaryType.fieldNames();
-
- fields = new ArrayList<>(binaryTypeFields.size());
-
- for (String metaField : binaryTypeFields)
- fields.add(new VisorBinaryMetadataField(metaField, binaryType.fieldTypeName(metaField), null));
- }
-
- /**
- * @return Type name.
- */
- public String getTypeName() {
- return typeName;
- }
-
- /**
- * @return Type Id.
- */
- public int getTypeId() {
- return typeId;
- }
-
- /**
- * @return Fields list.
- */
- public Collection<VisorBinaryMetadataField> getFields() {
- return fields;
- }
-
- /**
- * @return Affinity key field name.
- */
- @Nullable public String getAffinityKeyFieldName() {
- return affinityKeyFieldName;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- U.writeString(out, typeName);
- out.writeInt(typeId);
- U.writeString(out, affinityKeyFieldName);
- U.writeCollection(out, fields);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- typeName = U.readString(in);
- typeId = in.readInt();
- affinityKeyFieldName = U.readString(in);
- fields = U.readList(in);
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorBinaryMetadata.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/binary/VisorBinaryMetadataCollectorTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/binary/VisorBinaryMetadataCollectorTask.java
deleted file mode 100644
index f210f0db0a0..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/binary/VisorBinaryMetadataCollectorTask.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.binary;
-
-import org.apache.ignite.IgniteBinary;
-import org.apache.ignite.internal.binary.BinaryMarshaller;
-import org.apache.ignite.internal.processors.task.GridInternal;
-import org.apache.ignite.internal.processors.task.GridVisorManagementTask;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.visor.VisorJob;
-import org.apache.ignite.internal.visor.VisorOneNodeTask;
-import org.apache.ignite.marshaller.Marshaller;
-
-/**
- * Task that collects binary metadata.
- */
-@GridInternal
-@GridVisorManagementTask
-public class VisorBinaryMetadataCollectorTask
- extends VisorOneNodeTask<VisorBinaryMetadataCollectorTaskArg, VisorBinaryMetadataCollectorTaskResult> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** {@inheritDoc} */
- @Override protected VisorBinaryCollectMetadataJob job(VisorBinaryMetadataCollectorTaskArg lastUpdate) {
- return new VisorBinaryCollectMetadataJob(lastUpdate, debug);
- }
-
- /** Job that collect portables metadata on node. */
- private static class VisorBinaryCollectMetadataJob
- extends VisorJob<VisorBinaryMetadataCollectorTaskArg, VisorBinaryMetadataCollectorTaskResult> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /**
- * Create job with given argument.
- *
- * @param arg Task argument.
- * @param debug Debug flag.
- */
- private VisorBinaryCollectMetadataJob(VisorBinaryMetadataCollectorTaskArg arg, boolean debug) {
- super(arg, debug);
- }
-
- /** {@inheritDoc} */
- @Override protected VisorBinaryMetadataCollectorTaskResult run(VisorBinaryMetadataCollectorTaskArg arg) {
- Marshaller marsh = ignite.configuration().getMarshaller();
-
- IgniteBinary binary = marsh == null || marsh instanceof BinaryMarshaller ? ignite.binary() : null;
-
- return new VisorBinaryMetadataCollectorTaskResult(0L, VisorBinaryMetadata.list(binary));
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorBinaryCollectMetadataJob.class, this);
- }
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/binary/VisorBinaryMetadataCollectorTaskArg.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/binary/VisorBinaryMetadataCollectorTaskArg.java
deleted file mode 100644
index 84ff96a7fef..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/binary/VisorBinaryMetadataCollectorTaskArg.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.binary;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-
-/**
- * Arguments for {@link VisorBinaryMetadataCollectorTask}.
- */
-public class VisorBinaryMetadataCollectorTaskArg extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Time data was collected last time. */
- private long lastUpdate;
-
- /**
- * Default constructor.
- */
- public VisorBinaryMetadataCollectorTaskArg() {
- // No-op.
- }
-
- /**
- * @param lastUpdate Time data was collected last time.
- */
- public VisorBinaryMetadataCollectorTaskArg(long lastUpdate) {
- this.lastUpdate = lastUpdate;
- }
-
- /**
- * @return Time data was collected last time.
- */
- public long getMessage() {
- return lastUpdate;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- out.writeLong(lastUpdate);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- lastUpdate = in.readLong();
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorBinaryMetadataCollectorTaskArg.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/binary/VisorBinaryMetadataCollectorTaskResult.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/binary/VisorBinaryMetadataCollectorTaskResult.java
deleted file mode 100644
index b31897c4fe4..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/binary/VisorBinaryMetadataCollectorTaskResult.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.binary;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.util.List;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-
-/**
- * Result for {@link VisorBinaryMetadataCollectorTask}
- */
-public class VisorBinaryMetadataCollectorTaskResult extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Last binary metadata update date. */
- private long lastUpdate;
-
- /** Remote data center IDs for which full state transfer was requested. */
- private List<VisorBinaryMetadata> binary;
-
- /**
- * Default constructor.
- */
- public VisorBinaryMetadataCollectorTaskResult() {
- // No-op.
- }
-
- /**
- * @param lastUpdate Last binary metadata update date.
- * @param binary Remote data center IDs for which full state transfer was requested.
- */
- public VisorBinaryMetadataCollectorTaskResult(Long lastUpdate, List<VisorBinaryMetadata> binary) {
- this.lastUpdate = lastUpdate;
- this.binary = binary;
- }
-
- /**
- * @return Last binary metadata update date.
- */
- public long getLastUpdate() {
- return lastUpdate;
- }
-
- /**
- * @return Remote data center IDs for which full state transfer was requested.
- */
- public List<VisorBinaryMetadata> getBinary() {
- return binary;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- out.writeLong(lastUpdate);
- U.writeCollection(out, binary);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- lastUpdate = in.readLong();
- binary = U.readList(in);
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorBinaryMetadataCollectorTaskResult.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/binary/VisorBinaryMetadataField.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/binary/VisorBinaryMetadataField.java
deleted file mode 100644
index 69c880c1676..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/binary/VisorBinaryMetadataField.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.binary;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * Binary object metadata field information.
- */
-public class VisorBinaryMetadataField extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Field name. */
- private String fieldName;
-
- /** Field type name. */
- private String fieldTypeName;
-
- /** Field id. */
- private Integer fieldId;
-
- /**
- * Default constructor.
- */
- public VisorBinaryMetadataField() {
- // No-op.
- }
-
- /**
- * @param fieldName Field name.
- * @param fieldTypeName Field type name.
- * @param fieldId Field id.
- */
- public VisorBinaryMetadataField(String fieldName, String fieldTypeName, Integer fieldId) {
- this.fieldName = fieldName;
- this.fieldTypeName = fieldTypeName;
- this.fieldId = fieldId;
- }
-
- /**
- * @return Field name.
- */
- public String getFieldName() {
- return fieldName;
- }
-
- /**
- * @return Field type name.
- */
- @Nullable public String getFieldTypeName() {
- return fieldTypeName;
- }
-
- /**
- * @return Field id.
- */
- public Integer getFieldId() {
- return fieldId;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- U.writeString(out, fieldName);
- U.writeString(out, fieldTypeName);
- out.writeObject(fieldId);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- fieldName = U.readString(in);
- fieldTypeName = U.readString(in);
- fieldId = (Integer)in.readObject();
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorBinaryMetadataField.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java
deleted file mode 100644
index 0d239546f26..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java
+++ /dev/null
@@ -1,341 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.cache.CacheMode;
-import org.apache.ignite.cache.CachePeekMode;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.internal.IgniteEx;
-import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
-import org.apache.ignite.internal.processors.cache.GridCacheContext;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-import org.apache.ignite.lang.IgniteUuid;
-
-import static org.apache.ignite.cache.CachePeekMode.BACKUP;
-import static org.apache.ignite.cache.CachePeekMode.ONHEAP;
-import static org.apache.ignite.cache.CachePeekMode.PRIMARY;
-
-/**
- * Data transfer object for {@link IgniteCache}.
- */
-public class VisorCache extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** */
- private static final CachePeekMode[] PEEK_ONHEAP_PRIMARY =
- new CachePeekMode[] {ONHEAP, PRIMARY};
-
- /** */
- private static final CachePeekMode[] PEEK_ONHEAP_BACKUP =
- new CachePeekMode[] {ONHEAP, BACKUP};
-
- /** Cache name. */
- private String name;
-
- /** Cache deployment ID. */
- private IgniteUuid dynamicDeploymentId;
-
- /** Cache mode. */
- private CacheMode mode;
-
- /** Cache size in bytes. */
- private long memorySize;
-
- /** Cache size in bytes. */
- private long indexesSize;
-
- /** Number of all entries in cache. */
- private long size;
-
- /** Number of all entries in near cache. */
- private int nearSize;
-
- /** Number of primary entries in cache. */
- private long primarySize;
-
- /** Number of backup entries in cache. */
- private long backupSize;
-
- /** Number of partitions. */
- private int partitions;
-
- /** Flag indicating that cache has near cache. */
- private boolean near;
-
- /** Cache metrics. */
- private VisorCacheMetrics metrics;
-
- /** Cache system state. */
- private boolean sys;
-
- /** Checks whether statistics collection is enabled in this cache. */
- private boolean statisticsEnabled;
-
- /**
- * Create data transfer object for given cache.
- */
- public VisorCache() {
- // No-op.
- }
-
- /**
- * Create data transfer object for given cache.
- *
- * @param ca Internal cache.
- * @param collectMetrics Collect cache metrics flag.
- * @throws IgniteCheckedException If failed to create data transfer object.
- */
- public VisorCache(IgniteEx ignite, GridCacheAdapter ca, boolean collectMetrics) throws IgniteCheckedException {
- assert ca != null;
-
- GridCacheContext cctx = ca.context();
- CacheConfiguration cfg = ca.configuration();
-
- name = ca.name();
- dynamicDeploymentId = cctx.dynamicDeploymentId();
- mode = cfg.getCacheMode();
-
- primarySize = ca.localSizeLong(PEEK_ONHEAP_PRIMARY);
- backupSize = ca.localSizeLong(PEEK_ONHEAP_BACKUP);
- nearSize = ca.nearSize();
- size = primarySize + backupSize + nearSize;
-
- partitions = ca.affinity().partitions();
- near = cctx.isNear();
-
- if (collectMetrics)
- metrics = new VisorCacheMetrics(ignite, name);
-
- sys = ignite.context().cache().systemCache(name);
-
- statisticsEnabled = ca.clusterMetrics().isStatisticsEnabled();
- }
-
- /**
- * @return Cache name.
- */
- public String getName() {
- return name;
- }
-
- /**
- * Sets new value for cache name.
- *
- * @param name New cache name.
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * @return Dynamic deployment ID.
- */
- public IgniteUuid getDynamicDeploymentId() {
- return dynamicDeploymentId;
- }
-
- /**
- * @return Cache mode.
- */
- public CacheMode getMode() {
- return mode;
- }
-
- /**
- * @return Cache size in bytes.
- */
- public long getMemorySize() {
- return memorySize;
- }
-
- /**
- * @return Indexes size in bytes.
- */
- public long getIndexesSize() {
- return indexesSize;
- }
-
- /**
- * @return Number of all entries in cache.
- */
- public long getSize() {
- return size;
- }
-
- /**
- * @return Number of all entries in near cache.
- */
- public int getNearSize() {
- return nearSize;
- }
-
- /**
- * @return Number of backup entries in cache.
- */
- public long getBackupSize() {
- return backupSize;
- }
-
- /**
- * @return Number of primary entries in cache.
- */
- public long getPrimarySize() {
- return primarySize;
- }
-
- /**
- * @return Number of partitions.
- */
- public int getPartitions() {
- return partitions;
- }
-
- /**
- * @return Cache metrics.
- */
- public VisorCacheMetrics getMetrics() {
- return metrics;
- }
-
- /**
- * @param metrics Cache metrics.
- */
- public void setMetrics(VisorCacheMetrics metrics) {
- this.metrics = metrics;
- }
-
- /**
- * @return {@code true} if cache has near cache.
- */
- public boolean isNear() {
- return near;
- }
-
- /**
- * @return System cache flag.
- */
- public boolean isSystem() {
- return sys;
- }
-
- /**
- * @return Number of entries in cache in heap and off-heap.
- */
- public long size() {
- return size + (metrics != null ? metrics.getOffHeapEntriesCount() : 0L);
- }
-
- /**
- * @return Memory size allocated in off-heap.
- */
- public long offHeapAllocatedSize() {
- return metrics != null ? metrics.getOffHeapAllocatedSize() : 0L;
- }
-
- /**
- * @return Number of entries in heap memory.
- */
- public long heapEntriesCount() {
- return metrics != null ? metrics.getHeapEntriesCount() : 0L;
- }
-
- /**
- * @return Number of primary cache entries stored in off-heap memory.
- */
- public long offHeapPrimaryEntriesCount() {
- return metrics != null ? metrics.getOffHeapPrimaryEntriesCount() : 0L;
- }
-
- /**
- * @return Number of backup cache entries stored in off-heap memory.
- */
- public long offHeapBackupEntriesCount() {
- return metrics != null ? metrics.getOffHeapBackupEntriesCount() : 0L;
- }
-
- /**
- * @return Number of cache entries stored in off-heap memory.
- */
- public long offHeapEntriesCount() {
- return metrics != null ? metrics.getOffHeapEntriesCount() : 0L;
- }
-
- /**
- * @return Checks whether statistics collection is enabled in this cache.
- */
- public boolean isStatisticsEnabled() {
- return statisticsEnabled;
- }
-
- /** {@inheritDoc} */
- @Override public byte getProtocolVersion() {
- return V3;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- U.writeString(out, name);
- U.writeIgniteUuid(out, dynamicDeploymentId);
- out.writeByte(CacheMode.toCode(mode));
- out.writeLong(memorySize);
- out.writeLong(indexesSize);
- out.writeLong(size);
- out.writeInt(nearSize);
- out.writeLong(primarySize);
- out.writeLong(backupSize);
- out.writeInt(partitions);
- out.writeBoolean(near);
- out.writeObject(metrics);
- out.writeBoolean(sys);
- out.writeBoolean(statisticsEnabled);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- name = U.readString(in);
- dynamicDeploymentId = U.readIgniteUuid(in);
- mode = CacheMode.fromCode(in.readByte());
- memorySize = in.readLong();
- indexesSize = in.readLong();
- size = in.readLong();
- nearSize = in.readInt();
- primarySize = in.readLong();
- backupSize = in.readLong();
- partitions = in.readInt();
- near = in.readBoolean();
- metrics = (VisorCacheMetrics)in.readObject();
-
- sys = protoVer > V1 ? in.readBoolean() : metrics != null && metrics.isSystem();
-
- if (protoVer > V2)
- statisticsEnabled = in.readBoolean();
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCache.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAffinityNodeTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAffinityNodeTask.java
deleted file mode 100644
index 439b8d3edcd..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAffinityNodeTask.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.util.UUID;
-import org.apache.ignite.IgniteException;
-import org.apache.ignite.cluster.ClusterNode;
-import org.apache.ignite.internal.processors.task.GridInternal;
-import org.apache.ignite.internal.processors.task.GridVisorManagementTask;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.visor.VisorJob;
-import org.apache.ignite.internal.visor.VisorOneNodeTask;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * Task that will find affinity node for key.
- */
-@GridInternal
-@GridVisorManagementTask
-public class VisorCacheAffinityNodeTask extends VisorOneNodeTask<VisorCacheAffinityNodeTaskArg, UUID> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** {@inheritDoc} */
- @Override protected VisorCacheAffinityNodeJob job(VisorCacheAffinityNodeTaskArg arg) {
- return new VisorCacheAffinityNodeJob(arg, debug);
- }
-
- /** Job that will find affinity node for key. */
- private static class VisorCacheAffinityNodeJob extends VisorJob<VisorCacheAffinityNodeTaskArg, UUID> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /**
- * @param arg Cache name and key to find affinity node.
- * @param debug Debug flag.
- */
- private VisorCacheAffinityNodeJob(VisorCacheAffinityNodeTaskArg arg, boolean debug) {
- super(arg, debug);
- }
-
- /** {@inheritDoc} */
- @Override protected UUID run(@Nullable VisorCacheAffinityNodeTaskArg arg) throws IgniteException {
- assert arg != null;
-
- ClusterNode node = ignite.affinity(arg.getCacheName()).mapKeyToNode(arg.getKey());
-
- return node != null ? node.id() : null;
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheAffinityNodeJob.class, this);
- }
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAffinityNodeTaskArg.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAffinityNodeTaskArg.java
deleted file mode 100644
index ec057339f4b..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAffinityNodeTaskArg.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-
-/**
- * Argument for {@link VisorCacheAffinityNodeTask}.
- */
-public class VisorCacheAffinityNodeTaskArg extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Cache name. */
- private String cacheName;
-
- /** Key to map to a node. */
- private Object key;
-
- /**
- * Default constructor.
- */
- public VisorCacheAffinityNodeTaskArg() {
- // No-op.
- }
-
- /**
- * @param cacheName Cache name.
- * @param key Object.
- */
- public VisorCacheAffinityNodeTaskArg(String cacheName, Object key) {
- this.cacheName = cacheName;
- this.key = key;
- }
-
- /**
- * @return Cache name.
- */
- public String getCacheName() {
- return cacheName;
- }
-
- /**
- * @return Key to map to a node.
- */
- public Object getKey() {
- return key;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- U.writeString(out, cacheName);
- out.writeObject(key);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- cacheName = U.readString(in);
- key = in.readObject();
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheAffinityNodeTaskArg.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAggregatedMetrics.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAggregatedMetrics.java
deleted file mode 100644
index 8bcb5de4ab6..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAggregatedMetrics.java
+++ /dev/null
@@ -1,628 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-import org.apache.ignite.cache.CacheMode;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-
-/**
- * Data transfer object for aggregated cache metrics.
- */
-public class VisorCacheAggregatedMetrics extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Cache name. */
- private String name;
-
- /** Cache mode. */
- private CacheMode mode;
-
- /** Cache system state. */
- private boolean sys;
-
- /** Node IDs with cache metrics. */
- private Map<UUID, VisorCacheMetrics> metrics = new HashMap<>();
-
- /** Total number of entries in heap. */
- private transient Long totalHeapSize;
-
- /** Minimum number of entries in heap. */
- private transient Long minHeapSize;
-
- /** Average number of entries in heap. */
- private transient Double avgHeapSize;
-
- /** Maximum number of entries in heap. */
- private transient Long maxHeapSize;
-
- /** Total number of entries in off heap. */
- private transient Long totalOffHeapSize;
-
- /** Minimum number of entries in off heap. */
- private transient Long minOffHeapSize;
-
- /** Average number of entries in off heap. */
- private transient Double avgOffHeapSize;
-
- /** Maximum number of entries in off heap. */
- private transient Long maxOffHeapSize;
-
- /** Minimum hits of the owning cache. */
- private transient Long minHits;
-
- /** Average hits of the owning cache. */
- private transient Double avgHits;
-
- /** Maximum hits of the owning cache. */
- private transient Long maxHits;
-
- /** Minimum misses of the owning cache. */
- private transient Long minMisses;
-
- /** Average misses of the owning cache. */
- private transient Double avgMisses;
-
- /** Maximum misses of the owning cache. */
- private transient Long maxMisses;
-
- /** Minimum total number of reads of the owning cache. */
- private transient Long minReads;
-
- /** Average total number of reads of the owning cache. */
- private transient Double avgReads;
-
- /** Maximum total number of reads of the owning cache. */
- private transient Long maxReads;
-
- /** Minimum total number of writes of the owning cache. */
- private transient Long minWrites;
-
- /** Average total number of writes of the owning cache. */
- private transient Double avgWrites;
-
- /** Maximum total number of writes of the owning cache. */
- private transient Long maxWrites;
-
- /** Minimum execution time of query. */
- private transient Long minQryTime;
-
- /** Average execution time of query. */
- private transient Double avgQryTime;
-
- /** Maximum execution time of query. */
- private transient Long maxQryTime;
-
- /** Total execution time of query. */
- private transient Long totalQryTime;
-
- /** Number of executions. */
- private transient Integer execsQry;
-
- /** Total number of times a query execution failed. */
- private transient Integer failsQry;
-
- /**
- * Default constructor.
- */
- public VisorCacheAggregatedMetrics() {
- // No-op.
- }
-
- /**
- * Create data transfer object for aggregated cache metrics.
- *
- * @param cm Source cache metrics.
- */
- public VisorCacheAggregatedMetrics(VisorCacheMetrics cm) {
- name = cm.getName();
- mode = cm.getMode();
- sys = cm.isSystem();
- }
-
- /**
- * @return Cache name.
- */
- public String getName() {
- return name;
- }
-
- /** @return Cache mode. */
- public CacheMode getMode() {
- return mode;
- }
-
- /** @return Cache system state. */
- public boolean isSystem() {
- return sys;
- }
-
- /**
- * @return Nodes.
- */
- public Collection<UUID> getNodes() {
- return metrics.keySet();
- }
-
- /**
- * @return Total number of entries in heap.
- */
- public long getTotalHeapSize() {
- if (totalHeapSize == null) {
- totalHeapSize = 0L;
-
- for (VisorCacheMetrics metric : metrics.values())
- totalHeapSize += metric.getHeapEntriesCount();
- }
-
- return totalHeapSize;
- }
-
- /**
- * @return Minimum number of entries in heap.
- */
- public long getMinimumHeapSize() {
- if (minHeapSize == null) {
- minHeapSize = Long.MAX_VALUE;
-
- for (VisorCacheMetrics metric : metrics.values())
- minHeapSize = Math.min(minHeapSize, metric.getHeapEntriesCount());
- }
-
- return minHeapSize;
- }
-
- /**
- * @return Average number of entries in heap.
- */
- public double getAverageHeapSize() {
- if (avgHeapSize == null) {
- avgHeapSize = 0.0d;
-
- for (VisorCacheMetrics metric : metrics.values())
- avgHeapSize += metric.getHeapEntriesCount();
-
- avgHeapSize /= metrics.size();
- }
-
- return avgHeapSize;
- }
-
- /**
- * @return Maximum number of entries in heap.
- */
- public long getMaximumHeapSize() {
- if (maxHeapSize == null) {
- maxHeapSize = Long.MIN_VALUE;
-
- for (VisorCacheMetrics metric : metrics.values())
- maxHeapSize = Math.max(maxHeapSize, metric.getHeapEntriesCount());
- }
-
- return maxHeapSize;
- }
-
- /**
- * @param metric Metrics to process.
- * @return Off heap primary entries count.
- */
- private long getOffHeapPrimaryEntriesCount(VisorCacheMetrics metric) {
- return metric.getOffHeapPrimaryEntriesCount();
- }
-
- /**
- * @return Total number of entries in off-heap.
- */
- public long getTotalOffHeapSize() {
- if (totalOffHeapSize == null) {
- totalOffHeapSize = 0L;
-
- for (VisorCacheMetrics metric : metrics.values())
- totalOffHeapSize += metric.getOffHeapPrimaryEntriesCount();
- }
-
- return totalOffHeapSize;
- }
-
- /**
- * @return Minimum number of primary entries in off heap.
- */
- public long getMinimumOffHeapPrimarySize() {
- if (minOffHeapSize == null) {
- minOffHeapSize = Long.MAX_VALUE;
-
- for (VisorCacheMetrics metric : metrics.values())
- minOffHeapSize = Math.min(minOffHeapSize, getOffHeapPrimaryEntriesCount(metric));
- }
-
- return minOffHeapSize;
- }
-
- /**
- * @return Average number of primary entries in off heap.
- */
- public double getAverageOffHeapPrimarySize() {
- if (avgOffHeapSize == null) {
- avgOffHeapSize = 0.0d;
-
- for (VisorCacheMetrics metric : metrics.values())
- avgOffHeapSize += getOffHeapPrimaryEntriesCount(metric);
-
- avgOffHeapSize /= metrics.size();
- }
-
- return avgOffHeapSize;
- }
-
- /**
- * @return Maximum number of primary entries in off heap.
- */
- public long getMaximumOffHeapPrimarySize() {
- if (maxOffHeapSize == null) {
- maxOffHeapSize = Long.MIN_VALUE;
-
- for (VisorCacheMetrics metric : metrics.values())
- maxOffHeapSize = Math.max(maxOffHeapSize, getOffHeapPrimaryEntriesCount(metric));
- }
-
- return maxOffHeapSize;
- }
-
- /**
- * @return Minimum hits of the owning cache.
- */
- public long getMinimumHits() {
- if (minHits == null) {
- minHits = Long.MAX_VALUE;
-
- for (VisorCacheMetrics metric : metrics.values())
- minHits = Math.min(minHits, metric.getHits());
- }
-
- return minHits;
- }
-
- /**
- * @return Average hits of the owning cache.
- */
- public double getAverageHits() {
- if (avgHits == null) {
- avgHits = 0.0d;
-
- for (VisorCacheMetrics metric : metrics.values())
- avgHits += metric.getHits();
-
- avgHits /= metrics.size();
- }
-
- return avgHits;
- }
-
- /**
- * @return Maximum hits of the owning cache.
- */
- public long getMaximumHits() {
- if (maxHits == null) {
- maxHits = Long.MIN_VALUE;
-
- for (VisorCacheMetrics metric : metrics.values())
- maxHits = Math.max(maxHits, metric.getHits());
- }
-
- return maxHits;
- }
-
- /**
- * @return Minimum misses of the owning cache.
- */
- public long getMinimumMisses() {
- if (minMisses == null) {
- minMisses = Long.MAX_VALUE;
-
- for (VisorCacheMetrics metric : metrics.values())
- minMisses = Math.min(minMisses, metric.getMisses());
- }
-
- return minMisses;
- }
-
- /**
- * @return Average misses of the owning cache.
- */
- public double getAverageMisses() {
- if (avgMisses == null) {
- avgMisses = 0.0d;
-
- for (VisorCacheMetrics metric : metrics.values())
- avgMisses += metric.getMisses();
-
- avgMisses /= metrics.size();
- }
-
- return avgMisses;
- }
-
- /**
- * @return Maximum misses of the owning cache.
- */
- public long getMaximumMisses() {
- if (maxMisses == null) {
- maxMisses = Long.MIN_VALUE;
-
- for (VisorCacheMetrics metric : metrics.values())
- maxMisses = Math.max(maxMisses, metric.getMisses());
- }
-
- return maxMisses;
- }
-
- /**
- * @return Minimum total number of reads of the owning cache.
- */
- public long getMinimumReads() {
- if (minReads == null) {
- minReads = Long.MAX_VALUE;
-
- for (VisorCacheMetrics metric : metrics.values())
- minReads = Math.min(minReads, metric.getReads());
- }
-
- return minReads;
- }
-
- /**
- * @return Average total number of reads of the owning cache.
- */
- public double getAverageReads() {
- if (avgReads == null) {
- avgReads = 0.0d;
-
- for (VisorCacheMetrics metric : metrics.values())
- avgReads += metric.getReads();
-
- avgReads /= metrics.size();
- }
-
- return avgReads;
- }
-
- /**
- * @return Maximum total number of reads of the owning cache.
- */
- public long getMaximumReads() {
- if (maxReads == null) {
- maxReads = Long.MIN_VALUE;
-
- for (VisorCacheMetrics metric : metrics.values())
- maxReads = Math.max(maxReads, metric.getReads());
- }
-
- return maxReads;
- }
-
- /**
- * @return Minimum total number of writes of the owning cache.
- */
- public long getMinimumWrites() {
- if (minWrites == null) {
- minWrites = Long.MAX_VALUE;
-
- for (VisorCacheMetrics metric : metrics.values())
- minWrites = Math.min(minWrites, metric.getWrites());
- }
-
- return minWrites;
- }
-
- /**
- * @return Average total number of writes of the owning cache.
- */
- public double getAverageWrites() {
- if (avgWrites == null) {
- avgWrites = 0.0d;
-
- for (VisorCacheMetrics metric : metrics.values())
- avgWrites += metric.getWrites();
-
- avgWrites /= metrics.size();
- }
-
- return avgWrites;
- }
-
- /**
- * @return Maximum total number of writes of the owning cache.
- */
- public long getMaximumWrites() {
- if (maxWrites == null) {
- maxWrites = Long.MIN_VALUE;
-
- for (VisorCacheMetrics metric : metrics.values())
- maxWrites = Math.max(maxWrites, metric.getWrites());
- }
-
- return maxWrites;
- }
-
- /**
- * @return Minimum execution time of query.
- */
- public long getMinimumQueryTime() {
- if (minQryTime == null) {
- minQryTime = Long.MAX_VALUE;
-
- for (VisorCacheMetrics metric : metrics.values())
- minQryTime = Math.min(minQryTime, metric.getQueryMetrics().getMinimumTime());
- }
-
- return minQryTime;
- }
-
- /**
- * @return Average execution time of query.
- */
- public double getAverageQueryTime() {
- if (avgQryTime == null) {
- avgQryTime = 0.0d;
-
- for (VisorCacheMetrics metric : metrics.values())
- avgQryTime += metric.getQueryMetrics().getAverageTime();
-
- avgQryTime /= metrics.size();
- }
-
- return avgQryTime;
- }
-
- /**
- * @return Maximum execution time of query.
- */
- public long getMaximumQueryTime() {
- if (maxQryTime == null) {
- maxQryTime = Long.MIN_VALUE;
-
- for (VisorCacheMetrics metric : metrics.values())
- maxQryTime = Math.max(maxQryTime, metric.getQueryMetrics().getMaximumTime());
- }
-
- return maxQryTime;
- }
-
- /**
- * @return Total execution time of query.
- */
- public long getTotalQueryTime() {
- if (totalQryTime == null)
- totalQryTime = (long)(getAverageQueryTime() * getQueryExecutions());
-
- return totalQryTime;
- }
-
- /**
- * @return Number of executions.
- */
- public int getQueryExecutions() {
- if (execsQry == null) {
- execsQry = 0;
-
- for (VisorCacheMetrics metric : metrics.values())
- execsQry += metric.getQueryMetrics().getExecutions();
- }
-
- return execsQry;
- }
-
- /**
- * @return Total number of times a query execution failed.
- */
- public int getQueryFailures() {
- if (failsQry == null) {
- failsQry = 0;
-
- for (VisorCacheMetrics metric : metrics.values())
- failsQry += metric.getQueryMetrics().getFailures();
- }
-
- return failsQry;
- }
-
- /**
- * @return Map of Node IDs to cache metrics.
- */
- public Map<UUID, VisorCacheMetrics> getMetrics() {
- return metrics;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- U.writeString(out, name);
- out.writeByte(CacheMode.toCode(mode));
- out.writeBoolean(sys);
- U.writeMap(out, metrics);
- out.writeObject(minHeapSize);
- out.writeObject(avgHeapSize);
- out.writeObject(maxHeapSize);
- out.writeObject(minOffHeapSize);
- out.writeObject(avgOffHeapSize);
- out.writeObject(maxOffHeapSize);
- out.writeObject(minHits);
- out.writeObject(avgHits);
- out.writeObject(maxHits);
- out.writeObject(minMisses);
- out.writeObject(avgMisses);
- out.writeObject(maxMisses);
- out.writeObject(minReads);
- out.writeObject(avgReads);
- out.writeObject(maxReads);
- out.writeObject(minWrites);
- out.writeObject(avgWrites);
- out.writeObject(maxWrites);
- out.writeObject(minQryTime);
- out.writeObject(avgQryTime);
- out.writeObject(maxQryTime);
- out.writeObject(totalQryTime);
- out.writeObject(execsQry);
- out.writeObject(failsQry);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- name = U.readString(in);
- mode = CacheMode.fromCode(in.readByte());
- sys = in.readBoolean();
- metrics = U.readMap(in);
- minHeapSize = (Long)in.readObject();
- avgHeapSize = (Double)in.readObject();
- maxHeapSize = (Long)in.readObject();
- minOffHeapSize = (Long)in.readObject();
- avgOffHeapSize = (Double)in.readObject();
- maxOffHeapSize = (Long)in.readObject();
- minHits = (Long)in.readObject();
- avgHits = (Double)in.readObject();
- maxHits = (Long)in.readObject();
- minMisses = (Long)in.readObject();
- avgMisses = (Double)in.readObject();
- maxMisses = (Long)in.readObject();
- minReads = (Long)in.readObject();
- avgReads = (Double)in.readObject();
- maxReads = (Long)in.readObject();
- minWrites = (Long)in.readObject();
- avgWrites = (Double)in.readObject();
- maxWrites = (Long)in.readObject();
- minQryTime = (Long)in.readObject();
- avgQryTime = (Double)in.readObject();
- maxQryTime = (Long)in.readObject();
- totalQryTime = (Long)in.readObject();
- execsQry = (Integer)in.readObject();
- failsQry = (Integer)in.readObject();
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheAggregatedMetrics.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheClearTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheClearTask.java
deleted file mode 100644
index 68142b97aad..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheClearTask.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.cache.CachePeekMode;
-import org.apache.ignite.compute.ComputeJobContext;
-import org.apache.ignite.internal.processors.task.GridInternal;
-import org.apache.ignite.internal.processors.task.GridVisorManagementTask;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.visor.VisorJob;
-import org.apache.ignite.internal.visor.VisorOneNodeTask;
-import org.apache.ignite.lang.IgniteFuture;
-import org.apache.ignite.lang.IgniteInClosure;
-import org.apache.ignite.resources.JobContextResource;
-
-/**
- * Task that clears specified caches on specified node.
- */
-@GridInternal
-@GridVisorManagementTask
-public class VisorCacheClearTask extends VisorOneNodeTask<VisorCacheClearTaskArg, VisorCacheClearTaskResult> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** {@inheritDoc} */
- @Override protected VisorCacheClearJob job(VisorCacheClearTaskArg arg) {
- return new VisorCacheClearJob(arg, debug);
- }
-
- /**
- * Job that clear specified caches.
- */
- private static class VisorCacheClearJob extends VisorJob<VisorCacheClearTaskArg, VisorCacheClearTaskResult> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** */
- private final IgniteInClosure<IgniteFuture> lsnr;
-
- /** */
- private IgniteFuture<Long>[] futs;
-
- /** */
- @JobContextResource
- private ComputeJobContext jobCtx;
-
- /**
- * Create job.
- *
- * @param arg Task argument.
- * @param debug Debug flag.
- */
- private VisorCacheClearJob(VisorCacheClearTaskArg arg, boolean debug) {
- super(arg, debug);
-
- lsnr = new IgniteInClosure<IgniteFuture>() {
- /** */
- private static final long serialVersionUID = 0L;
-
- @Override public void apply(IgniteFuture f) {
- assert futs[0].isDone();
- assert futs[1] == null || futs[1].isDone();
- assert futs[2] == null || futs[2].isDone();
-
- jobCtx.callcc();
- }
- };
- }
-
- /**
- * @param fut Future to listen.
- * @return {@code true} If future was not completed and this job should holdCC.
- */
- private boolean callAsync(IgniteFuture fut) {
- if (fut.isDone())
- return false;
-
- jobCtx.holdcc();
-
- fut.listen(lsnr);
-
- return true;
- }
-
- /** {@inheritDoc} */
- @Override protected VisorCacheClearTaskResult run(final VisorCacheClearTaskArg arg) {
- if (futs == null)
- futs = new IgniteFuture[3];
-
- if (futs[0] == null || futs[1] == null || futs[2] == null) {
- String cacheName = arg.getCacheName();
-
- IgniteCache cache = ignite.cache(cacheName);
-
- if (cache == null)
- throw new IllegalStateException("Failed to find cache for name: " + cacheName);
-
- if (futs[0] == null) {
- futs[0] = cache.sizeLongAsync(CachePeekMode.PRIMARY);
-
- if (callAsync(futs[0]))
- return null;
- }
-
- if (futs[1] == null) {
- futs[1] = cache.clearAsync();
-
- if (callAsync(futs[1]))
- return null;
- }
-
- if (futs[2] == null) {
- futs[2] = cache.sizeLongAsync(CachePeekMode.PRIMARY);
-
- if (callAsync(futs[2]))
- return null;
- }
- }
-
- assert futs[0].isDone() && futs[1].isDone() && futs[2].isDone();
-
- return new VisorCacheClearTaskResult(futs[0].get(), futs[2].get());
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheClearJob.class, this);
- }
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheClearTaskArg.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheClearTaskArg.java
deleted file mode 100644
index ade2e126845..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheClearTaskArg.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-
-/**
- * Argument for {@link VisorCacheClearTask}.
- */
-public class VisorCacheClearTaskArg extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Cache name. */
- private String cacheName;
-
- /**
- * Default constructor.
- */
- public VisorCacheClearTaskArg() {
- // No-op.
- }
-
- /**
- * @param cacheName Cache name.
- */
- public VisorCacheClearTaskArg(String cacheName) {
- this.cacheName = cacheName;
- }
-
- /**
- * @return Cache name.
- */
- public String getCacheName() {
- return cacheName;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- U.writeString(out, cacheName);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- cacheName = U.readString(in);
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheClearTaskArg.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheClearTaskResult.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheClearTaskResult.java
deleted file mode 100644
index c7249f75eb2..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheClearTaskResult.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-
-/**
- * Result for {@link VisorCacheClearTask}.
- */
-public class VisorCacheClearTaskResult extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Cache size before clearing. */
- private long sizeBefore;
-
- /** Cache size after clearing. */
- private long sizeAfter;
-
- /**
- * Default constructor.
- */
- public VisorCacheClearTaskResult() {
- // No-op.
- }
-
- /**
- * @param sizeBefore Cache size before clearing.
- * @param sizeAfter Cache size after clearing.
- */
- public VisorCacheClearTaskResult(long sizeBefore, long sizeAfter) {
- this.sizeBefore = sizeBefore;
- this.sizeAfter = sizeAfter;
- }
-
- /**
- * @return Cache size before clearing.
- */
- public long getSizeBefore() {
- return sizeBefore;
- }
-
- /**
- * @return Cache size after clearing.
- */
- public long getSizeAfter() {
- return sizeAfter;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- out.writeLong(sizeBefore);
- out.writeLong(sizeAfter);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- sizeBefore = in.readLong();
- sizeAfter = in.readLong();
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheClearTaskResult.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheLoadTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheLoadTask.java
deleted file mode 100644
index 5d1bccd06f3..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheLoadTask.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.TimeUnit;
-import javax.cache.expiry.CreatedExpiryPolicy;
-import javax.cache.expiry.Duration;
-import javax.cache.expiry.ExpiryPolicy;
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.cache.CachePeekMode;
-import org.apache.ignite.internal.processors.task.GridInternal;
-import org.apache.ignite.internal.processors.task.GridVisorManagementTask;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorJob;
-import org.apache.ignite.internal.visor.VisorOneNodeTask;
-
-/**
- * Task to loads caches.
- */
-@GridInternal
-@GridVisorManagementTask
-public class VisorCacheLoadTask extends
- VisorOneNodeTask<VisorCacheLoadTaskArg, Map<String, Integer>> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** {@inheritDoc} */
- @Override protected VisorCachesLoadJob job(VisorCacheLoadTaskArg arg) {
- return new VisorCachesLoadJob(arg, debug);
- }
-
- /** Job that load caches. */
- private static class VisorCachesLoadJob extends
- VisorJob<VisorCacheLoadTaskArg, Map<String, Integer>> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /**
- * @param arg Cache names, ttl and loader arguments.
- * @param debug Debug flag.
- */
- private VisorCachesLoadJob(VisorCacheLoadTaskArg arg, boolean debug) {
- super(arg, debug);
- }
-
- /** {@inheritDoc} */
- @Override protected Map<String, Integer> run(VisorCacheLoadTaskArg arg) {
- Set<String> cacheNames = arg.getCacheNames();
- long ttl = arg.getTtl();
- Object[] ldrArgs = arg.getLoaderArguments();
-
- assert cacheNames != null && !cacheNames.isEmpty();
-
- Map<String, Integer> res = U.newHashMap(cacheNames.size());
-
- ExpiryPolicy plc = null;
-
- for (String cacheName : cacheNames) {
- IgniteCache cache = ignite.cache(cacheName);
-
- if (cache == null)
- throw new IllegalStateException("Failed to find cache for name: " + cacheName);
-
- if (ttl > 0) {
- if (plc == null)
- plc = new CreatedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS, ttl));
-
- cache = cache.withExpiryPolicy(plc);
- }
-
- cache.loadCache(null, ldrArgs);
-
- res.put(cacheName, cache.size(CachePeekMode.PRIMARY));
- }
-
- return res;
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCachesLoadJob.class, this);
- }
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheLoadTaskArg.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheLoadTaskArg.java
deleted file mode 100644
index b5da99322de..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheLoadTaskArg.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.util.Set;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-
-/**
- * Arguments for {@link VisorCacheLoadTask}.
- */
-public class VisorCacheLoadTaskArg extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Cache names to load data. */
- private Set<String> cacheNames;
-
- /** Duration a Cache Entry should exist be before it expires after being modified. */
- private long ttl;
-
- /** Optional user arguments to be passed into CacheStore.loadCache(IgniteBiInClosure, Object...) method. */
- private Object[] ldrArgs;
-
- /**
- * Default constructor.
- */
- public VisorCacheLoadTaskArg() {
- // No-op.
- }
-
- /**
- * @param cacheNames Cache names to load data.
- * @param ttl Duration a Cache Entry should exist be before it expires after being modified.
- * @param ldrArgs Optional user arguments to be passed into CacheStore.loadCache(IgniteBiInClosure, Object...) method.
- */
- public VisorCacheLoadTaskArg(Set<String> cacheNames, long ttl, Object[] ldrArgs) {
- this.cacheNames = cacheNames;
- this.ttl = ttl;
- this.ldrArgs = ldrArgs;
- }
-
- /**
- * @return Cache names to load data.
- */
- public Set<String> getCacheNames() {
- return cacheNames;
- }
-
- /**
- * @return Duration a Cache Entry should exist be before it expires after being modified.
- */
- public long getTtl() {
- return ttl;
- }
-
- /**
- * @return Optional user arguments to be passed into CacheStore.loadCache(IgniteBiInClosure, Object...) method.
- */
- public Object[] getLoaderArguments() {
- return ldrArgs;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- U.writeCollection(out, cacheNames);
- out.writeLong(ttl);
- U.writeArray(out, ldrArgs);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- cacheNames = U.readSet(in);
- ttl = in.readLong();
- ldrArgs = U.readArray(in);
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheLoadTaskArg.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheLostPartitionsTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheLostPartitionsTask.java
deleted file mode 100644
index daa4af7bec8..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheLostPartitionsTask.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.apache.ignite.internal.processors.cache.IgniteInternalCache;
-import org.apache.ignite.internal.processors.cache.distributed.dht.topology.GridDhtPartitionTopology;
-import org.apache.ignite.internal.processors.task.GridInternal;
-import org.apache.ignite.internal.processors.task.GridVisorManagementTask;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.visor.VisorJob;
-import org.apache.ignite.internal.visor.VisorOneNodeTask;
-
-/**
- * Collect list of lost partitions.
- */
-@GridInternal
-@GridVisorManagementTask
-public class VisorCacheLostPartitionsTask
- extends VisorOneNodeTask<VisorCacheLostPartitionsTaskArg, VisorCacheLostPartitionsTaskResult> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** {@inheritDoc} */
- @Override protected VisorCacheLostPartitionsJob job(VisorCacheLostPartitionsTaskArg arg) {
- return new VisorCacheLostPartitionsJob(arg, debug);
- }
-
- /**
- * Job that collect list of lost partitions.
- */
- private static class VisorCacheLostPartitionsJob
- extends VisorJob<VisorCacheLostPartitionsTaskArg, VisorCacheLostPartitionsTaskResult> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /**
- * @param arg Object with list of cache names to collect lost partitions.
- * @param debug Debug flag.
- */
- private VisorCacheLostPartitionsJob(VisorCacheLostPartitionsTaskArg arg, boolean debug) {
- super(arg, debug);
- }
-
- /** {@inheritDoc} */
- @Override protected VisorCacheLostPartitionsTaskResult run(VisorCacheLostPartitionsTaskArg arg) {
- Map<String, List<Integer>> res = new HashMap<>();
-
- for (String cacheName: arg.getCacheNames()) {
- IgniteInternalCache cache = ignite.cachex(cacheName);
-
- if (cache != null) {
- GridDhtPartitionTopology top = cache.context().topology();
-
- List<Integer> lostPartitions = new ArrayList<>(top.lostPartitions());
-
- if (!lostPartitions.isEmpty())
- res.put(cacheName, lostPartitions);
- }
- }
-
- return new VisorCacheLostPartitionsTaskResult(res);
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheLostPartitionsJob.class, this);
- }
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheLostPartitionsTaskArg.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheLostPartitionsTaskArg.java
deleted file mode 100644
index a937ce483b4..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheLostPartitionsTaskArg.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.util.List;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-
-/**
- * Argument for {@link VisorCacheLostPartitionsTask}.
- */
-public class VisorCacheLostPartitionsTaskArg extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** List of cache names. */
- private List<String> cacheNames;
-
- /** Created for toString method because Collection can't be printed. */
- private String modifiedCaches;
-
- /**
- * Default constructor.
- */
- public VisorCacheLostPartitionsTaskArg() {
- // No-op.
- }
-
- /**
- * @param cacheNames List of cache names.
- */
- public VisorCacheLostPartitionsTaskArg(List<String> cacheNames) {
- this.cacheNames = cacheNames;
-
- if (cacheNames != null)
- modifiedCaches = cacheNames.toString();
- }
-
- /**
- * @return List of cache names.
- */
- public List<String> getCacheNames() {
- return cacheNames;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- U.writeCollection(out, cacheNames);
- U.writeString(out, modifiedCaches);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- cacheNames = U.readList(in);
- modifiedCaches = U.readString(in);
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheLostPartitionsTaskArg.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheLostPartitionsTaskResult.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheLostPartitionsTaskResult.java
deleted file mode 100644
index b9a0e6b13ad..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheLostPartitionsTaskResult.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.util.List;
-import java.util.Map;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-
-/**
- * Result for {@link VisorCacheLostPartitionsTask}.
- */
-public class VisorCacheLostPartitionsTaskResult extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** List of lost partitions by caches. */
- private Map<String, List<Integer>> lostPartitions;
-
- /**
- * Default constructor.
- */
- public VisorCacheLostPartitionsTaskResult() {
- // No-op.
- }
-
- /**
- * @param lostPartitions List of lost partitions by caches.
- */
- public VisorCacheLostPartitionsTaskResult(Map<String, List<Integer>> lostPartitions) {
- this.lostPartitions = lostPartitions;
- }
-
- /**
- * @return List of lost partitions by caches.
- */
- public Map<String, List<Integer>> getLostPartitions() {
- return lostPartitions;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- U.writeMap(out, lostPartitions);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- lostPartitions = U.readMap(in);
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheLostPartitionsTaskResult.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetadataTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetadataTask.java
deleted file mode 100644
index 033087599e7..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetadataTask.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.IgniteException;
-import org.apache.ignite.internal.processors.cache.IgniteInternalCache;
-import org.apache.ignite.internal.processors.cache.query.GridCacheSqlMetadata;
-import org.apache.ignite.internal.processors.task.GridInternal;
-import org.apache.ignite.internal.util.typedef.F;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorJob;
-import org.apache.ignite.internal.visor.VisorOneNodeTask;
-
-import static org.apache.ignite.internal.visor.util.VisorTaskUtils.escapeName;
-
-/**
- * Task to get cache SQL metadata.
- */
-@GridInternal
-public class VisorCacheMetadataTask extends VisorOneNodeTask<VisorCacheMetadataTaskArg, VisorCacheSqlMetadata> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** {@inheritDoc} */
- @Override protected VisorCacheMetadataJob job(VisorCacheMetadataTaskArg arg) {
- return new VisorCacheMetadataJob(arg, debug);
- }
-
- /**
- * Job to get cache SQL metadata.
- */
- private static class VisorCacheMetadataJob extends VisorJob<VisorCacheMetadataTaskArg, VisorCacheSqlMetadata> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /**
- * @param arg Cache name to take metadata.
- * @param debug Debug flag.
- */
- private VisorCacheMetadataJob(VisorCacheMetadataTaskArg arg, boolean debug) {
- super(arg, debug);
- }
-
- /** {@inheritDoc} */
- @Override protected VisorCacheSqlMetadata run(VisorCacheMetadataTaskArg arg) {
- try {
- IgniteInternalCache<Object, Object> cache = ignite.cachex(arg.getCacheName());
-
- if (cache != null) {
- GridCacheSqlMetadata meta = F.first(cache.context().queries().sqlMetadata());
-
- if (meta != null)
- return new VisorCacheSqlMetadata(meta);
-
- return null;
- }
-
- throw new IgniteException("Cache not found: " + escapeName(arg.getCacheName()));
- }
- catch (IgniteCheckedException e) {
- throw U.convertException(e);
- }
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheMetadataJob.class, this);
- }
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetadataTaskArg.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetadataTaskArg.java
deleted file mode 100644
index 99ee350b63f..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetadataTaskArg.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-
-/**
- * Argument for {@link VisorCacheMetadataTask}.
- */
-public class VisorCacheMetadataTaskArg extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Cache name. */
- private String cacheName;
-
- /**
- * Default constructor.
- */
- public VisorCacheMetadataTaskArg() {
- // No-op.
- }
-
- /**
- * @param cacheName Cache name.
- */
- public VisorCacheMetadataTaskArg(String cacheName) {
- this.cacheName = cacheName;
- }
-
- /**
- * @return Cache name.
- */
- public String getCacheName() {
- return cacheName;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- U.writeString(out, cacheName);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- cacheName = U.readString(in);
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheMetadataTaskArg.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
deleted file mode 100644
index 378de7a5e98..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
+++ /dev/null
@@ -1,812 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.cache.CacheMetrics;
-import org.apache.ignite.cache.CacheMode;
-import org.apache.ignite.internal.IgniteEx;
-import org.apache.ignite.internal.processors.cache.GridCacheProcessor;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-import org.apache.ignite.internal.visor.query.VisorQueryMetrics;
-
-/**
- * Data transfer object for {@link CacheMetrics}.
- */
-public class VisorCacheMetrics extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** */
- private static final float MICROSECONDS_IN_SECOND = 1_000_000;
-
- /** Cache name. */
- private String name;
-
- /** Cache mode. */
- private CacheMode mode;
-
- /** Cache system state. */
- private boolean sys;
-
- /** Number of non-{@code null} values in the cache. */
- private int size;
-
- /** Gets number of keys in the cache, possibly with {@code null} values. */
- private int keySize;
-
- /** Number of non-{@code null} values in the cache as a long value. */
- private long cacheSize;
-
- /** Total number of reads of the owning entity (either cache or entry). */
- private long reads;
-
- /** The mean time to execute gets. */
- private float avgReadTime;
-
- /** Total number of writes of the owning entity (either cache or entry). */
- private long writes;
-
- /** Total number of hits for the owning entity (either cache or entry). */
- private long hits;
-
- /** Total number of misses for the owning entity (either cache or entry). */
- private long misses;
-
- /** Total number of transaction commits. */
- private long txCommits;
-
- /** The mean time to execute tx commit. */
- private float avgTxCommitTime;
-
- /** Total number of transaction rollbacks. */
- private long txRollbacks;
-
- /** The mean time to execute tx rollbacks. */
- private float avgTxRollbackTime;
-
- /** The total number of puts to the cache. */
- private long puts;
-
- /** The mean time to execute puts. */
- private float avgPutTime;
-
- /** The total number of removals from the cache. */
- private long removals;
-
- /** The mean time to execute removes. */
- private float avgRemovalTime;
-
- /** The total number of evictions from the cache. */
- private long evictions;
-
- /** Reads per second. */
- private int readsPerSec;
-
- /** Puts per second. */
- private int putsPerSec;
-
- /** Removes per second. */
- private int removalsPerSec;
-
- /** Commits per second. */
- private int commitsPerSec;
-
- /** Rollbacks per second. */
- private int rollbacksPerSec;
-
- /** Current size of evict queue used to batch up evictions. */
- private int dhtEvictQueueCurrSize;
-
- /** Gets transaction per-thread map size. */
- private int txThreadMapSize;
-
- /** Transaction per-Xid map size. */
- private int txXidMapSize;
-
- /** Committed transaction queue size. */
- private int txCommitQueueSize;
-
- /** Prepared transaction queue size. */
- private int txPrepareQueueSize;
-
- /** Start version counts map size. */
- private int txStartVerCountsSize;
-
- /** Number of cached committed transaction IDs. */
- private int txCommittedVersionsSize;
-
- /** Number of cached rolled back transaction IDs. */
- private int txRolledbackVersionsSize;
-
- /** DHT thread map size */
- private int txDhtThreadMapSize;
-
- /** Transaction DHT per-Xid map size. */
- private int txDhtXidMapSize;
-
- /** Committed DHT transaction queue size. */
- private int txDhtCommitQueueSize;
-
- /** Prepared DHT transaction queue size. */
- private int txDhtPrepareQueueSize;
-
- /** DHT start version counts map size. */
- private int txDhtStartVerCountsSize;
-
- /** Number of cached committed DHT transaction IDs. */
- private int txDhtCommittedVersionsSize;
-
- /** Number of cached rolled back DHT transaction IDs. */
- private int txDhtRolledbackVersionsSize;
-
- /** Number of cache entries stored in heap memory. */
- private long heapEntriesCnt;
-
- /** Memory size allocated in off-heap. */
- private long offHeapAllocatedSize;
-
- /** Number of cache entries stored in off-heap memory. */
- private long offHeapEntriesCnt;
-
- /** Number of primary cache entries stored in off-heap memory. */
- private long offHeapPrimaryEntriesCnt;
-
- /** Total number of partitions on current node. */
- private int totalPartsCnt;
-
- /** Number of already rebalanced keys. */
- private long rebalancedKeys;
-
- /** Number estimated to rebalance keys. */
- private long estimatedRebalancingKeys;
-
- /** Number of currently rebalancing partitions on current node. */
- private int rebalancingPartsCnt;
-
- /** Estimated number of keys to be rebalanced on current node. */
- private long keysToRebalanceLeft;
-
- /** Estimated rebalancing speed in keys. */
- private long rebalancingKeysRate;
-
- /** Estimated rebalancing speed in bytes. */
- private long rebalancingBytesRate;
-
- /** Gets query metrics for cache. */
- private VisorQueryMetrics qryMetrics;
-
- /**
- * Calculate rate of metric per second.
- *
- * @param meanTime Metric mean time.
- * @return Metric per second.
- */
- private static int perSecond(float meanTime) {
- return (meanTime > 0) ? (int)(MICROSECONDS_IN_SECOND / meanTime) : 0;
- }
-
- /**
- * Default constructor.
- */
- public VisorCacheMetrics() {
- // No-op.
- }
-
- /**
- * Create data transfer object for given cache metrics.
- *
- * @param ignite Ignite.
- * @param cacheName Cache name.
- */
- public VisorCacheMetrics(IgniteEx ignite, String cacheName) {
- GridCacheProcessor cacheProcessor = ignite.context().cache();
-
- IgniteCache<Object, Object> c = cacheProcessor.jcache(cacheName);
-
- name = cacheName;
- mode = cacheProcessor.cacheMode(cacheName);
- sys = cacheProcessor.systemCache(cacheName);
-
- CacheMetrics m = c.localMetrics();
-
- size = m.getSize();
- keySize = m.getKeySize();
-
- cacheSize = m.getCacheSize();
-
- reads = m.getCacheGets();
- writes = m.getCachePuts() + m.getCacheRemovals();
- hits = m.getCacheHits();
- misses = m.getCacheMisses();
-
- txCommits = m.getCacheTxCommits();
- txRollbacks = m.getCacheTxRollbacks();
-
- avgTxCommitTime = m.getAverageTxCommitTime();
- avgTxRollbackTime = m.getAverageTxRollbackTime();
-
- puts = m.getCachePuts();
- removals = m.getCacheRemovals();
- evictions = m.getCacheEvictions();
-
- avgReadTime = m.getAverageGetTime();
- avgPutTime = m.getAveragePutTime();
- avgRemovalTime = m.getAverageRemoveTime();
-
- readsPerSec = perSecond(m.getAverageGetTime());
- putsPerSec = perSecond(m.getAveragePutTime());
- removalsPerSec = perSecond(m.getAverageRemoveTime());
- commitsPerSec = perSecond(m.getAverageTxCommitTime());
- rollbacksPerSec = perSecond(m.getAverageTxRollbackTime());
-
- dhtEvictQueueCurrSize = m.getDhtEvictQueueCurrentSize();
- txThreadMapSize = m.getTxThreadMapSize();
- txXidMapSize = m.getTxXidMapSize();
- txCommitQueueSize = m.getTxCommitQueueSize();
- txPrepareQueueSize = m.getTxPrepareQueueSize();
- txStartVerCountsSize = m.getTxStartVersionCountsSize();
- txCommittedVersionsSize = m.getTxCommittedVersionsSize();
- txRolledbackVersionsSize = m.getTxRolledbackVersionsSize();
- txDhtThreadMapSize = m.getTxDhtThreadMapSize();
- txDhtXidMapSize = m.getTxDhtXidMapSize();
- txDhtCommitQueueSize = m.getTxDhtCommitQueueSize();
- txDhtPrepareQueueSize = m.getTxDhtPrepareQueueSize();
- txDhtStartVerCountsSize = m.getTxDhtStartVersionCountsSize();
- txDhtCommittedVersionsSize = m.getTxDhtCommittedVersionsSize();
- txDhtRolledbackVersionsSize = m.getTxDhtRolledbackVersionsSize();
-
- heapEntriesCnt = m.getHeapEntriesCount();
- offHeapAllocatedSize = m.getOffHeapAllocatedSize();
- offHeapEntriesCnt = m.getOffHeapEntriesCount();
- offHeapPrimaryEntriesCnt = m.getOffHeapPrimaryEntriesCount();
-
- totalPartsCnt = m.getTotalPartitionsCount();
- rebalancedKeys = m.getRebalancedKeys();
- estimatedRebalancingKeys = m.getEstimatedRebalancingKeys();
- rebalancingPartsCnt = m.getRebalancingPartitionsCount();
- keysToRebalanceLeft = m.getKeysToRebalanceLeft();
- rebalancingKeysRate = m.getRebalancingKeysRate();
- rebalancingBytesRate = m.getRebalancingBytesRate();
-
- qryMetrics = new VisorQueryMetrics(c.queryMetrics());
- }
-
- /**
- * @return Cache name.
- */
- public String getName() {
- return name;
- }
-
- /**
- * Sets cache name.
- *
- * @param name New value for cache name.
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * @return Cache mode.
- */
- public CacheMode getMode() {
- return mode;
- }
-
- /**
- * @return Cache system state.
- */
- public boolean isSystem() {
- return sys;
- }
-
- /**
- * @return Total number of reads of the owning entity (either cache or entry).
- */
- public long getReads() {
- return reads;
- }
-
- /**
- * @return The mean time to execute gets
- */
- public float getAvgReadTime() {
- return avgReadTime;
- }
-
- /**
- * @return Total number of writes of the owning entity (either cache or entry).
- */
- public long getWrites() {
- return writes;
- }
-
- /**
- * @return Total number of hits for the owning entity (either cache or entry).
- */
- public long getHits() {
- return hits;
- }
-
- /**
- * @return Total number of misses for the owning entity (either cache or entry).
- */
- public long getMisses() {
- return misses;
- }
-
- /**
- * @return Total number of transaction commits.
- */
- public long getTxCommits() {
- return txCommits;
- }
-
- /**
- * @return avgTxCommitTime
- */
- public float getAvgTxCommitTime() {
- return avgTxCommitTime;
- }
-
- /**
- * @return The mean time to execute tx rollbacks.
- */
- public float getAvgTxRollbackTime() {
- return avgTxRollbackTime;
- }
-
- /**
- * @return The total number of puts to the cache.
- */
- public long getPuts() {
- return puts;
- }
-
- /**
- * @return The mean time to execute puts.
- */
- public float getAvgPutTime() {
- return avgPutTime;
- }
-
- /**
- * @return The total number of removals from the cache.
- */
- public long getRemovals() {
- return removals;
- }
-
- /**
- * @return The mean time to execute removes.
- */
- public float getAvgRemovalTime() {
- return avgRemovalTime;
- }
-
- /**
- * @return The total number of evictions from the cache.
- */
- public long getEvictions() {
- return evictions;
- }
-
- /**
- * @return Total number of transaction rollbacks.
- */
- public long getTxRollbacks() {
- return txRollbacks;
- }
-
- /**
- * @return Reads per second.
- */
- public int getReadsPerSecond() {
- return readsPerSec;
- }
-
- /**
- * @return Puts per second.
- */
- public int getPutsPerSecond() {
- return putsPerSec;
- }
-
- /**
- * @return Removes per second.
- */
- public int getRemovalsPerSecond() {
- return removalsPerSec;
- }
-
- /**
- * @return Commits per second.
- */
- public int getCommitsPerSecond() {
- return commitsPerSec;
- }
-
- /**
- * @return Rollbacks per second.
- */
- public int getRollbacksPerSecond() {
- return rollbacksPerSec;
- }
-
- /**
- * @return Number of non-{@code null} values in the cache.
- */
- public int getSize() {
- return size;
- }
-
- /**
- * @return Gets number of keys in the cache, possibly with {@code null} values.
- */
- public int getKeySize() {
- return keySize;
- }
-
- /**
- * @return Number of non-{@code null} values in the cache as a long value.
- */
- public long getCacheSize() {
- return cacheSize;
- }
-
- /**
- * @return Gets query metrics for cache.
- */
- public VisorQueryMetrics getQueryMetrics() {
- return qryMetrics;
- }
-
- /**
- * @return Current size of evict queue used to batch up evictions.
- */
- public int getDhtEvictQueueCurrentSize() {
- return dhtEvictQueueCurrSize;
- }
-
- /**
- * @return Gets transaction per-thread map size.
- */
- public int getTxThreadMapSize() {
- return txThreadMapSize;
- }
-
- /**
- * @return Transaction per-Xid map size.
- */
- public int getTxXidMapSize() {
- return txXidMapSize;
- }
-
- /**
- * @return Committed transaction queue size.
- */
- public int getTxCommitQueueSize() {
- return txCommitQueueSize;
- }
-
- /**
- * @return Prepared transaction queue size.
- */
- public int getTxPrepareQueueSize() {
- return txPrepareQueueSize;
- }
-
- /**
- * @return Start version counts map size.
- */
- public int getTxStartVersionCountsSize() {
- return txStartVerCountsSize;
- }
-
- /**
- * @return Number of cached committed transaction IDs.
- */
- public int getTxCommittedVersionsSize() {
- return txCommittedVersionsSize;
- }
-
- /**
- * @return Number of cached rolled back transaction IDs.
- */
- public int getTxRolledbackVersionsSize() {
- return txRolledbackVersionsSize;
- }
-
- /**
- * @return DHT thread map size
- */
- public int getTxDhtThreadMapSize() {
- return txDhtThreadMapSize;
- }
-
- /**
- * @return Transaction DHT per-Xid map size.
- */
- public int getTxDhtXidMapSize() {
- return txDhtXidMapSize;
- }
-
- /**
- * @return Committed DHT transaction queue size.
- */
- public int getTxDhtCommitQueueSize() {
- return txDhtCommitQueueSize;
- }
-
- /**
- * @return Prepared DHT transaction queue size.
- */
- public int getTxDhtPrepareQueueSize() {
- return txDhtPrepareQueueSize;
- }
-
- /**
- * @return DHT start version counts map size.
- */
- public int getTxDhtStartVersionCountsSize() {
- return txDhtStartVerCountsSize;
- }
-
- /**
- * @return Number of cached committed DHT transaction IDs.
- */
- public int getTxDhtCommittedVersionsSize() {
- return txDhtCommittedVersionsSize;
- }
-
- /**
- * @return Number of cached rolled back DHT transaction IDs.
- */
- public int getTxDhtRolledbackVersionsSize() {
- return txDhtRolledbackVersionsSize;
- }
-
- /**
- * @return Number of entries in heap memory.
- */
- public long getHeapEntriesCount() {
- return heapEntriesCnt;
- }
-
- /**
- * @return Memory size allocated in off-heap.
- */
- public long getOffHeapAllocatedSize() {
- return offHeapAllocatedSize;
- }
-
- /**
- * @return Number of cache entries stored in off-heap memory.
- */
- public long getOffHeapEntriesCount() {
- return offHeapEntriesCnt;
- }
-
- /**
- * @return Number of primary cache entries stored in off-heap memory.
- */
- public long getOffHeapPrimaryEntriesCount() {
- return offHeapPrimaryEntriesCnt;
- }
-
- /**
- * @return Number of backup cache entries stored in off-heap memory.
- */
- public long getOffHeapBackupEntriesCount() {
- return offHeapEntriesCnt - offHeapPrimaryEntriesCnt;
- }
-
- /**
- * @return Total number of partitions on current node.
- */
- public int getTotalPartitionsCount() {
- return totalPartsCnt;
- }
-
- /**
- * @return Number of already rebalanced keys.
- */
- public long getRebalancedKeys() {
- return rebalancedKeys;
- }
-
- /**
- * @return Number estimated to rebalance keys.
- */
- public long getEstimatedRebalancingKeys() {
- return estimatedRebalancingKeys;
- }
-
- /**
- * @return Number of currently rebalancing partitions on current node.
- */
- public int getRebalancingPartitionsCount() {
- return rebalancingPartsCnt;
- }
-
- /**
- * @return Estimated number of keys to be rebalanced on current node.
- */
- public long getKeysToRebalanceLeft() {
- return keysToRebalanceLeft;
- }
-
- /**
- * @return Estimated rebalancing speed in keys.
- */
- public long getRebalancingKeysRate() {
- return rebalancingKeysRate;
- }
-
- /**
- * @return Estimated rebalancing speed in bytes.
- */
- public long getRebalancingBytesRate() {
- return rebalancingBytesRate;
- }
-
- /** {@inheritDoc} */
- @Override public byte getProtocolVersion() {
- return V2;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- U.writeString(out, name);
- out.writeByte(CacheMode.toCode(mode));
-
- out.writeBoolean(sys);
- out.writeInt(size);
- out.writeInt(keySize);
- out.writeLong(reads);
- out.writeFloat(avgReadTime);
- out.writeLong(writes);
- out.writeLong(hits);
- out.writeLong(misses);
- out.writeLong(txCommits);
- out.writeFloat(avgTxCommitTime);
- out.writeLong(txRollbacks);
- out.writeFloat(avgTxRollbackTime);
- out.writeLong(puts);
- out.writeFloat(avgPutTime);
- out.writeLong(removals);
- out.writeFloat(avgRemovalTime);
- out.writeLong(evictions);
- out.writeInt(readsPerSec);
- out.writeInt(putsPerSec);
- out.writeInt(removalsPerSec);
- out.writeInt(commitsPerSec);
- out.writeInt(rollbacksPerSec);
- out.writeInt(dhtEvictQueueCurrSize);
-
- out.writeInt(txThreadMapSize);
- out.writeInt(txXidMapSize);
- out.writeInt(txCommitQueueSize);
- out.writeInt(txPrepareQueueSize);
- out.writeInt(txStartVerCountsSize);
- out.writeInt(txCommittedVersionsSize);
- out.writeInt(txRolledbackVersionsSize);
- out.writeInt(txDhtThreadMapSize);
- out.writeInt(txDhtXidMapSize);
- out.writeInt(txDhtCommitQueueSize);
- out.writeInt(txDhtPrepareQueueSize);
- out.writeInt(txDhtStartVerCountsSize);
- out.writeInt(txDhtCommittedVersionsSize);
- out.writeInt(txDhtRolledbackVersionsSize);
-
- out.writeLong(heapEntriesCnt);
- out.writeLong(offHeapAllocatedSize);
- out.writeLong(offHeapEntriesCnt);
- out.writeLong(offHeapPrimaryEntriesCnt);
-
- out.writeInt(totalPartsCnt);
- out.writeInt(rebalancingPartsCnt);
- out.writeLong(keysToRebalanceLeft);
- out.writeLong(rebalancingKeysRate);
- out.writeLong(rebalancingBytesRate);
-
- out.writeObject(qryMetrics);
-
- out.writeLong(cacheSize);
-
- out.writeLong(rebalancedKeys);
- out.writeLong(estimatedRebalancingKeys);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- name = U.readString(in);
- mode = CacheMode.fromCode(in.readByte());
- sys = in.readBoolean();
- size = in.readInt();
- keySize = in.readInt();
- reads = in.readLong();
- avgReadTime = in.readFloat();
- writes = in.readLong();
- hits = in.readLong();
- misses = in.readLong();
- txCommits = in.readLong();
- avgTxCommitTime = in.readFloat();
- txRollbacks = in.readLong();
- avgTxRollbackTime = in.readFloat();
- puts = in.readLong();
- avgPutTime = in.readFloat();
- removals = in.readLong();
- avgRemovalTime = in.readFloat();
- evictions = in.readLong();
- readsPerSec = in.readInt();
- putsPerSec = in.readInt();
- removalsPerSec = in.readInt();
- commitsPerSec = in.readInt();
- rollbacksPerSec = in.readInt();
- dhtEvictQueueCurrSize = in.readInt();
-
- txThreadMapSize = in.readInt();
- txXidMapSize = in.readInt();
- txCommitQueueSize = in.readInt();
- txPrepareQueueSize = in.readInt();
- txStartVerCountsSize = in.readInt();
- txCommittedVersionsSize = in.readInt();
- txRolledbackVersionsSize = in.readInt();
- txDhtThreadMapSize = in.readInt();
- txDhtXidMapSize = in.readInt();
- txDhtCommitQueueSize = in.readInt();
- txDhtPrepareQueueSize = in.readInt();
- txDhtStartVerCountsSize = in.readInt();
- txDhtCommittedVersionsSize = in.readInt();
- txDhtRolledbackVersionsSize = in.readInt();
-
- heapEntriesCnt = in.readLong();
- offHeapAllocatedSize = in.readLong();
- offHeapEntriesCnt = in.readLong();
- offHeapPrimaryEntriesCnt = in.readLong();
-
- totalPartsCnt = in.readInt();
- rebalancingPartsCnt = in.readInt();
- keysToRebalanceLeft = in.readLong();
- rebalancingKeysRate = in.readLong();
- rebalancingBytesRate = in.readLong();
-
- qryMetrics = (VisorQueryMetrics)in.readObject();
-
- if (in.available() > 0)
- cacheSize = in.readLong();
-
- if (protoVer > V1) {
- rebalancedKeys = in.readLong();
- estimatedRebalancingKeys = in.readLong();
- }
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheMetrics.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetricsCollectorTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetricsCollectorTask.java
deleted file mode 100644
index 4c18ba3c782..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetricsCollectorTask.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import org.apache.ignite.compute.ComputeJobResult;
-import org.apache.ignite.internal.processors.cache.GridCacheContext;
-import org.apache.ignite.internal.processors.cache.GridCacheProcessor;
-import org.apache.ignite.internal.processors.cache.IgniteCacheProxy;
-import org.apache.ignite.internal.processors.task.GridInternal;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorJob;
-import org.apache.ignite.internal.visor.VisorMultiNodeTask;
-import org.apache.ignite.internal.visor.util.VisorTaskUtils;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * Task that collect cache metrics from all nodes.
- */
-@GridInternal
-public class VisorCacheMetricsCollectorTask extends VisorMultiNodeTask<VisorCacheMetricsCollectorTaskArg,
- Iterable<VisorCacheAggregatedMetrics>, Collection<VisorCacheMetrics>> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** {@inheritDoc} */
- @Override protected VisorCacheMetricsCollectorJob job(VisorCacheMetricsCollectorTaskArg arg) {
- return new VisorCacheMetricsCollectorJob(arg, debug);
- }
-
- /** {@inheritDoc} */
- @Nullable @Override protected Iterable<VisorCacheAggregatedMetrics> reduce0(List<ComputeJobResult> results) {
- Map<String, VisorCacheAggregatedMetrics> grpAggrMetrics = U.newHashMap(results.size());
-
- for (ComputeJobResult res : results) {
- if (res.getException() == null) {
- Collection<VisorCacheMetrics> cms = res.getData();
-
- for (VisorCacheMetrics cm : cms) {
- VisorCacheAggregatedMetrics am = grpAggrMetrics.get(cm.getName());
-
- if (am == null) {
- am = new VisorCacheAggregatedMetrics(cm);
-
- grpAggrMetrics.put(cm.getName(), am);
- }
-
- am.getMetrics().put(res.getNode().id(), cm);
- }
- }
- }
-
- // Create serializable result.
- return new ArrayList<>(grpAggrMetrics.values());
- }
-
- /**
- * Job that collect cache metrics from node.
- */
- private static class VisorCacheMetricsCollectorJob
- extends VisorJob<VisorCacheMetricsCollectorTaskArg, Collection<VisorCacheMetrics>> {
-
- /** */
- private static final long serialVersionUID = 0L;
-
- /**
- * Create job with given argument.
- *
- * @param arg Whether to collect metrics for all caches or for specified cache name only.
- * @param debug Debug flag.
- */
- private VisorCacheMetricsCollectorJob(VisorCacheMetricsCollectorTaskArg arg, boolean debug) {
- super(arg, debug);
- }
-
- /** {@inheritDoc} */
- @Override protected Collection<VisorCacheMetrics> run(final VisorCacheMetricsCollectorTaskArg arg) {
- assert arg != null;
-
- boolean showSysCaches = arg.isShowSystemCaches();
-
- Collection<String> cacheNames = arg.getCacheNames();
-
- assert cacheNames != null;
-
- GridCacheProcessor cacheProcessor = ignite.context().cache();
-
- Collection<IgniteCacheProxy<?, ?>> caches = cacheProcessor.jcaches();
-
- Collection<VisorCacheMetrics> res = new ArrayList<>(caches.size());
-
- boolean allCaches = cacheNames.isEmpty();
-
- for (IgniteCacheProxy ca : caches) {
- String cacheName = ca.getName();
-
- if (!VisorTaskUtils.isRestartingCache(ignite, cacheName)) {
- GridCacheContext ctx = ca.context();
-
- if (ctx.started() && (ctx.affinityNode() || ctx.isNear())) {
- VisorCacheMetrics cm = new VisorCacheMetrics(ignite, cacheName);
-
- if ((allCaches || cacheNames.contains(cacheName)) && (showSysCaches || !cm.isSystem()))
- res.add(cm);
- }
- }
- }
-
- return res;
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheMetricsCollectorJob.class, this);
- }
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetricsCollectorTaskArg.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetricsCollectorTaskArg.java
deleted file mode 100644
index 9529ab4d0a3..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetricsCollectorTaskArg.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.util.List;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-
-/**
- * Cache start arguments.
- */
-public class VisorCacheMetricsCollectorTaskArg extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Collect metrics for system caches. */
- private boolean showSysCaches;
-
- /** Cache names to collect metrics. */
- private List<String> cacheNames;
-
- /**
- * Default constructor.
- */
- public VisorCacheMetricsCollectorTaskArg() {
- // No-op.
- }
-
- /**
- * @param showSysCaches Collect metrics for system caches.
- * @param cacheNames Cache names to collect metrics.
- */
- public VisorCacheMetricsCollectorTaskArg(boolean showSysCaches, List<String> cacheNames) {
- this.showSysCaches = showSysCaches;
- this.cacheNames = cacheNames;
- }
-
- /**
- * @return Collect metrics for system caches
- */
- public boolean isShowSystemCaches() {
- return showSysCaches;
- }
-
- /**
- * @return Cache names to collect metrics
- */
- public List<String> getCacheNames() {
- return cacheNames;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- out.writeBoolean(showSysCaches);
- U.writeCollection(out, cacheNames);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- showSysCaches = in.readBoolean();
- cacheNames = U.readList(in);
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheMetricsCollectorTaskArg.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheModifyTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheModifyTask.java
deleted file mode 100644
index f68efa8622e..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheModifyTask.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.util.UUID;
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.cluster.ClusterNode;
-import org.apache.ignite.internal.processors.task.GridInternal;
-import org.apache.ignite.internal.processors.task.GridVisorManagementTask;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.visor.VisorJob;
-import org.apache.ignite.internal.visor.VisorOneNodeTask;
-import org.apache.ignite.internal.visor.query.VisorQueryUtils;
-import org.apache.ignite.internal.visor.util.VisorTaskUtils;
-
-/**
- * Task that modify value in specified cache.
- */
-@GridInternal
-@GridVisorManagementTask
-public class VisorCacheModifyTask extends VisorOneNodeTask<VisorCacheModifyTaskArg, VisorCacheModifyTaskResult> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** {@inheritDoc} */
- @Override protected VisorCacheModifyJob job(VisorCacheModifyTaskArg arg) {
- return new VisorCacheModifyJob(arg, debug);
- }
-
- /**
- * Job that modify value in specified cache.
- */
- private static class VisorCacheModifyJob extends VisorJob<VisorCacheModifyTaskArg, VisorCacheModifyTaskResult> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /**
- * Create job.
- *
- * @param arg Task argument.
- * @param debug Debug flag.
- */
- private VisorCacheModifyJob(VisorCacheModifyTaskArg arg, boolean debug) {
- super(arg, debug);
- }
-
- /** {@inheritDoc} */
- @Override protected VisorCacheModifyTaskResult run(final VisorCacheModifyTaskArg arg) {
- assert arg != null;
-
- VisorModifyCacheMode mode = arg.getMode();
- String cacheName = arg.getCacheName();
- Object key = arg.getKey();
-
- assert mode != null;
- assert cacheName != null;
- assert key != null;
-
- IgniteCache<Object, Object> cache = ignite.cache(cacheName);
-
- if (cache == null)
- throw new IllegalArgumentException("Failed to find cache with specified name [cacheName=" + arg.getCacheName() + "]");
-
- ClusterNode node = ignite.affinity(cacheName).mapKeyToNode(key);
-
- UUID nid = node != null ? node.id() : null;
-
- switch (mode) {
- case PUT:
- Object old = cache.get(key);
-
- cache.put(key, arg.getValue());
-
- return new VisorCacheModifyTaskResult(nid, VisorTaskUtils.compactClass(old),
- VisorQueryUtils.convertValue(old));
-
- case GET:
- Object val = cache.get(key);
-
- return new VisorCacheModifyTaskResult(nid, VisorTaskUtils.compactClass(val),
- VisorQueryUtils.convertValue(val));
-
- case REMOVE:
- Object rmv = cache.get(key);
-
- cache.remove(key);
-
- return new VisorCacheModifyTaskResult(nid, VisorTaskUtils.compactClass(rmv),
- VisorQueryUtils.convertValue(rmv));
- }
-
- return new VisorCacheModifyTaskResult(nid, null, null);
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheModifyJob.class, this);
- }
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheModifyTaskArg.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheModifyTaskArg.java
deleted file mode 100644
index 3948a2f0866..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheModifyTaskArg.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-
-/**
- * Argument for {@link VisorCacheModifyTask}.
- */
-public class VisorCacheModifyTaskArg extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Cache name. */
- private String cacheName;
-
- /** Modification mode. */
- private VisorModifyCacheMode mode;
-
- /** Specified key. */
- private Object key;
-
- /** Specified value. */
- private Object val;
-
- /** Created for toString method because Object can't be printed. */
- private String modifiedValues;
-
- /**
- * Default constructor.
- */
- public VisorCacheModifyTaskArg() {
- // No-op.
- }
-
- /**
- * @param cacheName Cache name.
- * @param mode Modification mode.
- * @param key Specified key.
- * @param val Specified value.
- */
- public VisorCacheModifyTaskArg(String cacheName, VisorModifyCacheMode mode, Object key, Object val) {
- this.cacheName = cacheName;
- this.mode = mode;
- this.key = key;
- this.val = val;
- this.modifiedValues = "[Key=" + key + ", Value=" + val + "]";
- }
-
- /**
- * @return Cache name.
- */
- public String getCacheName() {
- return cacheName;
- }
-
- /**
- * @return Modification mode.
- */
- public VisorModifyCacheMode getMode() {
- return mode;
- }
-
- /**
- * @return Specified key.
- */
- public Object getKey() {
- return key;
- }
-
- /**
- * @return Specified value.
- */
- public Object getValue() {
- return val;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- U.writeString(out, cacheName);
- U.writeEnum(out, mode);
- out.writeObject(key);
- out.writeObject(val);
- U.writeString(out, modifiedValues);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- cacheName = U.readString(in);
- mode = VisorModifyCacheMode.fromOrdinal(in.readByte());
- key = in.readObject();
- val = in.readObject();
- modifiedValues = U.readString(in);
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheModifyTaskArg.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheModifyTaskResult.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheModifyTaskResult.java
deleted file mode 100644
index 8d0152af576..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheModifyTaskResult.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.util.UUID;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-
-/**
- * Result for {@link VisorCacheModifyTask}.
- */
-public class VisorCacheModifyTaskResult extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Node ID where modified data contained. */
- private UUID affinityNode;
-
- /** Result type name. */
- private String resType;
-
- /** Value for specified key or number of modified rows. */
- private Object res;
-
- /**
- * Default constructor.
- */
- public VisorCacheModifyTaskResult() {
- // No-op.
- }
-
- /**
- * @param affinityNode Node ID where modified data contained.
- * @param resType Result type name.
- * @param res Value for specified key or number of modified rows.
- */
- public VisorCacheModifyTaskResult(UUID affinityNode, String resType, Object res) {
- this.affinityNode = affinityNode;
- this.resType = resType;
- this.res = res;
- }
-
- /**
- * @return Node ID where modified data contained.
- */
- public UUID getAffinityNode() {
- return affinityNode;
- }
-
- /**
- * @return Result type name.
- */
- public String getResultType() {
- return resType;
- }
-
- /**
- * @return Value for specified key or number of modified rows.
- */
- public Object getResult() {
- return res;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- U.writeUuid(out, affinityNode);
- U.writeString(out, resType);
- out.writeObject(res);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- affinityNode = U.readUuid(in);
- resType = U.readString(in);
- res = in.readObject();
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheModifyTaskResult.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheNamesCollectorTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheNamesCollectorTask.java
deleted file mode 100644
index 7d934d14339..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheNamesCollectorTask.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.ignite.internal.processors.cache.DynamicCacheDescriptor;
-import org.apache.ignite.internal.processors.cache.GridCacheProcessor;
-import org.apache.ignite.internal.processors.task.GridInternal;
-import org.apache.ignite.internal.util.typedef.F;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.visor.VisorJob;
-import org.apache.ignite.internal.visor.VisorOneNodeTask;
-import org.apache.ignite.lang.IgniteUuid;
-
-/**
- * Task that collect cache names and deployment IDs.
- */
-@GridInternal
-public class VisorCacheNamesCollectorTask extends VisorOneNodeTask<Void, VisorCacheNamesCollectorTaskResult> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** {@inheritDoc} */
- @Override protected VisorCacheNamesCollectorJob job(Void arg) {
- return new VisorCacheNamesCollectorJob(arg, debug);
- }
-
- /**
- * Job that collect cache names and deployment IDs.
- */
- private static class VisorCacheNamesCollectorJob extends VisorJob<Void, VisorCacheNamesCollectorTaskResult> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /**
- * Create job.
- *
- * @param arg Task argument.
- * @param debug Debug flag.
- */
- private VisorCacheNamesCollectorJob(Void arg, boolean debug) {
- super(arg, debug);
- }
-
- /** {@inheritDoc} */
- @Override protected VisorCacheNamesCollectorTaskResult run(Void arg) {
- GridCacheProcessor cacheProc = ignite.context().cache();
-
- Map<String, IgniteUuid> caches = new HashMap<>();
- Set<String> groups = new HashSet<>();
-
- for (Map.Entry<String, DynamicCacheDescriptor> item : cacheProc.cacheDescriptors().entrySet()) {
- DynamicCacheDescriptor cd = item.getValue();
-
- caches.put(item.getKey(), cd.deploymentId());
-
- String grp = cd.groupDescriptor().groupName();
-
- if (!F.isEmpty(grp))
- groups.add(grp);
- }
-
- return new VisorCacheNamesCollectorTaskResult(caches, groups);
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheNamesCollectorJob.class, this);
- }
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheNamesCollectorTaskResult.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheNamesCollectorTaskResult.java
deleted file mode 100644
index a2e0908f3e9..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheNamesCollectorTaskResult.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.util.Map;
-import java.util.Set;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-import org.apache.ignite.lang.IgniteUuid;
-
-/**
- * Result for {@link VisorCacheNamesCollectorTask}.
- */
-public class VisorCacheNamesCollectorTaskResult extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Cache names and deployment IDs. */
- private Map<String, IgniteUuid> caches;
-
- /** Cache groups. */
- private Set<String> groups;
-
- /**
- * Default constructor.
- */
- public VisorCacheNamesCollectorTaskResult() {
- // No-op.
- }
-
- /**
- * @param caches Cache names and deployment IDs.
- */
- public VisorCacheNamesCollectorTaskResult(Map<String, IgniteUuid> caches, Set<String> groups) {
- this.caches = caches;
- this.groups = groups;
- }
-
- /**
- * @return Value for specified key or number of modified rows..
- */
- public Map<String, IgniteUuid> getCaches() {
- return caches;
- }
-
- /**
- * @return Value for specified key or number of modified rows..
- */
- public Set<String> getGroups() {
- return groups;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- U.writeMap(out, caches);
- U.writeCollection(out, groups);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- caches = U.readMap(in);
- groups = U.readSet(in);
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheNamesCollectorTaskResult.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheNodesTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheNodesTask.java
deleted file mode 100644
index a8ed0a4fd13..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheNodesTask.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.UUID;
-import org.apache.ignite.cluster.ClusterNode;
-import org.apache.ignite.internal.processors.task.GridInternal;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.visor.VisorJob;
-import org.apache.ignite.internal.visor.VisorOneNodeTask;
-
-/**
- * Task that returns collection of cache data nodes IDs.
- */
-@GridInternal
-public class VisorCacheNodesTask extends VisorOneNodeTask<VisorCacheNodesTaskArg, Collection<UUID>> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** {@inheritDoc} */
- @Override protected VisorCacheNodesJob job(VisorCacheNodesTaskArg arg) {
- return new VisorCacheNodesJob(arg, debug);
- }
-
- /**
- * Job that collects cluster group for specified cache.
- */
- private static class VisorCacheNodesJob extends VisorJob<VisorCacheNodesTaskArg, Collection<UUID>> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /**
- * Create job.
- *
- * @param cacheName Cache name to clear.
- * @param debug Debug flag.
- */
- private VisorCacheNodesJob(VisorCacheNodesTaskArg cacheName, boolean debug) {
- super(cacheName, debug);
- }
-
- /** {@inheritDoc} */
- @Override protected Collection<UUID> run(VisorCacheNodesTaskArg arg) {
- Collection<ClusterNode> nodes = ignite.cluster().forDataNodes(arg.getCacheName()).nodes();
-
- Collection<UUID> res = new ArrayList<>(nodes.size());
-
- for (ClusterNode node : nodes)
- res.add(node.id());
-
- return res;
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheNodesJob.class, this);
- }
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheNodesTaskArg.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheNodesTaskArg.java
deleted file mode 100644
index 29e00e5b96d..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheNodesTaskArg.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-
-/**
- * Argument for {@link VisorCacheNodesTask}.
- */
-public class VisorCacheNodesTaskArg extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Cache name. */
- private String cacheName;
-
- /**
- * Default constructor.
- */
- public VisorCacheNodesTaskArg() {
- // No-op.
- }
-
- /**
- * @param cacheName Cache name.
- */
- public VisorCacheNodesTaskArg(String cacheName) {
- this.cacheName = cacheName;
- }
-
- /**
- * @return Cache name.
- */
- public String getCacheName() {
- return cacheName;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- U.writeString(out, cacheName);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- cacheName = U.readString(in);
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheNodesTaskArg.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCachePartitions.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCachePartitions.java
deleted file mode 100644
index 99feb23177a..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCachePartitions.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.util.HashMap;
-import java.util.Map;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-
-/**
- * Data transfer object for information about cache partitions.
- */
-public class VisorCachePartitions extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** */
- private Map<Integer, Long> primary;
-
- /** */
- private Map<Integer, Long> backup;
-
- /**
- * Default constructor.
- */
- public VisorCachePartitions() {
- primary = new HashMap<>();
- backup = new HashMap<>();
- }
-
- /**
- * Add primary partition descriptor.
- *
- * @param partId Partition id.
- * @param cnt Number of primary keys in partition.
- */
- public void addPrimary(int partId, long cnt) {
- primary.put(partId, cnt);
- }
-
- /**
- * Add backup partition descriptor.
- *
- * @param partId Partition id.
- * @param cnt Number of backup keys in partition.
- */
- public void addBackup(int partId, long cnt) {
- backup.put(partId, cnt);
- }
-
- /**
- * @return Get list of primary partitions.
- */
- public Map<Integer, Long> getPrimary() {
- return primary;
- }
-
- /**
- * @return Get list of backup partitions.
- */
- public Map<Integer, Long> getBackup() {
- return backup;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- U.writeMap(out, primary);
- U.writeMap(out, backup);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- primary = U.readMap(in);
- backup = U.readMap(in);
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCachePartitions.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCachePartitionsTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCachePartitionsTask.java
deleted file mode 100644
index 11ae18de754..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCachePartitionsTask.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-import org.apache.ignite.IgniteException;
-import org.apache.ignite.cache.CacheMode;
-import org.apache.ignite.compute.ComputeJobResult;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
-import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
-import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtCacheAdapter;
-import org.apache.ignite.internal.processors.cache.distributed.dht.topology.GridDhtLocalPartition;
-import org.apache.ignite.internal.processors.cache.distributed.dht.topology.GridDhtPartitionState;
-import org.apache.ignite.internal.processors.cache.distributed.dht.topology.GridDhtPartitionTopology;
-import org.apache.ignite.internal.processors.cache.distributed.near.GridNearCacheAdapter;
-import org.apache.ignite.internal.processors.task.GridInternal;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.visor.VisorJob;
-import org.apache.ignite.internal.visor.VisorMultiNodeTask;
-import org.apache.ignite.internal.visor.util.VisorTaskUtils;
-import org.jetbrains.annotations.Nullable;
-
-import static org.apache.ignite.internal.visor.util.VisorTaskUtils.escapeName;
-import static org.apache.ignite.internal.visor.util.VisorTaskUtils.log;
-
-/**
- * Task that collect keys distribution in partitions.
- */
-@GridInternal
-public class VisorCachePartitionsTask extends VisorMultiNodeTask<VisorCachePartitionsTaskArg,
- Map<UUID, VisorCachePartitions>, VisorCachePartitions> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** {@inheritDoc} */
- @Override protected VisorCachePartitionsJob job(VisorCachePartitionsTaskArg arg) {
- return new VisorCachePartitionsJob(arg, debug);
- }
-
- /** {@inheritDoc} */
- @Nullable @Override protected Map<UUID, VisorCachePartitions> reduce0(List<ComputeJobResult> results) {
- Map<UUID, VisorCachePartitions> parts = new HashMap<>();
-
- for (ComputeJobResult res : results) {
- if (res.getException() != null)
- throw res.getException();
-
- parts.put(res.getNode().id(), res.getData());
- }
-
- return parts;
- }
-
- /**
- * Job that collect cache metrics from node.
- */
- private static class VisorCachePartitionsJob extends VisorJob<VisorCachePartitionsTaskArg, VisorCachePartitions> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /**
- * Create job with given argument.
- *
- * @param arg Tasks arguments.
- * @param debug Debug flag.
- */
- private VisorCachePartitionsJob(VisorCachePartitionsTaskArg arg, boolean debug) {
- super(arg, debug);
- }
-
- /** {@inheritDoc} */
- @Override protected VisorCachePartitions run(VisorCachePartitionsTaskArg arg) throws IgniteException {
- String cacheName = arg.getCacheName();
-
- if (debug)
- log(ignite.log(), "Collecting partitions for cache: " + escapeName(cacheName));
-
- VisorCachePartitions parts = new VisorCachePartitions();
-
- GridCacheAdapter ca = ignite.context().cache().internalCache(cacheName);
-
- // Cache was not started.
- if (ca == null || !ca.context().started() || VisorTaskUtils.isRestartingCache(ignite, cacheName))
- return parts;
-
- CacheConfiguration cfg = ca.configuration();
-
- CacheMode mode = cfg.getCacheMode();
-
- boolean partitioned = (mode == CacheMode.PARTITIONED || mode == CacheMode.REPLICATED)
- && ca.context().affinityNode();
-
- if (partitioned) {
- GridDhtCacheAdapter dca = null;
-
- if (ca instanceof GridNearCacheAdapter)
- dca = ((GridNearCacheAdapter)ca).dht();
- else if (ca instanceof GridDhtCacheAdapter)
- dca = (GridDhtCacheAdapter)ca;
-
- if (dca != null) {
- GridDhtPartitionTopology top = dca.topology();
-
- List<GridDhtLocalPartition> locParts = top.localPartitions();
-
- for (GridDhtLocalPartition part : locParts) {
- int p = part.id();
-
- long sz = part.dataStore().cacheSize(ca.context().cacheId());
-
- // Pass NONE as topology version in order not to wait for topology version.
- if (part.primary(AffinityTopologyVersion.NONE))
- parts.addPrimary(p, sz);
- else if (part.state() == GridDhtPartitionState.OWNING && part.backup(AffinityTopologyVersion.NONE))
- parts.addBackup(p, sz);
- }
- }
- }
-
- return parts;
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCachePartitionsJob.class, this);
- }
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCachePartitionsTaskArg.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCachePartitionsTaskArg.java
deleted file mode 100644
index 957f0718b8c..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCachePartitionsTaskArg.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-
-/**
- * Arguments for {@link VisorCachePartitionsTask}.
- */
-public class VisorCachePartitionsTaskArg extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** */
- private String cacheName;
-
- /**
- * Default constructor.
- */
- public VisorCachePartitionsTaskArg() {
- // No-op.
- }
-
- /**
- * @param cacheName Cache name.
- */
- public VisorCachePartitionsTaskArg(String cacheName) {
- this.cacheName = cacheName;
- }
-
- /**
- * @return Cache name.
- */
- public String getCacheName() {
- return cacheName;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- U.writeString(out, cacheName);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- cacheName = U.readString(in);
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCachePartitionsTaskArg.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheRebalanceTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheRebalanceTask.java
deleted file mode 100644
index 58f8596bca4..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheRebalanceTask.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.internal.IgniteInternalFuture;
-import org.apache.ignite.internal.processors.cache.IgniteInternalCache;
-import org.apache.ignite.internal.processors.task.GridInternal;
-import org.apache.ignite.internal.processors.task.GridVisorManagementTask;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorJob;
-import org.apache.ignite.internal.visor.VisorOneNodeTask;
-
-/**
- * Pre-loads caches. Made callable just to conform common pattern.
- */
-@GridInternal
-@GridVisorManagementTask
-public class VisorCacheRebalanceTask extends VisorOneNodeTask<VisorCacheRebalanceTaskArg, Void> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** {@inheritDoc} */
- @Override protected VisorCachesRebalanceJob job(VisorCacheRebalanceTaskArg arg) {
- return new VisorCachesRebalanceJob(arg, debug);
- }
-
- /**
- * Job that rebalance caches.
- */
- private static class VisorCachesRebalanceJob extends VisorJob<VisorCacheRebalanceTaskArg, Void> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /**
- * @param arg Caches names.
- * @param debug Debug flag.
- */
- private VisorCachesRebalanceJob(VisorCacheRebalanceTaskArg arg, boolean debug) {
- super(arg, debug);
- }
-
- /** {@inheritDoc} */
- @Override protected Void run(VisorCacheRebalanceTaskArg arg) {
- try {
- Collection<IgniteInternalFuture<?>> futs = new ArrayList<>();
-
- for (IgniteInternalCache c : ignite.cachesx()) {
- if (arg.getCacheNames().contains(c.name()))
- futs.add(c.rebalance());
- }
-
- for (IgniteInternalFuture f : futs)
- f.get();
-
- return null;
- }
- catch (IgniteCheckedException e) {
- throw U.convertException(e);
- }
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCachesRebalanceJob.class, this);
- }
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheRebalanceTaskArg.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheRebalanceTaskArg.java
deleted file mode 100644
index 0bf420c52fb..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheRebalanceTaskArg.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.util.Set;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-
-/**
- * Argument for {@link VisorCacheRebalanceTask}.
- */
-public class VisorCacheRebalanceTaskArg extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Cache names. */
- private Set<String> cacheNames;
-
- /**
- * Default constructor.
- */
- public VisorCacheRebalanceTaskArg() {
- // No-op.
- }
-
- /**
- * @param cacheNames Cache names.
- */
- public VisorCacheRebalanceTaskArg(Set<String> cacheNames) {
- this.cacheNames = cacheNames;
- }
-
- /**
- * @return Cache names.
- */
- public Set<String> getCacheNames() {
- return cacheNames;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- U.writeCollection(out, cacheNames);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- cacheNames = U.readSet(in);
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheRebalanceTaskArg.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheResetLostPartitionsTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheResetLostPartitionsTask.java
deleted file mode 100644
index aa90d3e52a7..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheResetLostPartitionsTask.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import org.apache.ignite.internal.processors.task.GridInternal;
-import org.apache.ignite.internal.processors.task.GridVisorManagementTask;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.visor.VisorJob;
-import org.apache.ignite.internal.visor.VisorOneNodeTask;
-
-/**
- * Reset lost partitions for caches.
- */
-@GridInternal
-@GridVisorManagementTask
-public class VisorCacheResetLostPartitionsTask extends VisorOneNodeTask<VisorCacheResetLostPartitionsTaskArg, Void> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** {@inheritDoc} */
- @Override protected VisorCacheResetLostPartitionsJob job(VisorCacheResetLostPartitionsTaskArg arg) {
- return new VisorCacheResetLostPartitionsJob(arg, debug);
- }
-
- /**
- * Job that reset lost partitions for caches.
- */
- private static class VisorCacheResetLostPartitionsJob extends VisorJob<VisorCacheResetLostPartitionsTaskArg, Void> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /**
- * @param arg Object with list cache names to reset lost partitions.
- * @param debug Debug flag.
- */
- private VisorCacheResetLostPartitionsJob(VisorCacheResetLostPartitionsTaskArg arg, boolean debug) {
- super(arg, debug);
- }
-
- /** {@inheritDoc} */
- @Override protected Void run(VisorCacheResetLostPartitionsTaskArg arg) {
- ignite.resetLostPartitions(arg.getCacheNames());
-
- return null;
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheResetLostPartitionsJob.class, this);
- }
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheResetLostPartitionsTaskArg.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheResetLostPartitionsTaskArg.java
deleted file mode 100644
index c69e79db6d5..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheResetLostPartitionsTaskArg.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.util.List;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-
-/**
- * Argument for {@link VisorCacheResetLostPartitionsTask}.
- */
-public class VisorCacheResetLostPartitionsTaskArg extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** List of cache names. */
- private List<String> cacheNames;
-
- /** Created for toString method because Collection can't be printed. */
- private String modifiedCaches;
-
- /**
- * Default constructor.
- */
- public VisorCacheResetLostPartitionsTaskArg() {
- // No-op.
- }
-
- /**
- * @param cacheNames List of cache names.
- */
- public VisorCacheResetLostPartitionsTaskArg(List<String> cacheNames) {
- this.cacheNames = cacheNames;
-
- if (cacheNames != null)
- modifiedCaches = cacheNames.toString();
- }
-
- /**
- * @return List of cache names.
- */
- public List<String> getCacheNames() {
- return cacheNames;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- U.writeCollection(out, cacheNames);
- U.writeString(out, modifiedCaches);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- cacheNames = U.readList(in);
- modifiedCaches = U.readString(in);
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheResetLostPartitionsTaskArg.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheResetMetricsTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheResetMetricsTask.java
deleted file mode 100644
index bc6698de3ba..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheResetMetricsTask.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import org.apache.ignite.internal.processors.cache.IgniteInternalCache;
-import org.apache.ignite.internal.processors.task.GridInternal;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.visor.VisorJob;
-import org.apache.ignite.internal.visor.VisorOneNodeTask;
-
-/**
- * Reset compute grid metrics.
- */
-@GridInternal
-public class VisorCacheResetMetricsTask extends VisorOneNodeTask<VisorCacheResetMetricsTaskArg, Void> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** {@inheritDoc} */
- @Override protected VisorCacheResetMetricsJob job(VisorCacheResetMetricsTaskArg arg) {
- return new VisorCacheResetMetricsJob(arg, debug);
- }
-
- /**
- * Job that reset cache metrics.
- */
- private static class VisorCacheResetMetricsJob extends VisorJob<VisorCacheResetMetricsTaskArg, Void> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /**
- * @param arg Cache name to reset metrics for.
- * @param debug Debug flag.
- */
- private VisorCacheResetMetricsJob(VisorCacheResetMetricsTaskArg arg, boolean debug) {
- super(arg, debug);
- }
-
- /** {@inheritDoc} */
- @Override protected Void run(VisorCacheResetMetricsTaskArg arg) {
- IgniteInternalCache cache = ignite.cachex(arg.getCacheName());
-
- if (cache != null)
- cache.localMxBean().clear();
-
- return null;
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheResetMetricsJob.class, this);
- }
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheResetMetricsTaskArg.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheResetMetricsTaskArg.java
deleted file mode 100644
index 3a9d8aef0b5..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheResetMetricsTaskArg.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-
-/**
- * Argument for {@link VisorCacheResetMetricsTask}.
- */
-public class VisorCacheResetMetricsTaskArg extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Cache name. */
- private String cacheName;
-
- /**
- * Default constructor.
- */
- public VisorCacheResetMetricsTaskArg() {
- // No-op.
- }
-
- /**
- * @param cacheName Cache name.
- */
- public VisorCacheResetMetricsTaskArg(String cacheName) {
- this.cacheName = cacheName;
- }
-
- /**
- * @return Cache name.
- */
- public String getCacheName() {
- return cacheName;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- U.writeString(out, cacheName);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- cacheName = U.readString(in);
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheResetMetricsTaskArg.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheSqlIndexMetadata.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheSqlIndexMetadata.java
deleted file mode 100644
index cd4c95cc3af..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheSqlIndexMetadata.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.util.List;
-import org.apache.ignite.internal.processors.cache.query.GridCacheSqlIndexMetadata;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-
-/**
- * Data transfer object for cache SQL index metadata.
- */
-public class VisorCacheSqlIndexMetadata extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** */
- private String name;
-
- /** */
- private List<String> fields;
-
- /** */
- private List<String> descendings;
-
- /** */
- private boolean unique;
-
- /**
- * Default constructor.
- */
- public VisorCacheSqlIndexMetadata() {
- // No-op.
- }
-
- /**
- * Create data transfer object.
- *
- * @param meta SQL index metadata.
- */
- public VisorCacheSqlIndexMetadata(GridCacheSqlIndexMetadata meta) {
- name = meta.name();
- fields = toList(meta.fields());
- descendings = toList(meta.descendings());
- unique = meta.unique();
- }
-
- /**
- * @return Index name.
- */
- public String getName() {
- return name;
- }
-
- /**
- * @return Indexed fields names.
- */
- public List<String> getFields() {
- return fields;
- }
-
- /**
- * @return Descendings.
- */
- public List<String> getDescendings() {
- return descendings;
- }
-
- /**
- * @return {@code True} if index is unique, {@code false} otherwise.
- */
- public boolean isUnique() {
- return unique;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- U.writeString(out, name);
- U.writeCollection(out, fields);
- U.writeCollection(out, descendings);
- out.writeBoolean(unique);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- name = U.readString(in);
- fields = U.readList(in);
- descendings = U.readList(in);
- unique = in.readBoolean();
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheSqlIndexMetadata.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheSqlMetadata.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheSqlMetadata.java
deleted file mode 100644
index 7da9c975836..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheSqlMetadata.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.apache.ignite.internal.processors.cache.query.GridCacheSqlIndexMetadata;
-import org.apache.ignite.internal.processors.cache.query.GridCacheSqlMetadata;
-import org.apache.ignite.internal.util.IgniteUtils;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-
-/**
- * Data transfer object for cache SQL metadata.
- */
-public class VisorCacheSqlMetadata extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** */
- private String cacheName;
-
- /** */
- private List<String> types;
-
- /** */
- private Map<String, String> keyClasses;
-
- /** */
- private Map<String, String> valClasses;
-
- /** */
- private Map<String, Map<String, String>> fields;
-
- /** */
- private Map<String, List<VisorCacheSqlIndexMetadata>> indexes;
-
- /**
- * Default constructor.
- */
- public VisorCacheSqlMetadata() {
- // No-op.
- }
-
- /**
- * Create data transfer object.
- *
- * @param meta Cache SQL metadata.
- */
- public VisorCacheSqlMetadata(GridCacheSqlMetadata meta) {
- cacheName = meta.cacheName();
- types = toList(meta.types());
- keyClasses = meta.keyClasses();
- valClasses = meta.valClasses();
- fields = meta.fields();
- indexes = new HashMap<>();
-
- Map<String, Collection<GridCacheSqlIndexMetadata>> src = meta.indexes();
-
- if (src != null) {
- for (Map.Entry<String, Collection<GridCacheSqlIndexMetadata>> entry: src.entrySet()) {
- Collection<GridCacheSqlIndexMetadata> idxs = entry.getValue();
-
- List<VisorCacheSqlIndexMetadata> res = new ArrayList<>(idxs.size());
-
- for (GridCacheSqlIndexMetadata idx : idxs)
- res.add(new VisorCacheSqlIndexMetadata(idx));
-
- indexes.put(entry.getKey(), res);
- }
- }
- }
-
- /**
- * @return Cache name.
- */
- public String getCacheName() {
- return cacheName;
- }
-
- /**
- * @return Collection of available types.
- */
- public List<String> getTypes() {
- return types;
- }
-
- /**
- * @return Key classes.
- */
- public Map<String, String> getKeyClasses() {
- return keyClasses;
- }
-
- /**
- * @return Value classes.
- */
- public Map<String, String> getValueClasses() {
- return valClasses;
- }
-
- /**
- * @return Fields.
- */
- public Map<String, Map<String, String>> getFields() {
- return fields;
- }
-
- /**
- * @return Indexes.
- */
- public Map<String, List<VisorCacheSqlIndexMetadata>> getIndexes() {
- return indexes;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- U.writeString(out, cacheName);
- U.writeCollection(out, types);
- IgniteUtils.writeStringMap(out, keyClasses);
- IgniteUtils.writeStringMap(out, valClasses);
- U.writeMap(out, fields);
- U.writeMap(out, indexes);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- cacheName = U.readString(in);
- types = U.readList(in);
- keyClasses = IgniteUtils.readStringMap(in);
- valClasses = IgniteUtils.readStringMap(in);
- fields = U.readMap(in);
- indexes = U.readMap(in);
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheSqlMetadata.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheStartTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheStartTask.java
deleted file mode 100644
index 2e96a4b2139..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheStartTask.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-import org.apache.ignite.IgniteException;
-import org.apache.ignite.Ignition;
-import org.apache.ignite.compute.ComputeJobResult;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.NearCacheConfiguration;
-import org.apache.ignite.internal.processors.task.GridInternal;
-import org.apache.ignite.internal.processors.task.GridVisorManagementTask;
-import org.apache.ignite.internal.util.typedef.F;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.visor.VisorJob;
-import org.apache.ignite.internal.visor.VisorMultiNodeTask;
-import org.apache.ignite.internal.visor.util.VisorTaskUtils;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * Task that start cache or near cache with specified configuration.
- */
-@GridInternal
-@GridVisorManagementTask
-public class VisorCacheStartTask extends VisorMultiNodeTask<VisorCacheStartTaskArg, Map<UUID, IgniteException>, Void> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** {@inheritDoc} */
- @Override protected VisorCacheStartJob job(VisorCacheStartTaskArg arg) {
- return new VisorCacheStartJob(arg, debug);
- }
-
- /** {@inheritDoc} */
- @Nullable @Override protected Map<UUID, IgniteException> reduce0(List<ComputeJobResult> results) throws IgniteException {
- Map<UUID, IgniteException> map = new HashMap<>();
-
- for (ComputeJobResult res : results)
- if (res.getException() != null)
- map.put(res.getNode().id(), res.getException());
-
- return map;
- }
-
- /**
- * Job that start cache or near cache with specified configuration.
- */
- private static class VisorCacheStartJob extends VisorJob<VisorCacheStartTaskArg, Void> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /**
- * Create job.
- *
- * @param arg Contains cache name and XML configurations of cache.
- * @param debug Debug flag.
- */
- private VisorCacheStartJob(VisorCacheStartTaskArg arg, boolean debug) {
- super(arg, debug);
- }
-
- /** {@inheritDoc} */
- @Override protected Void run(VisorCacheStartTaskArg arg) throws IgniteException {
- String cfg = arg.getConfiguration();
-
- assert !F.isEmpty(cfg);
-
- try (ByteArrayInputStream bais = new ByteArrayInputStream(cfg.getBytes())) {
- if (arg.isNear()) {
- NearCacheConfiguration nearCfg = Ignition.loadSpringBean(bais, "nearCacheConfiguration");
-
- ignite.getOrCreateNearCache(VisorTaskUtils.unescapeName(arg.getName()), nearCfg);
- }
- else {
- CacheConfiguration cacheCfg = Ignition.loadSpringBean(bais, "cacheConfiguration");
-
- ignite.getOrCreateCache(cacheCfg);
- }
- }
- catch (IOException e) {
- throw new IgniteException(e);
- }
-
- return null;
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheStartJob.class, this);
- }
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheStartTaskArg.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheStartTaskArg.java
deleted file mode 100644
index 0b058aea525..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheStartTaskArg.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-
-/**
- * Cache start arguments.
- */
-public class VisorCacheStartTaskArg extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** */
- private boolean near;
-
- /** */
- private String name;
-
- /** */
- private String cfg;
-
- /**
- * Default constructor.
- */
- public VisorCacheStartTaskArg() {
- // No-op.
- }
-
- /**
- * @param near {@code true} if near cache should be started.
- * @param name Name for near cache.
- * @param cfg Cache XML configuration.
- */
- public VisorCacheStartTaskArg(boolean near, String name, String cfg) {
- this.near = near;
- this.name = name;
- this.cfg = cfg;
- }
-
- /**
- * @return {@code true} if near cache should be started.
- */
- public boolean isNear() {
- return near;
- }
-
- /**
- * @return Name for near cache.
- */
- public String getName() {
- return name;
- }
-
- /**
- * @return Cache XML configuration.
- */
- public String getConfiguration() {
- return cfg;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- out.writeBoolean(near);
- U.writeString(out, name);
- U.writeString(out, cfg);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- near = in.readBoolean();
- name = U.readString(in);
- cfg = U.readString(in);
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheStartTaskArg.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheToggleStatisticsTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheToggleStatisticsTask.java
deleted file mode 100644
index aebed810d2c..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheToggleStatisticsTask.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.internal.processors.task.GridInternal;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorJob;
-import org.apache.ignite.internal.visor.VisorOneNodeTask;
-
-/**
- * Switch statisticsEnabled flag for specified caches to specified state.
- */
-@GridInternal
-public class VisorCacheToggleStatisticsTask extends VisorOneNodeTask<VisorCacheToggleStatisticsTaskArg, Void> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** {@inheritDoc} */
- @Override protected VisorCachesToggleStatisticsJob job(VisorCacheToggleStatisticsTaskArg arg) {
- return new VisorCachesToggleStatisticsJob(arg, debug);
- }
-
- /**
- * Job that switch statisticsEnabled flag for specified caches to specified state.
- */
- private static class VisorCachesToggleStatisticsJob extends VisorJob<VisorCacheToggleStatisticsTaskArg, Void> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /**
- * @param arg Job argument object.
- * @param debug Debug flag.
- */
- private VisorCachesToggleStatisticsJob(VisorCacheToggleStatisticsTaskArg arg, boolean debug) {
- super(arg, debug);
- }
-
- /** {@inheritDoc} */
- @Override protected Void run(VisorCacheToggleStatisticsTaskArg arg) {
- try {
- ignite.context().cache().enableStatistics(arg.getCacheNames(), arg.getState());
- }
- catch (IgniteCheckedException e) {
- throw U.convertException(e);
- }
-
- return null;
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCachesToggleStatisticsJob.class, this);
- }
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheToggleStatisticsTaskArg.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheToggleStatisticsTaskArg.java
deleted file mode 100644
index 34359daeacf..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheToggleStatisticsTaskArg.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.util.Set;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-
-/**
- * Argument for {@link VisorCacheToggleStatisticsTask}.
- */
-public class VisorCacheToggleStatisticsTaskArg extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** State to set to statisticsEnabled flag. */
- private boolean state;
-
- /** Cache names to toggle statisticsEnabled flag. */
- private Set<String> cacheNames;
-
- /**
- * Default constructor.
- */
- public VisorCacheToggleStatisticsTaskArg() {
- // No-op.
- }
-
- /**
- * @param state State to set to statisticsEnabled flag.
- * @param cacheNames Collection of cache names to toggle statisticsEnabled flag.
- */
- public VisorCacheToggleStatisticsTaskArg(boolean state, Set<String> cacheNames) {
- this.state = state;
- this.cacheNames = cacheNames;
- }
-
- /**
- * @return State to set to statisticsEnabled flag.
- */
- public boolean getState() {
- return state;
- }
-
- /**
- * @return Cache names to toggle statisticsEnabled flag.
- */
- public Set<String> getCacheNames() {
- return cacheNames;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- out.writeBoolean(state);
- U.writeCollection(out, cacheNames);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- state = in.readBoolean();
- cacheNames = U.readSet(in);
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorCacheToggleStatisticsTaskArg.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorMemoryMetrics.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorMemoryMetrics.java
deleted file mode 100644
index d9ac08a8e35..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorMemoryMetrics.java
+++ /dev/null
@@ -1,352 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import org.apache.ignite.DataRegionMetrics;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-
-/**
- * Data transfer object for {@link DataRegionMetrics}
- */
-public class VisorMemoryMetrics extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** */
- private String name;
-
- /** */
- private long totalAllocatedPages;
-
- /** */
- private float allocationRate;
-
- /** */
- private float evictionRate;
-
- /** */
- private float largeEntriesPagesPercentage;
-
- /** */
- private float pagesFillFactor;
-
- /** */
- private long dirtyPages;
-
- /** */
- private float pagesReplaceRate;
-
- /** */
- private long physicalMemoryPages;
-
- /** */
- private long totalAllocatedSz;
-
- /** */
- private long physicalMemSz;
-
- /** */
- private int pageSize;
-
- /** */
- private long cpBufSz;
-
- /** */
- private long cpUsedBufPages;
-
- /** */
- private long cpUsedBufSz;
-
- /** */
- private long pagesRead;
-
- /** */
- private long pagesWritten;
-
- /** */
- private long pagesReplaced;
-
- /** */
- private long offHeapSz;
-
- /** */
- private long offHeapUsedSz;
-
- /**
- * Default constructor.
- */
- public VisorMemoryMetrics() {
- // No-op.
- }
-
- /**
- * @param m Metrics instance to create DTO.
- */
- public VisorMemoryMetrics(DataRegionMetrics m) {
- name = m.getName();
- totalAllocatedPages = m.getTotalAllocatedPages();
- allocationRate = m.getAllocationRate();
- evictionRate = m.getEvictionRate();
- largeEntriesPagesPercentage = m.getLargeEntriesPagesPercentage();
- pagesFillFactor = m.getPagesFillFactor();
- dirtyPages = m.getDirtyPages();
- pagesReplaceRate = m.getPagesReplaceRate();
- physicalMemoryPages = m.getPhysicalMemoryPages();
- totalAllocatedSz = m.getTotalAllocatedSize();
- physicalMemSz = m.getPhysicalMemorySize();
-
- pageSize = m.getPageSize();
-
- cpBufSz = m.getCheckpointBufferSize();
- cpUsedBufPages = m.getUsedCheckpointBufferPages();
- cpUsedBufSz = m.getUsedCheckpointBufferSize();
-
- pagesRead = m.getPagesRead();
- pagesWritten = m.getPagesWritten();
- pagesReplaced = m.getPagesReplaced();
-
- offHeapSz = m.getOffHeapSize();
- offHeapUsedSz = m.getOffheapUsedSize();
- }
-
- /**
- * @return Name of the memory region.
- */
- public String getName() {
- return name;
- }
-
- /**
- * @return Total number of allocated pages.
- */
- public long getTotalAllocatedPages() {
- return totalAllocatedPages;
- }
-
- /**
- * @return Number of allocated pages per second.
- */
- public float getAllocationRate() {
- return allocationRate;
- }
-
- /**
- * @return Eviction rate.
- */
- public float getEvictionRate() {
- return evictionRate;
- }
-
- /**
- * @return Number of evicted pages per second.
- */
- public float getLargeEntriesPagesPercentage() {
- return largeEntriesPagesPercentage;
- }
-
- /**
- * @return Percentage of pages fully occupied by large entities.
- */
- public float getPagesFillFactor() {
- return pagesFillFactor;
- }
-
- /**
- * @return Current number of dirty pages.
- */
- public long getDirtyPages() {
- return dirtyPages;
- }
-
- /**
- * @return Pages per second replace rate.
- */
- public float getPagesReplaceRate() {
- return pagesReplaceRate;
- }
-
- /**
- * @return Total number of pages loaded to RAM.
- */
- public long getPhysicalMemoryPages() {
- return physicalMemoryPages;
- }
-
- /**
- * @return Total size of memory allocated, in bytes.
- */
- public long getTotalAllocatedSize() {
- return totalAllocatedSz;
- }
-
- /**
- * @return Total size of pages loaded to RAM in bytes.
- */
- public long getPhysicalMemorySize() {
- return physicalMemSz;
- }
-
- /**
- * This method needed for compatibility with V2.
- *
- * @return Used checkpoint buffer size in pages.
- */
- public long getCheckpointBufferPages() {
- return cpUsedBufPages;
- }
-
- /**
- * @return @return Checkpoint buffer size in bytes.
- */
- public long getCheckpointBufferSize() {
- return cpBufSz;
- }
-
- /**
- * @return Used checkpoint buffer size in pages.
- */
- public long getUsedCheckpointBufferPages() {
- return cpUsedBufPages;
- }
-
- /**
- * @return Used checkpoint buffer size in bytes.
- */
- public long getUsedCheckpointBufferSize() {
- return cpUsedBufSz;
- }
-
- /**
- * @return Page size in bytes.
- */
- public int getPageSize() {
- return pageSize;
- }
-
- /**
- * @return The number of read pages from last restart.
- */
- public long getPagesRead() {
- return pagesRead;
- }
-
- /**
- * @return The number of written pages from last restart.
- */
- public long getPagesWritten() {
- return pagesWritten;
- }
-
- /**
- * @return The number of replaced pages from last restart .
- */
- public long getPagesReplaced() {
- return pagesReplaced;
- }
-
- /**
- * @return Total offheap size in bytes.
- */
- public long getOffHeapSize() {
- return offHeapSz;
- }
-
- /**
- * @return Total used offheap size in bytes.
- */
- public long getOffheapUsedSize() {
- return offHeapUsedSz;
- }
-
- /** {@inheritDoc} */
- @Override public byte getProtocolVersion() {
- return V3;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- U.writeString(out, name);
- out.writeLong(totalAllocatedPages);
- out.writeFloat(allocationRate);
- out.writeFloat(evictionRate);
- out.writeFloat(largeEntriesPagesPercentage);
- out.writeFloat(pagesFillFactor);
- out.writeLong(dirtyPages);
- out.writeFloat(pagesReplaceRate);
- out.writeLong(physicalMemoryPages);
-
- // V2
- out.writeLong(totalAllocatedSz);
- out.writeLong(physicalMemSz);
- out.writeLong(cpUsedBufPages);
- out.writeLong(cpBufSz);
- out.writeInt(pageSize);
-
- // V3
- out.writeLong(cpUsedBufSz);
-
- out.writeLong(pagesRead);
- out.writeLong(pagesWritten);
- out.writeLong(pagesReplaced);
-
- out.writeLong(offHeapSz);
- out.writeLong(offHeapUsedSz);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- name = U.readString(in);
- totalAllocatedPages = in.readLong();
- allocationRate = in.readFloat();
- evictionRate = in.readFloat();
- largeEntriesPagesPercentage = in.readFloat();
- pagesFillFactor = in.readFloat();
- dirtyPages = in.readLong();
- pagesReplaceRate = in.readFloat();
- physicalMemoryPages = in.readLong();
-
- if (protoVer > V1) {
- totalAllocatedSz = in.readLong();
- physicalMemSz = in.readLong();
- cpUsedBufPages = in.readLong();
- cpBufSz = in.readLong();
- pageSize = in.readInt();
- }
-
- if (protoVer > V2) {
- cpUsedBufSz = in.readLong();
-
- pagesRead = in.readLong();
- pagesWritten = in.readLong();
- pagesReplaced = in.readLong();
-
- offHeapSz = in.readLong();
- offHeapUsedSz = in.readLong();
- }
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorMemoryMetrics.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorModifyCacheMode.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorModifyCacheMode.java
deleted file mode 100644
index bd47f66c0af..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorModifyCacheMode.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import org.jetbrains.annotations.Nullable;
-
-/**
- * Enumeration of all supported cache modify modes.
- */
-public enum VisorModifyCacheMode {
- /** Put new value into cache. */
- PUT,
-
- /** Get value from cache. */
- GET,
-
- /** Remove value from cache. */
- REMOVE;
-
- /** Enumerated values. */
- private static final VisorModifyCacheMode[] VALS = values();
-
- /**
- * Efficiently gets enumerated value from its ordinal.
- *
- * @param ord Ordinal value.
- * @return Enumerated value or {@code null} if ordinal out of range.
- */
- @Nullable public static VisorModifyCacheMode fromOrdinal(int ord) {
- return ord >= 0 && ord < VALS.length ? VALS[ord] : null;
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorPartitionMap.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorPartitionMap.java
deleted file mode 100644
index 17c91a70f33..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorPartitionMap.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.cache;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.util.HashMap;
-import java.util.Map;
-import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap;
-import org.apache.ignite.internal.processors.cache.distributed.dht.topology.GridDhtPartitionState;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-
-/**
- * Data transfer object for partitions map.
- */
-public class VisorPartitionMap extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Map of partition states. */
- private Map<Integer, GridDhtPartitionState> parts;
-
- /**
- * Default constructor.
- */
- public VisorPartitionMap() {
- // No-op.
- }
-
- /**
- * @param map Partitions map.
- */
- public VisorPartitionMap(GridDhtPartitionMap map) {
- parts = map.map();
- }
-
- /**
- * @return Partitions map.
- */
- public Map<Integer, GridDhtPartitionState> getPartitions() {
- return parts;
- }
-
- /**
- * @return Partitions map size.
- */
- public int size() {
- return parts.size();
- }
-
- /**
- * @param part Partition.
- * @return Partition state.
- */
- public GridDhtPartitionState get(Integer part) {
- return parts.get(part);
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- if (parts != null) {
- out.writeInt(parts.size());
-
- for (Map.Entry<Integer, GridDhtPartitionState> e : parts.entrySet()) {
- out.writeInt(e.getKey());
- U.writeEnum(out, e.getValue());
- }
- }
- else
- out.writeInt(-1);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- int size = in.readInt();
-
- // Check null flag.
- if (size == -1)
- parts = null;
- else {
- parts = new HashMap<>(size, 1.0f);
-
- for (int i = 0; i < size; i++)
- parts.put(in.readInt(), GridDhtPartitionState.fromOrdinal(in.readByte()));
- }
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorPartitionMap.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/compute/VisorComputeMonitoringHolder.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/compute/VisorComputeMonitoringHolder.java
deleted file mode 100644
index 42eb4f5ba80..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/compute/VisorComputeMonitoringHolder.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.compute;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.apache.ignite.internal.IgniteEx;
-import org.apache.ignite.internal.processors.timeout.GridTimeoutObjectAdapter;
-import org.apache.ignite.internal.util.typedef.internal.S;
-
-import static org.apache.ignite.internal.visor.util.VisorTaskUtils.VISOR_TASK_EVTS;
-
-/**
- * Holder class to store information in node local map between data collector task executions.
- */
-public class VisorComputeMonitoringHolder {
- /** Task monitoring events holder key. */
- public static final String COMPUTE_MONITORING_HOLDER_KEY = "VISOR_COMPUTE_MONITORING_KEY";
-
- /** Visors that collect events (Visor instance key -> collect events since last cleanup check) */
- private final Map<String, Boolean> listenVisor = new HashMap<>();
-
- /** If cleanup process not scheduled. */
- private boolean cleanupStopped = true;
-
- /** Timeout between disable events check. */
- protected static final int CLEANUP_TIMEOUT = 2 * 60 * 1000;
-
- /**
- * Start collect events for Visor instance.
- *
- * @param ignite Grid.
- * @param visorKey unique Visor instance key.
- */
- public void startCollect(IgniteEx ignite, String visorKey) {
- synchronized (listenVisor) {
- if (cleanupStopped) {
- scheduleCleanupJob(ignite);
-
- cleanupStopped = false;
- }
-
- listenVisor.put(visorKey, Boolean.TRUE);
-
- ignite.events().enableLocal(VISOR_TASK_EVTS);
- }
- }
-
- /**
- * Check if collect events may be disable.
- *
- * @param ignite Grid.
- * @return {@code true} if task events should remain enabled.
- */
- private boolean tryDisableEvents(IgniteEx ignite) {
- if (!listenVisor.values().contains(Boolean.TRUE)) {
- listenVisor.clear();
-
- ignite.events().disableLocal(VISOR_TASK_EVTS);
- }
-
- // Return actual state. It could stay the same if events explicitly enabled in configuration.
- return ignite.allEventsUserRecordable(VISOR_TASK_EVTS);
- }
-
- /**
- * Disable collect events for Visor instance.
- *
- * @param g Grid.
- * @param visorKey Unique Visor instance key.
- */
- public void stopCollect(IgniteEx g, String visorKey) {
- synchronized (listenVisor) {
- listenVisor.remove(visorKey);
-
- tryDisableEvents(g);
- }
- }
-
- /**
- * Schedule cleanup process for events monitoring.
- *
- * @param ignite grid.
- */
- private void scheduleCleanupJob(final IgniteEx ignite) {
- ignite.context().timeout().addTimeoutObject(new GridTimeoutObjectAdapter(CLEANUP_TIMEOUT) {
- @Override public void onTimeout() {
- synchronized (listenVisor) {
- if (tryDisableEvents(ignite)) {
- for (String visorKey : listenVisor.keySet())
- listenVisor.put(visorKey, Boolean.FALSE);
-
- scheduleCleanupJob(ignite);
- }
- else
- cleanupStopped = true;
- }
- }
- });
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorComputeMonitoringHolder.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/compute/VisorComputeResetMetricsTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/compute/VisorComputeResetMetricsTask.java
deleted file mode 100644
index f9bc6248f90..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/compute/VisorComputeResetMetricsTask.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.compute;
-
-import org.apache.ignite.internal.processors.task.GridInternal;
-import org.apache.ignite.internal.processors.task.GridVisorManagementTask;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.visor.VisorJob;
-import org.apache.ignite.internal.visor.VisorOneNodeTask;
-
-/**
- * Reset compute grid metrics task.
- */
-@GridInternal
-@GridVisorManagementTask
-public class VisorComputeResetMetricsTask extends VisorOneNodeTask<Void, Void> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** {@inheritDoc} */
- @Override protected VisorComputeResetMetricsJob job(Void arg) {
- return new VisorComputeResetMetricsJob(arg, debug);
- }
-
- /**
- * Reset compute grid metrics job.
- */
- private static class VisorComputeResetMetricsJob extends VisorJob<Void, Void> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /**
- * @param arg Formal job argument.
- * @param debug Debug flag.
- */
- private VisorComputeResetMetricsJob(Void arg, boolean debug) {
- super(arg, debug);
- }
-
- /** {@inheritDoc} */
- @Override protected Void run(Void arg) {
- ignite.cluster().resetMetrics();
-
- return null;
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorComputeResetMetricsJob.class, this);
- }
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/compute/VisorComputeToggleMonitoringTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/compute/VisorComputeToggleMonitoringTask.java
deleted file mode 100644
index e9bd940d3cc..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/compute/VisorComputeToggleMonitoringTask.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.compute;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.concurrent.ConcurrentMap;
-import org.apache.ignite.compute.ComputeJobResult;
-import org.apache.ignite.internal.processors.task.GridInternal;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.visor.VisorJob;
-import org.apache.ignite.internal.visor.VisorMultiNodeTask;
-import org.jetbrains.annotations.Nullable;
-
-import static org.apache.ignite.internal.visor.compute.VisorComputeMonitoringHolder.COMPUTE_MONITORING_HOLDER_KEY;
-import static org.apache.ignite.internal.visor.util.VisorTaskUtils.VISOR_TASK_EVTS;
-import static org.apache.ignite.internal.visor.util.VisorTaskUtils.checkExplicitTaskMonitoring;
-
-/**
- * Task to run gc on nodes.
- */
-@GridInternal
-public class VisorComputeToggleMonitoringTask extends
- VisorMultiNodeTask<VisorComputeToggleMonitoringTaskArg, Boolean, Boolean> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** {@inheritDoc} */
- @Nullable @Override protected Boolean reduce0(List<ComputeJobResult> results) {
- Collection<Boolean> toggles = new HashSet<>();
-
- for (ComputeJobResult res : results)
- toggles.add(res.<Boolean>getData());
-
- // If all nodes return same result.
- return toggles.size() == 1;
- }
-
- /** {@inheritDoc} */
- @Override protected VisorComputeToggleMonitoringJob job(VisorComputeToggleMonitoringTaskArg arg) {
- return new VisorComputeToggleMonitoringJob(arg, debug);
- }
-
- /**
- * Job to toggle task monitoring on node.
- */
- private static class VisorComputeToggleMonitoringJob extends VisorJob<VisorComputeToggleMonitoringTaskArg, Boolean> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /**
- * @param arg Visor ID key and monitoring state flag.
- * @param debug Debug flag.
- */
- private VisorComputeToggleMonitoringJob(VisorComputeToggleMonitoringTaskArg arg, boolean debug) {
- super(arg, debug);
- }
-
- /** {@inheritDoc} */
- @Override protected Boolean run(VisorComputeToggleMonitoringTaskArg arg) {
- if (checkExplicitTaskMonitoring(ignite))
- return Boolean.TRUE;
-
- ConcurrentMap<String, VisorComputeMonitoringHolder> storage = ignite.cluster().nodeLocalMap();
-
- VisorComputeMonitoringHolder holder = storage.get(COMPUTE_MONITORING_HOLDER_KEY);
-
- if (holder == null) {
- VisorComputeMonitoringHolder holderNew = new VisorComputeMonitoringHolder();
-
- VisorComputeMonitoringHolder holderOld =
- storage.putIfAbsent(COMPUTE_MONITORING_HOLDER_KEY, holderNew);
-
- holder = holderOld == null ? holderNew : holderOld;
- }
-
- String visorKey = arg.getVisorKey();
-
- boolean state = arg.isEnabled();
-
- // Set task monitoring state.
- if (state)
- holder.startCollect(ignite, visorKey);
- else
- holder.stopCollect(ignite, visorKey);
-
- // Return actual state. It could stay the same if events explicitly enabled in configuration.
- return ignite.allEventsUserRecordable(VISOR_TASK_EVTS);
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorComputeToggleMonitoringJob.class, this);
- }
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/compute/VisorComputeToggleMonitoringTaskArg.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/compute/VisorComputeToggleMonitoringTaskArg.java
deleted file mode 100644
index e17379a08f8..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/compute/VisorComputeToggleMonitoringTaskArg.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.compute;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-
-/**
- * Toggle compute monitoring arguments.
- */
-public class VisorComputeToggleMonitoringTaskArg extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Visor monitoring id */
- private String visorKey;
-
- /** Enable state of compute monitoring */
- private boolean enabled;
-
- /**
- * Default constructor.
- */
- public VisorComputeToggleMonitoringTaskArg() {
- // No-op.
- }
-
- /**
- * @param visorKey Visor monitoring id.
- * @param enabled Enable state of compute monitoring.
- */
- public VisorComputeToggleMonitoringTaskArg(String visorKey, boolean enabled) {
- this.visorKey = visorKey;
- this.enabled = enabled;
- }
-
- /**
- * @return Visor monitoring id.
- */
- public String getVisorKey() {
- return visorKey;
- }
-
- /**
- * @return Enable state of compute monitoring.
- */
- public boolean isEnabled() {
- return enabled;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- U.writeString(out, visorKey);
- out.writeBoolean(enabled);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- visorKey = U.readString(in);
- enabled = in.readBoolean();
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorComputeToggleMonitoringTaskArg.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/compute/VisorGatewayTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/compute/VisorGatewayTask.java
deleted file mode 100644
index 8af62879f81..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/compute/VisorGatewayTask.java
+++ /dev/null
@@ -1,475 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.compute;
-
-import java.lang.reflect.Constructor;
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
-import org.apache.ignite.IgniteCompute;
-import org.apache.ignite.IgniteException;
-import org.apache.ignite.cluster.ClusterNode;
-import org.apache.ignite.compute.ComputeJob;
-import org.apache.ignite.compute.ComputeJobAdapter;
-import org.apache.ignite.compute.ComputeJobContext;
-import org.apache.ignite.compute.ComputeJobResult;
-import org.apache.ignite.compute.ComputeJobResultPolicy;
-import org.apache.ignite.compute.ComputeTask;
-import org.apache.ignite.internal.IgniteEx;
-import org.apache.ignite.internal.processors.task.GridInternal;
-import org.apache.ignite.internal.util.lang.GridTuple3;
-import org.apache.ignite.internal.util.typedef.CI1;
-import org.apache.ignite.internal.util.typedef.F;
-import org.apache.ignite.internal.visor.VisorCoordinatorNodeTask;
-import org.apache.ignite.internal.visor.VisorOneNodeTask;
-import org.apache.ignite.internal.visor.VisorTaskArgument;
-import org.apache.ignite.lang.IgniteBiTuple;
-import org.apache.ignite.lang.IgniteFuture;
-import org.apache.ignite.lang.IgniteUuid;
-import org.apache.ignite.resources.IgniteInstanceResource;
-import org.apache.ignite.resources.JobContextResource;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * Task to run Visor tasks through http REST.
- */
-@GridInternal
-public class VisorGatewayTask implements ComputeTask<Object[], Object> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** */
- private static final int JOB_ARG_IDX = 3;
-
- /** Array with additional length in arguments for specific nested types */
- private static final Map<Class, Integer> TYPE_ARG_LENGTH = new HashMap<>(4);
-
- static {
- TYPE_ARG_LENGTH.put(Collection.class, 2);
- TYPE_ARG_LENGTH.put(Set.class, 2);
- TYPE_ARG_LENGTH.put(List.class, 2);
- TYPE_ARG_LENGTH.put(Map.class, 3);
- TYPE_ARG_LENGTH.put(IgniteBiTuple.class, 4);
- TYPE_ARG_LENGTH.put(GridTuple3.class, 6);
- }
-
- /** Auto-injected grid instance. */
- @IgniteInstanceResource
- protected transient IgniteEx ignite;
-
- /** {@inheritDoc} */
- @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
- @Nullable Object[] args) throws IgniteException {
- assert args != null;
- assert args.length >= 2;
-
- return Collections.singletonMap(new VisorGatewayJob(args), ignite.localNode());
- }
-
- /** {@inheritDoc} */
- @Override public ComputeJobResultPolicy result(ComputeJobResult res,
- List<ComputeJobResult> rcvd) throws IgniteException {
- // Task should handle exceptions in reduce method.
- return ComputeJobResultPolicy.WAIT;
- }
-
- /** {@inheritDoc} */
- @Nullable @Override public Object reduce(List<ComputeJobResult> results) throws IgniteException {
- assert results.size() == 1;
-
- ComputeJobResult res = F.first(results);
-
- assert res != null;
-
- IgniteException ex = res.getException();
-
- if (ex != null)
- throw ex;
-
- return res.getData();
- }
-
- /**
- * Job to run Visor tasks through http REST.
- */
- private static class VisorGatewayJob extends ComputeJobAdapter {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** */
- private static final byte[] ZERO_BYTES = new byte[0];
-
- /** Auto-injected grid instance. */
- @IgniteInstanceResource
- protected transient IgniteEx ignite;
-
- /** Auto-inject job context. */
- @JobContextResource
- protected transient ComputeJobContext jobCtx;
-
- /** Arguments count. */
- private final int argsCnt;
-
- /** Future for spawned task. */
- private transient IgniteFuture fut;
-
- /**
- * Create job with specified argument.
- *
- * @param args Job argument.
- */
- VisorGatewayJob(@Nullable Object[] args) {
- super(args);
-
- assert args != null;
-
- argsCnt = args.length;
- }
-
- /**
- * Construct job argument.
- *
- * @param cls Class.
- * @param startIdx Index of first value argument.
- */
- @Nullable private Object toJobArgument(Class cls, int startIdx) throws ClassNotFoundException {
- String arg = argument(startIdx);
-
- boolean isList = cls == Collection.class || cls == List.class;
-
- if (isList || cls == Set.class) {
- String items = argument(startIdx + 1);
-
- if (items == null || "null".equals(items))
- return null;
-
- Class<?> itemsCls = Class.forName(arg);
-
- Collection<Object> res = isList ? new ArrayList<>() : new HashSet<>();
-
- for (String item : items.split(";"))
- res.add(toObject(itemsCls, item));
-
- return res;
- }
-
- if (cls == IgniteBiTuple.class) {
- Class<?> keyCls = Class.forName(arg);
-
- String valClsName = argument(startIdx + 1);
-
- assert valClsName != null;
-
- Class<?> valCls = Class.forName(valClsName);
-
- return new IgniteBiTuple<>(
- toObject(keyCls, argument(startIdx + 2)),
- toObject(valCls, argument(startIdx + 3)));
- }
-
- if (cls == Map.class) {
- Class<?> keyCls = Class.forName(arg);
-
- String valClsName = argument(startIdx + 1);
-
- assert valClsName != null;
-
- Class<?> valCls = Class.forName(valClsName);
-
- Map<Object, Object> res = new HashMap<>();
-
- String entries = argument(startIdx + 2);
-
- if (entries != null) {
- for (String entry : entries.split(";")) {
- if (!entry.isEmpty()) {
- String[] values = entry.split("=");
-
- assert values.length >= 1;
-
- res.put(toObject(keyCls, values[0]),
- values.length > 1 ? toObject(valCls, values[1]) : null);
- }
- }
- }
-
- return res;
- }
-
- if (cls == GridTuple3.class) {
- String v2ClsName = argument(startIdx + 1);
- String v3ClsName = argument(startIdx + 2);
-
- assert v2ClsName != null;
- assert v3ClsName != null;
-
- Class<?> v1Cls = Class.forName(arg);
- Class<?> v2Cls = Class.forName(v2ClsName);
- Class<?> v3Cls = Class.forName(v3ClsName);
-
- return new GridTuple3<>(
- toObject(v1Cls, argument(startIdx + 3)),
- toObject(v2Cls, argument(startIdx + 4)),
- toObject(v3Cls, argument(startIdx + 5)));
- }
-
- return toObject(cls, arg);
- }
-
- /**
- * Construct from string representation to target class.
- *
- * @param cls Target class.
- * @return Object constructed from string.
- */
- @Nullable private Object toObject(Class cls, String val) {
- if (val == null || "null".equals(val) || "nil".equals(val))
- return null;
-
- if (String.class == cls)
- return val;
-
- if (Boolean.class == cls || Boolean.TYPE == cls)
- return Boolean.parseBoolean(val);
-
- if (Integer.class == cls || Integer.TYPE == cls)
- return Integer.parseInt(val);
-
- if (Long.class == cls || Long.TYPE == cls)
- return Long.parseLong(val);
-
- if (UUID.class == cls)
- return UUID.fromString(val);
-
- if (IgniteUuid.class == cls)
- return IgniteUuid.fromString(val);
-
- if (Byte.class == cls || Byte.TYPE == cls)
- return Byte.parseByte(val);
-
- if (Short.class == cls || Short.TYPE == cls)
- return Short.parseShort(val);
-
- if (Float.class == cls || Float.TYPE == cls)
- return Float.parseFloat(val);
-
- if (Double.class == cls || Double.TYPE == cls)
- return Double.parseDouble(val);
-
- if (BigDecimal.class == cls)
- return new BigDecimal(val);
-
- if (Collection.class == cls || List.class == cls)
- return Arrays.asList(val.split(";"));
-
- if (Set.class == cls)
- return new HashSet<>(Arrays.asList(val.split(";")));
-
- if (Object[].class == cls)
- return val.split(";");
-
- if (byte[].class == cls) {
- String[] els = val.split(";");
-
- if (els.length == 0 || (els.length == 1 && els[0].isEmpty()))
- return ZERO_BYTES;
-
- byte[] res = new byte[els.length];
-
- for (int i = 0; i < els.length; i++)
- res[i] = Byte.valueOf(els[i]);
-
- return res;
- }
-
- if (cls.isEnum())
- return Enum.valueOf(cls, val);
-
- return val;
- }
-
- /**
- * Check if class is not a complex bean.
- *
- * @param cls Target class.
- * @return {@code True} if class is primitive or build-in java type or IgniteUuid.
- */
- private static boolean isBuildInObject(Class cls) {
- return cls.isPrimitive() || cls.getName().startsWith("java.") ||
- IgniteUuid.class == cls || IgniteBiTuple.class == cls || GridTuple3.class == cls;
- }
-
- /**
- * Extract Class object from arguments.
- *
- * @param idx Index of argument.
- */
- private Class toClass(int idx) throws ClassNotFoundException {
- Object arg = argument(idx); // Workaround generics: extract argument as Object to use in String.valueOf().
-
- return Class.forName(String.valueOf(arg));
- }
-
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- @Override public Object execute() throws IgniteException {
- if (fut != null)
- return fut.get();
-
- String nidsArg = argument(0);
- String taskName = argument(1);
-
- Object jobArgs = null;
-
- if (argsCnt > 2) {
- String argClsName = argument(2);
-
- assert argClsName != null;
-
- try {
- Class<?> argCls = Class.forName(argClsName);
-
- if (argCls == Void.class)
- jobArgs = null;
- else if (isBuildInObject(argCls))
- jobArgs = toJobArgument(argCls, JOB_ARG_IDX);
- else {
- int beanArgsCnt = argsCnt - JOB_ARG_IDX;
-
- for (Constructor ctor : argCls.getDeclaredConstructors()) {
- Class[] types = ctor.getParameterTypes();
-
- int args = types.length;
-
- // Length of arguments that required to constructor by influence of nested complex objects.
- int needArgs = args;
-
- for (Class type: types) {
- // When constructor required specified types increase length of required arguments.
- if (TYPE_ARG_LENGTH.containsKey(type))
- needArgs += TYPE_ARG_LENGTH.get(type);
- }
-
- if (needArgs == beanArgsCnt) {
- Object[] initArgs = new Object[args];
-
- for (int i = 0, ctrIdx = 0; i < beanArgsCnt; i++, ctrIdx++) {
- Class type = types[ctrIdx];
-
- // Parse nested complex objects from arguments for specified types.
- if (TYPE_ARG_LENGTH.containsKey(type)) {
- initArgs[ctrIdx] = toJobArgument(toClass(JOB_ARG_IDX + i), JOB_ARG_IDX + 1 + i);
-
- i += TYPE_ARG_LENGTH.get(type);
- }
- // In common case convert value to object.
- else {
- String val = argument(JOB_ARG_IDX + i);
-
- initArgs[ctrIdx] = toObject(type, val);
- }
- }
-
- ctor.setAccessible(true);
- jobArgs = ctor.newInstance(initArgs);
-
- break;
- }
- }
-
- if (jobArgs == null) {
- Object[] args = new Object[beanArgsCnt];
-
- for (int i = 0; i < beanArgsCnt; i++)
- args[i] = argument(i + JOB_ARG_IDX);
-
- throw new IgniteException("Failed to find constructor for task argument " +
- "[taskName=" + taskName + ", argsCnt=" + args.length +
- ", args=" + Arrays.toString(args) + "]");
- }
- }
- }
- catch (Exception e) {
- throw new IgniteException("Failed to construct job argument [taskName=" + taskName + "]", e);
- }
- }
-
- final List<UUID> nids;
-
- if (F.isEmpty(nidsArg) || "null".equals(nidsArg)) {
- try {
- Class<?> taskCls = Class.forName(taskName);
-
- if (VisorCoordinatorNodeTask.class.isAssignableFrom(taskCls)) {
- ClusterNode crd = ignite.context().discovery().discoCache().oldestAliveServerNode();
-
- nids = Collections.singletonList(crd.id());
- }
- else if (VisorOneNodeTask.class.isAssignableFrom(taskCls))
- nids = Collections.singletonList(ignite.localNode().id());
- else {
- Collection<ClusterNode> nodes = ignite.cluster().nodes();
-
- nids = new ArrayList<>(nodes.size());
-
- for (ClusterNode node : nodes)
- nids.add(node.id());
- }
- }
- catch (ClassNotFoundException e) {
- throw new IgniteException("Failed to find task class:" + taskName, e);
- }
- }
- else {
- String[] items = nidsArg.split(";");
-
- nids = new ArrayList<>(items.length);
-
- for (String item : items) {
- try {
- nids.add(UUID.fromString(item));
- }
- catch (IllegalArgumentException ignore) {
- ignite.log().warning("Failed to parse node id [taskName=" + taskName + ", nid=" + item + "]");
- }
- }
- }
-
- IgniteCompute comp = ignite.compute(ignite.cluster().forNodeIds(nids));
-
- fut = comp.executeAsync(taskName, new VisorTaskArgument<>(nids, jobArgs, false));
-
- fut.listen(new CI1<IgniteFuture<Object>>() {
- @Override public void apply(IgniteFuture<Object> f) {
- jobCtx.callcc();
- }
- });
-
- return jobCtx.holdcc();
- }
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/debug/VisorThreadDumpTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/debug/VisorThreadDumpTask.java
deleted file mode 100644
index f064028abcf..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/debug/VisorThreadDumpTask.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.debug;
-
-import java.lang.management.ThreadInfo;
-import java.lang.management.ThreadMXBean;
-import org.apache.ignite.internal.processors.task.GridInternal;
-import org.apache.ignite.internal.processors.task.GridVisorManagementTask;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorJob;
-import org.apache.ignite.internal.visor.VisorOneNodeTask;
-
-/**
- * Creates thread dump.
- */
-@GridInternal
-@GridVisorManagementTask
-public class VisorThreadDumpTask extends VisorOneNodeTask<Void, VisorThreadDumpTaskResult> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** {@inheritDoc} */
- @Override protected VisorDumpThreadJob job(Void arg) {
- return new VisorDumpThreadJob(arg, debug);
- }
-
- /**
- * Job that take thread dump on node.
- */
- private static class VisorDumpThreadJob extends VisorJob<Void, VisorThreadDumpTaskResult> {
- /** */
- private static final long serialVersionUID = 0L;
-
- /**
- * @param arg Formal job argument.
- * @param debug Debug flag.
- */
- private VisorDumpThreadJob(Void arg, boolean debug) {
- super(arg, debug);
- }
-
- /** {@inheritDoc} */
- @Override protected VisorThreadDumpTaskResult run(Void arg) {
- ThreadMXBean mx = U.getThreadMx();
-
- ThreadInfo[] info = mx.dumpAllThreads(true, true);
-
- VisorThreadInfo[] visorInfo = new VisorThreadInfo[info.length];
-
- for (int i = 0; i < info.length; i++)
- visorInfo[i] = new VisorThreadInfo(info[i]);
-
- return new VisorThreadDumpTaskResult(visorInfo, mx.findDeadlockedThreads());
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorDumpThreadJob.class, this);
- }
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/debug/VisorThreadDumpTaskResult.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/debug/VisorThreadDumpTaskResult.java
deleted file mode 100644
index f6e016104e9..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/debug/VisorThreadDumpTaskResult.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.debug;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.lang.management.ThreadInfo;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-
-/**
- * Data transfer object for Visor {@link ThreadInfo}.
- */
-public class VisorThreadDumpTaskResult extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** List of information about threads. */
- private VisorThreadInfo[] threadInfo;
-
- /** List of deadlocked thread ids. */
- private long[] deadlockedThreads;
-
- /**
- * Default constructor.
- */
- public VisorThreadDumpTaskResult() {
- // No-op.
- }
-
- /**
- * Create data transfer object for given thread info.
- *
- * @param threadInfo Thread info.
- * @param deadlockedThreads Thread info.
- */
- public VisorThreadDumpTaskResult(VisorThreadInfo[] threadInfo, long[] deadlockedThreads) {
- this.threadInfo = threadInfo;
- this.deadlockedThreads = deadlockedThreads;
- }
-
- /**
- * @return List of information about threads.
- */
- public VisorThreadInfo[] getThreadInfo() {
- return threadInfo;
- }
-
- /**
- * @return List of deadlocked thread ids.
- */
- public long[] getDeadlockedThreads() {
- return deadlockedThreads;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- out.writeObject(threadInfo);
- out.writeObject(deadlockedThreads);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- threadInfo = (VisorThreadInfo[])in.readObject();
- deadlockedThreads = (long[])in.readObject();
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorThreadDumpTaskResult.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/debug/VisorThreadInfo.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/debug/VisorThreadInfo.java
deleted file mode 100644
index c7c646bcecc..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/debug/VisorThreadInfo.java
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.debug;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.lang.management.ThreadInfo;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import org.apache.ignite.internal.util.typedef.F;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-
-/**
- * Data transfer object for Visor {@link ThreadInfo}.
- */
-public class VisorThreadInfo extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Thread name. */
- private String name;
-
- /** Thread ID. */
- private long id;
-
- /** Thread state. */
- private Thread.State state;
-
- /** Lock information. */
- private VisorThreadLockInfo lock;
-
- /** Lock name. */
- private String lockName;
-
- /** Lock owner thread ID. */
- private long lockOwnerId;
-
- /** Lock owner name. */
- private String lockOwnerName;
-
- /** Thread executing native code. */
- private boolean inNative;
-
- /** Thread is suspended. */
- private boolean suspended;
-
- /** Waited count. */
- private long waitedCnt;
-
- /** Waited time. */
- private long waitedTime;
-
- /** Blocked count. */
- private long blockedCnt;
-
- /** Blocked time. */
- private long blockedTime;
-
- /** Stack trace. */
- private List<StackTraceElement> stackTrace;
-
- /** Locks info. */
- private List<VisorThreadLockInfo> locks;
-
- /** Locked monitors. */
- private List<VisorThreadMonitorInfo> lockedMonitors;
-
- /**
- * Default constructor.
- */
- public VisorThreadInfo() {
- // No-op.
- }
-
- /**
- * Create data transfer object for given thread info.
- *
- * @param ti Thread info.
- */
- public VisorThreadInfo(ThreadInfo ti) {
- assert ti != null;
-
- name = ti.getThreadName();
- id = ti.getThreadId();
- state = ti.getThreadState();
- lock = ti.getLockInfo() != null ? new VisorThreadLockInfo(ti.getLockInfo()) : null;
- lockName = ti.getLockName();
- lockOwnerId = ti.getLockOwnerId();
- lockOwnerName = ti.getLockOwnerName();
- inNative = ti.isInNative();
- suspended = ti.isSuspended();
- waitedCnt = ti.getWaitedCount();
- waitedTime = ti.getWaitedTime();
- blockedCnt = ti.getBlockedCount();
- blockedTime = ti.getBlockedTime();
- stackTrace = Arrays.asList(ti.getStackTrace());
-
- locks = ti.getLockedSynchronizers() != null ?
- new ArrayList<VisorThreadLockInfo>(ti.getLockedSynchronizers().length) : null;
-
- if (ti.getLockedSynchronizers() != null)
- for (int i = 0; i < ti.getLockedSynchronizers().length; i++)
- locks.add(new VisorThreadLockInfo(ti.getLockedSynchronizers()[i]));
-
- lockedMonitors = ti.getLockedMonitors() != null ?
- new ArrayList<VisorThreadMonitorInfo>(ti.getLockedMonitors().length) : null;
-
- if (ti.getLockedMonitors() != null)
- for (int i = 0; i < ti.getLockedMonitors().length; i++)
- lockedMonitors.add(new VisorThreadMonitorInfo(ti.getLockedMonitors()[i]));
- }
-
- /**
- * @return Thread name.
- */
- public String getName() {
- return name;
- }
-
- /**
- * @return Thread ID.
- */
- public long getId() {
- return id;
- }
-
- /**
- * @return Thread state.
- */
- public Thread.State getState() {
- return state;
- }
-
- /**
- * @return Lock information.
- */
- public VisorThreadLockInfo getLock() {
- return lock;
- }
-
- /**
- * @return Lock name.
- */
- public String getLockName() {
- return lockName;
- }
-
- /**
- * @return Lock owner thread ID.
- */
- public long getLockOwnerId() {
- return lockOwnerId;
- }
-
- /**
- * @return Lock owner name.
- */
- public String getLockOwnerName() {
- return lockOwnerName;
- }
-
- /**
- * @return Thread executing native code.
- */
- public boolean isInNative() {
- return inNative;
- }
-
- /**
- * @return Thread is suspended.
- */
- public boolean isSuspended() {
- return suspended;
- }
-
- /**
- * @return Waited count.
- */
- public long getWaitedCount() {
- return waitedCnt;
- }
-
- /**
- * @return Waited time.
- */
- public long getWaitedTime() {
- return waitedTime;
- }
-
- /**
- * @return Blocked count.
- */
- public long getBlockedCount() {
- return blockedCnt;
- }
-
- /**
- * @return Blocked time.
- */
- public long getBlockedTime() {
- return blockedTime;
- }
-
- /**
- * @return Stack trace.
- */
- public List<StackTraceElement> getStackTrace() {
- return stackTrace;
- }
-
- /**
- * @return Locks info.
- */
- public List<VisorThreadLockInfo> getLocks() {
- return locks;
- }
-
- /**
- * @return Locked monitors.
- */
- public List<VisorThreadMonitorInfo> getLockedMonitors() {
- return lockedMonitors;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- U.writeString(out, name);
- out.writeLong(id);
- U.writeString(out, state.toString());
- out.writeObject(lock);
- U.writeString(out, lockName);
- out.writeLong(lockOwnerId);
- U.writeString(out, lockOwnerName);
- out.writeBoolean(inNative);
- out.writeBoolean(suspended);
- out.writeLong(waitedCnt);
- out.writeLong(waitedTime);
- out.writeLong(blockedCnt);
- out.writeLong(blockedTime);
- U.writeCollection(out, stackTrace);
- U.writeCollection(out, locks);
- U.writeCollection(out, lockedMonitors);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- name = U.readString(in);
- id = in.readLong();
-
- String statePresentation = U.readString(in);
-
- if (statePresentation != null)
- state = Enum.valueOf(Thread.State.class, statePresentation);
-
- lock = (VisorThreadLockInfo)in.readObject();
- lockName = U.readString(in);
- lockOwnerId = in.readLong();
- lockOwnerName = U.readString(in);
- inNative = in.readBoolean();
- suspended = in.readBoolean();
- waitedCnt = in.readLong();
- waitedTime = in.readLong();
- blockedCnt = in.readLong();
- blockedTime = in.readLong();
- stackTrace = U.readList(in);
- locks = U.readList(in);
- lockedMonitors = U.readList(in);
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- StringBuilder sb = new StringBuilder(512);
-
- sb.append('"').append(name).append('"').append(" Id=").append(id).append(' ').append(state);
-
- if (lockName != null)
- sb.append(" on ").append(lockName);
-
- if (lockOwnerName != null)
- sb.append(" owned by \"").append(lockOwnerName).append("\" Id=").append(lockOwnerId);
-
- if (suspended)
- sb.append(" (suspended)");
-
- if (inNative)
- sb.append(" (in native)");
-
- sb.append('\n');
-
- for (int i = 0; i < stackTrace.size(); i++) {
- StackTraceElement ste = stackTrace.get(i);
-
- sb.append("\tat ").append(ste).append('\n');
-
- if (i == 0 && lock != null) {
- switch (state) {
- case BLOCKED:
- sb.append("\t- blocked on ").append(lock).append('\n');
- break;
-
- case WAITING:
- sb.append("\t- waiting on ").append(lock).append('\n');
- break;
-
- case TIMED_WAITING:
- sb.append("\t- waiting on ").append(lock).append('\n');
- break;
-
- default:
- }
- }
-
- for (VisorThreadMonitorInfo mi : lockedMonitors) {
- if (mi.getStackDepth() == i)
- sb.append("\t- locked ").append(mi).append('\n');
- }
- }
-
- if (!F.isEmpty(locks)) {
- sb.append("\n\tNumber of locked synchronizers = ").append(locks.size()).append('\n');
-
- for (VisorThreadLockInfo li : locks)
- sb.append("\t- ").append(li).append('\n');
- }
-
- sb.append('\n');
-
- return sb.toString();
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/debug/VisorThreadLockInfo.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/debug/VisorThreadLockInfo.java
deleted file mode 100644
index 4aab0e00bfc..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/debug/VisorThreadLockInfo.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.debug;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.lang.management.LockInfo;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.internal.visor.VisorDataTransferObject;
-
-/**
- * Data transfer object for {@link LockInfo}.
- */
-public class VisorThreadLockInfo extends VisorDataTransferObject {
- /** */
- private static final long serialVersionUID = 0L;
-
- /**
- * Fully qualified name of the class of the lock object.
- */
- protected String clsName;
-
- /**
- * Identity hash code of the lock object.
- */
- protected Integer identityHashCode;
-
- /**
- * Default constructor.
- */
- public VisorThreadLockInfo() {
- // No-op.
- }
-
- /**
- * Create data transfer object for given lock info.
- *
- * @param li Lock info.
- */
- public VisorThreadLockInfo(LockInfo li) {
- assert li != null;
-
- clsName = li.getClassName();
- identityHashCode = li.getIdentityHashCode();
- }
-
- /**
- * @return Fully qualified name of the class of the lock object.
- */
- public String getClassName() {
- return clsName;
- }
-
- /**
- * @return Identity hash code of the lock object.
- */
- public Integer getIdentityHashCode() {
- return identityHashCode;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- U.writeString(out, clsName);
- out.writeObject(identityHashCode);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- clsName = U.readString(in);
- identityHashCode = (Integer)in.readObject();
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return clsName + '@' + Integer.toHexString(identityHashCode);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/debug/VisorThreadMonitorInfo.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/debug/VisorThreadMonitorInfo.java
deleted file mode 100644
index 189b8e3cdfb..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/debug/VisorThreadMonitorInfo.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.debug;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.lang.management.MonitorInfo;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.visor.VisorDataTransferObjectInput;
-import org.apache.ignite.internal.visor.VisorDataTransferObjectOutput;
-
-/**
- * Data transfer object for {@link MonitorInfo}.
- */
-public class VisorThreadMonitorInfo extends VisorThreadLockInfo {
- /** */
- private static final long serialVersionUID = 0L;
-
- /** Stack depth. */
- private int stackDepth;
-
- /** Stack frame. */
- private StackTraceElement stackFrame;
-
- /**
- * Default constructor.
- */
- public VisorThreadMonitorInfo() {
- // No-op.
- }
-
- /**
- * Create data transfer object for given monitor info.
- *
- * @param mi Monitoring info.
- */
- public VisorThreadMonitorInfo(MonitorInfo mi) {
- super(mi);
-
- stackDepth = mi.getLockedStackDepth();
- stackFrame = mi.getLockedStackFrame();
- }
-
- /**
- * @return Stack depth.
- */
- public int getStackDepth() {
- return stackDepth;
- }
-
- /**
- * @return Stack frame.
- */
- public StackTraceElement getStackFrame() {
- return stackFrame;
- }
-
- /** {@inheritDoc} */
- @Override protected void writeExternalData(ObjectOutput out) throws IOException {
- try (VisorDataTransferObjectOutput dtout = new VisorDataTransferObjectOutput(out)) {
- dtout.writeByte(super.getProtocolVersion());
-
- super.writeExternalData(dtout);
- }
-
- out.writeInt(stackDepth);
- out.writeObject(stackFrame);
- }
-
- /** {@inheritDoc} */
- @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
- try (VisorDataTransferObjectInput dtin = new VisorDataTransferObjectInput(in)) {
- super.readExternalData(dtin.readByte(), dtin);
- }
-
- stackDepth = in.readInt();
- stackFrame = (StackTraceElement)in.readObject();
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(VisorThreadMonitorInfo.class, this);
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/event/VisorGridDeploymentEvent.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/event/VisorGridDeploymentEvent.java
deleted file mode 100644
index e74b54c896c..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/event/VisorGridDeploymentEvent.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.visor.event;
-
-import java.io.IOException;
-import java.io.ObjectInput;
... 40306 lines suppressed ...