You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by dg...@apache.org on 2019/07/08 20:26:52 UTC
[ignite] branch master updated: IGNITE-11952 Bug fixes and
improvements in console utilities & test fixes - Fixes #6659
This is an automated email from the ASF dual-hosted git repository.
dgovorukhin 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 1867f8f IGNITE-11952 Bug fixes and improvements in console utilities & test fixes - Fixes #6659
1867f8f is described below
commit 1867f8fa501c97bc1bbd752b29badce4a5dd2666
Author: Sergey Chugunov <se...@gmail.com>
AuthorDate: Mon Jul 8 23:26:31 2019 +0300
IGNITE-11952 Bug fixes and improvements in console utilities & test fixes - Fixes #6659
Co-authored-by: Ivan Bessonov <be...@gmail.com>
Co-authored-by: Anton Kalashnikov <ka...@yandex.ru>
Co-authored-by: Dmitriy Govorukhin <dm...@gmail.com>
Signed-off-by: Dmitriy Govorukhin <dm...@gmail.com>
---
examples/pom-standalone-lgpl.xml | 18 ----
examples/pom-standalone.xml | 18 ----
.../ComputeContinuousMapperExample.java | 3 +-
.../computegrid/ComputeTaskMapExample.java | 3 +-
.../direct/singlesplit/SingleSplitTestTask.java | 3 +-
.../main/java/org/apache/ignite/IgniteCompute.java | 8 +-
.../java/org/apache/ignite/IgniteScheduler.java | 34 +++----
.../org/apache/ignite/IgniteSystemProperties.java | 2 +-
.../org/apache/ignite/compute/ComputeTask.java | 3 +-
.../ignite/compute/ComputeTaskSplitAdapter.java | 3 +-
.../gridify/aop/GridifyDefaultRangeTask.java | 3 +-
.../compute/gridify/aop/GridifyDefaultTask.java | 3 +-
.../configuration/ConnectorConfiguration.java | 8 +-
.../configuration/DataStorageConfiguration.java | 54 ++++++----
.../ignite/internal/GridTaskSessionImpl.java | 56 ++++++++---
.../org/apache/ignite/internal/IgniteKernal.java | 3 +-
.../ignite/internal/IgniteSchedulerImpl.java | 12 +--
.../org/apache/ignite/internal/IgnitionEx.java | 2 +
.../internal/MarshallerMappingFileStore.java | 4 +-
.../binary/streams/BinaryMemoryAllocatorChunk.java | 8 +-
.../connection/GridClientNioTcpConnection.java | 2 +
.../ignite/internal/cluster/IgniteKillTask.java | 3 +-
.../internal/commandline/BaselineCommand.java | 20 +++-
.../internal/commandline/CommandArgIterator.java | 10 +-
.../internal/commandline/CommandHandler.java | 96 ++++++++++++------
.../ignite/internal/commandline/StateCommand.java | 3 +-
.../internal/executor/GridExecutorService.java | 48 +++++----
.../managers/discovery/GridDiscoveryManager.java | 10 +-
.../eventstorage/GridEventStorageManager.java | 13 +--
.../internal/pagemem/wal/record/PageSnapshot.java | 44 ++++----
.../processors/cache/GridCacheAdapter.java | 9 +-
.../cache/GridCachePartitionExchangeManager.java | 6 +-
.../distributed/GridDistributedCacheAdapter.java | 2 +-
.../preloader/GridDhtPartitionsExchangeFuture.java | 20 ++--
.../dht/topology/GridDhtPartitionTopologyImpl.java | 18 ++--
.../dht/topology/PartitionsEvictManager.java | 8 +-
.../GridCacheDatabaseSharedManager.java | 32 +++---
.../cache/persistence/GridCacheOffheapManager.java | 8 +-
.../cache/persistence/file/AbstractFileIO.java | 4 +-
.../pagemem/IntervalBasedMeasurement.java | 3 +-
.../wal/filehandle/FileHandleManagerImpl.java | 21 ++--
.../query/jdbc/GridCacheQueryJdbcMetadataTask.java | 3 +-
.../cache/query/jdbc/GridCacheQueryJdbcTask.java | 3 +-
.../transactions/IgniteTxLocalStateAdapter.java | 3 +-
.../verify/CollectConflictPartitionKeysTask.java | 3 +-
.../RetrieveConflictPartitionValuesTask.java | 3 +-
.../verify/VerifyBackupPartitionsDumpTask.java | 3 +-
.../cache/verify/VerifyBackupPartitionsTask.java | 3 +-
.../cache/verify/VerifyBackupPartitionsTaskV2.java | 3 +-
.../processors/cache/verify/ViewCacheClosure.java | 5 +-
.../processors/closure/GridClosureProcessor.java | 22 ++--
.../compute/PlatformBalancingMultiClosureTask.java | 3 +-
...PlatformBalancingSingleClosureAffinityTask.java | 3 +-
.../PlatformBalancingSingleClosureTask.java | 3 +-
.../PlatformBroadcastingMultiClosureTask.java | 3 +-
.../PlatformBroadcastingSingleClosureTask.java | 3 +-
.../platform/compute/PlatformFullTask.java | 3 +-
.../processors/rest/GridRestProcessor.java | 44 ++++----
.../internal/processors/rest/GridRestResponse.java | 3 +
.../rest/client/message/GridClientResponse.java | 3 +
.../handlers/cache/GridCacheCommandHandler.java | 3 +-
.../internal/util/GridSpinReadWriteLock.java | 7 +-
.../apache/ignite/internal/util/IgniteUtils.java | 31 ++++++
.../internal/util/future/IgniteRemoteMapTask.java | 3 +-
.../ignite/internal/visor/VisorMultiNodeTask.java | 3 +-
.../internal/visor/baseline/VisorBaselineTask.java | 4 +-
.../cache/VisorCacheConfigurationCollectorJob.java | 3 +
.../internal/visor/compute/VisorGatewayTask.java | 3 +-
.../ignite/internal/visor/misc/VisorNopTask.java | 3 +-
.../spi/ExponentialBackoffTimeoutStrategy.java | 14 +--
.../spi/IgniteSpiOperationTimeoutHelper.java | 14 +--
.../spi/checkpoint/jdbc/JdbcCheckpointSpi.java | 6 +-
.../jobstealing/JobStealingCollisionSpi.java | 6 +-
.../spi/communication/tcp/TcpCommunicationSpi.java | 20 ++--
.../ignite/spi/discovery/tcp/ClientImpl.java | 49 +++++----
.../ignite/spi/discovery/tcp/ServerImpl.java | 112 +++++++++++----------
.../ignite/spi/discovery/tcp/TcpDiscoveryImpl.java | 8 +-
.../discovery/tcp/internal/TcpDiscoveryNode.java | 54 ++++++----
.../tcp/internal/TcpDiscoveryNodesRing.java | 4 +-
.../multicast/TcpDiscoveryMulticastIpFinder.java | 4 +-
.../apache/ignite/ClassPathContentLoggingTest.java | 2 +
.../internal/GridCancelOnGridStopSelfTest.java | 3 +-
.../GridContinuousJobAnnotationSelfTest.java | 3 +-
.../internal/GridContinuousTaskSelfTest.java | 7 +-
.../GridDeploymentMultiThreadedSelfTest.java | 3 +-
.../ignite/internal/GridDeploymentSelfTest.java | 7 +-
.../GridFailoverCustomTopologySelfTest.java | 3 +-
.../ignite/internal/GridFailoverSelfTest.java | 3 +-
.../GridFailoverTaskWithPredicateSelfTest.java | 3 +-
.../internal/GridFailoverTopologySelfTest.java | 3 +-
.../internal/GridJobCheckpointCleanupSelfTest.java | 3 +-
.../ignite/internal/GridJobStealingSelfTest.java | 5 +-
.../GridJobStealingZeroActiveJobsSelfTest.java | 3 +-
.../ignite/internal/GridJobSubjectIdSelfTest.java | 3 +-
.../ignite/internal/GridMultipleSpisSelfTest.java | 3 +-
.../GridMultipleVersionsDeploymentSelfTest.java | 3 +-
.../GridMultithreadedJobStealingSelfTest.java | 3 +-
.../internal/GridRuntimeExceptionSelfTest.java | 3 +-
.../internal/GridStopWithCancelSelfTest.java | 3 +-
.../ignite/internal/GridStopWithWaitSelfTest.java | 5 +-
.../internal/GridTaskContinuousMapperSelfTest.java | 7 +-
.../internal/GridTaskInstantiationSelfTest.java | 3 +-
.../ignite/internal/GridTaskJobRejectSelfTest.java | 3 +-
.../internal/GridTaskNameAnnotationSelfTest.java | 3 +-
.../internal/IgniteComputeResultExceptionTest.java | 3 +-
.../IgniteExplicitImplicitDeploymentSelfTest.java | 3 +-
.../ignite/internal/TaskNodeRestartTest.java | 5 +-
.../checkpoint/GridCheckpointTaskSelfTest.java | 5 +-
.../processors/cache/GridCachePutAllTask.java | 3 +-
...gniteRebalanceScheduleResendPartitionsTest.java | 14 ++-
.../IgniteCheckpointDirtyPagesForLowLoadTest.java | 4 +-
.../wal/memtracker/PageMemoryTracker.java | 4 +-
.../persistence/wal/scanner/WalScannerTest.java | 5 +
.../internal/util/GridCountDownCallbackTest.java | 4 +-
.../direct/multisplit/GridLoadTestTask.java | 3 +-
.../newnodes/GridSingleSplitNewNodesTestTask.java | 3 +-
.../direct/session/GridSessionLoadTestTask.java | 3 +-
.../direct/stealing/GridStealingLoadTestTask.java | 3 +-
.../job/GridJobExecutionLoadTestTask.java | 3 +-
.../job/GridJobExecutionSingleNodeLoadTest.java | 3 +-
...ridJobExecutionSingleNodeSemaphoreLoadTest.java | 3 +-
.../ignite/loadtests/job/GridJobLoadTestTask.java | 3 +-
.../ignite/p2p/GridP2PLocalDeploymentSelfTest.java | 3 +-
.../ignite/p2p/GridP2PRecursionTaskSelfTest.java | 3 +-
.../p2p/GridP2PRemoteClassLoadersSelfTest.java | 3 +-
.../org/apache/ignite/p2p/GridP2PTestTask.java | 3 +-
.../platform/PlatformCacheWriteMetricsTask.java | 3 +-
.../PlatformComputeBinarizableArgTask.java | 3 +-
.../platform/PlatformComputeBroadcastTask.java | 3 +-
.../platform/PlatformComputeDecimalTask.java | 3 +-
.../ignite/platform/PlatformComputeEchoTask.java | 3 +-
.../ignite/platform/PlatformDeployServiceTask.java | 3 +-
.../platform/PlatformEventsWriteEventTask.java | 3 +-
.../ignite/platform/PlatformExceptionTask.java | 3 +-
.../ignite/platform/PlatformMaxMemoryTask.java | 3 +-
.../ignite/platform/PlatformMinMemoryTask.java | 3 +-
.../ignite/platform/PlatformSqlQueryTask.java | 3 +-
.../ignite/platform/PlatformStartIgniteTask.java | 3 +-
.../ignite/platform/PlatformStopIgniteTask.java | 3 +-
.../ignite/platform/PlatformStringTestTask.java | 3 +-
.../lifecycle/PlatformJavaLifecycleTask.java | 3 +-
.../session/GridSessionJobFailoverSelfTest.java | 3 +-
.../ignite/session/GridSessionLoadSelfTest.java | 3 +-
.../GridSessionSetJobAttribute2SelfTest.java | 3 +-
.../GridSessionSetJobAttributeOrderSelfTest.java | 3 +-
.../ignite/util/GridCommandHandlerSslTest.java | 24 ++---
.../apache/ignite/util/GridCommandHandlerTest.java | 27 +++--
.../ignite/tests/p2p/CacheDeploymentTestTask1.java | 3 +-
.../ignite/tests/p2p/CacheDeploymentTestTask2.java | 3 +-
.../ignite/tests/p2p/CacheDeploymentTestTask3.java | 3 +-
.../apache/ignite/tests/p2p/JobStealingTask.java | 3 +-
.../ignite/tests/p2p/P2PTestTaskExternalPath1.java | 3 +-
.../ignite/tests/p2p/P2PTestTaskExternalPath2.java | 3 +-
.../plugin/cache/PlatformGetCachePluginsTask.java | 3 +-
.../apache/ignite/ml/genetic/CrossOverTask.java | 3 +-
.../org/apache/ignite/ml/genetic/FitnessTask.java | 3 +-
.../org/apache/ignite/ml/genetic/MutateTask.java | 3 +-
.../ml/genetic/RouletteWheelSelectionTask.java | 3 +-
.../ignite/ml/genetic/TruncateSelectionTask.java | 3 +-
.../Query/CacheQueriesWithRestartServerTest.cs | 22 ++--
.../uri/GridUriDeploymentSimpleSelfTest.java | 5 +-
.../console/demo/task/DemoCancellableTask.java | 3 +-
.../ignite/console/demo/task/DemoComputeTask.java | 3 +-
.../ignite/yardstick/compute/model/NoopTask.java | 3 +-
164 files changed, 859 insertions(+), 592 deletions(-)
diff --git a/examples/pom-standalone-lgpl.xml b/examples/pom-standalone-lgpl.xml
index a87745a..c9b7183 100644
--- a/examples/pom-standalone-lgpl.xml
+++ b/examples/pom-standalone-lgpl.xml
@@ -121,24 +121,6 @@
<artifactId>pmml-model</artifactId>
<version>1.4.7</version>
</dependency>
-
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- <version>2.7.3</version>
- </dependency>
-
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <version>2.7.3</version>
- </dependency>
-
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-annotations</artifactId>
- <version>2.7.3</version>
- </dependency>
</dependencies>
<profiles>
diff --git a/examples/pom-standalone.xml b/examples/pom-standalone.xml
index 8cdccf3..3ff8270 100644
--- a/examples/pom-standalone.xml
+++ b/examples/pom-standalone.xml
@@ -121,24 +121,6 @@
<artifactId>pmml-model</artifactId>
<version>1.4.7</version>
</dependency>
-
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- <version>2.7.3</version>
- </dependency>
-
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <version>2.7.3</version>
- </dependency>
-
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-annotations</artifactId>
- <version>2.7.3</version>
- </dependency>
</dependencies>
<profiles>
diff --git a/examples/src/main/java/org/apache/ignite/examples/computegrid/ComputeContinuousMapperExample.java b/examples/src/main/java/org/apache/ignite/examples/computegrid/ComputeContinuousMapperExample.java
index ea7eba7..66e093c 100644
--- a/examples/src/main/java/org/apache/ignite/examples/computegrid/ComputeContinuousMapperExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/computegrid/ComputeContinuousMapperExample.java
@@ -38,6 +38,7 @@ import org.apache.ignite.compute.ComputeTaskContinuousMapper;
import org.apache.ignite.compute.ComputeTaskNoResultCache;
import org.apache.ignite.examples.ExampleNodeStartup;
import org.apache.ignite.resources.TaskContinuousMapperResource;
+import org.jetbrains.annotations.NotNull;
/**
* Demonstrates usage of continuous mapper. With continuous mapper
@@ -99,7 +100,7 @@ public class ComputeContinuousMapperExample {
private final AtomicInteger totalChrCnt = new AtomicInteger(0);
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> nodes, String phrase) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> nodes, String phrase) {
if (phrase == null || phrase.isEmpty())
throw new IgniteException("Phrase is empty.");
diff --git a/examples/src/main/java/org/apache/ignite/examples/computegrid/ComputeTaskMapExample.java b/examples/src/main/java/org/apache/ignite/examples/computegrid/ComputeTaskMapExample.java
index f96dd6c..6f6fc21 100644
--- a/examples/src/main/java/org/apache/ignite/examples/computegrid/ComputeTaskMapExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/computegrid/ComputeTaskMapExample.java
@@ -30,6 +30,7 @@ import org.apache.ignite.compute.ComputeJobAdapter;
import org.apache.ignite.compute.ComputeJobResult;
import org.apache.ignite.compute.ComputeTaskAdapter;
import org.apache.ignite.examples.ExampleNodeStartup;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
@@ -79,7 +80,7 @@ public class ComputeTaskMapExample {
* @param arg String to split into words for processing.
* @return Map of jobs to nodes.
*/
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> nodes, String arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> nodes, String arg) {
Map<ComputeJob, ClusterNode> map = new HashMap<>();
Iterator<ClusterNode> it = nodes.iterator();
diff --git a/modules/aop/src/test/java/org/apache/loadtests/direct/singlesplit/SingleSplitTestTask.java b/modules/aop/src/test/java/org/apache/loadtests/direct/singlesplit/SingleSplitTestTask.java
index 1ba6c09..e0384e0 100644
--- a/modules/aop/src/test/java/org/apache/loadtests/direct/singlesplit/SingleSplitTestTask.java
+++ b/modules/aop/src/test/java/org/apache/loadtests/direct/singlesplit/SingleSplitTestTask.java
@@ -32,6 +32,7 @@ import org.apache.ignite.compute.ComputeTaskAdapter;
import org.apache.ignite.compute.ComputeTaskSession;
import org.apache.ignite.resources.LoadBalancerResource;
import org.apache.ignite.resources.TaskSessionResource;
+import org.jetbrains.annotations.NotNull;
/**
* Single split test task.
@@ -46,7 +47,7 @@ public class SingleSplitTestTask extends ComputeTaskAdapter<Integer, Integer> {
private ComputeLoadBalancer balancer;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Integer arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Integer arg) {
assert !subgrid.isEmpty() : "Subgrid cannot be empty.";
Map<ComputeJobAdapter, ClusterNode> jobs = new HashMap<>(subgrid.size());
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteCompute.java b/modules/core/src/main/java/org/apache/ignite/IgniteCompute.java
index 18e93ae..fb2db2f 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteCompute.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteCompute.java
@@ -523,7 +523,7 @@ public interface IgniteCompute extends IgniteAsyncSupport {
* Executes collection of jobs on nodes within the underlying cluster group.
* Collection of all returned job results is returned from the result future.
*
- * @param jobs Collection of jobs to execute.
+ * @param jobs Non-empty collection of jobs to execute.
* @return Collection of job results for this execution.
* @throws IgniteException If execution failed.
*/
@@ -534,7 +534,7 @@ public interface IgniteCompute extends IgniteAsyncSupport {
* Executes collection of jobs asynchronously on nodes within the underlying cluster group.
* Collection of all returned job results is returned from the result future.
*
- * @param jobs Collection of jobs to execute.
+ * @param jobs Non-empty collection of jobs to execute.
* @return a Future representing pending completion of the job.
* @throws IgniteException If execution failed.
*/
@@ -545,7 +545,7 @@ public interface IgniteCompute extends IgniteAsyncSupport {
* Executes collection of jobs on nodes within the underlying cluster group. The returned
* job results will be reduced into an individual result by provided reducer.
*
- * @param jobs Collection of jobs to execute.
+ * @param jobs Non-empty collection of jobs to execute.
* @param rdc Reducer to reduce all job results into one individual return value.
* @return Reduced job result for this execution.
* @throws IgniteException If execution failed.
@@ -558,7 +558,7 @@ public interface IgniteCompute extends IgniteAsyncSupport {
* Executes collection of jobs asynchronously on nodes within the underlying cluster group. The returned
* job results will be reduced into an individual result by provided reducer.
*
- * @param jobs Collection of jobs to execute.
+ * @param jobs Non-empty collection of jobs to execute.
* @param rdc Reducer to reduce all job results into one individual return value.
* @return a Future with reduced job result for this execution.
* @throws IgniteException If execution failed.
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteScheduler.java b/modules/core/src/main/java/org/apache/ignite/IgniteScheduler.java
index e71a393..bf70e85 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteScheduler.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteScheduler.java
@@ -24,13 +24,13 @@ import org.apache.ignite.lang.IgniteFuture;
import org.apache.ignite.lang.IgniteOutClosure;
import org.apache.ignite.lang.IgniteRunnable;
import org.apache.ignite.scheduler.SchedulerFuture;
-import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
/**
* Provides functionality for scheduling jobs locally using UNIX cron-based syntax.
* Instance of {@code GridScheduler} is obtained from grid as follows:
* <pre name="code" class="java">
- * GridScheduler s = Ignition.ignite().scheduler();
+ * IgniteScheduler s = Ignition.ignite().scheduler();
* </pre>
* <p>
* Scheduler supports standard UNIX {@code cron} format with optional prefix of
@@ -39,12 +39,13 @@ import org.jetbrains.annotations.Nullable;
* Here's an example of scheduling a closure that broadcasts a message
* to all nodes five times, once every minute, with initial delay of two seconds:
* <pre name="code" class="java">
- * Ignition.ignite().scheduler().scheduleLocal(
- * GridSchedulerFuture<?> = Ignition.ignite().scheduler().scheduleLocal(new Callable<Object>() {
+ * SchedulerFuture<?> s = Ignition.ignite().scheduler().scheduleLocal(
+ * new Callable<Object>() {
* @Override public Object call() throws IgniteCheckedException {
- * g.broadcast(new GridCallable() {...}).get();
+ * g.broadcast(new IgniteCallable() {...}).get();
* }
- * }, "{2, 5} * * * * *" // 2 seconds delay with 5 executions only.
+ * },
+ * "{2, 5} * * * * *" // 2 seconds delay with 5 executions only.
* );
* </pre>
*/
@@ -55,23 +56,23 @@ public interface IgniteScheduler {
* Note that class {@link IgniteRunnable} implements {@link Runnable} and class {@link IgniteOutClosure}
* implements {@link Callable} interface.
*
- * @param r Runnable to execute. If {@code null} - this method is no-op.
+ * @param r Not null runnable to execute.
* @return Future for this execution.
* @see #callLocal(Callable)
* @see org.apache.ignite.lang.IgniteClosure
*/
- public IgniteFuture<?> runLocal(@Nullable Runnable r);
+ public IgniteFuture<?> runLocal(@NotNull Runnable r);
/**
* Executes given closure after the delay.
* <p>
* Note that class {@link IgniteRunnable} implements {@link Runnable}
- * @param r Runnable to execute.
+ * @param r Not null runnable to execute.
* @param delay Initial delay.
* @param timeUnit Time granularity.
* @return java.io.Closeable which can be used to cancel execution.
*/
- public Closeable runLocal(@Nullable Runnable r, long delay, TimeUnit timeUnit);
+ public Closeable runLocal(@NotNull Runnable r, long delay, TimeUnit timeUnit);
/**
* Executes given callable on internal system thread pool asynchronously.
@@ -79,34 +80,33 @@ public interface IgniteScheduler {
* Note that class {@link IgniteRunnable} implements {@link Runnable} and class {@link IgniteOutClosure}
* implements {@link Callable} interface.
*
- * @param c Callable to execute. If {@code null} - this method is no-op.
+ * @param c Not null callable to execute.
* @return Future for this execution.
* @param <R> Type of the return value for the closure.
* @see #runLocal(Runnable)
* @see IgniteOutClosure
*/
- public <R> IgniteFuture<R> callLocal(@Nullable Callable<R> c);
+ public <R> IgniteFuture<R> callLocal(@NotNull Callable<R> c);
/**
* Schedules job for execution using local <b>cron-based</b> scheduling.
*
- * @param job Job to schedule to run as a background cron-based job.
- * If {@code null} - this method is no-op.
+ * @param job Not null job to schedule to run as a background cron-based job.
* @param ptrn Scheduling pattern in UNIX cron format with optional prefix <tt>{n1, n2}</tt>
* where {@code n1} is delay of scheduling in seconds and {@code n2} is the number of execution. Both
* parameters are optional.
* @return Scheduled execution future.
*/
- public SchedulerFuture<?> scheduleLocal(Runnable job, String ptrn);
+ public SchedulerFuture<?> scheduleLocal(@NotNull Runnable job, String ptrn);
/**
* Schedules job for execution using local <b>cron-based</b> scheduling.
*
- * @param c Job to schedule to run as a background cron-based job.
+ * @param job Not null job to schedule to run as a background cron-based job.
* @param ptrn Scheduling pattern in UNIX cron format with optional prefix <tt>{n1, n2}</tt>
* where {@code n1} is delay of scheduling in seconds and {@code n2} is the number of execution. Both
* parameters are optional.
* @return Scheduled execution future.
*/
- public <R> SchedulerFuture<R> scheduleLocal(Callable<R> c, String ptrn);
+ public <R> SchedulerFuture<R> scheduleLocal(@NotNull Callable<R> job, String ptrn);
}
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
index bdba983..66acae0 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
@@ -1329,7 +1329,7 @@ public final class IgniteSystemProperties {
public static boolean getBoolean(String name, boolean dflt) {
String val = getString(name);
- return val == null ? dflt : Boolean.valueOf(val);
+ return val == null ? dflt : Boolean.parseBoolean(val);
}
/**
diff --git a/modules/core/src/main/java/org/apache/ignite/compute/ComputeTask.java b/modules/core/src/main/java/org/apache/ignite/compute/ComputeTask.java
index 35ec234..031323d 100644
--- a/modules/core/src/main/java/org/apache/ignite/compute/ComputeTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/compute/ComputeTask.java
@@ -22,6 +22,7 @@ import java.util.List;
import java.util.Map;
import org.apache.ignite.IgniteException;
import org.apache.ignite.cluster.ClusterNode;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
@@ -244,7 +245,7 @@ public interface ComputeTask<T, R> extends Serializable {
* @throws IgniteException If mapping could not complete successfully. This exception will be
* thrown out of {@link ComputeTaskFuture#get()} method.
*/
- @Nullable public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable T arg) throws IgniteException;
+ @NotNull public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable T arg) throws IgniteException;
/**
* Asynchronous callback invoked every time a result from remote execution is
diff --git a/modules/core/src/main/java/org/apache/ignite/compute/ComputeTaskSplitAdapter.java b/modules/core/src/main/java/org/apache/ignite/compute/ComputeTaskSplitAdapter.java
index f5181fe..11798f8 100644
--- a/modules/core/src/main/java/org/apache/ignite/compute/ComputeTaskSplitAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/compute/ComputeTaskSplitAdapter.java
@@ -25,6 +25,7 @@ import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.resources.LoadBalancerResource;
+import org.jetbrains.annotations.NotNull;
/**
* This class defines simplified adapter for {@link ComputeTask}. This adapter can be used
@@ -99,7 +100,7 @@ public abstract class ComputeTaskSplitAdapter<T, R> extends ComputeTaskAdapter<T
protected abstract Collection<? extends ComputeJob> split(int gridSize, T arg) throws IgniteException;
/** {@inheritDoc} */
- @Override public final Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, T arg) {
+ @NotNull @Override public final Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, T arg) {
assert subgrid != null;
assert !subgrid.isEmpty();
diff --git a/modules/core/src/main/java/org/apache/ignite/compute/gridify/aop/GridifyDefaultRangeTask.java b/modules/core/src/main/java/org/apache/ignite/compute/gridify/aop/GridifyDefaultRangeTask.java
index c1049f2..8eb00d0 100644
--- a/modules/core/src/main/java/org/apache/ignite/compute/gridify/aop/GridifyDefaultRangeTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/compute/gridify/aop/GridifyDefaultRangeTask.java
@@ -47,6 +47,7 @@ import org.apache.ignite.resources.LoadBalancerResource;
import org.apache.ignite.resources.LoggerResource;
import org.apache.ignite.resources.TaskContinuousMapperResource;
import org.apache.ignite.resources.TaskSessionResource;
+import org.jetbrains.annotations.NotNull;
import static org.apache.ignite.internal.util.gridify.GridifyUtils.UNKNOWN_SIZE;
@@ -129,7 +130,7 @@ public class GridifyDefaultRangeTask extends ComputeTaskAdapter<GridifyRangeArgu
}
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, GridifyRangeArgument arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, GridifyRangeArgument arg) {
assert !subgrid.isEmpty() : "Subgrid should not be empty: " + subgrid;
assert ignite != null : "Grid instance could not be injected";
diff --git a/modules/core/src/main/java/org/apache/ignite/compute/gridify/aop/GridifyDefaultTask.java b/modules/core/src/main/java/org/apache/ignite/compute/gridify/aop/GridifyDefaultTask.java
index d194719..588e8fc 100644
--- a/modules/core/src/main/java/org/apache/ignite/compute/gridify/aop/GridifyDefaultTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/compute/gridify/aop/GridifyDefaultTask.java
@@ -32,6 +32,7 @@ import org.apache.ignite.internal.util.lang.GridPeerDeployAware;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.resources.LoadBalancerResource;
+import org.jetbrains.annotations.NotNull;
/**
* Default gridify task which simply executes a method on remote node.
@@ -85,7 +86,7 @@ public class GridifyDefaultTask extends ComputeTaskAdapter<GridifyArgument, Obje
}
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, GridifyArgument arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, GridifyArgument arg) {
assert !subgrid.isEmpty() : "Subgrid should not be empty: " + subgrid;
assert ignite != null : "Grid instance could not be injected";
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/ConnectorConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/ConnectorConfiguration.java
index 23e5a8f..c300002 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/ConnectorConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/ConnectorConfiguration.java
@@ -345,18 +345,18 @@ public class ConnectorConfiguration {
}
/**
- * Gets REST TCP server receive buffer size.
+ * Gets REST TCP server receive buffer size in bytes.
*
- * @return REST TCP server receive buffer size (0 for default).
+ * @return REST TCP server receive buffer size in bytes(0 for default).
*/
public int getReceiveBufferSize() {
return rcvBufSize;
}
/**
- * Sets REST TCP server receive buffer size.
+ * Sets REST TCP server receive buffer size in bytes.
*
- * @param rcvBufSize Receive buffer size.
+ * @param rcvBufSize Receive buffer size in bytes.
* @see #getReceiveBufferSize()
* @return {@code this} for chaining.
*/
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/DataStorageConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/DataStorageConfiguration.java
index e95f553..3805954 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/DataStorageConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/DataStorageConfiguration.java
@@ -300,6 +300,13 @@ public class DataStorageConfiguration implements Serializable {
private Integer walPageCompressionLevel;
/**
+ * Creates valid durable memory configuration with all default values.
+ */
+ @SuppressWarnings("RedundantNoArgConstructor")
+ public DataStorageConfiguration() {
+ }
+
+ /**
* Initial size of a data region reserved for system cache.
*
* @return Size in bytes.
@@ -363,7 +370,8 @@ public class DataStorageConfiguration implements Serializable {
/**
* Changes the page size.
*
- * @param pageSize Page size in bytes. If value is not set (or zero), {@link #DFLT_PAGE_SIZE} will be used.
+ * @param pageSize Page size in bytes. Supported values are: {@code 1024}, {@code 2048}, {@code 4096}, {@code 8192}
+ * and {@code 16384}. If value is not set (or zero), {@link #DFLT_PAGE_SIZE} ({@code 4096}) will be used.
* @see #MIN_PAGE_SIZE
* @see #MAX_PAGE_SIZE
*/
@@ -402,18 +410,21 @@ public class DataStorageConfiguration implements Serializable {
}
/**
- * Returns the number of concurrent segments in Ignite internal page mapping tables. By default equals
- * to the number of available CPUs.
+ * Returns the number of concurrent segments in Ignite internal page mapping tables.
+ *
+ * By default equals to the number of available CPUs.
*
- * @return Mapping table concurrency level.
+ * @return Mapping table concurrency level(always greater than 0).
*/
public int getConcurrencyLevel() {
- return concLvl;
+ return concLvl <= 0 ? Runtime.getRuntime().availableProcessors() : concLvl;
}
/**
* Sets the number of concurrent segments in Ignite internal page mapping tables.
*
+ * If value is not positive, the number of available CPUs will be used.
+ *
* @param concLvl Mapping table concurrency level.
*/
public DataStorageConfiguration setConcurrencyLevel(int concLvl) {
@@ -463,7 +474,7 @@ public class DataStorageConfiguration implements Serializable {
/**
* Gets checkpoint frequency.
*
- * @return checkpoint frequency in milliseconds.
+ * @return Checkpoint frequency in milliseconds.
*/
public long getCheckpointFrequency() {
return checkpointFreq <= 0 ? DFLT_CHECKPOINT_FREQ : checkpointFreq;
@@ -473,7 +484,9 @@ public class DataStorageConfiguration implements Serializable {
* Sets the checkpoint frequency which is a minimal interval when the dirty pages will be written
* to the Persistent Store. If the rate is high, checkpoint will be triggered more frequently.
*
- * @param checkpointFreq checkpoint frequency in milliseconds.
+ * If value is not positive, {@link #DFLT_CHECKPOINT_FREQ} will be used.
+ *
+ * @param checkpointFreq Checkpoint frequency in milliseconds.
* @return {@code this} for chaining.
*/
public DataStorageConfiguration setCheckpointFrequency(long checkpointFreq) {
@@ -561,18 +574,20 @@ public class DataStorageConfiguration implements Serializable {
}
/**
- * Gets a max allowed size of WAL archives. In bytes.
+ * Gets a max allowed size(in bytes) of WAL archives.
*
- * @return max size of WAL archive directory.
+ * @return max size(in bytes) of WAL archive directory(always greater than 0).
*/
public long getMaxWalArchiveSize() {
return maxWalArchiveSize <= 0 ? DFLT_WAL_ARCHIVE_MAX_SIZE : maxWalArchiveSize;
}
/**
- * Sets a max allowed size of WAL archives. In bytes
+ * Sets a max allowed size(in bytes) of WAL archives.
*
- * @param walArchiveMaxSize max size of WAL archive directory.
+ * If value is not positive, {@link #DFLT_WAL_ARCHIVE_MAX_SIZE} will be used.
+ *
+ * @param walArchiveMaxSize max size(in bytes) of WAL archive directory.
* @return {@code this} for chaining.
*/
public DataStorageConfiguration setMaxWalArchiveSize(long walArchiveMaxSize) {
@@ -604,19 +619,19 @@ public class DataStorageConfiguration implements Serializable {
}
/**
- * Gets size of a WAL segment in bytes.
+ * Gets size(in bytes) of a WAL segment.
*
- * @return WAL segment size.
+ * @return WAL segment size(in bytes).
*/
public int getWalSegmentSize() {
return walSegmentSize == 0 ? DFLT_WAL_SEGMENT_SIZE : walSegmentSize;
}
/**
- * Sets size of a WAL segment.
+ * Sets size(in bytes) of a WAL segment.
* If value is not set (or zero), {@link #DFLT_WAL_SEGMENT_SIZE} will be used.
*
- * @param walSegmentSize WAL segment size. Value must be between 512Kb and 2Gb.
+ * @param walSegmentSize WAL segment size(in bytes). Value must be between 512Kb and 2Gb.
* @return {@code This} for chaining.
*/
public DataStorageConfiguration setWalSegmentSize(int walSegmentSize) {
@@ -802,17 +817,20 @@ public class DataStorageConfiguration implements Serializable {
}
/**
- * Property defines size of WAL buffer.
+ * Property defines size(in bytes) of WAL buffer.
* Each WAL record will be serialized to this buffer before write in WAL file.
*
- * @return WAL buffer size.
+ * @return WAL buffer size(in bytes).
*/
public int getWalBufferSize() {
return walBuffSize <= 0 ? getWalSegmentSize() / 4 : walBuffSize;
}
/**
- * @param walBuffSize WAL buffer size.
+ * Property defines size(in bytes) of WAL buffer.
+ * If value isn't positive it calculation will be based on {@link #getWalSegmentSize()}.
+ *
+ * @param walBuffSize WAL buffer size(in bytes).
*/
public DataStorageConfiguration setWalBufferSize(int walBuffSize) {
this.walBuffSize = walBuffSize;
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridTaskSessionImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/GridTaskSessionImpl.java
index 88091ea..7c15e31 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridTaskSessionImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridTaskSessionImpl.java
@@ -293,7 +293,7 @@ public class GridTaskSessionImpl implements GridTaskSessionInternal {
if (timeout == 0)
timeout = Long.MAX_VALUE;
- long now = U.currentTimeMillis();
+ long now = System.currentTimeMillis();
// Prevent overflow.
long end = now + timeout < 0 ? Long.MAX_VALUE : now + timeout;
@@ -302,11 +302,17 @@ public class GridTaskSessionImpl implements GridTaskSessionInternal {
if (end > endTime)
end = endTime;
+ timeout = end - now;
+
+ long startNanos = System.nanoTime();
+
synchronized (mux) {
- while (!closed && (attrs == null || !attrs.containsKey(key)) && now < end) {
- mux.wait(end - now);
+ long passedMillis = 0L;
+
+ while (!closed && (attrs == null || !attrs.containsKey(key)) && passedMillis < timeout) {
+ mux.wait(timeout - passedMillis);
- now = U.currentTimeMillis();
+ passedMillis = U.millisSinceNanos(startNanos);
}
if (closed)
@@ -325,7 +331,7 @@ public class GridTaskSessionImpl implements GridTaskSessionInternal {
if (timeout == 0)
timeout = Long.MAX_VALUE;
- long now = U.currentTimeMillis();
+ long now = System.currentTimeMillis();
// Prevent overflow.
long end = now + timeout < 0 ? Long.MAX_VALUE : now + timeout;
@@ -334,13 +340,19 @@ public class GridTaskSessionImpl implements GridTaskSessionInternal {
if (end > endTime)
end = endTime;
+ timeout = end - now;
+
+ long startNanos = System.nanoTime();
+
synchronized (mux) {
boolean isFound = false;
- while (!closed && !(isFound = isAttributeSet(key, val)) && now < end) {
- mux.wait(end - now);
+ long passedMillis = 0L;
+
+ while (!closed && !(isFound = isAttributeSet(key, val)) && passedMillis < timeout) {
+ mux.wait(timeout - passedMillis);
- now = U.currentTimeMillis();
+ passedMillis = U.millisSinceNanos(startNanos);
}
if (closed)
@@ -363,7 +375,7 @@ public class GridTaskSessionImpl implements GridTaskSessionInternal {
if (timeout == 0)
timeout = Long.MAX_VALUE;
- long now = U.currentTimeMillis();
+ long now = System.currentTimeMillis();
// Prevent overflow.
long end = now + timeout < 0 ? Long.MAX_VALUE : now + timeout;
@@ -372,11 +384,17 @@ public class GridTaskSessionImpl implements GridTaskSessionInternal {
if (end > endTime)
end = endTime;
+ timeout = end - now;
+
+ long startNanos = System.nanoTime();
+
synchronized (mux) {
- while (!closed && (attrs == null || !attrs.keySet().containsAll(keys)) && now < end) {
- mux.wait(end - now);
+ long passedMillis = 0L;
+
+ while (!closed && (attrs == null || !attrs.keySet().containsAll(keys)) && passedMillis < timeout) {
+ mux.wait(timeout - passedMillis);
- now = U.currentTimeMillis();
+ passedMillis = U.millisSinceNanos(startNanos);
}
if (closed)
@@ -404,7 +422,7 @@ public class GridTaskSessionImpl implements GridTaskSessionInternal {
if (timeout == 0)
timeout = Long.MAX_VALUE;
- long now = U.currentTimeMillis();
+ long now = System.currentTimeMillis();
// Prevent overflow.
long end = now + timeout < 0 ? Long.MAX_VALUE : now + timeout;
@@ -413,18 +431,24 @@ public class GridTaskSessionImpl implements GridTaskSessionInternal {
if (end > endTime)
end = endTime;
+ timeout = end - now;
+
+ long startNanos = System.nanoTime();
+
synchronized (mux) {
boolean isFound = false;
- while (!closed && now < end) {
+ long passedMillis = 0L;
+
+ while (!closed && passedMillis < timeout) {
isFound = this.attrs != null && this.attrs.entrySet().containsAll(attrs.entrySet());
if (isFound)
break;
- mux.wait(end - now);
+ mux.wait(timeout - passedMillis);
- now = U.currentTimeMillis();
+ passedMillis = U.millisSinceNanos(startNanos);
}
if (closed)
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index 6406913..c9e6a11 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -1407,7 +1407,8 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
U.quietAndInfo(log, "To start Console Management & Monitoring run ignitevisorcmd.{sh|bat}");
- ackClassPathContent();
+ if (!IgniteSystemProperties.getBoolean(IgniteSystemProperties.IGNITE_QUIET, true))
+ ackClassPathContent();
ackStart(rtBean);
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteSchedulerImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteSchedulerImpl.java
index 88d6306b..57c6303 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteSchedulerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteSchedulerImpl.java
@@ -30,7 +30,7 @@ import org.apache.ignite.internal.util.future.IgniteFutureImpl;
import org.apache.ignite.internal.util.typedef.internal.A;
import org.apache.ignite.lang.IgniteFuture;
import org.apache.ignite.scheduler.SchedulerFuture;
-import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
/**
* {@link IgniteScheduler} implementation.
@@ -57,7 +57,7 @@ public class IgniteSchedulerImpl implements IgniteScheduler, Externalizable {
}
/** {@inheritDoc} */
- @Override public IgniteFuture<?> runLocal(Runnable r) {
+ @Override public IgniteFuture<?> runLocal(@NotNull Runnable r) {
A.notNull(r, "r");
guard();
@@ -71,7 +71,7 @@ public class IgniteSchedulerImpl implements IgniteScheduler, Externalizable {
}
/** {@inheritDoc} */
- @Override public Closeable runLocal(@Nullable Runnable r, long delay, TimeUnit timeUnit) {
+ @Override public Closeable runLocal(@NotNull Runnable r, long delay, TimeUnit timeUnit) {
A.notNull(r, "r");
A.ensure(delay > 0, "Illegal delay");
@@ -86,7 +86,7 @@ public class IgniteSchedulerImpl implements IgniteScheduler, Externalizable {
}
/** {@inheritDoc} */
- @Override public <R> IgniteFuture<R> callLocal(Callable<R> c) {
+ @Override public <R> IgniteFuture<R> callLocal(@NotNull Callable<R> c) {
A.notNull(c, "c");
guard();
@@ -100,7 +100,7 @@ public class IgniteSchedulerImpl implements IgniteScheduler, Externalizable {
}
/** {@inheritDoc} */
- @Override public SchedulerFuture<?> scheduleLocal(Runnable job, String ptrn) {
+ @Override public SchedulerFuture<?> scheduleLocal(@NotNull Runnable job, String ptrn) {
A.notNull(job, "job");
guard();
@@ -114,7 +114,7 @@ public class IgniteSchedulerImpl implements IgniteScheduler, Externalizable {
}
/** {@inheritDoc} */
- @Override public <R> SchedulerFuture<R> scheduleLocal(Callable<R> job, String ptrn) {
+ @Override public <R> SchedulerFuture<R> scheduleLocal(@NotNull Callable<R> job, String ptrn) {
A.notNull(job, "job");
guard();
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index 2d2a093..eeef23e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -152,6 +152,8 @@ import static org.apache.ignite.internal.IgniteComponentType.SPRING;
import static org.apache.ignite.plugin.segmentation.SegmentationPolicy.RESTART_JVM;
/**
+ * This class is part of an internal API and can be modified at any time without backward compatibility.
+ *
* This class defines a factory for the main Ignite API. It controls Grid life cycle
* and allows listening for grid events.
* <h1 class="header">Grid Loaders</h1>
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerMappingFileStore.java b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerMappingFileStore.java
index a01981b..66d19db 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerMappingFileStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerMappingFileStore.java
@@ -146,8 +146,8 @@ final class MarshallerMappingFileStore {
rnd = ThreadLocalRandom.current();
if (time == 0)
- time = U.currentTimeMillis();
- else if ((U.currentTimeMillis() - time) >= FILE_LOCK_TIMEOUT_MS)
+ time = System.nanoTime();
+ else if (U.millisSinceNanos(time) >= FILE_LOCK_TIMEOUT_MS)
return null;
U.sleep(rnd.nextLong(50));
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryMemoryAllocatorChunk.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryMemoryAllocatorChunk.java
index 09f8c3f..5bac138 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryMemoryAllocatorChunk.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryMemoryAllocatorChunk.java
@@ -35,7 +35,7 @@ public class BinaryMemoryAllocatorChunk {
private int maxMsgSize;
/** Last time array size is checked. */
- private long lastCheck = U.currentTimeMillis();
+ private long lastCheckNanos = System.nanoTime();
/** Whether the holder is acquired or not. */
private boolean acquired;
@@ -88,15 +88,15 @@ public class BinaryMemoryAllocatorChunk {
this.acquired = false;
- long now = U.currentTimeMillis();
+ long nowNanos = System.nanoTime();
- if (now - this.lastCheck >= CHECK_FREQ) {
+ if (U.nanosToMillis(nowNanos - lastCheckNanos) >= CHECK_FREQ) {
int halfSize = data.length >> 1;
if (this.maxMsgSize < halfSize)
this.data = new byte[halfSize];
- this.lastCheck = now;
+ lastCheckNanos = nowNanos;
}
}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java
index 8a9b0f1..c863a0c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java
@@ -610,6 +610,8 @@ public class GridClientNioTcpConnection extends GridClientConnection {
if (resp.successStatus() == GridClientResponse.STATUS_AUTH_FAILURE)
fut.onDone(new GridClientAuthenticationException("Client authentication failed [clientId=" + clientId +
", srvAddr=" + serverAddress() + ", errMsg=" + resp.errorMessage() +']'));
+ else if (resp.successStatus() == GridClientResponse.STATUS_ILLEGAL_ARGUMENT)
+ fut.onDone(new IllegalArgumentException(resp.errorMessage()));
else if (resp.errorMessage() != null)
fut.onDone(new GridClientException(resp.errorMessage()));
else
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteKillTask.java b/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteKillTask.java
index 15fb8c0..665ad93 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteKillTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteKillTask.java
@@ -28,6 +28,7 @@ import org.apache.ignite.compute.ComputeTaskAdapter;
import org.apache.ignite.internal.processors.task.GridInternal;
import org.apache.ignite.internal.util.typedef.G;
import org.apache.ignite.internal.util.typedef.internal.U;
+import org.jetbrains.annotations.NotNull;
import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_DAEMON;
@@ -43,7 +44,7 @@ class IgniteKillTask extends ComputeTaskAdapter<Boolean, Void> {
private boolean restart;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Boolean restart) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Boolean restart) {
assert restart != null;
this.restart = restart;
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/commandline/BaselineCommand.java b/modules/core/src/main/java/org/apache/ignite/internal/commandline/BaselineCommand.java
index 8064c4b..51e3511 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/commandline/BaselineCommand.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/commandline/BaselineCommand.java
@@ -22,9 +22,11 @@ import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.UUID;
import java.util.logging.Logger;
import org.apache.ignite.internal.client.GridClient;
import org.apache.ignite.internal.client.GridClientConfiguration;
+import org.apache.ignite.internal.client.GridClientNode;
import org.apache.ignite.internal.commandline.argument.CommandArgUtils;
import org.apache.ignite.internal.commandline.baseline.AutoAdjustCommandArg;
import org.apache.ignite.internal.commandline.baseline.BaselineArguments;
@@ -42,7 +44,7 @@ import static org.apache.ignite.internal.commandline.CommandList.BASELINE;
import static org.apache.ignite.internal.commandline.CommandLogger.DOUBLE_INDENT;
import static org.apache.ignite.internal.commandline.CommandLogger.optional;
import static org.apache.ignite.internal.commandline.CommonArgParser.CMD_AUTO_CONFIRMATION;
-import static org.apache.ignite.internal.commandline.TaskExecutor.executeTask;
+import static org.apache.ignite.internal.commandline.TaskExecutor.executeTaskByNameOnNode;
import static org.apache.ignite.internal.commandline.baseline.BaselineSubcommands.of;
/**
@@ -66,7 +68,7 @@ public class BaselineCommand implements Command<BaselineArguments> {
Command.usage(logger, "Set baseline topology based on version:", BASELINE,
BaselineSubcommands.VERSION.text() + " topologyVersion", optional(CMD_AUTO_CONFIRMATION));
Command.usage(logger, "Set baseline autoadjustment settings:", BASELINE,
- BaselineSubcommands.AUTO_ADJUST.text(), "disable|enable timeout <timeoutValue>", optional(CMD_AUTO_CONFIRMATION));
+ BaselineSubcommands.AUTO_ADJUST.text(), "[disable|enable] [timeout <timeoutMillis>]", optional(CMD_AUTO_CONFIRMATION));
}
/** {@inheritDoc} */
@@ -80,13 +82,23 @@ public class BaselineCommand implements Command<BaselineArguments> {
/**
* Change baseline.
*
- *
* @param clientCfg Client configuration.
* @throws Exception If failed to execute baseline action.
*/
@Override public Object execute(GridClientConfiguration clientCfg, Logger logger) throws Exception {
try (GridClient client = Command.startClient(clientCfg)) {
- VisorBaselineTaskResult res = executeTask(client, VisorBaselineTask.class, toVisorArguments(baselineArgs), clientCfg);
+ UUID coordinatorId = client.compute().nodes().stream()
+ .min(Comparator.comparingLong(GridClientNode::order))
+ .map(GridClientNode::nodeId)
+ .orElse(null);
+
+ VisorBaselineTaskResult res = executeTaskByNameOnNode(
+ client,
+ VisorBaselineTask.class.getName(),
+ toVisorArguments(baselineArgs),
+ coordinatorId,
+ clientCfg
+ );
baselinePrint0(res, logger);
}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/commandline/CommandArgIterator.java b/modules/core/src/main/java/org/apache/ignite/internal/commandline/CommandArgIterator.java
index 4f5f57e..d9ff51c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/commandline/CommandArgIterator.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/commandline/CommandArgIterator.java
@@ -18,6 +18,7 @@
package org.apache.ignite.internal.commandline;
+import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
@@ -119,9 +120,14 @@ public class CommandArgIterator {
* @param argName Name of argument.
*/
public Set<String> nextStringSet(String argName) {
- String string = nextArg("Expected " + argName);
+ String nextArg = peekNextArg();
- return parseStringSet(string);
+ if (isCommandOrOption(nextArg))
+ return Collections.emptySet();
+
+ nextArg = nextArg("Expected " + argName);
+
+ return parseStringSet(nextArg);
}
/**
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/commandline/CommandHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/commandline/CommandHandler.java
index 5ca5850..591f75e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/commandline/CommandHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/commandline/CommandHandler.java
@@ -103,7 +103,7 @@ public class CommandHandler {
private static final Scanner IN = new Scanner(System.in);
/** Utility name. */
- public static final String UTILITY_NAME = "control.sh";
+ public static final String UTILITY_NAME = "control.(sh|bat)";
/** */
public static final String NULL = "null";
@@ -235,48 +235,50 @@ public class CommandHandler {
return EXIT_CODE_OK;
}
- boolean tryConnectAgain = true;
-
int tryConnectMaxCount = 3;
boolean suppliedAuth = !F.isEmpty(args.userName()) && !F.isEmpty(args.password());
GridClientConfiguration clientCfg = getClientConfiguration(args);
- while (tryConnectAgain) {
- tryConnectAgain = false;
+ logger.info("Command [" + commandName + "] started");
+ logger.info("Arguments: " + String.join(" ", rawArgs));
+ logger.info(DELIM);
+
+ boolean credentialsRequested = false;
+ while (true) {
try {
- logger.info("Command [" + commandName + "] started");
- logger.info("Arguments: " + String.join(" ", rawArgs));
- logger.info(DELIM);
lastOperationRes = command.execute(clientCfg, logger);
+
+ break;
}
catch (Throwable e) {
- if (tryConnectMaxCount > 0 && isAuthError(e)) {
- logger.info(suppliedAuth ?
- "Authentication error, please try again." :
- "This cluster requires authentication.");
-
- String user = clientCfg.getSecurityCredentialsProvider() == null ?
- requestDataFromConsole("user: ") :
- (String)clientCfg.getSecurityCredentialsProvider().credentials().getLogin();
+ if (!isAuthError(e))
+ throw e;
- clientCfg = getClientConfiguration(user, new String(requestPasswordFromConsole("password: ")), args);
+ if (suppliedAuth)
+ throw new GridClientAuthenticationException("Wrong credentials.");
- tryConnectAgain = true;
+ if (tryConnectMaxCount == 0) {
+ throw new GridClientAuthenticationException("Maximum number of " +
+ "retries exceeded");
+ }
- suppliedAuth = true;
+ logger.info(credentialsRequested ?
+ "Authentication error, please try again." :
+ "This cluster requires authentication.");
+ if (credentialsRequested)
tryConnectMaxCount--;
- }
- else {
- if (tryConnectMaxCount == 0)
- throw new GridClientAuthenticationException("Authentication error, maximum number of " +
- "retries exceeded");
- throw e;
- }
+ String user = retrieveUserName(args, clientCfg);
+
+ String pwd = new String(requestPasswordFromConsole("password: "));
+
+ clientCfg = getClientConfiguration(user, pwd, args);
+
+ credentialsRequested = true;
}
}
@@ -301,6 +303,11 @@ public class CommandHandler {
}
if (isConnectionError(e)) {
+ IgniteCheckedException cause = X.cause(e, IgniteCheckedException.class);
+
+ if (cause != null && cause.getMessage() != null && cause.getMessage().contains("SSL"))
+ e = cause;
+
logger.severe("Connection to cluster failed. " + CommandLogger.errorMessage(e));
logger.info("Command [" + commandName + "] finished with code: " + EXIT_CODE_CONNECTION_FAILED);
@@ -308,6 +315,15 @@ public class CommandHandler {
return EXIT_CODE_CONNECTION_FAILED;
}
+ if (X.hasCause(e, IllegalArgumentException.class)) {
+ IllegalArgumentException iae = X.cause(e, IllegalArgumentException.class);
+
+ logger.severe("Check arguments. " + CommandLogger.errorMessage(iae));
+ logger.info("Command [" + commandName + "] finished with code: " + EXIT_CODE_INVALID_ARGUMENTS);
+
+ return EXIT_CODE_INVALID_ARGUMENTS;
+ }
+
logger.severe(CommandLogger.errorMessage(e));
logger.info("Command [" + commandName + "] finished with code: " + EXIT_CODE_UNEXPECTED_ERROR);
@@ -328,6 +344,30 @@ public class CommandHandler {
}
/**
+ * Does one of three things:
+ * <ul>
+ * <li>returns user name from connection parameters if it is there;</li>
+ * <li>returns user name from client configuration if it is there;</li>
+ * <li>requests user input and returns entered name.</li>
+ * </ul>
+ *
+ * @param args Connection parameters.
+ * @param clientCfg Client configuration.
+ * @throws IgniteCheckedException If security credetials cannot be provided from client configuration.
+ */
+ private String retrieveUserName(
+ ConnectionAndSslParameters args,
+ GridClientConfiguration clientCfg
+ ) throws IgniteCheckedException {
+ if (!F.isEmpty(args.userName()))
+ return args.userName();
+ else if (clientCfg.getSecurityCredentialsProvider() == null)
+ return requestDataFromConsole("user: ");
+ else
+ return (String)clientCfg.getSecurityCredentialsProvider().credentials().getLogin();
+ }
+
+ /**
* @param args Common arguments.
* @return Thin client configuration to connect to cluster.
* @throws IgniteCheckedException If error occur.
@@ -474,7 +514,7 @@ public class CommandHandler {
* @param e Exception to check.
* @return {@code true} if specified exception is {@link GridClientAuthenticationException}.
*/
- private static boolean isAuthError(Throwable e) {
+ public static boolean isAuthError(Throwable e) {
return X.hasCause(e, GridClientAuthenticationException.class);
}
@@ -540,7 +580,7 @@ public class CommandHandler {
/** */
private void printHelp() {
- logger.info("Control.sh is used to execute admin commands on cluster or get common cluster info. " +
+ logger.info("Control utility script is used to execute admin commands on cluster or get common cluster info. " +
"The command has the following syntax:");
logger.info("");
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/commandline/StateCommand.java b/modules/core/src/main/java/org/apache/ignite/internal/commandline/StateCommand.java
index 5eee039..d93dda3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/commandline/StateCommand.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/commandline/StateCommand.java
@@ -46,7 +46,8 @@ public class StateCommand implements Command<Void> {
logger.info("Cluster is " + (state.active() ? "active" : "inactive"));
}
catch (Throwable e) {
- logger.severe("Failed to get cluster state.");
+ if (!CommandHandler.isAuthError(e))
+ logger.severe("Failed to get cluster state.");
throw e;
}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/executor/GridExecutorService.java b/modules/core/src/main/java/org/apache/ignite/internal/executor/GridExecutorService.java
index bd17108..46f6c02 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/executor/GridExecutorService.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/executor/GridExecutorService.java
@@ -207,15 +207,13 @@ public class GridExecutorService implements ExecutorService, Externalizable {
/** {@inheritDoc} */
@Override public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException {
- long now = U.currentTimeMillis();
+ long startNanos = System.nanoTime();
timeout = TimeUnit.MILLISECONDS.convert(timeout, unit);
- long end = timeout == 0 ? Long.MAX_VALUE : timeout + now;
-
// Prevent overflow.
- if (end < 0)
- end = Long.MAX_VALUE;
+ if (timeout <= 0)
+ timeout = Long.MAX_VALUE;
List<IgniteInternalFuture<?>> locTasks;
@@ -226,11 +224,13 @@ public class GridExecutorService implements ExecutorService, Externalizable {
Iterator<IgniteInternalFuture<?>> iter = locTasks.iterator();
- while (iter.hasNext() && now < end) {
+ long passedMillis = 0L;
+
+ while (iter.hasNext() && passedMillis < timeout) {
IgniteInternalFuture<?> fut = iter.next();
try {
- fut.get(end - now);
+ fut.get(timeout - passedMillis);
}
catch (ComputeTaskTimeoutCheckedException e) {
U.error(log, "Failed to get task result: " + fut, e);
@@ -244,7 +244,7 @@ public class GridExecutorService implements ExecutorService, Externalizable {
throw new InterruptedException("Got interrupted while waiting for task completion.");
}
- now = U.currentTimeMillis();
+ passedMillis = U.millisSinceNanos(startNanos);
}
return true;
@@ -342,20 +342,20 @@ public class GridExecutorService implements ExecutorService, Externalizable {
A.ensure(timeout >= 0, "timeout >= 0");
A.notNull(unit, "unit != null");
- long now = U.currentTimeMillis();
+ long startNanos = System.nanoTime();
timeout = TimeUnit.MILLISECONDS.convert(timeout, unit);
- long end = timeout == 0 ? Long.MAX_VALUE : timeout + now;
-
// Prevent overflow.
- if (end < 0)
- end = Long.MAX_VALUE;
+ if (timeout <= 0)
+ timeout = Long.MAX_VALUE;
checkShutdown();
Collection<IgniteInternalFuture<T>> taskFuts = new ArrayList<>();
+ long passedMillis = 0L;
+
for (Callable<T> task : tasks) {
// Execute task without predefined timeout.
// GridFuture.cancel() will be called if timeout elapsed.
@@ -372,15 +372,15 @@ public class GridExecutorService implements ExecutorService, Externalizable {
taskFuts.add(fut);
- now = U.currentTimeMillis();
+ passedMillis = U.millisSinceNanos(startNanos);
}
boolean isInterrupted = false;
for (IgniteInternalFuture<T> fut : taskFuts) {
- if (!isInterrupted && now < end) {
+ if (!isInterrupted && passedMillis < timeout) {
try {
- fut.get(end - now);
+ fut.get(timeout - passedMillis);
}
catch (ComputeTaskTimeoutCheckedException ignore) {
if (log.isDebugEnabled())
@@ -399,7 +399,7 @@ public class GridExecutorService implements ExecutorService, Externalizable {
}
}
- now = U.currentTimeMillis();
+ passedMillis = U.millisSinceNanos(startNanos);
}
// Throw exception if any task wait was interrupted.
@@ -478,15 +478,13 @@ public class GridExecutorService implements ExecutorService, Externalizable {
A.ensure(timeout >= 0, "timeout >= 0");
A.notNull(unit, "unit != null");
- long now = System.currentTimeMillis();
+ long startNanos = System.nanoTime();
timeout = TimeUnit.MILLISECONDS.convert(timeout, unit);
- long end = timeout == 0 ? Long.MAX_VALUE : timeout + now;
-
// Prevent overflow.
- if (end < 0)
- end = Long.MAX_VALUE;
+ if (timeout <= 0)
+ timeout = Long.MAX_VALUE;
checkShutdown();
@@ -516,13 +514,13 @@ public class GridExecutorService implements ExecutorService, Externalizable {
int errCnt = 0;
for (IgniteInternalFuture<T> fut : taskFuts) {
- now = U.currentTimeMillis();
+ long passedMillis = U.millisSinceNanos(startNanos);
boolean cancel = false;
- if (!isInterrupted && !isResRcvd && now < end) {
+ if (!isInterrupted && !isResRcvd && passedMillis < timeout) {
try {
- res = fut.get(end - now);
+ res = fut.get(timeout - passedMillis);
isResRcvd = true;
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index 4d894a1..f95ca0e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -2482,15 +2482,15 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
/** {@inheritDoc} */
@Override protected void body() throws InterruptedException {
- long lastChk = 0;
+ long lastChkNanos = 0;
while (!isCancelled()) {
Object req = queue.poll(2000, MILLISECONDS);
- long now = U.currentTimeMillis();
+ long nowNanos = System.nanoTime();
// Check frequency if segment check has not been requested.
- if (req == null && (segChkFreq == 0 || lastChk + segChkFreq >= now)) {
+ if (req == null && (segChkFreq == 0 || U.nanosToMillis(nowNanos - lastChkNanos) <= segChkFreq)) {
if (log.isDebugEnabled())
log.debug("Skipping segment check as it has not been requested and it is not time to check.");
@@ -2499,7 +2499,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
// We should always check segment if it has been explicitly
// requested (on any node failure or leave).
- assert req != null || lastChk + segChkFreq < now;
+ assert req != null || U.nanosToMillis(nowNanos - lastChkNanos) > segChkFreq;
// Drain queue.
while (queue.poll() != null) {
@@ -2509,7 +2509,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
if (lastSegChkRes.get()) {
boolean segValid = ctx.segmentation().isValidSegment();
- lastChk = now;
+ lastChkNanos = nowNanos;
if (!segValid) {
ClusterNode node = getSpi().getLocalNode();
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
index 12c480a..a9baed0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
@@ -1061,21 +1061,18 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
if (timeout == 0)
timeout = Long.MAX_VALUE;
- long now = U.currentTimeMillis();
+ long startNanos = System.nanoTime();
- // Account for overflow of long value.
- long endTime = now + timeout <= 0 ? Long.MAX_VALUE : now + timeout;
-
- long delta = timeout;
+ long passedMillis = 0L;
Collection<UUID> uidsCp = null;
synchronized (qryMux) {
try {
- while (!uids.isEmpty() && err.get() == null && delta > 0) {
- qryMux.wait(delta);
+ while (!uids.isEmpty() && err.get() == null && passedMillis < timeout) {
+ qryMux.wait(timeout - passedMillis);
- delta = endTime - U.currentTimeMillis();
+ passedMillis = U.millisSinceNanos(startNanos);
}
}
catch (InterruptedException e) {
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/PageSnapshot.java b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/PageSnapshot.java
index 1244912..6e3a9b0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/PageSnapshot.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/PageSnapshot.java
@@ -32,7 +32,7 @@ import org.apache.ignite.internal.util.tostring.GridToStringExclude;
public class PageSnapshot extends WALRecord implements WalRecordCacheGroupAware {
/** */
@GridToStringExclude
- private ByteBuffer pageData;
+ private byte[] pageDataBytes;
/** */
private FullPageId fullPageId;
@@ -49,13 +49,13 @@ public class PageSnapshot extends WALRecord implements WalRecordCacheGroupAware
*/
public PageSnapshot(FullPageId fullId, byte[] arr, int realPageSize) {
this.fullPageId = fullId;
- this.pageData = ByteBuffer.wrap(arr).order(ByteOrder.nativeOrder());
+ this.pageDataBytes = arr;
this.realPageSize = realPageSize;
}
/**
- * This constructor doesn't actually create a page snapshot (copy), it creates a wrapper over page memory region.
- * A created record should not be used after WAL manager writes it to log, since page content can be modified.
+ * This constructor doesn't actually create a page snapshot (copy), it creates a wrapper over page memory region. A
+ * created record should not be used after WAL manager writes it to log, since page content can be modified.
*
* @param fullPageId Full page ID.
* @param ptr Pointer to wrap.
@@ -66,7 +66,7 @@ public class PageSnapshot extends WALRecord implements WalRecordCacheGroupAware
this.fullPageId = fullPageId;
this.realPageSize = realPageSize;
- pageData = GridUnsafe.wrapPointer(ptr, pageSize);
+ pageDataBytes = toBytes(GridUnsafe.wrapPointer(ptr, pageSize));
}
/** {@inheritDoc} */
@@ -75,11 +75,11 @@ public class PageSnapshot extends WALRecord implements WalRecordCacheGroupAware
}
/**
- * @return Snapshot of page data.
+ * @return Bytes which was copied from given byte buffer.
*/
- public byte[] pageData() {
+ private byte[] toBytes(ByteBuffer pageData) {
if (!pageData.isDirect())
- return pageData.array();
+ return Arrays.copyOf(pageData.array(), pageData.limit());
// In case of direct buffer copy buffer content to new array.
byte[] arr = new byte[pageData.limit()];
@@ -91,19 +91,28 @@ public class PageSnapshot extends WALRecord implements WalRecordCacheGroupAware
}
/**
+ * @return Snapshot of page data.
+ */
+ public byte[] pageData() {
+ return pageDataBytes;
+ }
+
+ /**
* @return Size of page data.
*/
public int pageDataSize() {
- return pageData.limit();
+ return pageDataBytes.length;
}
/**
* @return Page data byte buffer.
*/
public ByteBuffer pageDataBuffer() {
- pageData.rewind();
+ ByteBuffer buf = ByteBuffer.wrap(pageDataBytes).order(ByteOrder.nativeOrder());
+
+ buf.rewind();
- return pageData;
+ return buf;
}
/**
@@ -127,13 +136,9 @@ public class PageSnapshot extends WALRecord implements WalRecordCacheGroupAware
/** {@inheritDoc} */
@Override public String toString() {
- ByteBuffer buf = pageData;
-
- if (!pageData.isDirect()) {
- buf = ByteBuffer.allocateDirect(pageDataSize());
- buf.order(ByteOrder.nativeOrder());
- buf.put(pageData);
- }
+ ByteBuffer buf = ByteBuffer.allocateDirect(pageDataSize());
+ buf.order(ByteOrder.nativeOrder());
+ buf.put(pageDataBytes);
long addr = GridUnsafe.bufferAddress(buf);
@@ -148,8 +153,7 @@ public class PageSnapshot extends WALRecord implements WalRecordCacheGroupAware
", pageData = " + Arrays.toString(pageData()) + ", super=" + super.toString() + "]";
}
finally {
- if (!pageData.isDirect())
- GridUnsafe.cleanDirectBuffer(buf);
+ GridUnsafe.cleanDirectBuffer(buf);
}
}
}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index 4de3b70..6269cf1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -150,6 +150,7 @@ import org.apache.ignite.resources.LoggerResource;
import org.apache.ignite.transactions.Transaction;
import org.apache.ignite.transactions.TransactionConcurrency;
import org.apache.ignite.transactions.TransactionIsolation;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import static org.apache.ignite.IgniteSystemProperties.IGNITE_CACHE_KEY_VALIDATION_DISABLED;
@@ -6517,7 +6518,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
}
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable Object arg) throws IgniteException {
Map<ComputeJob, ClusterNode> jobs = new HashMap();
@@ -6583,7 +6584,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
}
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable Object arg) throws IgniteException {
Map<ComputeJob, ClusterNode> jobs = new HashMap();
@@ -6659,7 +6660,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
}
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(
List<ClusterNode> subgrid,
@Nullable Object arg
) throws IgniteException {
@@ -6736,7 +6737,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
}
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable Object arg) throws IgniteException {
Map<ComputeJob, ClusterNode> jobs = new HashMap<>();
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
index ea51a87..c4b5cf1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
@@ -3080,7 +3080,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
int dumpCnt = 0;
- long waitStart = U.currentTimeMillis();
+ long waitStartNanos = System.nanoTime();
// Call rollback logic only for client node, for server nodes
// rollback logic is in GridDhtPartitionsExchangeFuture.
@@ -3135,7 +3135,9 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
nextDumpTime = U.currentTimeMillis() + nextDumpTimeout(dumpCnt++, dumpTimeout);
}
- if (!txRolledBack && curTimeout > 0 && U.currentTimeMillis() - waitStart >= curTimeout) {
+ long passedMillis = U.millisSinceNanos(waitStartNanos);
+
+ if (!txRolledBack && curTimeout > 0 && passedMillis >= curTimeout) {
txRolledBack = true; // Try automatic rollback only once.
cctx.tm().rollbackOnTopologyChange(exchFut.initialVersion());
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java
index 0287339..ce9e71e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java
@@ -351,7 +351,7 @@ public abstract class GridDistributedCacheAdapter<K, V> extends GridCacheAdapter
}
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable Object arg) throws IgniteException {
Map<ComputeJob, ClusterNode> jobs = new HashMap<>();
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index cbe1112..97f127c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@ -1563,18 +1563,18 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
*/
private void tryToPerformLocalSnapshotOperation() {
try {
- long start = U.currentTimeMillis();
+ long start = System.nanoTime();
IgniteInternalFuture fut = cctx.snapshot().tryStartLocalSnapshotOperation(firstDiscoEvt, exchId.topologyVersion());
if (fut != null) {
fut.get();
- long end = U.currentTimeMillis();
+ long end = System.nanoTime();
if (log.isInfoEnabled())
log.info("Snapshot initialization completed [topVer=" + exchangeId().topologyVersion() +
- ", time=" + (end - start) + "ms]");
+ ", time=" + U.nanosToMillis(end - start) + "ms]");
}
}
catch (IgniteCheckedException e) {
@@ -1664,7 +1664,7 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
IgniteConfiguration cfg = cctx.gridConfig();
- long waitStart = U.currentTimeMillis();
+ long waitStartNanos = System.nanoTime();
long waitTimeout = 2 * cfg.getNetworkTimeout();
@@ -1691,7 +1691,9 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
nextDumpTime = U.currentTimeMillis() + nextDumpTimeout(dumpCnt++, waitTimeout);
}
- if (!txRolledBack && curTimeout > 0 && U.currentTimeMillis() - waitStart >= curTimeout) {
+ long passedMillis = U.millisSinceNanos(waitStartNanos);
+
+ if (!txRolledBack && curTimeout > 0 && passedMillis >= curTimeout) {
txRolledBack = true;
cctx.tm().rollbackOnTopologyChange(initialVersion());
@@ -1707,10 +1709,10 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
}
}
- long waitEnd = U.currentTimeMillis();
+ long waitEndNanos = System.nanoTime();
if (log.isInfoEnabled()) {
- long waitTime = (waitEnd - waitStart);
+ long waitTime = U.nanosToMillis(waitEndNanos - waitStartNanos);
String futInfo = RELEASE_FUTURE_DUMP_THRESHOLD > 0 && waitTime > RELEASE_FUTURE_DUMP_THRESHOLD ?
partReleaseFut.toString() : "NA";
@@ -1719,7 +1721,7 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
if (log.isInfoEnabled())
log.info("Finished waiting for partition release future [topVer=" + exchangeId().topologyVersion() +
- ", waitTime=" + (waitEnd - waitStart) + "ms, futInfo=" + futInfo + ", mode=" + mode + "]");
+ ", waitTime=" + waitTime + "ms, futInfo=" + futInfo + ", mode=" + mode + "]");
}
IgniteInternalFuture<?> locksFut = cctx.mvcc().finishLocks(exchId.topologyVersion());
@@ -2380,7 +2382,7 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte
latestStartedNode = nodeId;
}
- return new T2<>(TimeUnit.NANOSECONDS.toMillis(maxStartTime - minStartTime), latestStartedNode);
+ return new T2<>(U.nanosToMillis(maxStartTime - minStartTime), latestStartedNode);
}
/**
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionTopologyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionTopologyImpl.java
index a831e78..b18ce66 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionTopologyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/GridDhtPartitionTopologyImpl.java
@@ -1671,17 +1671,18 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
@Override public void collectUpdateCounters(CachePartitionPartialCountersMap cntrMap) {
assert cntrMap != null;
- long now = U.currentTimeMillis();
+ long nowNanos = System.nanoTime();
lock.writeLock().lock();
try {
- long acquired = U.currentTimeMillis();
+ long acquiredNanos = System.nanoTime();
- if (acquired - now >= 100) {
+ if (acquiredNanos - nowNanos >= U.millisToNanos(100)) {
if (timeLog.isInfoEnabled())
timeLog.info("Waited too long to acquire topology write lock " +
- "[grp=" + grp.cacheOrGroupName() + ", waitTime=" + (acquired - now) + ']');
+ "[grp=" + grp.cacheOrGroupName() + ", waitTime=" +
+ U.nanosToMillis(acquiredNanos - nowNanos) + ']');
}
if (stopping)
@@ -1706,17 +1707,18 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
/** {@inheritDoc} */
@Override public void applyUpdateCounters() {
- long now = U.currentTimeMillis();
+ long nowNanos = System.nanoTime();
lock.writeLock().lock();
try {
- long acquired = U.currentTimeMillis();
+ long acquiredNanos = System.nanoTime();
- if (acquired - now >= 100) {
+ if (acquiredNanos - nowNanos >= U.millisToNanos(100)) {
if (timeLog.isInfoEnabled())
timeLog.info("Waited too long to acquire topology write lock " +
- "[grp=" + grp.cacheOrGroupName() + ", waitTime=" + (acquired - now) + ']');
+ "[grp=" + grp.cacheOrGroupName() + ", waitTime=" +
+ U.nanosToMillis(acquiredNanos - nowNanos) + ']');
}
if (stopping)
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/PartitionsEvictManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/PartitionsEvictManager.java
index b294843..826902c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/PartitionsEvictManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/topology/PartitionsEvictManager.java
@@ -60,8 +60,8 @@ public class PartitionsEvictManager extends GridCacheSharedManagerAdapter {
/** */
private final int confPermits = getInteger(IGNITE_EVICTION_PERMITS, -1);
- /** Next time of show eviction progress. */
- private long nextShowProgressTime;
+ /** Last time of show eviction progress. */
+ private long lastShowProgressTimeNanos = System.nanoTime() - U.millisToNanos(evictionProgressFreqMs);
/** */
private final Map<Integer, GroupEvictionContext> evictionGroupsMap = new ConcurrentHashMap<>();
@@ -213,7 +213,7 @@ public class PartitionsEvictManager extends GridCacheSharedManagerAdapter {
* Shows progress of eviction.
*/
private void showProgress() {
- if (U.currentTimeMillis() >= nextShowProgressTime) {
+ if (U.millisSinceNanos(lastShowProgressTimeNanos) >= evictionProgressFreqMs) {
int size = evictionQueue.size() + 1; // Queue size plus current partition.
if (log.isInfoEnabled())
@@ -224,7 +224,7 @@ public class PartitionsEvictManager extends GridCacheSharedManagerAdapter {
evictionGroupsMap.values().forEach(GroupEvictionContext::showProgress);
- nextShowProgressTime = U.currentTimeMillis() + evictionProgressFreqMs;
+ lastShowProgressTimeNanos = System.nanoTime();
}
}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
index 7ab212b..96cbe2d 100755
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
@@ -391,7 +391,7 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
/** Flag allows to log additional information about partitions during recovery phases. */
private final boolean recoveryVerboseLogging =
- getBoolean(IgniteSystemProperties.IGNITE_RECOVERY_VERBOSE_LOGGING, true);
+ getBoolean(IgniteSystemProperties.IGNITE_RECOVERY_VERBOSE_LOGGING, false);
/** Pointer to a memory recovery record that should be included into the next checkpoint record. */
private volatile WALPointer memoryRecoveryRecordPtr;
@@ -3528,7 +3528,7 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
protected Checkpointer(@Nullable String gridName, String name, IgniteLogger log) {
super(gridName, name, log, cctx.kernalContext().workersRegistry());
- scheduledCp = new CheckpointProgress(U.currentTimeMillis() + checkpointFreq);
+ scheduledCp = new CheckpointProgress(checkpointFreq);
tmpWriteBuf = ByteBuffer.allocateDirect(pageSize());
@@ -3571,7 +3571,7 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
doCheckpoint();
else {
synchronized (this) {
- scheduledCp.nextCpTs = U.currentTimeMillis() + checkpointFreq;
+ scheduledCp.nextCpNanos = System.nanoTime() + U.millisToNanos(checkpointFreq);
}
}
}
@@ -3606,9 +3606,9 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
private CheckpointProgressSnapshot wakeupForCheckpoint(long delayFromNow, String reason) {
CheckpointProgress sched = scheduledCp;
- long next = U.currentTimeMillis() + delayFromNow;
+ long nextNanos = System.nanoTime() + U.millisToNanos(delayFromNow);
- if (sched.nextCpTs <= next)
+ if (sched.nextCpNanos <= nextNanos)
return new CheckpointProgressSnapshot(sched);
CheckpointProgressSnapshot ret;
@@ -3616,10 +3616,10 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
synchronized (this) {
sched = scheduledCp;
- if (sched.nextCpTs > next) {
+ if (sched.nextCpNanos - nextNanos > 0) {
sched.reason = reason;
- sched.nextCpTs = next;
+ sched.nextCpNanos = nextNanos;
}
ret = new CheckpointProgressSnapshot(sched);
@@ -3637,7 +3637,7 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
GridFutureAdapter<Object> ret;
synchronized (this) {
- scheduledCp.nextCpTs = U.currentTimeMillis();
+ scheduledCp.nextCpNanos = System.nanoTime();
scheduledCp.reason = "snapshot";
@@ -3997,13 +3997,15 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
try {
synchronized (this) {
- long remaining;
+ long remaining = U.nanosToMillis(scheduledCp.nextCpNanos - System.nanoTime());
- while ((remaining = scheduledCp.nextCpTs - U.currentTimeMillis()) > 0 && !isCancelled()) {
+ while (remaining > 0 && !isCancelled()) {
blockingSectionBegin();
try {
wait(remaining);
+
+ remaining = U.nanosToMillis(scheduledCp.nextCpNanos - System.nanoTime());
}
finally {
blockingSectionEnd();
@@ -4324,7 +4326,7 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
curr.reason = "timeout";
// It is important that we assign a new progress object before checkpoint mark in page memory.
- scheduledCp = new CheckpointProgress(U.currentTimeMillis() + checkpointFreq);
+ scheduledCp = new CheckpointProgress(checkpointFreq);
curCpProgress = curr;
}
@@ -4941,7 +4943,7 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
*/
public static class CheckpointProgress {
/** Scheduled time of checkpoint. */
- private volatile long nextCpTs;
+ private volatile long nextCpNanos;
/** Checkpoint begin phase future. */
private GridFutureAdapter cpBeginFut = new GridFutureAdapter<>();
@@ -4972,10 +4974,10 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
private String reason;
/**
- * @param nextCpTs Next checkpoint timestamp.
+ * @param cpFreq Timeout until next checkpoint.
*/
- private CheckpointProgress(long nextCpTs) {
- this.nextCpTs = nextCpTs;
+ private CheckpointProgress(long cpFreq) {
+ this.nextCpNanos = System.nanoTime() + U.millisToNanos(cpFreq);
}
/** */
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheOffheapManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheOffheapManager.java
index 4ebcf61..0b027f1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheOffheapManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheOffheapManager.java
@@ -1590,7 +1590,7 @@ public class GridCacheOffheapManager extends IgniteCacheOffheapManagerImpl imple
* in accordance with the value of {@code lastThrottledCacheId}.
* Used for fine-grained throttling on per-partition basis.
*/
- private volatile long nextStoreCleanTime;
+ private volatile long nextStoreCleanTimeNanos;
/** */
private PartitionMetaStorage<SimpleDataRow> partStorage;
@@ -2621,9 +2621,9 @@ public class GridCacheOffheapManager extends IgniteCacheOffheapManagerImpl imple
) throws IgniteCheckedException {
CacheDataStore delegate0 = init0(true);
- long now = U.currentTimeMillis();
+ long nowNanos = System.nanoTime();
- if (delegate0 == null || (cctx.cacheId() == lastThrottledCacheId && nextStoreCleanTime > now))
+ if (delegate0 == null || (cctx.cacheId() == lastThrottledCacheId && nextStoreCleanTimeNanos - nowNanos > 0))
return 0;
assert pendingTree != null : "Partition data store was not initialized.";
@@ -2634,7 +2634,7 @@ public class GridCacheOffheapManager extends IgniteCacheOffheapManagerImpl imple
if (cleared < amount) {
lastThrottledCacheId = cctx.cacheId();
- nextStoreCleanTime = now + unwindThrottlingTimeout;
+ nextStoreCleanTimeNanos = nowNanos + U.millisToNanos(unwindThrottlingTimeout);
}
return cleared;
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/AbstractFileIO.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/AbstractFileIO.java
index d0aaef7..8708f0d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/AbstractFileIO.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/AbstractFileIO.java
@@ -61,8 +61,8 @@ public abstract class AbstractFileIO implements FileIO {
return i;
if (time == 0)
- time = U.currentTimeMillis();
- else if ((U.currentTimeMillis() - time) >= MAX_IO_TIMEOUT_MS)
+ time = System.nanoTime();
+ else if ((System.nanoTime() - time) >= U.millisToNanos(MAX_IO_TIMEOUT_MS))
throw new IOException(write && (position + i) == size() ? "Failed to extend file." :
"Probably disk is too busy, please check your device.");
}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/IntervalBasedMeasurement.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/IntervalBasedMeasurement.java
index f2c1910..de14d62 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/IntervalBasedMeasurement.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/IntervalBasedMeasurement.java
@@ -21,6 +21,7 @@ import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;
+import org.apache.ignite.internal.util.typedef.internal.U;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -82,7 +83,7 @@ class IntervalBasedMeasurement {
* @param maxMeasurements Max historical measurements to keep.
*/
IntervalBasedMeasurement(int intervalSwitchMs, int maxMeasurements) {
- this.intervalSwitchNanos = intervalSwitchMs > 0 ? intervalSwitchMs * TimeUnit.MILLISECONDS.toNanos(1) : -1;
+ this.intervalSwitchNanos = intervalSwitchMs > 0 ? U.millisToNanos(intervalSwitchMs) : -1;
this.maxMeasurements = maxMeasurements;
}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/filehandle/FileHandleManagerImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/filehandle/FileHandleManagerImpl.java
index b02d5f4..10977f0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/filehandle/FileHandleManagerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/filehandle/FileHandleManagerImpl.java
@@ -211,18 +211,21 @@ public class FileHandleManagerImpl implements FileHandleManager {
@Override public void onDeactivate() throws IgniteCheckedException {
FileWriteHandleImpl currHnd = currentHandle();
- if (mode == WALMode.BACKGROUND) {
+ try {
+ if (mode == WALMode.BACKGROUND) {
+ if (currHnd != null)
+ currHnd.flush(null);
+ }
+
if (currHnd != null)
- currHnd.flush(null);
+ currHnd.close(false);
}
+ finally {
+ if (walSegmentSyncWorker != null)
+ walSegmentSyncWorker.shutdown();
- if (currHnd != null)
- currHnd.close(false);
-
- if (walSegmentSyncWorker != null)
- walSegmentSyncWorker.shutdown();
-
- walWriter.shutdown();
+ walWriter.shutdown();
+ }
}
/** {@inheritDoc} */
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/jdbc/GridCacheQueryJdbcMetadataTask.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/jdbc/GridCacheQueryJdbcMetadataTask.java
index 07c1c01..dd68152 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/jdbc/GridCacheQueryJdbcMetadataTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/jdbc/GridCacheQueryJdbcMetadataTask.java
@@ -44,6 +44,7 @@ import org.apache.ignite.marshaller.Marshaller;
import org.apache.ignite.marshaller.jdk.JdkMarshaller;
import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.resources.LoggerResource;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
@@ -61,7 +62,7 @@ public class GridCacheQueryJdbcMetadataTask extends ComputeTaskAdapter<String, b
private Ignite ignite;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable String cacheName) {
Map<JdbcDriverMetadataJob, ClusterNode> map = new HashMap<>();
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/jdbc/GridCacheQueryJdbcTask.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/jdbc/GridCacheQueryJdbcTask.java
index ba87cff..41f02ee 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/jdbc/GridCacheQueryJdbcTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/jdbc/GridCacheQueryJdbcTask.java
@@ -55,6 +55,7 @@ import org.apache.ignite.marshaller.Marshaller;
import org.apache.ignite.marshaller.jdk.JdkMarshaller;
import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.resources.LoggerResource;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import static org.apache.ignite.compute.ComputeJobResultPolicy.WAIT;
@@ -80,7 +81,7 @@ public class GridCacheQueryJdbcTask extends ComputeTaskAdapter<byte[], byte[]> {
private Ignite ignite;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, byte[] arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, byte[] arg) {
try {
assert arg != null;
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalStateAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalStateAdapter.java
index 0b4c05e..8a41ba1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalStateAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalStateAdapter.java
@@ -22,7 +22,6 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
-import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import org.apache.ignite.internal.processors.cache.GridCacheContext;
import org.apache.ignite.internal.util.typedef.internal.U;
@@ -44,7 +43,7 @@ public abstract class IgniteTxLocalStateAdapter implements IgniteTxLocalState {
*/
protected final void onTxEnd(GridCacheContext cacheCtx, IgniteInternalTx tx, boolean commit) {
if (cacheCtx.statisticsEnabled()) {
- long durationNanos = TimeUnit.MILLISECONDS.toNanos(U.currentTimeMillis() - tx.startTime());
+ long durationNanos = U.millisToNanos(U.currentTimeMillis() - tx.startTime());
if (commit)
cacheCtx.cache().metrics0().onTxCommit(durationNanos);
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/CollectConflictPartitionKeysTask.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/CollectConflictPartitionKeysTask.java
index 4141d7f..8e8128c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/CollectConflictPartitionKeysTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/CollectConflictPartitionKeysTask.java
@@ -45,6 +45,7 @@ import org.apache.ignite.internal.util.lang.GridIterator;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.resources.LoggerResource;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
@@ -61,7 +62,7 @@ public class CollectConflictPartitionKeysTask extends ComputeTaskAdapter<Partiti
private IgniteLogger log;
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(
List<ClusterNode> subgrid, PartitionKey partKey) throws IgniteException {
Map<ComputeJob, ClusterNode> jobs = new HashMap<>();
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/RetrieveConflictPartitionValuesTask.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/RetrieveConflictPartitionValuesTask.java
index 79d5b4b..b51622b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/RetrieveConflictPartitionValuesTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/RetrieveConflictPartitionValuesTask.java
@@ -43,6 +43,7 @@ import org.apache.ignite.internal.util.typedef.T2;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.resources.LoggerResource;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
@@ -59,7 +60,7 @@ public class RetrieveConflictPartitionValuesTask extends ComputeTaskAdapter<Map<
private IgniteLogger log;
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(
List<ClusterNode> subgrid,
Map<PartitionHashRecord, List<PartitionEntryHashRecord>> collectTaskRes
) throws IgniteException {
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/VerifyBackupPartitionsDumpTask.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/VerifyBackupPartitionsDumpTask.java
index 5057281..30433fb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/VerifyBackupPartitionsDumpTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/VerifyBackupPartitionsDumpTask.java
@@ -42,6 +42,7 @@ import org.apache.ignite.internal.visor.verify.VisorIdleVerifyDumpTaskArg;
import org.apache.ignite.internal.visor.verify.VisorIdleVerifyTaskArg;
import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.resources.LoggerResource;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import static org.apache.ignite.internal.commandline.cache.IdleVerify.logParsedArgs;
@@ -78,7 +79,7 @@ public class VerifyBackupPartitionsDumpTask extends ComputeTaskAdapter<VisorIdle
private IgniteLogger log;
/** {@inheritDoc} */
- @Override public @Nullable Map<? extends ComputeJob, ClusterNode> map(
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(
List<ClusterNode> subgrid,
VisorIdleVerifyTaskArg arg
) throws IgniteException {
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/VerifyBackupPartitionsTask.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/VerifyBackupPartitionsTask.java
index ecab815..f700567 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/VerifyBackupPartitionsTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/VerifyBackupPartitionsTask.java
@@ -53,6 +53,7 @@ import org.apache.ignite.internal.util.lang.GridIterator;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.resources.LoggerResource;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
@@ -82,7 +83,7 @@ public class VerifyBackupPartitionsTask extends ComputeTaskAdapter<Set<String>,
private IgniteLogger log;
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(
List<ClusterNode> subgrid, Set<String> cacheNames) throws IgniteException {
Map<ComputeJob, ClusterNode> jobs = new HashMap<>();
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/VerifyBackupPartitionsTaskV2.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/VerifyBackupPartitionsTaskV2.java
index 4a68fc0..92b6e36 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/VerifyBackupPartitionsTaskV2.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/VerifyBackupPartitionsTaskV2.java
@@ -67,6 +67,7 @@ import org.apache.ignite.lang.IgniteInClosure;
import org.apache.ignite.lang.IgniteProductVersion;
import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.resources.LoggerResource;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import static org.apache.ignite.cache.CacheMode.LOCAL;
@@ -95,7 +96,7 @@ public class VerifyBackupPartitionsTaskV2 extends ComputeTaskAdapter<VisorIdleVe
private static final long serialVersionUID = 0L;
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(
List<ClusterNode> subgrid,
VisorIdleVerifyTaskArg arg
) throws IgniteException {
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/ViewCacheClosure.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/ViewCacheClosure.java
index 9003ac0..c7242a6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/ViewCacheClosure.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/ViewCacheClosure.java
@@ -88,7 +88,7 @@ public class ViewCacheClosure implements IgniteCallable<List<CacheInfo>> {
Collection<CacheGroupContext> contexts = k.context().cache().cacheGroups();
for (CacheGroupContext context : contexts) {
- if (!compiled.matcher(context.cacheOrGroupName()).find())
+ if (!context.userCache() || !compiled.matcher(context.cacheOrGroupName()).find())
continue;
CacheInfo ci = new CacheInfo();
@@ -111,10 +111,9 @@ public class ViewCacheClosure implements IgniteCallable<List<CacheInfo>> {
Map<String, DynamicCacheDescriptor> descMap = k.context().cache().cacheDescriptors();
for (Map.Entry<String, DynamicCacheDescriptor> entry : descMap.entrySet()) {
-
DynamicCacheDescriptor desc = entry.getValue();
- if (!compiled.matcher(desc.cacheName()).find())
+ if (!desc.cacheType().userCache() || !compiled.matcher(desc.cacheName()).find())
continue;
CacheInfo ci = new CacheInfo();
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
index 2ecea07..1e6152a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
@@ -1202,7 +1202,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
}
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Void arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Void arg) {
return absMap(t.get1(), t.get2(), subgrid, lb);
}
}
@@ -1233,7 +1233,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
}
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Void arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Void arg) {
return absMap(t.get1(), F.asList(t.get2()), subgrid, lb);
}
}
@@ -1273,7 +1273,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
}
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Void arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Void arg) {
return outMap(t.get1(), t.get2(), subgrid, lb);
}
@@ -1335,7 +1335,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
}
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Void arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Void arg) {
return Collections.singletonMap(job(job), node);
}
@@ -1399,7 +1399,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
}
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Void arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Void arg) {
return Collections.singletonMap(job(job), node);
}
@@ -1462,7 +1462,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
}
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Void arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Void arg) {
return outMap(mode, jobs, subgrid, lb);
}
@@ -1498,7 +1498,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
}
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Void arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Void arg) {
return outMap(t.get1(), F.asList(t.get2()), subgrid, lb);
}
@@ -1540,7 +1540,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
}
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Void arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Void arg) {
ComputeJob job = job(this.job, this.arg);
ClusterNode node = lb.getBalancedNode(job, null);
@@ -1587,7 +1587,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
}
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Void arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Void arg) {
try {
JobMapper mapper = new JobMapper(args.size());
@@ -1645,7 +1645,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
}
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Void arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Void arg) {
try {
JobMapper mapper = new JobMapper(args.size());
@@ -1700,7 +1700,7 @@ public class GridClosureProcessor extends GridProcessorAdapter {
}
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable T arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable T arg) {
if (F.isEmpty(subgrid))
return Collections.emptyMap();
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformBalancingMultiClosureTask.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformBalancingMultiClosureTask.java
index 382639c..65ae500 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformBalancingMultiClosureTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformBalancingMultiClosureTask.java
@@ -29,6 +29,7 @@ import org.apache.ignite.compute.ComputeTaskNoResultCache;
import org.apache.ignite.internal.processors.platform.PlatformContext;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.resources.LoadBalancerResource;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
@@ -57,7 +58,7 @@ public class PlatformBalancingMultiClosureTask extends PlatformAbstractTask {
}
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable Object arg) {
assert !F.isEmpty(jobs) : "Jobs emptiness must be checked in native platform.";
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformBalancingSingleClosureAffinityTask.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformBalancingSingleClosureAffinityTask.java
index a07d41d..a550719 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformBalancingSingleClosureAffinityTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformBalancingSingleClosureAffinityTask.java
@@ -27,6 +27,7 @@ import org.apache.ignite.compute.ComputeTaskNoResultCache;
import org.apache.ignite.internal.GridKernalContext;
import org.apache.ignite.internal.processors.platform.PlatformContext;
import org.apache.ignite.internal.util.typedef.internal.U;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
@@ -54,7 +55,7 @@ public class PlatformBalancingSingleClosureAffinityTask extends PlatformAbstract
}
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable Object arg) {
assert job != null : "Job null-check must be performed in native platform.";
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformBalancingSingleClosureTask.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformBalancingSingleClosureTask.java
index 66f51c6..e2dc7aa 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformBalancingSingleClosureTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformBalancingSingleClosureTask.java
@@ -28,6 +28,7 @@ import org.apache.ignite.compute.ComputeTaskNoResultCache;
import org.apache.ignite.internal.processors.platform.PlatformContext;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.resources.LoadBalancerResource;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
@@ -56,7 +57,7 @@ public class PlatformBalancingSingleClosureTask extends PlatformAbstractTask {
}
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable Object arg) {
assert job != null : "Job null-check must be performed in native platform.";
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformBroadcastingMultiClosureTask.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformBroadcastingMultiClosureTask.java
index d7543a1..1c1605b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformBroadcastingMultiClosureTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformBroadcastingMultiClosureTask.java
@@ -27,6 +27,7 @@ import org.apache.ignite.compute.ComputeJob;
import org.apache.ignite.compute.ComputeTaskNoResultCache;
import org.apache.ignite.internal.processors.platform.PlatformContext;
import org.apache.ignite.internal.util.typedef.F;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
@@ -51,7 +52,7 @@ public class PlatformBroadcastingMultiClosureTask extends PlatformAbstractTask {
}
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable Object arg) {
assert !F.isEmpty(jobs) : "Jobs emptiness must be checked in native platform.";
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformBroadcastingSingleClosureTask.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformBroadcastingSingleClosureTask.java
index 2d25b83..71818b0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformBroadcastingSingleClosureTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformBroadcastingSingleClosureTask.java
@@ -26,6 +26,7 @@ import org.apache.ignite.compute.ComputeJob;
import org.apache.ignite.compute.ComputeTaskNoResultCache;
import org.apache.ignite.internal.processors.platform.PlatformContext;
import org.apache.ignite.internal.util.typedef.F;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
@@ -50,7 +51,7 @@ public class PlatformBroadcastingSingleClosureTask extends PlatformAbstractTask
}
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable Object arg) {
assert job != null : "Job null-check must be performed in native platform.";
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformFullTask.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformFullTask.java
index 3134066..6a53533 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformFullTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformFullTask.java
@@ -35,6 +35,7 @@ import org.apache.ignite.internal.processors.platform.memory.PlatformMemory;
import org.apache.ignite.internal.processors.platform.memory.PlatformMemoryManager;
import org.apache.ignite.internal.processors.platform.memory.PlatformOutputStream;
import org.apache.ignite.internal.util.typedef.internal.U;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
@@ -67,7 +68,7 @@ public final class PlatformFullTask extends PlatformAbstractTask {
}
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable Object arg) {
assert arg == null;
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 07d6064..2780e8b 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
@@ -93,6 +93,7 @@ import static org.apache.ignite.IgniteSystemProperties.IGNITE_REST_START_ON_CLIE
import static org.apache.ignite.internal.processors.rest.GridRestCommand.AUTHENTICATE;
import static org.apache.ignite.internal.processors.rest.GridRestResponse.STATUS_AUTH_FAILED;
import static org.apache.ignite.internal.processors.rest.GridRestResponse.STATUS_FAILED;
+import static org.apache.ignite.internal.processors.rest.GridRestResponse.STATUS_ILLEGAL_ARGUMENT;
import static org.apache.ignite.internal.processors.rest.GridRestResponse.STATUS_SECURITY_CHECK_FAILED;
import static org.apache.ignite.plugin.security.SecuritySubjectType.REMOTE_CLIENT;
@@ -338,31 +339,38 @@ public class GridRestProcessor extends GridProcessorAdapter {
catch (Exception e) {
failed = true;
- if (!X.hasCause(e, VisorClusterGroupEmptyException.class))
- LT.error(log, e, "Failed to handle request: " + req.command());
+ if (X.hasCause(e, IllegalArgumentException.class)) {
+ IllegalArgumentException iae = X.cause(e, IllegalArgumentException.class);
- if (log.isDebugEnabled())
- log.debug("Failed to handle request [req=" + req + ", e=" + e + "]");
+ res = new GridRestResponse(STATUS_ILLEGAL_ARGUMENT, iae.getMessage());
+ }
+ else {
+ if (!X.hasCause(e, VisorClusterGroupEmptyException.class))
+ LT.error(log, e, "Failed to handle request: " + req.command());
- // Prepare error message:
- SB sb = new SB(256);
+ if (log.isDebugEnabled())
+ log.debug("Failed to handle request [req=" + req + ", e=" + e + "]");
- sb.a("Failed to handle request: [req=").a(req.command());
+ // Prepare error message:
+ SB sb = new SB(256);
- if (req instanceof GridRestTaskRequest) {
- GridRestTaskRequest tskReq = (GridRestTaskRequest)req;
+ sb.a("Failed to handle request: [req=").a(req.command());
- sb.a(", taskName=").a(tskReq.taskName())
- .a(", params=").a(tskReq.params());
- }
+ if (req instanceof GridRestTaskRequest) {
+ GridRestTaskRequest tskReq = (GridRestTaskRequest)req;
- sb.a(", err=")
- .a(e.getMessage() != null ? e.getMessage() : e.getClass().getName())
- .a(", trace=")
- .a(getErrorMessage(e))
- .a(']');
+ sb.a(", taskName=").a(tskReq.taskName())
+ .a(", params=").a(tskReq.params());
+ }
- res = new GridRestResponse(STATUS_FAILED, sb.toString());
+ sb.a(", err=")
+ .a(e.getMessage() != null ? e.getMessage() : e.getClass().getName())
+ .a(", trace=")
+ .a(getErrorMessage(e))
+ .a(']');
+
+ res = new GridRestResponse(STATUS_FAILED, sb.toString());
+ }
}
assert res != null;
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestResponse.java
index f91a2c0..0c3ac04 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestResponse.java
@@ -45,6 +45,9 @@ public class GridRestResponse implements Externalizable {
/** Security check failed. */
public static final int STATUS_SECURITY_CHECK_FAILED = 3;
+ /** */
+ public static final int STATUS_ILLEGAL_ARGUMENT = 4;
+
/** Success status. */
private int successStatus = STATUS_SUCCESS;
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientResponse.java
index fceb1e9..f938b80 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientResponse.java
@@ -41,6 +41,9 @@ public class GridClientResponse extends GridClientAbstractMessage {
/** Operation security failure. */
public static final int STATUS_SECURITY_CHECK_FAILED = 3;
+ /** */
+ public static final int STATUS_ILLEGAL_ARGUMENT = 4;
+
/** Success flag */
private int successStatus;
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java
index f3c3935..ede41d4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java
@@ -77,6 +77,7 @@ import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteClosure;
import org.apache.ignite.resources.IgniteInstanceResource;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
@@ -1020,7 +1021,7 @@ public class GridCacheCommandHandler extends GridRestCommandHandlerAdapter {
private IgniteEx ignite;
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
String cacheName) throws IgniteException {
GridDiscoveryManager discovery = ignite.context().discovery();
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/GridSpinReadWriteLock.java b/modules/core/src/main/java/org/apache/ignite/internal/util/GridSpinReadWriteLock.java
index ade1814..f2cdc65 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/GridSpinReadWriteLock.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/GridSpinReadWriteLock.java
@@ -20,7 +20,6 @@ package org.apache.ignite.internal.util;
import java.util.concurrent.TimeUnit;
import org.apache.ignite.internal.util.tostring.GridToStringExclude;
import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.internal.util.typedef.internal.U;
/**
*
@@ -332,7 +331,9 @@ public class GridSpinReadWriteLock {
break;
}
- long end = U.currentTimeMillis() + unit.toMillis(timeout);
+ long startNanos = System.nanoTime();
+
+ long timeoutNanos = unit.toNanos(timeout);
while (true) {
if (compareAndSet(STATE_OFFS, 0, -1)) {
@@ -346,7 +347,7 @@ public class GridSpinReadWriteLock {
Thread.sleep(10);
- if (end <= U.currentTimeMillis())
+ if (System.nanoTime() - startNanos >= timeoutNanos)
return false;
}
}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
index 007a777..d2b7c6e 100755
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
@@ -1075,6 +1075,37 @@ public abstract class IgniteUtils {
}
/**
+ * Convert milliseconds time interval to nanoseconds.
+ *
+ * @param millis Original time interval.
+ * @return Calculated time interval.
+ */
+ public static long millisToNanos(long millis) {
+ return TimeUnit.MILLISECONDS.toNanos(millis);
+ }
+
+ /**
+ * Convert nanoseconds time interval to milliseconds.
+ *
+ * @param nanos Original time interval.
+ * @return Calculated time interval.
+ */
+ public static long nanosToMillis(long nanos) {
+ return TimeUnit.NANOSECONDS.toMillis(nanos);
+ }
+
+ /**
+ * Returns number of milliseconds passed after the given nanos timestamp.
+ *
+ * @param nanos Nanos timestamp.
+ * @return Number of milliseconds passed after the given nanos timestamp.
+ * @see System#nanoTime()
+ */
+ public static long millisSinceNanos(long nanos) {
+ return nanosToMillis(System.nanoTime() - nanos);
+ }
+
+ /**
* Gets nearest power of 2 larger or equal than v.
*
* @param v Value.
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/future/IgniteRemoteMapTask.java b/modules/core/src/main/java/org/apache/ignite/internal/util/future/IgniteRemoteMapTask.java
index 4d0b3fd..f8e4d7d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/future/IgniteRemoteMapTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/future/IgniteRemoteMapTask.java
@@ -36,6 +36,7 @@ import org.apache.ignite.lang.IgniteFuture;
import org.apache.ignite.lang.IgniteInClosure;
import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.resources.JobContextResource;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
@@ -61,7 +62,7 @@ import org.jetbrains.annotations.Nullable;
}
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable T arg) throws IgniteException {
for (ClusterNode node : subgrid) {
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorMultiNodeTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorMultiNodeTask.java
index dbf1c66..70f08ba 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorMultiNodeTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorMultiNodeTask.java
@@ -30,6 +30,7 @@ import org.apache.ignite.compute.ComputeTask;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.resources.IgniteInstanceResource;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import static org.apache.ignite.internal.visor.util.VisorTaskUtils.logFinish;
@@ -64,7 +65,7 @@ public abstract class VisorMultiNodeTask<A, R, J> implements ComputeTask<VisorTa
protected abstract VisorJob<A, J> job(A arg);
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, VisorTaskArgument<A> arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, VisorTaskArgument<A> arg) {
assert arg != null;
start = U.currentTimeMillis();
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/baseline/VisorBaselineTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/baseline/VisorBaselineTask.java
index 74883c2..4173775 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/baseline/VisorBaselineTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/baseline/VisorBaselineTask.java
@@ -173,7 +173,7 @@ public class VisorBaselineTask extends VisorOneNodeTask<VisorBaselineTaskArg, Vi
BaselineNode node = srvrs.get(consistentId);
if (node == null)
- throw new IllegalStateException("Node not found for consistent ID: " + consistentId);
+ throw new IllegalArgumentException("Node not found for consistent ID: " + consistentId);
baseline.put(consistentId, node);
}
@@ -197,7 +197,7 @@ public class VisorBaselineTask extends VisorOneNodeTask<VisorBaselineTaskArg, Vi
BaselineNode node = baseline.remove(consistentId);
if (node == null)
- throw new IllegalStateException("Node not found for consistent ID: " + consistentId);
+ throw new IllegalArgumentException("Node not found for consistent ID: " + consistentId);
}
return set0(baseline.values());
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheConfigurationCollectorJob.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheConfigurationCollectorJob.java
index 51477c9..70112ee 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheConfigurationCollectorJob.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheConfigurationCollectorJob.java
@@ -60,6 +60,9 @@ public class VisorCacheConfigurationCollectorJob
Map<String, VisorCacheConfiguration> res = U.newHashMap(caches.size());
for (IgniteCacheProxy<?, ?> cache : caches) {
+ if (!cache.context().userCache())
+ continue;
+
String cacheName = cache.getName();
boolean matched = hasPtrn ? ptrn.matcher(cacheName).find() : all || arg.getCacheNames().contains(cacheName);
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
index c41864f..4e141fb 100644
--- 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
@@ -51,6 +51,7 @@ 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;
/**
@@ -81,7 +82,7 @@ public class VisorGatewayTask implements ComputeTask<Object[], Object> {
protected transient IgniteEx ignite;
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable Object[] args) throws IgniteException {
assert args != null;
assert args.length >= 2;
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/misc/VisorNopTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/misc/VisorNopTask.java
index 367e495..aeca762 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/misc/VisorNopTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/misc/VisorNopTask.java
@@ -28,6 +28,7 @@ import org.apache.ignite.compute.ComputeJobResultPolicy;
import org.apache.ignite.compute.ComputeTask;
import org.apache.ignite.internal.util.GridLeanMap;
import org.apache.ignite.internal.util.typedef.internal.S;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
@@ -38,7 +39,7 @@ public class VisorNopTask implements ComputeTask<Integer, Void> {
private static final long serialVersionUID = 0L;
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable Integer arg) {
Map<ComputeJob, ClusterNode> map = new GridLeanMap<>(subgrid.size());
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/ExponentialBackoffTimeoutStrategy.java b/modules/core/src/main/java/org/apache/ignite/spi/ExponentialBackoffTimeoutStrategy.java
index 41d34e5..30b1d7a 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/ExponentialBackoffTimeoutStrategy.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/ExponentialBackoffTimeoutStrategy.java
@@ -38,7 +38,7 @@ public class ExponentialBackoffTimeoutStrategy implements TimeoutStrategy {
private final long totalTimeout;
/** Timestamp of operation start to check totalTimeout. */
- private final long start;
+ private final long startNanos;
/** Current calculated timeout, ms. */
private long currTimeout;
@@ -92,12 +92,12 @@ public class ExponentialBackoffTimeoutStrategy implements TimeoutStrategy {
currTimeout = startTimeout;
- start = U.currentTimeMillis();
+ startNanos = System.nanoTime();
}
/** {@inheritDoc} */
@Override public long nextTimeout(long timeout) throws IgniteSpiOperationTimeoutException {
- long remainingTime = remainingTime(U.currentTimeMillis());
+ long remainingTime = remainingTime(System.nanoTime());
if (remainingTime <= 0)
throw new IgniteSpiOperationTimeoutException("Operation timed out [timeoutStrategy= " +this +"]");
@@ -119,16 +119,16 @@ public class ExponentialBackoffTimeoutStrategy implements TimeoutStrategy {
/**
* Returns remaining time for current totalTimeout chunk.
*
- * @param curTs Current timestamp.
+ * @param curNanos Current timestamp.
* @return Time to wait in millis.
*/
- public long remainingTime(long curTs) {
- return totalTimeout - (curTs - start);
+ private long remainingTime(long curNanos) {
+ return totalTimeout - U.nanosToMillis(curNanos - startNanos);
}
/** {@inheritDoc} */
@Override public boolean checkTimeout(long timeInFut) {
- return remainingTime(U.currentTimeMillis() + timeInFut) <= 0;
+ return remainingTime(System.nanoTime() + U.millisToNanos(timeInFut)) <= 0;
}
/** {@inheritDoc} */
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiOperationTimeoutHelper.java b/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiOperationTimeoutHelper.java
index 9f1773b..2e590ce 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiOperationTimeoutHelper.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiOperationTimeoutHelper.java
@@ -34,7 +34,7 @@ public class IgniteSpiOperationTimeoutHelper {
// We need to reuse new logic ExponentialBackoffTimeout logic in TcpDiscovery instead of this class.
/** */
- private long lastOperStartTs;
+ private long lastOperStartNanos;
/** */
private long timeout;
@@ -72,16 +72,16 @@ public class IgniteSpiOperationTimeoutHelper {
if (!failureDetectionTimeoutEnabled)
return dfltTimeout;
- if (lastOperStartTs == 0) {
+ if (lastOperStartNanos == 0) {
timeout = failureDetectionTimeout;
- lastOperStartTs = U.currentTimeMillis();
+ lastOperStartNanos = System.nanoTime();
}
else {
- long curTs = U.currentTimeMillis();
+ long curNanos = System.nanoTime();
- timeout = timeout - (curTs - lastOperStartTs);
+ timeout -= U.nanosToMillis(curNanos - lastOperStartNanos);
- lastOperStartTs = curTs;
+ lastOperStartNanos = curNanos;
if (timeout <= 0)
throw new IgniteSpiOperationTimeoutException("Network operation timed out. Increase " +
@@ -105,6 +105,6 @@ public class IgniteSpiOperationTimeoutHelper {
if (X.hasCause(e, IgniteSpiOperationTimeoutException.class, SocketTimeoutException.class, SocketException.class))
return true;
- return (timeout - (U.currentTimeMillis() - lastOperStartTs) <= 0);
+ return (timeout - U.millisSinceNanos(lastOperStartNanos) <= 0);
}
}
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/jdbc/JdbcCheckpointSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/jdbc/JdbcCheckpointSpi.java
index 921d0fc..e99e158 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/jdbc/JdbcCheckpointSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/checkpoint/jdbc/JdbcCheckpointSpi.java
@@ -378,7 +378,8 @@ public class JdbcCheckpointSpi extends IgniteSpiAdapter implements CheckpointSpi
* Sets checkpoint database user name. Note that authentication will be
* performed only if both, {@code user} and {@code password} are set.
*
- * @param user Checkpoint database user name to set.
+ * @param user Checkpoint database user name to set. {@code null} is a valid value that means that no user
+ * provided. Authentication won't be performed in this case.
* @see #setPwd(String)
* @return {@code this} for chaining.
*/
@@ -393,7 +394,8 @@ public class JdbcCheckpointSpi extends IgniteSpiAdapter implements CheckpointSpi
* Sets checkpoint database password. Note that authentication will be
* performed only if both, {@code user} and {@code password} are set.
*
- * @param pwd Checkpoint database password to set.
+ * @param pwd Checkpoint database password to set. {@code null} is a valid value that means that no password
+ * provided. Authentication won't be performed in this case.
* @see #setUser(String)
** @return {@code this} for chaining.
*/
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingCollisionSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingCollisionSpi.java
index 6b0209a..01e4f6e 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingCollisionSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/collision/jobstealing/JobStealingCollisionSpi.java
@@ -1116,7 +1116,7 @@ public class JobStealingCollisionSpi extends IgniteSpiAdapter implements Collisi
private int jobsToSteal;
/** */
- private long ts = U.currentTimeMillis();
+ private long ts = System.nanoTime();
/**
* @return Job to steal.
@@ -1133,7 +1133,7 @@ public class JobStealingCollisionSpi extends IgniteSpiAdapter implements Collisi
boolean expired() {
assert Thread.holdsLock(this);
- return jobsToSteal > 0 && U.currentTimeMillis() - ts >= msgExpireTime;
+ return jobsToSteal > 0 && U.millisSinceNanos(ts) >= msgExpireTime;
}
/**
@@ -1144,7 +1144,7 @@ public class JobStealingCollisionSpi extends IgniteSpiAdapter implements Collisi
this.jobsToSteal = jobsToSteal;
- ts = U.currentTimeMillis();
+ ts = System.nanoTime();
}
/** {@inheritDoc} */
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
index 29e0d21..0c99051 100755
--- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
@@ -3032,14 +3032,11 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter implements Communicati
}
}
- connectGate.enter();
+ final long start = System.currentTimeMillis();
- try {
- final long start = System.currentTimeMillis();
-
- GridCommunicationClient client = createTcpClient(node, connIdx);
+ GridCommunicationClient client = createTcpClient(node, connIdx);
- final long time = System.currentTimeMillis() - start;
+ final long time = System.currentTimeMillis() - start;
if (time > CONNECTION_ESTABLISH_THRESHOLD_MS) {
if (log.isInfoEnabled())
@@ -3048,11 +3045,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter implements Communicati
else if (log.isDebugEnabled())
log.debug("TCP client created [client=" + clientString(client, node) + ", duration=" + time + "ms]");
- return client;
- }
- finally {
- connectGate.leave();
- }
+ return client;
}
/**
@@ -3375,6 +3368,8 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter implements Communicati
long timeout = 0;
+ connectGate.enter();
+
try {
if (getSpiContext().node(node.id()) == null)
throw new ClusterTopologyCheckedException("Failed to send message (node left topology): " + node);
@@ -3595,6 +3590,9 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter implements Communicati
break;
}
}
+ finally {
+ connectGate.leave();
+ }
CommunicationWorker commWorker0 = commWorker;
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
index 9a6eae3..72fc438 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
@@ -552,7 +552,7 @@ class ClientImpl extends TcpDiscoveryImpl {
) throws IgniteSpiException, InterruptedException {
List<InetSocketAddress> addrs = null;
- long startTime = U.currentTimeMillis();
+ long startNanos = System.nanoTime();
while (true) {
if (Thread.currentThread().isInterrupted())
@@ -566,7 +566,7 @@ class ClientImpl extends TcpDiscoveryImpl {
log.debug("Resolved addresses from IP finder: " + addrs);
}
else {
- if (timeout > 0 && (U.currentTimeMillis() - startTime) > timeout)
+ if (timeout > 0 && U.millisSinceNanos(startNanos) > timeout)
return null;
LT.warn(log, "IP finder returned empty addresses list. " +
@@ -635,7 +635,7 @@ class ClientImpl extends TcpDiscoveryImpl {
}
}
- if (timeout > 0 && (U.currentTimeMillis() - startTime) > timeout)
+ if (timeout > 0 && U.millisSinceNanos(startNanos) > timeout)
return null;
if (wait) {
@@ -703,7 +703,7 @@ class ClientImpl extends TcpDiscoveryImpl {
Socket sock = null;
try {
- long tstamp = U.currentTimeMillis();
+ long tsNanos = System.nanoTime();
sock = spi.openSocket(addr, timeoutHelper);
@@ -722,11 +722,11 @@ class ClientImpl extends TcpDiscoveryImpl {
assert rmtNodeId != null;
assert !getLocalNodeId().equals(rmtNodeId);
- spi.stats.onClientSocketInitialized(U.currentTimeMillis() - tstamp);
+ spi.stats.onClientSocketInitialized(U.millisSinceNanos(tsNanos));
locNode.clientRouterNodeId(rmtNodeId);
- tstamp = U.currentTimeMillis();
+ tsNanos = System.nanoTime();
TcpDiscoveryAbstractMessage msg;
@@ -756,7 +756,7 @@ class ClientImpl extends TcpDiscoveryImpl {
spi.writeToSocket(sock, msg, timeoutHelper.nextTimeoutChunk(spi.getSocketTimeout()));
- spi.stats.onMessageSent(msg, U.currentTimeMillis() - tstamp);
+ spi.stats.onMessageSent(msg, U.millisSinceNanos(tsNanos));
if (log.isDebugEnabled())
log.debug("Message has been sent to address [msg=" + msg + ", addr=" + addr +
@@ -1387,14 +1387,19 @@ class ClientImpl extends TcpDiscoveryImpl {
msg = null;
if (ack) {
- long waitEnd = U.currentTimeMillis() + (spi.failureDetectionTimeoutEnabled() ?
+ long waitEndNanos = System.nanoTime() + U.millisToNanos(spi.failureDetectionTimeoutEnabled() ?
spi.failureDetectionTimeout() : spi.getAckTimeout());
TcpDiscoveryAbstractMessage unacked;
synchronized (mux) {
- while (unackedMsg != null && U.currentTimeMillis() < waitEnd)
- mux.wait(waitEnd);
+ long nowNanos = System.nanoTime();
+
+ while (unackedMsg != null && waitEndNanos - nowNanos > 0) {
+ mux.wait(U.nanosToMillis(waitEndNanos - nowNanos));
+
+ nowNanos = System.nanoTime();
+ }
unacked = unackedMsg;
@@ -1508,7 +1513,7 @@ class ClientImpl extends TcpDiscoveryImpl {
long timeout = join ? spi.joinTimeout : spi.netTimeout;
- long startTime = U.currentTimeMillis();
+ long startNanos = System.nanoTime();
if (log.isDebugEnabled())
log.debug("Started reconnect process [join=" + join + ", timeout=" + timeout + ']');
@@ -1594,7 +1599,7 @@ class ClientImpl extends TcpDiscoveryImpl {
if (log.isDebugEnabled())
log.error("Reconnect error [join=" + join + ", timeout=" + timeout + ']', e);
- if (timeout > 0 && (U.currentTimeMillis() - startTime) > timeout) {
+ if (timeout > 0 && U.millisSinceNanos(startNanos) > timeout) {
String msg = join ? "Failed to connect to cluster (consider increasing 'joinTimeout' " +
"configuration property) [joinTimeout=" + spi.joinTimeout + ", err=" + e + ']' :
"Failed to reconnect to cluster (consider increasing 'networkTimeout' " +
@@ -1654,7 +1659,7 @@ class ClientImpl extends TcpDiscoveryImpl {
private boolean nodeAdded;
/** */
- private long lastReconnectTimestamp = -1;
+ private long lastReconnectTsNanos = -1;
/** */
private long currentReconnectDelay = -1;
@@ -1959,7 +1964,9 @@ class ClientImpl extends TcpDiscoveryImpl {
* @throws InterruptedException If thread is interrupted.
*/
private void throttleClientReconnect() throws InterruptedException {
- if (U.currentTimeMillis() - lastReconnectTimestamp > CLIENT_THROTTLE_RECONNECT_RESET_TIMEOUT)
+ if (currentReconnectDelay == -1
+ || U.millisSinceNanos(lastReconnectTsNanos) > CLIENT_THROTTLE_RECONNECT_RESET_TIMEOUT
+ )
currentReconnectDelay = 0; // Skip pause on first reconnect.
else if (currentReconnectDelay == 0)
currentReconnectDelay = 200;
@@ -1977,7 +1984,7 @@ class ClientImpl extends TcpDiscoveryImpl {
Thread.sleep(random.nextLong(currentReconnectDelay / 2, currentReconnectDelay));
}
- lastReconnectTimestamp = U.currentTimeMillis();
+ lastReconnectTsNanos = System.nanoTime();
}
/**
@@ -2436,7 +2443,7 @@ class ClientImpl extends TcpDiscoveryImpl {
log.debug("Received metrics response: " + msg);
}
else {
- long tstamp = U.currentTimeMillis();
+ long tsNanos = System.nanoTime();
if (msg.hasMetrics()) {
for (Map.Entry<UUID, TcpDiscoveryMetricsUpdateMessage.MetricsSet> e : msg.metrics().entrySet()) {
@@ -2447,10 +2454,10 @@ class ClientImpl extends TcpDiscoveryImpl {
Map<Integer, CacheMetrics> cacheMetrics = msg.hasCacheMetrics(nodeId) ?
msg.cacheMetrics().get(nodeId) : Collections.<Integer, CacheMetrics>emptyMap();
- updateMetrics(nodeId, metricsSet.metrics(), cacheMetrics, tstamp);
+ updateMetrics(nodeId, metricsSet.metrics(), cacheMetrics, tsNanos);
for (T2<UUID, ClusterMetrics> t : metricsSet.clientMetrics())
- updateMetrics(t.get1(), t.get2(), cacheMetrics, tstamp);
+ updateMetrics(t.get1(), t.get2(), cacheMetrics, tsNanos);
}
}
}
@@ -2556,12 +2563,12 @@ class ClientImpl extends TcpDiscoveryImpl {
* @param nodeId Node ID.
* @param metrics Metrics.
* @param cacheMetrics Cache metrics.
- * @param tstamp Timestamp.
+ * @param tsNanos Timestamp as returned by {@link System#nanoTime()}.
*/
private void updateMetrics(UUID nodeId,
ClusterMetrics metrics,
Map<Integer, CacheMetrics> cacheMetrics,
- long tstamp)
+ long tsNanos)
{
boolean isLocDaemon = spi.locNode.isDaemon();
@@ -2577,7 +2584,7 @@ class ClientImpl extends TcpDiscoveryImpl {
if (!isLocDaemon)
node.setCacheMetrics(cacheMetrics);
- node.lastUpdateTime(tstamp);
+ node.lastUpdateTimeNanos(tsNanos);
notifyDiscovery(EVT_NODE_METRICS_UPDATED, topVer, node, allVisibleNodes());
}
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
index 0c7b903..aee48b2 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
@@ -470,13 +470,13 @@ class ServerImpl extends TcpDiscoveryImpl {
synchronized (mux) {
long timeout = spi.netTimeout;
- long threshold = U.currentTimeMillis() + timeout;
+ long thresholdNanos = System.nanoTime() + U.millisToNanos(timeout);
while (spiState != LEFT && timeout > 0) {
try {
mux.wait(timeout);
- timeout = threshold - U.currentTimeMillis();
+ timeout = U.nanosToMillis(thresholdNanos - System.nanoTime());
}
catch (InterruptedException ignored) {
Thread.currentThread().interrupt();
@@ -746,7 +746,7 @@ class ServerImpl extends TcpDiscoveryImpl {
if (addr.isUnresolved())
addr = new InetSocketAddress(InetAddress.getByName(addr.getHostName()), addr.getPort());
- long tstamp = U.currentTimeMillis();
+ long tsNanos = System.nanoTime();
sock = spi.createSocket();
@@ -769,7 +769,7 @@ class ServerImpl extends TcpDiscoveryImpl {
break;
}
- spi.stats.onClientSocketInitialized(U.currentTimeMillis() - tstamp);
+ spi.stats.onClientSocketInitialized(U.millisSinceNanos(tsNanos));
IgniteBiTuple<UUID, Boolean> t = F.t(res.creatorNodeId(), res.clientExists());
@@ -899,7 +899,7 @@ class ServerImpl extends TcpDiscoveryImpl {
/** {@inheritDoc} */
@Override protected void onMessageExchanged() {
if (spi.failureDetectionTimeoutEnabled() && locNode != null)
- locNode.lastExchangeTime(U.currentTimeMillis());
+ locNode.lastExchangeTime(U.currentTimeMillis(), System.nanoTime());
}
/**
@@ -1015,13 +1015,13 @@ class ServerImpl extends TcpDiscoveryImpl {
synchronized (mux) {
long timeout = spi.netTimeout;
- long threshold = U.currentTimeMillis() + timeout;
+ long thresholdNanos = System.nanoTime() + U.millisToNanos(timeout);
while (spiState == CONNECTING && timeout > 0) {
try {
mux.wait(timeout);
- timeout = threshold - U.currentTimeMillis();
+ timeout = U.nanosToMillis(thresholdNanos - System.nanoTime());
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
@@ -1119,7 +1119,7 @@ class ServerImpl extends TcpDiscoveryImpl {
TcpDiscoveryAbstractMessage joinReq = new TcpDiscoveryJoinRequestMessage(locNode, discoveryData);
// Time when join process started.
- long joinStart = 0;
+ long joinStartNanos = 0;
while (true) {
Collection<InetSocketAddress> addrs = spi.resolvedAddresses();
@@ -1155,7 +1155,7 @@ class ServerImpl extends TcpDiscoveryImpl {
//(only CONNECTING node sends back WAIT and CONTINUE_JOIN codes),
//otherwise two CONNECTING nodes can stuck in infinite loop sending join reqs to each other forever
if (res != RES_WAIT && res != RES_CONTINUE_JOIN)
- joinStart = 0;
+ joinStartNanos = 0;
switch (res) {
case RES_WAIT:
@@ -1244,9 +1244,9 @@ class ServerImpl extends TcpDiscoveryImpl {
}
if (spi.joinTimeout > 0) {
- if (joinStart == 0)
- joinStart = U.currentTimeMillis();
- else if (U.currentTimeMillis() - joinStart > spi.joinTimeout)
+ if (joinStartNanos == 0)
+ joinStartNanos = System.nanoTime();
+ else if (U.millisSinceNanos(joinStartNanos) > spi.joinTimeout)
throw new IgniteSpiException(
"Failed to connect to any address from IP finder within join timeout " +
"(make sure IP finder addresses are correct, and operating system firewalls are disabled " +
@@ -1307,7 +1307,7 @@ class ServerImpl extends TcpDiscoveryImpl {
Socket sock = null;
try {
- long tstamp = U.currentTimeMillis();
+ long tsNanos = System.nanoTime();
sock = spi.openSocket(addr, timeoutHelper);
@@ -1353,14 +1353,14 @@ class ServerImpl extends TcpDiscoveryImpl {
break;
}
- spi.stats.onClientSocketInitialized(U.currentTimeMillis() - tstamp);
+ spi.stats.onClientSocketInitialized(U.millisSinceNanos(tsNanos));
// Send message.
- tstamp = U.currentTimeMillis();
+ tsNanos = System.nanoTime();
spi.writeToSocket(sock, msg, timeoutHelper.nextTimeoutChunk(spi.getSocketTimeout()));
- long tstamp0 = U.currentTimeMillis();
+ long tsNanos0 = System.nanoTime();
if (debugMode)
debugLog(msg, "Message has been sent directly to address [msg=" + msg + ", addr=" + addr +
@@ -1377,7 +1377,7 @@ class ServerImpl extends TcpDiscoveryImpl {
int receipt = spi.readReceipt(sock, timeoutHelper.nextTimeoutChunk(ackTimeout0));
- spi.stats.onMessageSent(msg, tstamp0 - tstamp);
+ spi.stats.onMessageSent(msg, U.nanosToMillis(tsNanos0 - tsNanos));
return receipt;
}
@@ -2720,13 +2720,13 @@ class ServerImpl extends TcpDiscoveryImpl {
private OutputStream out;
/** Last time status message has been sent. */
- private long lastTimeStatusMsgSent;
+ private long lastTimeStatusMsgSentNanos;
/** Incoming metrics check frequency. */
private long metricsCheckFreq = 3 * spi.metricsUpdateFreq + 50;
/** Last time metrics update message has been sent. */
- private long lastTimeMetricsUpdateMsgSent;
+ private long lastTimeMetricsUpdateMsgSentNanos = System.nanoTime() - U.millisToNanos(spi.metricsUpdateFreq);
/** Time when the last status message has been sent. */
private long lastTimeConnCheckMsgSent;
@@ -2738,7 +2738,7 @@ class ServerImpl extends TcpDiscoveryImpl {
private long connCheckThreshold;
/** */
- private long lastRingMsgTime;
+ private long lastRingMsgTimeNanos;
/** */
private List<DiscoveryDataPacket> joiningNodesDiscoDataList;
@@ -2931,7 +2931,7 @@ class ServerImpl extends TcpDiscoveryImpl {
boolean ensured = spi.ensured(msg);
if (!locNode.id().equals(msg.senderNodeId()) && ensured)
- lastRingMsgTime = U.currentTimeMillis();
+ lastRingMsgTimeNanos = System.nanoTime();
if (locNode.internalOrder() == 0) {
boolean proc = false;
@@ -3209,7 +3209,7 @@ class ServerImpl extends TcpDiscoveryImpl {
// Restore ring.
try {
- long tstamp = U.currentTimeMillis();
+ long tsNanos = System.nanoTime();
sock = spi.openSocket(addr, timeoutHelper);
@@ -3279,7 +3279,7 @@ class ServerImpl extends TcpDiscoveryImpl {
break;
}
- spi.stats.onClientSocketInitialized(U.currentTimeMillis() - tstamp);
+ spi.stats.onClientSocketInitialized(U.millisSinceNanos(tsNanos));
UUID nextId = res.creatorNodeId();
@@ -3405,7 +3405,7 @@ class ServerImpl extends TcpDiscoveryImpl {
", failedNodes=" + failedNodes + ']');
for (TcpDiscoveryAbstractMessage pendingMsg : pendingMsgs) {
- long tstamp = U.currentTimeMillis();
+ long tsNanos = System.nanoTime();
prepareNodeAddedMessage(pendingMsg, next.id(), pendingMsgs.msgs,
pendingMsgs.customDiscardId);
@@ -3423,11 +3423,11 @@ class ServerImpl extends TcpDiscoveryImpl {
clearNodeAddedMessage(pendingMsg);
}
- long tstamp0 = U.currentTimeMillis();
+ long tsNanos0 = System.nanoTime();
int res = spi.readReceipt(sock, timeoutHelper.nextTimeoutChunk(ackTimeout0));
- spi.stats.onMessageSent(pendingMsg, tstamp0 - tstamp);
+ spi.stats.onMessageSent(pendingMsg, U.nanosToMillis(tsNanos0 - tsNanos));
if (log.isDebugEnabled())
log.debug("Pending message has been sent to next node [msgId=" + msg.id() +
@@ -3452,7 +3452,7 @@ class ServerImpl extends TcpDiscoveryImpl {
try {
SecurityUtils.serializeVersion(1);
- long tstamp = U.currentTimeMillis();
+ long tsNanos = System.nanoTime();
if (timeoutHelper == null)
timeoutHelper = new IgniteSpiOperationTimeoutHelper(spi, true);
@@ -3470,14 +3470,14 @@ class ServerImpl extends TcpDiscoveryImpl {
msg,
timeoutHelper.nextTimeoutChunk(spi.getSocketTimeout()));
- long tstamp0 = U.currentTimeMillis();
+ long tsNanos0 = System.nanoTime();
int res = spi.readReceipt(sock, timeoutHelper.nextTimeoutChunk(ackTimeout0));
if (latencyCheck && log.isInfoEnabled())
log.info("Latency check message has been acked: " + msg.id());
- spi.stats.onMessageSent(msg, tstamp0 - tstamp);
+ spi.stats.onMessageSent(msg, U.nanosToMillis(tsNanos0 - tsNanos));
onMessageExchanged();
@@ -5447,7 +5447,7 @@ class ServerImpl extends TcpDiscoveryImpl {
}
if (locNodeId.equals(msg.creatorNodeId()) && msg.senderNodeId() == null &&
- U.currentTimeMillis() - locNode.lastUpdateTime() < spi.metricsUpdateFreq) {
+ U.millisSinceNanos(locNode.lastUpdateTimeNanos()) < spi.metricsUpdateFreq) {
if (log.isDebugEnabled())
log.debug("Status check message discarded (local node receives updates).");
@@ -5531,7 +5531,7 @@ class ServerImpl extends TcpDiscoveryImpl {
return;
}
- long tstamp = U.currentTimeMillis();
+ long tsNanos = System.nanoTime();
if (spiStateCopy() == CONNECTED) {
if (msg.hasMetrics()) {
@@ -5543,10 +5543,10 @@ class ServerImpl extends TcpDiscoveryImpl {
Map<Integer, CacheMetrics> cacheMetrics = msg.hasCacheMetrics(nodeId) ?
msg.cacheMetrics().get(nodeId) : Collections.emptyMap();
- updateMetrics(nodeId, metricsSet.metrics(), cacheMetrics, tstamp);
+ updateMetrics(nodeId, metricsSet.metrics(), cacheMetrics, tsNanos);
for (T2<UUID, ClusterMetrics> t : metricsSet.clientMetrics())
- updateMetrics(t.get1(), t.get2(), cacheMetrics, tstamp);
+ updateMetrics(t.get1(), t.get2(), cacheMetrics, tsNanos);
}
}
}
@@ -5579,7 +5579,7 @@ class ServerImpl extends TcpDiscoveryImpl {
if (clientNodeIds.contains(clientNode.id()))
clientNode.clientAliveTime(spi.clientFailureDetectionTimeout());
else {
- if (clientNode.clientAliveTime() == 0L)
+ if (!clientNode.clientAliveTimeSet())
clientNode.clientAliveTime(spi.clientFailureDetectionTimeout());
boolean aliveCheck = clientNode.isClientAlive();
@@ -5613,7 +5613,7 @@ class ServerImpl extends TcpDiscoveryImpl {
sendMessageAcrossRing(msg);
}
else {
- locNode.lastUpdateTime(tstamp);
+ locNode.lastUpdateTimeNanos(tsNanos);
notifyDiscovery(EVT_NODE_METRICS_UPDATED, ring.topologyVersion(), locNode);
}
@@ -5623,12 +5623,12 @@ class ServerImpl extends TcpDiscoveryImpl {
* @param nodeId Node ID.
* @param metrics Metrics.
* @param cacheMetrics Cache metrics.
- * @param tstamp Timestamp.
+ * @param tsNanos Timestamp as returned by {@link System#nanoTime()}.
*/
private void updateMetrics(UUID nodeId,
ClusterMetrics metrics,
Map<Integer, CacheMetrics> cacheMetrics,
- long tstamp)
+ long tsNanos)
{
assert nodeId != null;
assert metrics != null;
@@ -5639,7 +5639,7 @@ class ServerImpl extends TcpDiscoveryImpl {
node.setMetrics(metrics);
node.setCacheMetrics(cacheMetrics);
- node.lastUpdateTime(tstamp);
+ node.lastUpdateTimeNanos(tsNanos);
notifyDiscovery(EVT_NODE_METRICS_UPDATED, ring.topologyVersion(), node);
}
@@ -5981,7 +5981,7 @@ class ServerImpl extends TcpDiscoveryImpl {
* Sends metrics update message if needed.
*/
private void sendMetricsUpdateMessage() {
- long elapsed = (lastTimeMetricsUpdateMsgSent + spi.metricsUpdateFreq) - U.currentTimeMillis();
+ long elapsed = spi.metricsUpdateFreq - U.millisSinceNanos(lastTimeMetricsUpdateMsgSentNanos);
if (elapsed > 0 || !isLocalNodeCoordinator())
return;
@@ -5992,7 +5992,7 @@ class ServerImpl extends TcpDiscoveryImpl {
msgWorker.addMessage(msg);
- lastTimeMetricsUpdateMsgSent = U.currentTimeMillis();
+ lastTimeMetricsUpdateMsgSentNanos = System.nanoTime();
}
/**
@@ -6000,19 +6000,21 @@ class ServerImpl extends TcpDiscoveryImpl {
* than {@link TcpDiscoveryStatusCheckMessage} is sent across the ring.
*/
private void checkMetricsReceiving() {
- if (lastTimeStatusMsgSent < locNode.lastUpdateTime())
- lastTimeStatusMsgSent = locNode.lastUpdateTime();
+ if (lastTimeStatusMsgSentNanos - locNode.lastUpdateTimeNanos() < 0)
+ lastTimeStatusMsgSentNanos = locNode.lastUpdateTimeNanos();
- long updateTime = Math.max(lastTimeStatusMsgSent, lastRingMsgTime);
+ long updateTimeNanos = lastTimeStatusMsgSentNanos - lastRingMsgTimeNanos > 0
+ ? lastTimeStatusMsgSentNanos
+ : lastRingMsgTimeNanos;
- long elapsed = (updateTime + metricsCheckFreq) - U.currentTimeMillis();
+ long elapsed = metricsCheckFreq - U.millisSinceNanos(updateTimeNanos);
if (elapsed > 0)
return;
msgWorker.addMessage(new TcpDiscoveryStatusCheckMessage(locNode, null));
- lastTimeStatusMsgSent = U.currentTimeMillis();
+ lastTimeStatusMsgSentNanos = System.nanoTime();
}
/**
@@ -6022,7 +6024,7 @@ class ServerImpl extends TcpDiscoveryImpl {
Boolean hasRemoteSrvNodes = null;
if (spi.failureDetectionTimeoutEnabled() && !failureThresholdReached &&
- U.currentTimeMillis() - locNode.lastExchangeTime() >= connCheckThreshold &&
+ U.millisSinceNanos(locNode.lastExchangeTimeNanos()) >= connCheckThreshold &&
spiStateCopy() == CONNECTED &&
(hasRemoteSrvNodes = ring.hasRemoteServerNodes())) {
@@ -6160,7 +6162,7 @@ class ServerImpl extends TcpDiscoveryImpl {
blockingSectionEnd();
}
- long tstamp = U.currentTimeMillis();
+ long tsNanos = System.nanoTime();
if (log.isInfoEnabled())
log.info("TCP discovery accepted incoming connection " +
@@ -6178,7 +6180,7 @@ class ServerImpl extends TcpDiscoveryImpl {
reader.start();
- spi.stats.onServerSocketInitialized(U.currentTimeMillis() - tstamp);
+ spi.stats.onServerSocketInitialized(U.millisSinceNanos(tsNanos));
onIdle();
}
@@ -7189,7 +7191,7 @@ class ServerImpl extends TcpDiscoveryImpl {
private volatile ClusterMetrics metrics;
/** Last metrics update message receive time. */
- private volatile long lastMetricsUpdateMsgTime;
+ private volatile long lastMetricsUpdateMsgTimeNanos;
/** */
private final AtomicReference<GridFutureAdapter<Boolean>> pingFut = new AtomicReference<>();
@@ -7210,7 +7212,7 @@ class ServerImpl extends TcpDiscoveryImpl {
this.sock = sock;
this.clientNodeId = clientNodeId;
- lastMetricsUpdateMsgTime = U.currentTimeMillis();
+ lastMetricsUpdateMsgTimeNanos = System.nanoTime();
}
/**
@@ -7231,7 +7233,7 @@ class ServerImpl extends TcpDiscoveryImpl {
* @param metrics New current client metrics.
*/
void metrics(ClusterMetrics metrics) {
- lastMetricsUpdateMsgTime = U.currentTimeMillis();
+ lastMetricsUpdateMsgTimeNanos = System.nanoTime();
this.metrics = metrics;
}
@@ -7416,7 +7418,7 @@ class ServerImpl extends TcpDiscoveryImpl {
/** {@inheritDoc} */
@Override protected void noMessageLoop() {
- if (U.currentTimeMillis() - lastMetricsUpdateMsgTime > spi.clientFailureDetectionTimeout()) {
+ if (U.millisSinceNanos(lastMetricsUpdateMsgTimeNanos) > spi.clientFailureDetectionTimeout()) {
TcpDiscoveryNode clientNode = ring.node(clientNodeId);
if (clientNode != null) {
@@ -7676,13 +7678,13 @@ class ServerImpl extends TcpDiscoveryImpl {
private int failedNodes;
/** */
- private final long failTime;
+ private final long failTimeNanos;
/**
*
*/
CrossRingMessageSendState() {
- failTime = spi.getEffectiveConnectionRecoveryTimeout() + U.currentTimeMillis();
+ failTimeNanos = U.millisToNanos(spi.getEffectiveConnectionRecoveryTimeout()) + System.nanoTime();
}
/**
@@ -7735,7 +7737,7 @@ class ServerImpl extends TcpDiscoveryImpl {
if (--failedNodes <= 0) {
failedNodes = 0;
- if (U.currentTimeMillis() >= failTime) {
+ if (System.nanoTime() - failTimeNanos >= 0) {
state = RingMessageSendState.FAILED;
return false;
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryImpl.java
index 0862614..bbd78fe 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryImpl.java
@@ -350,9 +350,11 @@ abstract class TcpDiscoveryImpl {
* @throws IgniteSpiException If failed.
*/
protected final void registerLocalNodeAddress() throws IgniteSpiException {
+ long spiJoinTimeout = spi.getJoinTimeout();
+
// Make sure address registration succeeded.
// ... but limit it if join timeout is configured.
- long start = spi.getJoinTimeout() > 0 ? U.currentTimeMillis() : 0;
+ long startNanos = spiJoinTimeout > 0 ? System.nanoTime() : 0;
while (true) {
try {
@@ -372,12 +374,12 @@ abstract class TcpDiscoveryImpl {
"change 'reconnectDelay' to configure the frequency of retries).");
};
- if (start > 0 && (U.currentTimeMillis() - start) > spi.getJoinTimeout())
+ if (spiJoinTimeout > 0 && U.millisSinceNanos(startNanos) > spiJoinTimeout)
throw new IgniteSpiException(
"Failed to register local addresses with IP finder within join timeout " +
"(make sure IP finder configuration is correct, and operating system firewalls are disabled " +
"on all host machines, or consider increasing 'joinTimeout' configuration property) " +
- "[joinTimeout=" + spi.getJoinTimeout() + ']');
+ "[joinTimeout=" + spiJoinTimeout + ']');
try {
U.sleep(spi.getReconnectDelay());
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java
index 7db5036..325a1691 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java
@@ -104,11 +104,15 @@ public class TcpDiscoveryNode extends GridMetadataAwareAdapter implements Ignite
/** The most recent time when metrics update message was received from the node. */
@GridToStringExclude
- private volatile long lastUpdateTime = U.currentTimeMillis();
+ private volatile long lastUpdateTimeNanos = System.nanoTime();
/** The most recent time when node exchanged a message with a remote node. */
private volatile long lastExchangeTime = U.currentTimeMillis();
+ /** Same as {@link #lastExchangeTime} but as returned by {@link System#nanoTime()} */
+ @GridToStringExclude
+ private volatile long lastExchangeTimeNanos = System.nanoTime();
+
/** Metrics provider (transient). */
@GridToStringExclude
private DiscoveryMetricsProvider metricsProvider;
@@ -125,7 +129,7 @@ public class TcpDiscoveryNode extends GridMetadataAwareAdapter implements Ignite
/** Alive check time (used by clients). */
@GridToStringExclude
- private transient volatile long aliveCheckTime;
+ private transient volatile long aliveCheckTimeNanos;
/** Client router node ID. */
@GridToStringExclude
@@ -409,41 +413,55 @@ public class TcpDiscoveryNode extends GridMetadataAwareAdapter implements Ignite
}
/**
- * Gets node last update time.
+ * Gets node last update time. Used for logging purposes only.<br/>
+ * Note that this method tries to convert {@code nanoTime} internal JVM time format into a regular timestamp.
+ * This might lead to errors if there was GC between measuring of current timestamp and current nano time,
+ * but generally it might be ignored.
*
* @return Time of the last metrics update.
+ * @see System#currentTimeMillis()
+ * @see System#nanoTime()
*/
public long lastUpdateTime() {
- return lastUpdateTime;
+ return System.currentTimeMillis() - U.nanosToMillis(System.nanoTime() - lastUpdateTimeNanos);
}
/**
- * Sets node last update.
+ * Gets node last update time.
*
- * @param lastUpdateTime Time of last metrics update.
+ * @return Time of the last metrics update as returned by {@link System#nanoTime()}.
*/
- public void lastUpdateTime(long lastUpdateTime) {
- assert lastUpdateTime > 0;
+ public long lastUpdateTimeNanos() {
+ return lastUpdateTimeNanos;
+ }
- this.lastUpdateTime = lastUpdateTime;
+ /**
+ * Sets node last update.
+ *
+ * @param lastUpdateTimeNanos Time of last metrics update.
+ */
+ public void lastUpdateTimeNanos(long lastUpdateTimeNanos) {
+ this.lastUpdateTimeNanos = lastUpdateTimeNanos;
}
/**
* Gets the last time a node exchanged a message with a remote node.
*
- * @return Time in milliseconds.
+ * @return Time in nanoseconds as returned by {@link System#nanoTime()}.
*/
- public long lastExchangeTime() {
- return lastExchangeTime;
+ public long lastExchangeTimeNanos() {
+ return lastExchangeTimeNanos;
}
/**
* Sets the last time a node exchanged a message with a remote node.
*
* @param lastExchangeTime Time in milliseconds.
+ * @param lastExchangeTimeNanos Time in nanoseconds.
*/
- public void lastExchangeTime(long lastExchangeTime) {
+ public void lastExchangeTime(long lastExchangeTime, long lastExchangeTimeNanos) {
this.lastExchangeTime = lastExchangeTime;
+ this.lastExchangeTimeNanos = lastExchangeTimeNanos;
}
/**
@@ -485,7 +503,7 @@ public class TcpDiscoveryNode extends GridMetadataAwareAdapter implements Ignite
public boolean isClientAlive() {
assert isClient() : this;
- return (aliveCheckTime - U.currentTimeMillis()) >= 0;
+ return (aliveCheckTimeNanos - System.nanoTime()) >= 0;
}
/**
@@ -496,14 +514,14 @@ public class TcpDiscoveryNode extends GridMetadataAwareAdapter implements Ignite
public void clientAliveTime(long aliveTime) {
assert isClient() : this;
- this.aliveCheckTime = U.currentTimeMillis() + aliveTime;
+ aliveCheckTimeNanos = System.nanoTime() + U.millisToNanos(aliveTime);
}
/**
- * @return Client alive check time.
+ * @return {@code true} if client alive check time initialized.
*/
- public long clientAliveTime() {
- return aliveCheckTime;
+ public boolean clientAliveTimeSet() {
+ return aliveCheckTimeNanos != 0;
}
/**
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNodesRing.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNodesRing.java
index d1b18d3..fdb9997 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNodesRing.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNodesRing.java
@@ -237,7 +237,7 @@ public class TcpDiscoveryNodesRing {
nodes = new TreeSet<>(nodes);
- node.lastUpdateTime(U.currentTimeMillis());
+ node.lastUpdateTimeNanos(System.nanoTime());
nodes.add(node);
@@ -310,7 +310,7 @@ public class TcpDiscoveryNodesRing {
firstAdd = false;
}
- node.lastUpdateTime(U.currentTimeMillis());
+ node.lastUpdateTimeNanos(System.nanoTime());
this.nodes.add(node);
}
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
index 246992b..d33f9bc 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
@@ -605,10 +605,10 @@ public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder {
continue;
}
- long rcvEnd = U.currentTimeMillis() + resWaitTime;
+ long rcvStartNanos = System.nanoTime();
try {
- while (U.currentTimeMillis() < rcvEnd) { // Try to receive multiple responses.
+ while (U.millisSinceNanos(rcvStartNanos) < resWaitTime) { // Try to receive multiple responses.
sock.receive(resPckt);
byte[] data = resPckt.getData();
diff --git a/modules/core/src/test/java/org/apache/ignite/ClassPathContentLoggingTest.java b/modules/core/src/test/java/org/apache/ignite/ClassPathContentLoggingTest.java
index ee2260d..6777d92 100644
--- a/modules/core/src/test/java/org/apache/ignite/ClassPathContentLoggingTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/ClassPathContentLoggingTest.java
@@ -28,11 +28,13 @@ import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.junit.Test;
import static org.apache.ignite.IgniteSystemProperties.IGNITE_LOG_CLASSPATH_CONTENT_ON_STARTUP;
+import static org.apache.ignite.IgniteSystemProperties.IGNITE_QUIET;
/**
*
*/
@WithSystemProperty(key = IGNITE_LOG_CLASSPATH_CONTENT_ON_STARTUP, value = "true")
+@WithSystemProperty(key = IGNITE_QUIET, value = "false")
public class ClassPathContentLoggingTest extends GridCommonAbstractTest {
/** */
private final ListeningTestLogger listeningLog = new ListeningTestLogger(false, log);
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridCancelOnGridStopSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridCancelOnGridStopSelfTest.java
index ec7dd33..b921106 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridCancelOnGridStopSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridCancelOnGridStopSelfTest.java
@@ -31,6 +31,7 @@ import org.apache.ignite.compute.ComputeTaskAdapter;
import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.testframework.junits.common.GridCommonTest;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.junit.Test;
@@ -78,7 +79,7 @@ public class GridCancelOnGridStopSelfTest extends GridCommonAbstractTest {
private Ignite ignite;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable String arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable String arg) {
for (ClusterNode node : subgrid) {
if (node.id().equals(ignite.configuration().getNodeId())) {
return Collections.singletonMap(new ComputeJob() {
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridContinuousJobAnnotationSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridContinuousJobAnnotationSelfTest.java
index 8277d72..4f9fd4a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridContinuousJobAnnotationSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridContinuousJobAnnotationSelfTest.java
@@ -40,6 +40,7 @@ import org.apache.ignite.internal.util.typedef.X;
import org.apache.ignite.resources.TaskContinuousMapperResource;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.testframework.junits.common.GridCommonTest;
+import org.jetbrains.annotations.NotNull;
import org.junit.Test;
/**
@@ -119,7 +120,7 @@ public class GridContinuousJobAnnotationSelfTest extends GridCommonAbstractTest
private ComputeTaskContinuousMapper mapper;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) {
try {
mapper.send(((Class<ComputeJob>)arg).newInstance());
}
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridContinuousTaskSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridContinuousTaskSelfTest.java
index 27232f9..37c2a0c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridContinuousTaskSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridContinuousTaskSelfTest.java
@@ -54,6 +54,7 @@ import org.apache.ignite.resources.TaskSessionResource;
import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.testframework.junits.common.GridCommonTest;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.junit.Test;
@@ -223,7 +224,7 @@ public class GridContinuousTaskSelfTest extends GridCommonAbstractTest {
@GridInternal
public static class NestedHoldccTask extends ComputeTaskAdapter<String, String> {
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable String arg) throws IgniteException {
Map<ComputeJob, ClusterNode> map = new HashMap<>();
@@ -361,7 +362,7 @@ public class GridContinuousTaskSelfTest extends GridCommonAbstractTest {
private int cnt;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Boolean arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Boolean arg) {
assert mapper != null;
assert arg != null;
@@ -537,7 +538,7 @@ public class GridContinuousTaskSelfTest extends GridCommonAbstractTest {
private int cnt;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) {
mapper.send(new TestJob(++cnt));
try {
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridDeploymentMultiThreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridDeploymentMultiThreadedSelfTest.java
index 3f6ca35..7c0a9bc 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridDeploymentMultiThreadedSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridDeploymentMultiThreadedSelfTest.java
@@ -31,6 +31,7 @@ import org.apache.ignite.compute.ComputeTaskAdapter;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.jetbrains.annotations.NotNull;
import org.junit.Test;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
@@ -114,7 +115,7 @@ public class GridDeploymentMultiThreadedSelfTest extends GridCommonAbstractTest
*/
private static class GridDeploymentTestTask extends ComputeTaskAdapter<Object, Object> {
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) {
assert false;
return Collections.emptyMap();
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridDeploymentSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridDeploymentSelfTest.java
index 51485c4..f7f57da 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridDeploymentSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridDeploymentSelfTest.java
@@ -40,6 +40,7 @@ import org.apache.ignite.spi.IgniteSpiException;
import org.apache.ignite.spi.deployment.local.LocalDeploymentSpi;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.testframework.junits.common.GridCommonTest;
+import org.jetbrains.annotations.NotNull;
import org.junit.Test;
import static org.apache.ignite.events.EventType.EVT_TASK_DEPLOYED;
@@ -376,7 +377,7 @@ public class GridDeploymentSelfTest extends GridCommonAbstractTest {
private IgniteLogger log;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) {
Map<ComputeJobAdapter, ClusterNode> map = new HashMap<>(subgrid.size());
for (ClusterNode node : subgrid) {
@@ -409,7 +410,7 @@ public class GridDeploymentSelfTest extends GridCommonAbstractTest {
private IgniteLogger log;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) {
Map<ComputeJobAdapter, ClusterNode> map = new HashMap<>(subgrid.size());
for (ClusterNode node : subgrid) {
@@ -441,7 +442,7 @@ public class GridDeploymentSelfTest extends GridCommonAbstractTest {
private IgniteLogger log;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) {
Map<ComputeJobAdapter, ClusterNode> map = new HashMap<>(subgrid.size());
for (ClusterNode node : subgrid) {
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridFailoverCustomTopologySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridFailoverCustomTopologySelfTest.java
index 0ed6855..0afc274 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridFailoverCustomTopologySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridFailoverCustomTopologySelfTest.java
@@ -40,6 +40,7 @@ import org.apache.ignite.spi.failover.FailoverContext;
import org.apache.ignite.spi.failover.always.AlwaysFailoverSpi;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.testframework.junits.common.GridCommonTest;
+import org.jetbrains.annotations.NotNull;
import org.junit.Test;
/**
@@ -137,7 +138,7 @@ public class GridFailoverCustomTopologySelfTest extends GridCommonAbstractTest {
private Ignite ignite;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, String arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, String arg) {
assert ignite != null;
UUID locNodeId = ignite.configuration().getNodeId();
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridFailoverSelfTest.java
index 4601f1e..7fa5d0f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridFailoverSelfTest.java
@@ -40,6 +40,7 @@ import org.apache.ignite.resources.TaskSessionResource;
import org.apache.ignite.spi.failover.always.AlwaysFailoverSpi;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.testframework.junits.common.GridCommonTest;
+import org.jetbrains.annotations.NotNull;
import org.junit.Test;
/**
@@ -97,7 +98,7 @@ public class GridFailoverSelfTest extends GridCommonAbstractTest {
private ComputeTaskSession ses;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, String arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, String arg) {
ses.setAttribute("fail", true);
nodeRef.set(subgrid.get(0));
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridFailoverTaskWithPredicateSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridFailoverTaskWithPredicateSelfTest.java
index b986fc8..d2bd07b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridFailoverTaskWithPredicateSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridFailoverTaskWithPredicateSelfTest.java
@@ -43,6 +43,7 @@ import org.apache.ignite.spi.failover.FailoverContext;
import org.apache.ignite.spi.failover.always.AlwaysFailoverSpi;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.testframework.junits.common.GridCommonTest;
+import org.jetbrains.annotations.NotNull;
import org.junit.Test;
/**
@@ -215,7 +216,7 @@ public class GridFailoverTaskWithPredicateSelfTest extends GridCommonAbstractTes
private ComputeTaskSession ses;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, String arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, String arg) {
ses.setAttribute("fail", true);
return Collections.singletonMap(new ComputeJobAdapter(arg) {
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridFailoverTopologySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridFailoverTopologySelfTest.java
index 1ae2e9d..6be7b9c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridFailoverTopologySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridFailoverTopologySelfTest.java
@@ -37,6 +37,7 @@ import org.apache.ignite.spi.failover.FailoverContext;
import org.apache.ignite.spi.failover.always.AlwaysFailoverSpi;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.testframework.junits.common.GridCommonTest;
+import org.jetbrains.annotations.NotNull;
import org.junit.Test;
/**
@@ -127,7 +128,7 @@ public class GridFailoverTopologySelfTest extends GridCommonAbstractTest {
private boolean jobFailedOver;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, String arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, String arg) {
assert ignite != null;
UUID locNodeId = ignite.configuration().getNodeId();
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridJobCheckpointCleanupSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridJobCheckpointCleanupSelfTest.java
index cfecbb0..b0dc230 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridJobCheckpointCleanupSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridJobCheckpointCleanupSelfTest.java
@@ -37,6 +37,7 @@ import org.apache.ignite.spi.IgniteSpiMultipleInstancesSupport;
import org.apache.ignite.spi.checkpoint.CheckpointListener;
import org.apache.ignite.spi.checkpoint.CheckpointSpi;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.junit.Test;
@@ -145,7 +146,7 @@ public class GridJobCheckpointCleanupSelfTest extends GridCommonAbstractTest {
@ComputeTaskSessionFullSupport
private static class CheckpointCountingTestTask extends ComputeTaskAdapter<ClusterNode, Object> {
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable ClusterNode arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable ClusterNode arg) {
for (ClusterNode node : subgrid) {
if (node.id().equals(arg.id()))
return Collections.singletonMap(new ComputeJobAdapter() {
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridJobStealingSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridJobStealingSelfTest.java
index 9c45bc3..1d01282 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridJobStealingSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridJobStealingSelfTest.java
@@ -49,6 +49,7 @@ import org.apache.ignite.spi.failover.jobstealing.JobStealingFailoverSpi;
import org.apache.ignite.testframework.config.GridTestProperties;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.testframework.junits.common.GridCommonTest;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.junit.Test;
@@ -346,7 +347,7 @@ public class GridJobStealingSelfTest extends GridCommonAbstractTest {
}
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable Object arg) {
//assert subgrid.size() == 2 : "Invalid subgrid size: " + subgrid.size();
@@ -394,7 +395,7 @@ public class GridJobStealingSelfTest extends GridCommonAbstractTest {
}
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Object arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Object arg) {
assert subgrid.size() > 1 : "Invalid subgrid size: " + subgrid.size();
Map<ComputeJobAdapter, ClusterNode> map = new HashMap<>(subgrid.size());
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridJobStealingZeroActiveJobsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridJobStealingZeroActiveJobsSelfTest.java
index 671d29d..a9d90d0 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridJobStealingZeroActiveJobsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridJobStealingZeroActiveJobsSelfTest.java
@@ -38,6 +38,7 @@ import org.apache.ignite.spi.collision.jobstealing.JobStealingCollisionSpi;
import org.apache.ignite.spi.failover.jobstealing.JobStealingFailoverSpi;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.testframework.junits.common.GridCommonTest;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.junit.Test;
@@ -115,7 +116,7 @@ public class GridJobStealingZeroActiveJobsSelfTest extends GridCommonAbstractTes
private IgniteLogger log;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Object arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Object arg) {
assert subgrid.size() == 2 : "Invalid subgrid size: " + subgrid.size();
Map<ComputeJobAdapter, ClusterNode> map = new HashMap<>(subgrid.size());
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridJobSubjectIdSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridJobSubjectIdSelfTest.java
index a8e1fcd..c932b7c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridJobSubjectIdSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridJobSubjectIdSelfTest.java
@@ -35,6 +35,7 @@ import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.lang.IgnitePredicate;
import org.apache.ignite.resources.TaskSessionResource;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.junit.Test;
@@ -159,7 +160,7 @@ public class GridJobSubjectIdSelfTest extends GridCommonAbstractTest {
}
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable Object arg) {
taskSubjId = ((GridTaskSessionInternal)ses).subjectId();
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridMultipleSpisSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridMultipleSpisSelfTest.java
index bf451d9..b8a7cfe 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridMultipleSpisSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridMultipleSpisSelfTest.java
@@ -42,6 +42,7 @@ import org.apache.ignite.spi.failover.always.AlwaysFailoverSpi;
import org.apache.ignite.spi.loadbalancing.roundrobin.RoundRobinLoadBalancingSpi;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.testframework.junits.common.GridCommonTest;
+import org.jetbrains.annotations.NotNull;
import org.junit.Test;
/**
@@ -250,7 +251,7 @@ public class GridMultipleSpisSelfTest extends GridCommonAbstractTest {
private Ignite ignite;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, UUID arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, UUID arg) {
assert subgrid.size() == 2;
assert taskSes != null;
assert ignite != null;
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridMultipleVersionsDeploymentSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridMultipleVersionsDeploymentSelfTest.java
index b4538c8..ea1af2e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridMultipleVersionsDeploymentSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridMultipleVersionsDeploymentSelfTest.java
@@ -44,6 +44,7 @@ import org.apache.ignite.resources.LoggerResource;
import org.apache.ignite.testframework.GridTestClassLoader;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.testframework.junits.common.GridCommonTest;
+import org.jetbrains.annotations.NotNull;
import org.junit.Test;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
@@ -253,7 +254,7 @@ public class GridMultipleVersionsDeploymentSelfTest extends GridCommonAbstractTe
private Ignite ignite;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) {
Map<ComputeJobAdapter, ClusterNode> map = new HashMap<>(subgrid.size());
boolean ignoreLocNode = false;
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridMultithreadedJobStealingSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridMultithreadedJobStealingSelfTest.java
index 00dc35a..eecf4bc 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridMultithreadedJobStealingSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridMultithreadedJobStealingSelfTest.java
@@ -46,6 +46,7 @@ import org.apache.ignite.spi.failover.jobstealing.JobStealingFailoverSpi;
import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.testframework.junits.common.GridCommonTest;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.junit.Test;
@@ -244,7 +245,7 @@ public class GridMultithreadedJobStealingSelfTest extends GridCommonAbstractTest
}
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable Object arg) {
assert subgrid.size() == 2 : "Invalid subgrid size: " + subgrid.size();
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridRuntimeExceptionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridRuntimeExceptionSelfTest.java
index 71be673..dd37333 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridRuntimeExceptionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridRuntimeExceptionSelfTest.java
@@ -40,6 +40,7 @@ import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.resources.LoggerResource;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.testframework.junits.common.GridCommonTest;
+import org.jetbrains.annotations.NotNull;
import org.junit.Test;
import static org.apache.ignite.events.EventType.EVT_TASK_FAILED;
@@ -234,7 +235,7 @@ public class GridRuntimeExceptionSelfTest extends GridCommonAbstractTest {
private FailType failType;
/** {@inheritDoc} */
- @SuppressWarnings({"ProhibitedExceptionThrown"})
+ @NotNull @SuppressWarnings({"ProhibitedExceptionThrown"})
@Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Serializable arg) {
if (log.isInfoEnabled())
log.info("Mapping job [job=" + this + ", grid=" + subgrid + ", arg=" + arg + ']');
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridStopWithCancelSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridStopWithCancelSelfTest.java
index b31e261..522ed77 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridStopWithCancelSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridStopWithCancelSelfTest.java
@@ -32,6 +32,7 @@ import org.apache.ignite.compute.ComputeTaskAdapter;
import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.testframework.junits.common.GridCommonTest;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.junit.Test;
@@ -91,7 +92,7 @@ public class GridStopWithCancelSelfTest extends GridCommonAbstractTest {
private Ignite ignite;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable String arg) {
for (ClusterNode node : subgrid) {
if (node.id().equals(ignite.configuration().getNodeId())) {
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridStopWithWaitSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridStopWithWaitSelfTest.java
index c042e3a..3d25e87 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridStopWithWaitSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridStopWithWaitSelfTest.java
@@ -48,6 +48,7 @@ import org.apache.ignite.resources.TaskSessionResource;
import org.apache.ignite.spi.failover.always.AlwaysFailoverSpi;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.testframework.junits.common.GridCommonTest;
+import org.jetbrains.annotations.NotNull;
import org.junit.Test;
/**
@@ -153,7 +154,7 @@ public class GridStopWithWaitSelfTest extends GridCommonAbstractTest {
@ComputeTaskSessionFullSupport
private static class GridWaitTask extends ComputeTaskAdapter<UUID, Integer> {
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, UUID arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, UUID arg) {
ClusterNode mappedNode = null;
for (ClusterNode node : subgrid) {
@@ -195,7 +196,7 @@ public class GridStopWithWaitSelfTest extends GridCommonAbstractTest {
private Ignite ignite;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, String arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, String arg) {
ses.setAttribute("fail", true);
ClusterNode node = F.view(subgrid, F.remoteNodes(ignite.configuration().getNodeId())).iterator().next();
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridTaskContinuousMapperSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridTaskContinuousMapperSelfTest.java
index d4c2cdd..baec83d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridTaskContinuousMapperSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridTaskContinuousMapperSelfTest.java
@@ -38,6 +38,7 @@ import org.apache.ignite.resources.LoggerResource;
import org.apache.ignite.resources.TaskContinuousMapperResource;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.testframework.junits.common.GridCommonTest;
+import org.jetbrains.annotations.NotNull;
import org.junit.Test;
/**
@@ -103,7 +104,7 @@ public class GridTaskContinuousMapperSelfTest extends GridCommonAbstractTest {
private int cnt;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) {
assert subgrid.size() == 2;
mapper.send(new TestJob(cnt++), subgrid.get(0));
@@ -159,7 +160,7 @@ public class GridTaskContinuousMapperSelfTest extends GridCommonAbstractTest {
}
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) {
mapper.send(new TestJob());
return null;
@@ -237,7 +238,7 @@ public class GridTaskContinuousMapperSelfTest extends GridCommonAbstractTest {
private IgniteLogger log;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) {
try {
mapper.send(new TestJob(), null);
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridTaskInstantiationSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridTaskInstantiationSelfTest.java
index b7b68b8..df79732 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridTaskInstantiationSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridTaskInstantiationSelfTest.java
@@ -31,6 +31,7 @@ import org.apache.ignite.compute.ComputeTaskAdapter;
import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.testframework.junits.common.GridCommonTest;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.junit.Test;
@@ -75,7 +76,7 @@ public class GridTaskInstantiationSelfTest extends GridCommonAbstractTest {
private Ignite ignite;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable String arg) {
for (ClusterNode node : subgrid)
if (node.id().equals(ignite.configuration().getNodeId()))
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridTaskJobRejectSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridTaskJobRejectSelfTest.java
index a0fba4a..0afead2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridTaskJobRejectSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridTaskJobRejectSelfTest.java
@@ -34,6 +34,7 @@ import org.apache.ignite.internal.util.typedef.X;
import org.apache.ignite.lang.IgnitePredicate;
import org.apache.ignite.spi.collision.fifoqueue.FifoQueueCollisionSpi;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.junit.Test;
@@ -122,7 +123,7 @@ public class GridTaskJobRejectSelfTest extends GridCommonAbstractTest {
final ClusterNode node = grid(1).localNode();
ComputeTaskFuture<?> fut = grid(1).compute().executeAsync(new ComputeTaskAdapter<Void, Void>() {
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable Void arg) {
return F.asMap(new SleepJob(), node, new SleepJob(), node);
}
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridTaskNameAnnotationSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridTaskNameAnnotationSelfTest.java
index fba49d8..04e9393 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridTaskNameAnnotationSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridTaskNameAnnotationSelfTest.java
@@ -31,6 +31,7 @@ import org.apache.ignite.internal.util.lang.GridPeerDeployAware;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.resources.TaskSessionResource;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.junit.Test;
@@ -92,7 +93,7 @@ public class GridTaskNameAnnotationSelfTest extends GridCommonAbstractTest {
@ComputeTaskName(TASK_NAME)
private static class TestTask implements ComputeTask<Void, String> {
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable Void arg) {
return F.asMap(new ComputeJobAdapter() {
@TaskSessionResource
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteComputeResultExceptionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/IgniteComputeResultExceptionTest.java
index a3934e8..f754fa4 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/IgniteComputeResultExceptionTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteComputeResultExceptionTest.java
@@ -30,6 +30,7 @@ import org.apache.ignite.compute.ComputeJobResultPolicy;
import org.apache.ignite.compute.ComputeTask;
import org.apache.ignite.compute.ComputeTaskFuture;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.junit.Test;
@@ -175,7 +176,7 @@ public class IgniteComputeResultExceptionTest extends GridCommonAbstractTest {
}
/** */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable Object arg) throws IgniteException {
Map<ComputeJob, ClusterNode> jobs = new HashMap<>();
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteExplicitImplicitDeploymentSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/IgniteExplicitImplicitDeploymentSelfTest.java
index f08a821..b38ede2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/IgniteExplicitImplicitDeploymentSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteExplicitImplicitDeploymentSelfTest.java
@@ -46,6 +46,7 @@ import org.apache.ignite.resources.LoggerResource;
import org.apache.ignite.testframework.GridTestClassLoader;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.testframework.junits.common.GridCommonTest;
+import org.jetbrains.annotations.NotNull;
import org.junit.Test;
/**
@@ -418,7 +419,7 @@ public class IgniteExplicitImplicitDeploymentSelfTest extends GridCommonAbstract
private Ignite ignite;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, String arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, String arg) {
Map<ComputeJobAdapter, ClusterNode> map = new HashMap<>(subgrid.size());
boolean ignoreLocNode = false;
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/TaskNodeRestartTest.java b/modules/core/src/test/java/org/apache/ignite/internal/TaskNodeRestartTest.java
index ef3a6fb..14dd933 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/TaskNodeRestartTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/TaskNodeRestartTest.java
@@ -39,6 +39,7 @@ import org.apache.ignite.lang.IgniteCallable;
import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.junit.Test;
@@ -153,7 +154,7 @@ public class TaskNodeRestartTest extends GridCommonAbstractTest {
*/
private static class TestTask1 extends ComputeTaskAdapter<Void, Void> {
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Void arg)
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Void arg)
throws IgniteException {
Map<TestJob, ClusterNode> jobs = new HashMap<>();
@@ -174,7 +175,7 @@ public class TaskNodeRestartTest extends GridCommonAbstractTest {
*/
private static class TestTask2 implements ComputeTask<Void, Void> {
/** {@inheritDoc} */
- @Override @Nullable public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Void arg)
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Void arg)
throws IgniteException {
Map<TestJob, ClusterNode> jobs = new HashMap<>();
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/managers/checkpoint/GridCheckpointTaskSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/managers/checkpoint/GridCheckpointTaskSelfTest.java
index c4d1154..a9db0ae 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/managers/checkpoint/GridCheckpointTaskSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/managers/checkpoint/GridCheckpointTaskSelfTest.java
@@ -37,6 +37,7 @@ import org.apache.ignite.resources.TaskSessionResource;
import org.apache.ignite.spi.checkpoint.CheckpointSpi;
import org.apache.ignite.spi.checkpoint.cache.CacheCheckpointSpi;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.junit.Test;
@@ -131,7 +132,7 @@ public class GridCheckpointTaskSelfTest extends GridCommonAbstractTest {
private ComputeTaskSession ses;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable Void arg) {
assert ignite.cluster().nodes().size() == 2;
@@ -188,7 +189,7 @@ public class GridCheckpointTaskSelfTest extends GridCommonAbstractTest {
private ComputeTaskSession ses;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable Void arg) {
assert ignite.cluster().nodes().size() == 2;
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllTask.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllTask.java
index e4255f4..ce17bba 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllTask.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllTask.java
@@ -40,6 +40,7 @@ import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgnitePredicate;
import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.resources.LoggerResource;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
@@ -69,7 +70,7 @@ class GridCachePutAllTask extends ComputeTaskAdapter<Collection<Integer>, Void>
}
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable final Collection<Integer> data) {
assert !subgrid.isEmpty();
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgniteRebalanceScheduleResendPartitionsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgniteRebalanceScheduleResendPartitionsTest.java
index 5b5a2281..0259c68 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgniteRebalanceScheduleResendPartitionsTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgniteRebalanceScheduleResendPartitionsTest.java
@@ -139,17 +139,20 @@ public class IgniteRebalanceScheduleResendPartitionsTest extends GridCommonAbstr
AtomicInteger cnt = new AtomicInteger();
- CountDownLatch latch = new CountDownLatch(1);
+ CountDownLatch awaitlatch = new CountDownLatch(1);
+ AtomicBoolean done = new AtomicBoolean();
runAsync(() -> {
try {
- latch.await();
+ awaitlatch.await();
// Sleep should be less that full awaitPartitionMapExchange().
Thread.sleep(super.getPartitionMapExchangeTimeout());
log.info("Await completed, continue rebalance.");
+ done.set(true);
+
unwrapSPI(ig3).resume();
}
catch (InterruptedException ignored) {
@@ -166,10 +169,13 @@ public class IgniteRebalanceScheduleResendPartitionsTest extends GridCommonAbstr
// Continue after baseline changed exchange occurred.
if (msg.exchangeId() != null)
- latch.countDown();
+ awaitlatch.countDown();
+
+ if (!done.get() && prevMessageComparator.prevEquals(msg)) {
+ System.out.println("Equals messages, prev=" + prevMessageComparator.prev + " , curr=" + msg);
- if (prevMessageComparator.prevEquals(msg))
cnt.incrementAndGet();
+ }
});
ig3.cluster().setBaselineTopology(ig3.context().discovery().topologyVersion());
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/IgniteCheckpointDirtyPagesForLowLoadTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/IgniteCheckpointDirtyPagesForLowLoadTest.java
index a38a7b6..5e690e5 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/IgniteCheckpointDirtyPagesForLowLoadTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/checkpoint/IgniteCheckpointDirtyPagesForLowLoadTest.java
@@ -148,7 +148,7 @@ public class IgniteCheckpointDirtyPagesForLowLoadTest extends GridCommonAbstract
db.wakeupForCheckpoint("").get(cpTimeout, TimeUnit.MILLISECONDS);
}
catch (IgniteFutureTimeoutCheckedException ignored) {
- long msPassed = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start);
+ long msPassed = U.millisSinceNanos(start);
log.error("Timeout during waiting for checkpoint to start:" +
" [" + msPassed + "] but checkpoint is not running");
@@ -199,7 +199,7 @@ public class IgniteCheckpointDirtyPagesForLowLoadTest extends GridCommonAbstract
long start = System.currentTimeMillis();
while (currCpPages == 0) {
- LockSupport.parkNanos(TimeUnit.MILLISECONDS.toNanos(1));
+ LockSupport.parkNanos(U.millisToNanos(1));
currCpPages = db.currentCheckpointPagesCount();
if (currCpPages == 0 && ((System.currentTimeMillis() - start) > timeout))
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/memtracker/PageMemoryTracker.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/memtracker/PageMemoryTracker.java
index 181ceb4..d8a0c3d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/memtracker/PageMemoryTracker.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/memtracker/PageMemoryTracker.java
@@ -465,8 +465,8 @@ public class PageMemoryTracker implements IgnitePlugin {
page.lock();
- try {
- GridUnsafe.copyMemory(GridUnsafe.bufferAddress(snapshot.pageDataBuffer()), page.address(), pageSize);
+ try {
+ GridUnsafe.copyHeapOffheap(snapshot.pageData(), GridUnsafe.BYTE_ARR_OFF, page.address(), pageSize);
page.changeHistory().clear();
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/scanner/WalScannerTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/scanner/WalScannerTest.java
index 0081d3a..4ba50cd 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/scanner/WalScannerTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/scanner/WalScannerTest.java
@@ -26,6 +26,7 @@ import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
+import java.util.stream.Collectors;
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.internal.pagemem.FullPageId;
import org.apache.ignite.internal.pagemem.wal.WALIterator;
@@ -310,6 +311,10 @@ public class WalScannerTest {
targetFile.delete();
}
+ actualFileRecords = actualFileRecords.stream()
+ .filter(it -> it.startsWith("Next WAL record ::"))
+ .collect(Collectors.toList());
+
// then: Should be find only expected value from file.
assertEquals(actualFileRecords.size(), 3);
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/GridCountDownCallbackTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/GridCountDownCallbackTest.java
index aea9ed1..72eabf9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/util/GridCountDownCallbackTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/util/GridCountDownCallbackTest.java
@@ -48,11 +48,9 @@ public class GridCountDownCallbackTest {
ExecutorService es = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
for (int i = 1; i < 100; i++) {
- final int fi = i;
-
es.submit(() -> {
synchronized (es) {
- cntr.incrementAndGet();
+ int fi = cntr.incrementAndGet();
if (fi % 5 == 0)
performedCntr.incrementAndGet();
diff --git a/modules/core/src/test/java/org/apache/ignite/loadtests/direct/multisplit/GridLoadTestTask.java b/modules/core/src/test/java/org/apache/ignite/loadtests/direct/multisplit/GridLoadTestTask.java
index e8498a5..0e4075d 100644
--- a/modules/core/src/test/java/org/apache/ignite/loadtests/direct/multisplit/GridLoadTestTask.java
+++ b/modules/core/src/test/java/org/apache/ignite/loadtests/direct/multisplit/GridLoadTestTask.java
@@ -32,6 +32,7 @@ import org.apache.ignite.compute.ComputeTaskAdapter;
import org.apache.ignite.compute.ComputeTaskSession;
import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.resources.TaskSessionResource;
+import org.jetbrains.annotations.NotNull;
/**
* Load test task.
@@ -47,7 +48,7 @@ public class GridLoadTestTask extends ComputeTaskAdapter<Integer, Integer> {
private Ignite ignite;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Integer arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Integer arg) {
assert arg != null;
assert arg > 1;
diff --git a/modules/core/src/test/java/org/apache/ignite/loadtests/direct/newnodes/GridSingleSplitNewNodesTestTask.java b/modules/core/src/test/java/org/apache/ignite/loadtests/direct/newnodes/GridSingleSplitNewNodesTestTask.java
index c9a6819..de31e5e 100644
--- a/modules/core/src/test/java/org/apache/ignite/loadtests/direct/newnodes/GridSingleSplitNewNodesTestTask.java
+++ b/modules/core/src/test/java/org/apache/ignite/loadtests/direct/newnodes/GridSingleSplitNewNodesTestTask.java
@@ -33,6 +33,7 @@ import org.apache.ignite.compute.ComputeTaskAdapter;
import org.apache.ignite.compute.ComputeTaskSession;
import org.apache.ignite.resources.LoadBalancerResource;
import org.apache.ignite.resources.TaskSessionResource;
+import org.jetbrains.annotations.NotNull;
/**
* Single split on new nodes test task.
@@ -47,7 +48,7 @@ public class GridSingleSplitNewNodesTestTask extends ComputeTaskAdapter<Integer,
private ComputeLoadBalancer balancer;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Integer arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Integer arg) {
assert !subgrid.isEmpty() : "Subgrid cannot be empty.";
Map<ComputeJobAdapter, ClusterNode> jobs = new HashMap<>(subgrid.size());
diff --git a/modules/core/src/test/java/org/apache/ignite/loadtests/direct/session/GridSessionLoadTestTask.java b/modules/core/src/test/java/org/apache/ignite/loadtests/direct/session/GridSessionLoadTestTask.java
index 287d6bf..bf1055b 100644
--- a/modules/core/src/test/java/org/apache/ignite/loadtests/direct/session/GridSessionLoadTestTask.java
+++ b/modules/core/src/test/java/org/apache/ignite/loadtests/direct/session/GridSessionLoadTestTask.java
@@ -34,6 +34,7 @@ import org.apache.ignite.compute.ComputeTaskAdapter;
import org.apache.ignite.compute.ComputeTaskSession;
import org.apache.ignite.resources.LoggerResource;
import org.apache.ignite.resources.TaskSessionResource;
+import org.jetbrains.annotations.NotNull;
/**
* Session load test task.
@@ -51,7 +52,7 @@ public class GridSessionLoadTestTask extends ComputeTaskAdapter<Integer, Boolean
private Map<String, Integer> params;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Integer arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Integer arg) {
assert taskSes != null;
assert arg != null;
assert arg > 0;
diff --git a/modules/core/src/test/java/org/apache/ignite/loadtests/direct/stealing/GridStealingLoadTestTask.java b/modules/core/src/test/java/org/apache/ignite/loadtests/direct/stealing/GridStealingLoadTestTask.java
index 34cee2e..b6512a8 100644
--- a/modules/core/src/test/java/org/apache/ignite/loadtests/direct/stealing/GridStealingLoadTestTask.java
+++ b/modules/core/src/test/java/org/apache/ignite/loadtests/direct/stealing/GridStealingLoadTestTask.java
@@ -30,6 +30,7 @@ import org.apache.ignite.compute.ComputeJobResult;
import org.apache.ignite.compute.ComputeTaskAdapter;
import org.apache.ignite.compute.ComputeTaskSession;
import org.apache.ignite.resources.TaskSessionResource;
+import org.jetbrains.annotations.NotNull;
/**
* Stealing load test task.
@@ -46,7 +47,7 @@ public class GridStealingLoadTestTask extends ComputeTaskAdapter<UUID, Integer>
private int stolenJobs;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, UUID arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, UUID arg) {
assert arg != null;
assert subgrid.size() > 1: "Test requires at least 2 nodes. One with load and another one to steal.";
diff --git a/modules/core/src/test/java/org/apache/ignite/loadtests/job/GridJobExecutionLoadTestTask.java b/modules/core/src/test/java/org/apache/ignite/loadtests/job/GridJobExecutionLoadTestTask.java
index f1b1834..355b5f7 100644
--- a/modules/core/src/test/java/org/apache/ignite/loadtests/job/GridJobExecutionLoadTestTask.java
+++ b/modules/core/src/test/java/org/apache/ignite/loadtests/job/GridJobExecutionLoadTestTask.java
@@ -25,6 +25,7 @@ import org.apache.ignite.compute.ComputeJobResult;
import org.apache.ignite.compute.ComputeJobResultPolicy;
import org.apache.ignite.compute.ComputeTask;
import org.apache.ignite.internal.util.typedef.F;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import static org.apache.ignite.compute.ComputeJobResultPolicy.REDUCE;
@@ -34,7 +35,7 @@ import static org.apache.ignite.compute.ComputeJobResultPolicy.REDUCE;
*/
public class GridJobExecutionLoadTestTask implements ComputeTask<Object, Object> {
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Object arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Object arg) {
return F.asMap(new GridJobExecutionLoadTestJob(), subgrid.get(0));
}
diff --git a/modules/core/src/test/java/org/apache/ignite/loadtests/job/GridJobExecutionSingleNodeLoadTest.java b/modules/core/src/test/java/org/apache/ignite/loadtests/job/GridJobExecutionSingleNodeLoadTest.java
index 63fa75e..8dea6df 100644
--- a/modules/core/src/test/java/org/apache/ignite/loadtests/job/GridJobExecutionSingleNodeLoadTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/loadtests/job/GridJobExecutionSingleNodeLoadTest.java
@@ -42,6 +42,7 @@ import org.apache.ignite.internal.util.typedef.X;
import org.apache.ignite.loadtests.util.GridCumulativeAverage;
import org.apache.ignite.testframework.GridFileLock;
import org.apache.ignite.testframework.GridLoadTestUtils;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import static org.apache.ignite.compute.ComputeJobResultPolicy.REDUCE;
@@ -217,7 +218,7 @@ public class GridJobExecutionSingleNodeLoadTest {
*/
private static class GridJobExecutionLoadTestTask implements ComputeTask<Object, Object> {
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Object arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Object arg) {
return F.asMap(new GridJobExecutionLoadTestJob(), subgrid.get(0));
}
diff --git a/modules/core/src/test/java/org/apache/ignite/loadtests/job/GridJobExecutionSingleNodeSemaphoreLoadTest.java b/modules/core/src/test/java/org/apache/ignite/loadtests/job/GridJobExecutionSingleNodeSemaphoreLoadTest.java
index 6502065..c0a0973 100644
--- a/modules/core/src/test/java/org/apache/ignite/loadtests/job/GridJobExecutionSingleNodeSemaphoreLoadTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/loadtests/job/GridJobExecutionSingleNodeSemaphoreLoadTest.java
@@ -43,6 +43,7 @@ import org.apache.ignite.loadtests.util.GridCumulativeAverage;
import org.apache.ignite.testframework.GridFileLock;
import org.apache.ignite.testframework.GridLoadTestUtils;
import org.apache.ignite.testframework.GridTestUtils;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import static org.apache.ignite.compute.ComputeJobResultPolicy.REDUCE;
@@ -200,7 +201,7 @@ public class GridJobExecutionSingleNodeSemaphoreLoadTest {
*/
private static class GridJobExecutionLoadTestTask implements ComputeTask<Object, Object> {
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Object arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Object arg) {
return F.asMap(new GridJobExecutionLoadTestJob(), subgrid.get(0));
}
diff --git a/modules/core/src/test/java/org/apache/ignite/loadtests/job/GridJobLoadTestTask.java b/modules/core/src/test/java/org/apache/ignite/loadtests/job/GridJobLoadTestTask.java
index d6d2519..b548fdf 100644
--- a/modules/core/src/test/java/org/apache/ignite/loadtests/job/GridJobLoadTestTask.java
+++ b/modules/core/src/test/java/org/apache/ignite/loadtests/job/GridJobLoadTestTask.java
@@ -25,6 +25,7 @@ import org.apache.ignite.compute.ComputeJob;
import org.apache.ignite.compute.ComputeJobResult;
import org.apache.ignite.compute.ComputeJobResultPolicy;
import org.apache.ignite.compute.ComputeTaskAdapter;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import static org.apache.ignite.compute.ComputeJobResultPolicy.FAILOVER;
@@ -36,7 +37,7 @@ import static org.apache.ignite.compute.ComputeJobResultPolicy.WAIT;
*/
public class GridJobLoadTestTask extends ComputeTaskAdapter<GridJobLoadTestParams, Integer> {
/**{@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable GridJobLoadTestParams arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable GridJobLoadTestParams arg) {
assert !subgrid.isEmpty();
Map<ComputeJob, ClusterNode> jobs = new HashMap<>();
diff --git a/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PLocalDeploymentSelfTest.java b/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PLocalDeploymentSelfTest.java
index 19a643b..3c8adb4 100644
--- a/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PLocalDeploymentSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PLocalDeploymentSelfTest.java
@@ -43,6 +43,7 @@ import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.testframework.config.GridTestProperties;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.testframework.junits.common.GridCommonTest;
+import org.jetbrains.annotations.NotNull;
import org.junit.Test;
import static org.apache.ignite.IgniteSystemProperties.IGNITE_CACHE_REMOVED_ENTRIES_TTL;
@@ -332,7 +333,7 @@ public class GridP2PLocalDeploymentSelfTest extends GridCommonAbstractTest {
*/
public static class TestTask extends ComputeTaskAdapter<UUID, Serializable> {
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(final List<ClusterNode> subgrid, UUID arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(final List<ClusterNode> subgrid, UUID arg) {
taskLdr = getClass().getClassLoader();
for (ClusterNode node : subgrid) {
diff --git a/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PRecursionTaskSelfTest.java b/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PRecursionTaskSelfTest.java
index 5e49965..c47ac59 100644
--- a/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PRecursionTaskSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PRecursionTaskSelfTest.java
@@ -32,6 +32,7 @@ import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.testframework.junits.common.GridCommonTest;
+import org.jetbrains.annotations.NotNull;
import org.junit.Test;
/**
@@ -141,7 +142,7 @@ public class GridP2PRecursionTaskSelfTest extends GridCommonAbstractTest {
*/
public static class FactorialTask extends ComputeTaskAdapter<Long, Long> {
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Long arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Long arg) {
assert arg > 1;
Map<FactorialJob, ClusterNode> map = new HashMap<>();
diff --git a/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PRemoteClassLoadersSelfTest.java b/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PRemoteClassLoadersSelfTest.java
index 455ca89..67f7655 100644
--- a/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PRemoteClassLoadersSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PRemoteClassLoadersSelfTest.java
@@ -37,6 +37,7 @@ import org.apache.ignite.resources.LoggerResource;
import org.apache.ignite.testframework.GridTestClassLoader;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.testframework.junits.common.GridCommonTest;
+import org.jetbrains.annotations.NotNull;
import org.junit.Test;
/**
@@ -260,7 +261,7 @@ public class GridP2PRemoteClassLoadersSelfTest extends GridCommonAbstractTest {
private Ignite ignite;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Serializable arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Serializable arg) {
Map<ComputeJob, ClusterNode> map = new HashMap<>(subgrid.size());
for (ClusterNode node : subgrid) {
diff --git a/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PTestTask.java b/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PTestTask.java
index ae1836c..bcbc529 100644
--- a/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PTestTask.java
+++ b/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PTestTask.java
@@ -30,6 +30,7 @@ import org.apache.ignite.compute.ComputeTaskAdapter;
import org.apache.ignite.compute.gridify.GridifyArgument;
import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.resources.LoggerResource;
+import org.jetbrains.annotations.NotNull;
/**
* P2P test task.
@@ -47,7 +48,7 @@ public class GridP2PTestTask extends ComputeTaskAdapter<Object, Integer> {
private Ignite ignite;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) {
assert subgrid != null;
assert !subgrid.isEmpty();
diff --git a/modules/core/src/test/java/org/apache/ignite/platform/PlatformCacheWriteMetricsTask.java b/modules/core/src/test/java/org/apache/ignite/platform/PlatformCacheWriteMetricsTask.java
index ee5a5c1..faca537 100644
--- a/modules/core/src/test/java/org/apache/ignite/platform/PlatformCacheWriteMetricsTask.java
+++ b/modules/core/src/test/java/org/apache/ignite/platform/PlatformCacheWriteMetricsTask.java
@@ -32,6 +32,7 @@ import org.apache.ignite.internal.processors.platform.memory.PlatformOutputStrea
import org.apache.ignite.internal.processors.platform.utils.PlatformUtils;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.resources.IgniteInstanceResource;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collections;
@@ -43,7 +44,7 @@ import java.util.Map;
*/
public class PlatformCacheWriteMetricsTask extends ComputeTaskAdapter<Long, Object> {
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Long ptr) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Long ptr) {
return Collections.singletonMap(new Job(ptr), F.first(subgrid));
}
diff --git a/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeBinarizableArgTask.java b/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeBinarizableArgTask.java
index 404f6e5..b3ded5f 100644
--- a/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeBinarizableArgTask.java
+++ b/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeBinarizableArgTask.java
@@ -28,6 +28,7 @@ import org.apache.ignite.compute.ComputeTaskAdapter;
import org.apache.ignite.internal.binary.BinaryObjectEx;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.resources.IgniteInstanceResource;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.Externalizable;
@@ -43,7 +44,7 @@ import java.util.Map;
*/
public class PlatformComputeBinarizableArgTask extends ComputeTaskAdapter<Object, Integer> {
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Object arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Object arg) {
return Collections.singletonMap(new BinarizableArgJob(arg), F.first(subgrid));
}
diff --git a/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeBroadcastTask.java b/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeBroadcastTask.java
index 1336d38..cede4a1 100644
--- a/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeBroadcastTask.java
+++ b/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeBroadcastTask.java
@@ -24,6 +24,7 @@ import org.apache.ignite.compute.ComputeJobAdapter;
import org.apache.ignite.compute.ComputeJobResult;
import org.apache.ignite.compute.ComputeTaskAdapter;
import org.apache.ignite.resources.IgniteInstanceResource;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
@@ -38,7 +39,7 @@ import java.util.UUID;
*/
public class PlatformComputeBroadcastTask extends ComputeTaskAdapter<Object, Collection<UUID>> {
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Object arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Object arg) {
Map<ComputeJob, ClusterNode> jobs = new HashMap<>();
for (ClusterNode node : subgrid)
diff --git a/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeDecimalTask.java b/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeDecimalTask.java
index 8a61fb9..a935f5b 100644
--- a/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeDecimalTask.java
+++ b/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeDecimalTask.java
@@ -24,6 +24,7 @@ import org.apache.ignite.compute.ComputeJobAdapter;
import org.apache.ignite.compute.ComputeJobResult;
import org.apache.ignite.compute.ComputeTaskAdapter;
import org.apache.ignite.internal.util.typedef.F;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.Externalizable;
@@ -38,7 +39,7 @@ import java.util.Map;
@SuppressWarnings({"ConstantConditions"})
public class PlatformComputeDecimalTask extends ComputeTaskAdapter<Object[], BigDecimal> {
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Object[] arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, @Nullable Object[] arg) {
return Collections.singletonMap(new DecimalJob((BigDecimal)arg[0], (String)arg[1]), F.first(subgrid));
}
diff --git a/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeEchoTask.java b/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeEchoTask.java
index 12d9e09..5714f9e 100644
--- a/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeEchoTask.java
+++ b/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeEchoTask.java
@@ -31,6 +31,7 @@ import org.apache.ignite.compute.ComputeJobResult;
import org.apache.ignite.compute.ComputeTaskAdapter;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.resources.IgniteInstanceResource;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collections;
@@ -117,7 +118,7 @@ public class PlatformComputeEchoTask extends ComputeTaskAdapter<Integer, Object>
public static final String DEFAULT_CACHE_NAME = "default";
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable Integer arg) {
return Collections.singletonMap(new EchoJob(arg), F.first(subgrid));
}
diff --git a/modules/core/src/test/java/org/apache/ignite/platform/PlatformDeployServiceTask.java b/modules/core/src/test/java/org/apache/ignite/platform/PlatformDeployServiceTask.java
index 157b600..dda44c4 100644
--- a/modules/core/src/test/java/org/apache/ignite/platform/PlatformDeployServiceTask.java
+++ b/modules/core/src/test/java/org/apache/ignite/platform/PlatformDeployServiceTask.java
@@ -29,6 +29,7 @@ import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.services.Service;
import org.apache.ignite.services.ServiceContext;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
@@ -42,7 +43,7 @@ import java.util.Map;
*/
public class PlatformDeployServiceTask extends ComputeTaskAdapter<String, Object> {
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable String serviceName) throws IgniteException {
return Collections.singletonMap(new PlatformDeployServiceJob(serviceName), F.first(subgrid));
}
diff --git a/modules/core/src/test/java/org/apache/ignite/platform/PlatformEventsWriteEventTask.java b/modules/core/src/test/java/org/apache/ignite/platform/PlatformEventsWriteEventTask.java
index 0c626bb5..3ab18e8 100644
--- a/modules/core/src/test/java/org/apache/ignite/platform/PlatformEventsWriteEventTask.java
+++ b/modules/core/src/test/java/org/apache/ignite/platform/PlatformEventsWriteEventTask.java
@@ -33,6 +33,7 @@ import org.apache.ignite.lang.IgniteUuid;
import org.apache.ignite.events.*;
import org.apache.ignite.resources.IgniteInstanceResource;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collections;
@@ -45,7 +46,7 @@ import java.util.UUID;
*/
public class PlatformEventsWriteEventTask extends ComputeTaskAdapter<Long, Object> {
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
Long ptr) {
return Collections.singletonMap(new Job(ptr, F.first(subgrid)), F.first(subgrid));
}
diff --git a/modules/core/src/test/java/org/apache/ignite/platform/PlatformExceptionTask.java b/modules/core/src/test/java/org/apache/ignite/platform/PlatformExceptionTask.java
index aea3433..0bab5da 100644
--- a/modules/core/src/test/java/org/apache/ignite/platform/PlatformExceptionTask.java
+++ b/modules/core/src/test/java/org/apache/ignite/platform/PlatformExceptionTask.java
@@ -27,6 +27,7 @@ import org.apache.ignite.lang.IgniteFutureCancelledException;
import org.apache.ignite.services.ServiceConfiguration;
import org.apache.ignite.services.ServiceDeploymentException;
import org.apache.ignite.transactions.*;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.cache.CacheException;
@@ -43,7 +44,7 @@ import java.util.Map;
@SuppressWarnings("unused") // Used by .NET ExceptionsTest.
public class PlatformExceptionTask extends ComputeTaskAdapter<String, String> {
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable String arg) {
assert arg != null;
diff --git a/modules/core/src/test/java/org/apache/ignite/platform/PlatformMaxMemoryTask.java b/modules/core/src/test/java/org/apache/ignite/platform/PlatformMaxMemoryTask.java
index 23c7d3d..9c83c55 100644
--- a/modules/core/src/test/java/org/apache/ignite/platform/PlatformMaxMemoryTask.java
+++ b/modules/core/src/test/java/org/apache/ignite/platform/PlatformMaxMemoryTask.java
@@ -23,6 +23,7 @@ import org.apache.ignite.compute.ComputeJobAdapter;
import org.apache.ignite.compute.ComputeJobResult;
import org.apache.ignite.compute.ComputeTaskAdapter;
import org.apache.ignite.internal.util.typedef.F;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.lang.management.ManagementFactory;
@@ -35,7 +36,7 @@ import java.util.Map;
*/
public class PlatformMaxMemoryTask extends ComputeTaskAdapter<Object, Long> {
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable Object arg) {
return Collections.singletonMap(new MaxMemoryJob(), F.first(subgrid));
}
diff --git a/modules/core/src/test/java/org/apache/ignite/platform/PlatformMinMemoryTask.java b/modules/core/src/test/java/org/apache/ignite/platform/PlatformMinMemoryTask.java
index 624701b..d66df0e 100644
--- a/modules/core/src/test/java/org/apache/ignite/platform/PlatformMinMemoryTask.java
+++ b/modules/core/src/test/java/org/apache/ignite/platform/PlatformMinMemoryTask.java
@@ -23,6 +23,7 @@ import org.apache.ignite.compute.ComputeJobAdapter;
import org.apache.ignite.compute.ComputeJobResult;
import org.apache.ignite.compute.ComputeTaskAdapter;
import org.apache.ignite.internal.util.typedef.F;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.lang.management.ManagementFactory;
@@ -35,7 +36,7 @@ import java.util.Map;
*/
public class PlatformMinMemoryTask extends ComputeTaskAdapter<Object, Long> {
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable Object arg) {
return Collections.singletonMap(new MinMemoryJob(), F.first(subgrid));
}
diff --git a/modules/core/src/test/java/org/apache/ignite/platform/PlatformSqlQueryTask.java b/modules/core/src/test/java/org/apache/ignite/platform/PlatformSqlQueryTask.java
index c839f81..f982e70 100644
--- a/modules/core/src/test/java/org/apache/ignite/platform/PlatformSqlQueryTask.java
+++ b/modules/core/src/test/java/org/apache/ignite/platform/PlatformSqlQueryTask.java
@@ -28,6 +28,7 @@ import org.apache.ignite.compute.ComputeJobResult;
import org.apache.ignite.compute.ComputeTaskAdapter;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.resources.IgniteInstanceResource;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.cache.Cache;
@@ -46,7 +47,7 @@ import java.util.Map;
*/
public class PlatformSqlQueryTask extends ComputeTaskAdapter<String, Object> {
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable String arg) throws IgniteException {
return Collections.singletonMap(new SqlQueryJob(arg), F.first(subgrid));
}
diff --git a/modules/core/src/test/java/org/apache/ignite/platform/PlatformStartIgniteTask.java b/modules/core/src/test/java/org/apache/ignite/platform/PlatformStartIgniteTask.java
index e703431..d815d00 100644
--- a/modules/core/src/test/java/org/apache/ignite/platform/PlatformStartIgniteTask.java
+++ b/modules/core/src/test/java/org/apache/ignite/platform/PlatformStartIgniteTask.java
@@ -26,6 +26,7 @@ import org.apache.ignite.compute.ComputeJobAdapter;
import org.apache.ignite.compute.ComputeJobResult;
import org.apache.ignite.compute.ComputeTaskAdapter;
import org.apache.ignite.internal.util.typedef.F;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collections;
@@ -37,7 +38,7 @@ import java.util.Map;
*/
public class PlatformStartIgniteTask extends ComputeTaskAdapter<String, String> {
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable String arg) throws IgniteException {
return Collections.singletonMap(new PlatformStartIgniteJob(arg), F.first(subgrid));
}
diff --git a/modules/core/src/test/java/org/apache/ignite/platform/PlatformStopIgniteTask.java b/modules/core/src/test/java/org/apache/ignite/platform/PlatformStopIgniteTask.java
index 81d0474..5ec8347 100644
--- a/modules/core/src/test/java/org/apache/ignite/platform/PlatformStopIgniteTask.java
+++ b/modules/core/src/test/java/org/apache/ignite/platform/PlatformStopIgniteTask.java
@@ -24,6 +24,7 @@ import org.apache.ignite.compute.ComputeJob;
import org.apache.ignite.compute.ComputeJobAdapter;
import org.apache.ignite.compute.ComputeJobResult;
import org.apache.ignite.compute.ComputeTaskAdapter;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collections;
@@ -35,7 +36,7 @@ import java.util.Map;
*/
public class PlatformStopIgniteTask extends ComputeTaskAdapter<String, Boolean> {
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable String arg) throws IgniteException {
ClusterNode node = subgrid.get(0);
diff --git a/modules/core/src/test/java/org/apache/ignite/platform/PlatformStringTestTask.java b/modules/core/src/test/java/org/apache/ignite/platform/PlatformStringTestTask.java
index d7b29aa..db718f5 100644
--- a/modules/core/src/test/java/org/apache/ignite/platform/PlatformStringTestTask.java
+++ b/modules/core/src/test/java/org/apache/ignite/platform/PlatformStringTestTask.java
@@ -23,6 +23,7 @@ import org.apache.ignite.compute.ComputeJobAdapter;
import org.apache.ignite.compute.ComputeJobResult;
import org.apache.ignite.compute.ComputeTaskAdapter;
import org.apache.ignite.internal.util.typedef.F;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collections;
@@ -34,7 +35,7 @@ import java.util.Map;
*/
public class PlatformStringTestTask extends ComputeTaskAdapter<String, String> {
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable String arg) {
return Collections.singletonMap(new StringTestTaskJob(arg), F.first(subgrid));
}
diff --git a/modules/core/src/test/java/org/apache/ignite/platform/lifecycle/PlatformJavaLifecycleTask.java b/modules/core/src/test/java/org/apache/ignite/platform/lifecycle/PlatformJavaLifecycleTask.java
index 637e5c3..4d3246f 100644
--- a/modules/core/src/test/java/org/apache/ignite/platform/lifecycle/PlatformJavaLifecycleTask.java
+++ b/modules/core/src/test/java/org/apache/ignite/platform/lifecycle/PlatformJavaLifecycleTask.java
@@ -22,6 +22,7 @@ import org.apache.ignite.compute.ComputeJob;
import org.apache.ignite.compute.ComputeJobAdapter;
import org.apache.ignite.compute.ComputeJobResult;
import org.apache.ignite.compute.ComputeTaskAdapter;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
@@ -34,7 +35,7 @@ import java.util.Map;
*/
public class PlatformJavaLifecycleTask extends ComputeTaskAdapter<Object, List<Integer>> {
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable Object arg) {
Map<ComputeJob, ClusterNode> jobs = new HashMap<>();
diff --git a/modules/core/src/test/java/org/apache/ignite/session/GridSessionJobFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/session/GridSessionJobFailoverSelfTest.java
index 4774915..a5229d0 100644
--- a/modules/core/src/test/java/org/apache/ignite/session/GridSessionJobFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/session/GridSessionJobFailoverSelfTest.java
@@ -36,6 +36,7 @@ import org.apache.ignite.resources.TaskSessionResource;
import org.apache.ignite.spi.failover.always.AlwaysFailoverSpi;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.testframework.junits.common.GridCommonTest;
+import org.jetbrains.annotations.NotNull;
import org.junit.Test;
/**
@@ -94,7 +95,7 @@ public class GridSessionJobFailoverSelfTest extends GridCommonAbstractTest {
private boolean jobFailed;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, String arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, String arg) {
ses.setAttribute("fail", true);
for (int i = 0; i < 10; i++) {
diff --git a/modules/core/src/test/java/org/apache/ignite/session/GridSessionLoadSelfTest.java b/modules/core/src/test/java/org/apache/ignite/session/GridSessionLoadSelfTest.java
index 03a1863..58db4dc 100644
--- a/modules/core/src/test/java/org/apache/ignite/session/GridSessionLoadSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/session/GridSessionLoadSelfTest.java
@@ -44,6 +44,7 @@ import org.apache.ignite.resources.TaskSessionResource;
import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.testframework.junits.common.GridCommonTest;
+import org.jetbrains.annotations.NotNull;
import org.junit.Test;
/**
@@ -154,7 +155,7 @@ public class GridSessionLoadSelfTest extends GridCommonAbstractTest {
private Map<String, Integer> params;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Integer arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Integer arg) {
assert taskSes != null;
assert arg != null;
assert arg > 1;
diff --git a/modules/core/src/test/java/org/apache/ignite/session/GridSessionSetJobAttribute2SelfTest.java b/modules/core/src/test/java/org/apache/ignite/session/GridSessionSetJobAttribute2SelfTest.java
index c770be9..9bfd2fe 100644
--- a/modules/core/src/test/java/org/apache/ignite/session/GridSessionSetJobAttribute2SelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/session/GridSessionSetJobAttribute2SelfTest.java
@@ -35,6 +35,7 @@ import org.apache.ignite.compute.ComputeTaskSessionFullSupport;
import org.apache.ignite.resources.TaskSessionResource;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.testframework.junits.common.GridCommonTest;
+import org.jetbrains.annotations.NotNull;
import org.junit.Test;
/**
@@ -85,7 +86,7 @@ public class GridSessionSetJobAttribute2SelfTest extends GridCommonAbstractTest
private UUID attrVal;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, UUID arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, UUID arg) {
assert subgrid.size() == 2;
assert arg != null;
diff --git a/modules/core/src/test/java/org/apache/ignite/session/GridSessionSetJobAttributeOrderSelfTest.java b/modules/core/src/test/java/org/apache/ignite/session/GridSessionSetJobAttributeOrderSelfTest.java
index 48a12b6..ef00101 100644
--- a/modules/core/src/test/java/org/apache/ignite/session/GridSessionSetJobAttributeOrderSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/session/GridSessionSetJobAttributeOrderSelfTest.java
@@ -37,6 +37,7 @@ import org.apache.ignite.resources.LoggerResource;
import org.apache.ignite.resources.TaskSessionResource;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.testframework.junits.common.GridCommonTest;
+import org.jetbrains.annotations.NotNull;
import org.junit.Test;
/**
@@ -96,7 +97,7 @@ public class GridSessionSetJobAttributeOrderSelfTest extends GridCommonAbstractT
private IgniteLogger log;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, UUID arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, UUID arg) {
assert subgrid.size() == 2;
assert arg != null;
diff --git a/modules/core/src/test/java/org/apache/ignite/util/GridCommandHandlerSslTest.java b/modules/core/src/test/java/org/apache/ignite/util/GridCommandHandlerSslTest.java
index e3fa4c2..ca96409 100644
--- a/modules/core/src/test/java/org/apache/ignite/util/GridCommandHandlerSslTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/util/GridCommandHandlerSslTest.java
@@ -28,34 +28,20 @@ import org.apache.ignite.internal.commandline.CommandHandler;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.ssl.SslContextFactory;
import org.apache.ignite.testframework.GridTestUtils;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.jetbrains.annotations.NotNull;
import org.junit.Test;
import static org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_CONNECTION_FAILED;
import static org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_OK;
+import static org.apache.ignite.testframework.GridTestUtils.assertContains;
/**
* Command line handler test with SSL.
*/
-public class GridCommandHandlerSslTest extends GridCommonAbstractTest {
+public class GridCommandHandlerSslTest extends GridCommandHandlerAbstractTest {
/** */
private volatile String[] cipherSuites;
- /** {@inheritDoc} */
- @Override protected void beforeTest() throws Exception {
- cleanPersistenceDir();
-
- stopAllGrids();
- }
-
- /** {@inheritDoc} */
- @Override protected void afterTest() throws Exception {
- stopAllGrids();
-
- cleanPersistenceDir();
- }
-
/**
* @return SSL factory.
*/
@@ -109,7 +95,7 @@ public class GridCommandHandlerSslTest extends GridCommonAbstractTest {
params.add(utilityCipherSuite);
}
- assertEquals(expRes, cmd.execute(params));
+ assertEquals(expRes, execute(params));
if (expRes == EXIT_CODE_OK)
assertTrue(ignite.cluster().active());
@@ -165,6 +151,10 @@ public class GridCommandHandlerSslTest extends GridCommonAbstractTest {
String utilityCipherSuites = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256," +
"TLS_DHE_RSA_WITH_AES_128_GCM_SHA256";
+ injectTestSystemOut();
+
activate(nodeCipherSuites, utilityCipherSuites, EXIT_CODE_CONNECTION_FAILED);
+
+ assertContains(log, testOut.toString(), "SSL handshake failed (connection closed).");
}
}
diff --git a/modules/core/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java b/modules/core/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java
index 5c9d325..20e8f67 100644
--- a/modules/core/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java
@@ -90,7 +90,6 @@ import org.apache.ignite.internal.processors.cache.transactions.TransactionProxy
import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
import org.apache.ignite.internal.processors.datastructures.GridCacheInternalKeyImpl;
import org.apache.ignite.internal.util.lang.GridAbsPredicate;
-import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.G;
import org.apache.ignite.internal.util.typedef.T2;
import org.apache.ignite.internal.util.typedef.X;
@@ -365,18 +364,18 @@ public class GridCommandHandlerTest extends GridCommandHandlerAbstractTest {
* @return Local node consistent ID.
*/
private String consistentIds(Ignite... ignites) {
- String res = "";
+ StringBuilder res = new StringBuilder();
for (Ignite ignite : ignites) {
String consistentId = ignite.cluster().localNode().consistentId().toString();
- if (!F.isEmpty(res))
- res += ", ";
+ if (res.length() != 0)
+ res.append(", ");
- res += consistentId;
+ res.append(consistentId);
}
- return res;
+ return res.toString();
}
/**
@@ -392,6 +391,10 @@ public class GridCommandHandlerTest extends GridCommandHandlerAbstractTest {
ignite.cluster().active(true);
+ assertEquals(EXIT_CODE_INVALID_ARGUMENTS, execute("--baseline", "add"));
+
+ assertEquals(EXIT_CODE_INVALID_ARGUMENTS, execute("--baseline", "add", "non-existent-id"));
+
Ignite other = startGrid(2);
assertEquals(EXIT_CODE_OK, execute("--baseline", "add", consistentIds(other)));
@@ -1193,7 +1196,7 @@ public class GridCommandHandlerTest extends GridCommandHandlerAbstractTest {
getTestIgniteInstanceName(2) + "," +
getTestIgniteInstanceName(3);
- assertEquals(EXIT_CODE_UNEXPECTED_ERROR, execute("--baseline", "add", consistentIDs));
+ assertEquals(EXIT_CODE_INVALID_ARGUMENTS, execute("--baseline", "add", consistentIDs));
String testOutStr = testOut.toString();
@@ -1227,6 +1230,11 @@ public class GridCommandHandlerTest extends GridCommandHandlerAbstractTest {
assertTrue(cmd + " " + arg, output.contains(arg.toString()));
}
+ else {
+ assertContains(log, output, CommandHandler.UTILITY_NAME);
+
+ assertNotContains(log, output, "control.sh");
+ }
}
}
@@ -1257,6 +1265,11 @@ public class GridCommandHandlerTest extends GridCommandHandlerAbstractTest {
for (CommandList cmd : CommandList.values())
assertContains(log, testOutStr, cmd.toString());
+
+ assertContains(log, testOutStr, "Control utility script");
+ assertContains(log, testOutStr, CommandHandler.UTILITY_NAME);
+
+ assertNotContains(log, testOutStr, "Control.sh");
}
/**
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/CacheDeploymentTestTask1.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/CacheDeploymentTestTask1.java
index 2ef2ea1..868737d 100644
--- a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/CacheDeploymentTestTask1.java
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/CacheDeploymentTestTask1.java
@@ -29,6 +29,7 @@ import org.apache.ignite.compute.ComputeTaskAdapter;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.X;
import org.apache.ignite.resources.IgniteInstanceResource;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
@@ -39,7 +40,7 @@ public class CacheDeploymentTestTask1 extends ComputeTaskAdapter<ClusterNode, Ob
private static final int PUT_CNT = 100;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable ClusterNode node) {
return F.asMap(
new ComputeJobAdapter() {
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/CacheDeploymentTestTask2.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/CacheDeploymentTestTask2.java
index f0ae232..5623bd7 100644
--- a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/CacheDeploymentTestTask2.java
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/CacheDeploymentTestTask2.java
@@ -28,6 +28,7 @@ import org.apache.ignite.compute.ComputeTaskAdapter;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.X;
import org.apache.ignite.resources.IgniteInstanceResource;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
@@ -35,7 +36,7 @@ import org.jetbrains.annotations.Nullable;
*/
public class CacheDeploymentTestTask2 extends ComputeTaskAdapter<ClusterNode, Object> {
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable ClusterNode node) {
return F.asMap(
new ComputeJobAdapter() {
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/CacheDeploymentTestTask3.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/CacheDeploymentTestTask3.java
index 144684c..493c646 100644
--- a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/CacheDeploymentTestTask3.java
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/CacheDeploymentTestTask3.java
@@ -29,6 +29,7 @@ import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.T2;
import org.apache.ignite.internal.util.typedef.X;
import org.apache.ignite.resources.IgniteInstanceResource;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
@@ -36,7 +37,7 @@ import org.jetbrains.annotations.Nullable;
*/
public class CacheDeploymentTestTask3 extends ComputeTaskAdapter<T2<ClusterNode, String>, Object> {
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable T2<ClusterNode, String> tup) {
final String val = tup.getValue();
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/JobStealingTask.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/JobStealingTask.java
index a6f34a7..c981c7f 100644
--- a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/JobStealingTask.java
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/JobStealingTask.java
@@ -32,6 +32,7 @@ import org.apache.ignite.compute.ComputeTaskAdapter;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.resources.LoggerResource;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
@@ -50,7 +51,7 @@ public class JobStealingTask extends ComputeTaskAdapter<Object, Map<UUID, Intege
private IgniteLogger log;
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable Object arg) {
assert !subgrid.isEmpty();
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/P2PTestTaskExternalPath1.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/P2PTestTaskExternalPath1.java
index f482e3d..79fd1b8 100644
--- a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/P2PTestTaskExternalPath1.java
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/P2PTestTaskExternalPath1.java
@@ -38,6 +38,7 @@ import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.resources.LoggerResource;
import org.apache.ignite.resources.TaskSessionResource;
+import org.jetbrains.annotations.NotNull;
/**
* Test P2P task.
@@ -50,7 +51,7 @@ public class P2PTestTaskExternalPath1 extends ComputeTaskAdapter<Object, Integer
/**
* {@inheritDoc}
*/
- @SuppressWarnings({"unchecked"})
+ @NotNull @SuppressWarnings({"unchecked"})
@Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) {
if (log.isInfoEnabled()) {
log.info("Mapping [task=" + this + ", subgrid=" + F.viewReadOnly(subgrid, F.node2id()) +
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/P2PTestTaskExternalPath2.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/P2PTestTaskExternalPath2.java
index bd94346..40d7c7a 100644
--- a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/P2PTestTaskExternalPath2.java
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/P2PTestTaskExternalPath2.java
@@ -38,6 +38,7 @@ import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.resources.LoggerResource;
import org.apache.ignite.resources.TaskSessionResource;
+import org.jetbrains.annotations.NotNull;
/**
* Simple test task.
@@ -50,7 +51,7 @@ public class P2PTestTaskExternalPath2 extends ComputeTaskAdapter<Object, Integer
/**
* {@inheritDoc}
*/
- @SuppressWarnings({"unchecked"})
+ @NotNull @SuppressWarnings({"unchecked"})
@Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) {
if (log.isInfoEnabled()) {
log.info("Mapping [task=" + this + ", subgrid=" + F.viewReadOnly(subgrid, F.node2id()) +
diff --git a/modules/extdata/platform/src/test/java/org/apache/ignite/platform/plugin/cache/PlatformGetCachePluginsTask.java b/modules/extdata/platform/src/test/java/org/apache/ignite/platform/plugin/cache/PlatformGetCachePluginsTask.java
index 4980e35..46f931b 100644
--- a/modules/extdata/platform/src/test/java/org/apache/ignite/platform/plugin/cache/PlatformGetCachePluginsTask.java
+++ b/modules/extdata/platform/src/test/java/org/apache/ignite/platform/plugin/cache/PlatformGetCachePluginsTask.java
@@ -27,6 +27,7 @@ import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.plugin.CachePluginConfiguration;
import org.apache.ignite.resources.IgniteInstanceResource;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collections;
@@ -38,7 +39,7 @@ import java.util.Map;
*/
public class PlatformGetCachePluginsTask extends ComputeTaskAdapter<String, String[]> {
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable String arg) {
return Collections.singletonMap(new GetCachePluginsJob(arg), F.first(subgrid));
}
diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/genetic/CrossOverTask.java b/modules/ml/src/main/java/org/apache/ignite/ml/genetic/CrossOverTask.java
index 50d7362..121de72 100644
--- a/modules/ml/src/main/java/org/apache/ignite/ml/genetic/CrossOverTask.java
+++ b/modules/ml/src/main/java/org/apache/ignite/ml/genetic/CrossOverTask.java
@@ -32,6 +32,7 @@ import org.apache.ignite.compute.ComputeTaskAdapter;
import org.apache.ignite.ml.genetic.parameter.GAConfiguration;
import org.apache.ignite.ml.genetic.parameter.GAGridConstants;
import org.apache.ignite.resources.IgniteInstanceResource;
+import org.jetbrains.annotations.NotNull;
/**
* Responsible for assigning 2 X 'parent' chromosomes to produce 2 X 'child' chromosomes.
@@ -59,7 +60,7 @@ public class CrossOverTask extends ComputeTaskAdapter<List<Long>, Boolean> {
}
/** {@inheritDoc} */
- @Override public Map map(List<ClusterNode> nodes, List<Long> chromosomeKeys) throws IgniteException {
+ @NotNull @Override public Map map(List<ClusterNode> nodes, List<Long> chromosomeKeys) throws IgniteException {
Map<ComputeJob, ClusterNode> map = new HashMap<>();
diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/genetic/FitnessTask.java b/modules/ml/src/main/java/org/apache/ignite/ml/genetic/FitnessTask.java
index 9062bac..1cb15d2 100644
--- a/modules/ml/src/main/java/org/apache/ignite/ml/genetic/FitnessTask.java
+++ b/modules/ml/src/main/java/org/apache/ignite/ml/genetic/FitnessTask.java
@@ -31,6 +31,7 @@ import org.apache.ignite.compute.ComputeTaskAdapter;
import org.apache.ignite.ml.genetic.parameter.GAConfiguration;
import org.apache.ignite.ml.genetic.parameter.GAGridConstants;
import org.apache.ignite.resources.IgniteInstanceResource;
+import org.jetbrains.annotations.NotNull;
/**
* Responsible for fitness operation
@@ -51,7 +52,7 @@ public class FitnessTask extends ComputeTaskAdapter<List<Long>, Boolean> {
}
/** {@inheritDoc} */
- @Override public Map map(List<ClusterNode> nodes, List<Long> chromosomeKeys) throws IgniteException {
+ @NotNull @Override public Map map(List<ClusterNode> nodes, List<Long> chromosomeKeys) throws IgniteException {
Map<ComputeJob, ClusterNode> map = new HashMap<>();
diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/genetic/MutateTask.java b/modules/ml/src/main/java/org/apache/ignite/ml/genetic/MutateTask.java
index 592ac44..e8b1667 100644
--- a/modules/ml/src/main/java/org/apache/ignite/ml/genetic/MutateTask.java
+++ b/modules/ml/src/main/java/org/apache/ignite/ml/genetic/MutateTask.java
@@ -37,6 +37,7 @@ import org.apache.ignite.compute.ComputeTaskAdapter;
import org.apache.ignite.ml.genetic.parameter.GAConfiguration;
import org.apache.ignite.ml.genetic.parameter.GAGridConstants;
import org.apache.ignite.resources.IgniteInstanceResource;
+import org.jetbrains.annotations.NotNull;
/**
* Responsible for applying mutation on respective chromosomes. <br/>
@@ -75,7 +76,7 @@ public class MutateTask extends ComputeTaskAdapter<List<Long>, Boolean> {
}
/** {@inheritDoc} */
- @Override public Map map(List<ClusterNode> nodes, List<Long> chromosomeKeys) throws IgniteException {
+ @NotNull @Override public Map map(List<ClusterNode> nodes, List<Long> chromosomeKeys) throws IgniteException {
Map<ComputeJob, ClusterNode> map = new HashMap<>();
Affinity affinity = ignite.affinity(GAGridConstants.POPULATION_CACHE);
diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/genetic/RouletteWheelSelectionTask.java b/modules/ml/src/main/java/org/apache/ignite/ml/genetic/RouletteWheelSelectionTask.java
index 9d81471..f94136e 100644
--- a/modules/ml/src/main/java/org/apache/ignite/ml/genetic/RouletteWheelSelectionTask.java
+++ b/modules/ml/src/main/java/org/apache/ignite/ml/genetic/RouletteWheelSelectionTask.java
@@ -39,6 +39,7 @@ import org.apache.ignite.ml.genetic.parameter.GAConfiguration;
import org.apache.ignite.ml.genetic.parameter.GAGridConstants;
import org.apache.ignite.resources.IgniteInstanceResource;
import org.apache.ignite.resources.LoadBalancerResource;
+import org.jetbrains.annotations.NotNull;
/**
* Responsible for performing Roulette Wheel selection.
@@ -88,7 +89,7 @@ public class RouletteWheelSelectionTask extends ComputeTaskAdapter<LinkedHashMap
* @param chromosomeKeyFitness Map of key/fitness score pairs.
* @return Map of nodes to jobs.
*/
- @Override public Map<ComputeJob, ClusterNode> map(List<ClusterNode> nodes,
+ @NotNull @Override public Map<ComputeJob, ClusterNode> map(List<ClusterNode> nodes,
LinkedHashMap<Long, Double> chromosomeKeyFitness) throws IgniteException {
Map<ComputeJob, ClusterNode> map = new HashMap<>();
diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/genetic/TruncateSelectionTask.java b/modules/ml/src/main/java/org/apache/ignite/ml/genetic/TruncateSelectionTask.java
index b3dabda..fbd2380 100644
--- a/modules/ml/src/main/java/org/apache/ignite/ml/genetic/TruncateSelectionTask.java
+++ b/modules/ml/src/main/java/org/apache/ignite/ml/genetic/TruncateSelectionTask.java
@@ -35,6 +35,7 @@ import org.apache.ignite.compute.ComputeJobResultPolicy;
import org.apache.ignite.compute.ComputeTaskAdapter;
import org.apache.ignite.ml.genetic.parameter.GAGridConstants;
import org.apache.ignite.resources.IgniteInstanceResource;
+import org.jetbrains.annotations.NotNull;
/**
* Responsible for performing truncate selection.
@@ -108,7 +109,7 @@ public class TruncateSelectionTask extends ComputeTaskAdapter<List<Long>, Boolea
}
/** {@inheritDoc} */
- @Override public Map map(List<ClusterNode> nodes, List<Long> chromosomeKeys) throws IgniteException {
+ @NotNull @Override public Map map(List<ClusterNode> nodes, List<Long> chromosomeKeys) throws IgniteException {
Map<ComputeJob, ClusterNode> map = new HashMap<>();
Affinity affinity = ignite.affinity(GAGridConstants.POPULATION_CACHE);
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesWithRestartServerTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesWithRestartServerTest.cs
index b3a910d..1e64667 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesWithRestartServerTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesWithRestartServerTest.cs
@@ -66,8 +66,15 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
cache.Put(1, new Item { Id = 20, Title = "test" });
Ignition.Stop(_server.Name, false);
+
+ var evt = new ManualResetEventSlim(false);
+
+ _client.ClientReconnected += (sender, args) => evt.Set();
+
_server = StartGrid(0);
- WaitForReconnect(_client, 10000);
+
+ var restarted = evt.Wait(10000);
+ Assert.IsTrue(restarted);
cache = _client.GetOrCreateCache<int, Item>("Test");
cache.Put(1, new Item { Id = 30, Title = "test" });
@@ -95,19 +102,6 @@ namespace Apache.Ignite.Core.Tests.Cache.Query
}
/// <summary>
- /// Waits for reconnect.
- /// </summary>
- private static void WaitForReconnect(IIgnite ignite, int timeout)
- {
- var evt = new ManualResetEventSlim(false);
-
- ignite.ClientReconnected += (sender, args) => evt.Set();
-
- var restarted = evt.Wait(timeout);
- Assert.IsTrue(restarted);
- }
-
- /// <summary>
/// Test filter.
/// </summary>
private class TestFilter : ICacheEntryFilter<int, Item>
diff --git a/modules/urideploy/src/test/java/org/apache/ignite/spi/deployment/uri/GridUriDeploymentSimpleSelfTest.java b/modules/urideploy/src/test/java/org/apache/ignite/spi/deployment/uri/GridUriDeploymentSimpleSelfTest.java
index f00db08..74f1dd6 100644
--- a/modules/urideploy/src/test/java/org/apache/ignite/spi/deployment/uri/GridUriDeploymentSimpleSelfTest.java
+++ b/modules/urideploy/src/test/java/org/apache/ignite/spi/deployment/uri/GridUriDeploymentSimpleSelfTest.java
@@ -33,6 +33,7 @@ import org.apache.ignite.testframework.config.GridTestProperties;
import org.apache.ignite.testframework.junits.spi.GridSpiAbstractTest;
import org.apache.ignite.testframework.junits.spi.GridSpiTest;
import org.apache.ignite.testframework.junits.spi.GridSpiTestConfig;
+import org.jetbrains.annotations.NotNull;
import org.junit.Test;
/**
@@ -152,7 +153,7 @@ public class GridUriDeploymentSimpleSelfTest extends GridSpiAbstractTest<UriDepl
*/
private static class TestTask extends ComputeTaskAdapter<Object, Object> {
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) {
assert subgrid.size() == 1;
return Collections.singletonMap(new ComputeJobAdapter() {
@@ -174,7 +175,7 @@ public class GridUriDeploymentSimpleSelfTest extends GridSpiAbstractTest<UriDepl
@ComputeTaskName("TestTaskWithName")
private static class TestTaskWithName extends ComputeTaskAdapter<Object, Object> {
/** {@inheritDoc} */
- @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) {
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid, Object arg) {
assert subgrid.size() == 1;
return Collections.singletonMap(new ComputeJobAdapter() {
diff --git a/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/task/DemoCancellableTask.java b/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/task/DemoCancellableTask.java
index 2a22908..1113275 100644
--- a/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/task/DemoCancellableTask.java
+++ b/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/task/DemoCancellableTask.java
@@ -30,6 +30,7 @@ import org.apache.ignite.compute.ComputeJobResultPolicy;
import org.apache.ignite.compute.ComputeTask;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.internal.util.typedef.internal.U;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
@@ -40,7 +41,7 @@ public class DemoCancellableTask implements ComputeTask<Void, Void> {
private static final long serialVersionUID = 0L;
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable Void arg) throws IgniteException {
HashMap<ComputeJob, ClusterNode> map = U.newHashMap(1);
diff --git a/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/task/DemoComputeTask.java b/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/task/DemoComputeTask.java
index 7dba1b7..32261c4 100644
--- a/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/task/DemoComputeTask.java
+++ b/modules/web-console/web-agent/src/main/java/org/apache/ignite/console/demo/task/DemoComputeTask.java
@@ -29,6 +29,7 @@ import org.apache.ignite.compute.ComputeJobResult;
import org.apache.ignite.compute.ComputeJobResultPolicy;
import org.apache.ignite.compute.ComputeTask;
import org.apache.ignite.internal.util.typedef.internal.S;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
@@ -42,7 +43,7 @@ public class DemoComputeTask implements ComputeTask<Void, Integer>{
private static final Random rnd = new Random();
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(List<ClusterNode> subgrid,
@Nullable Void arg) throws IgniteException {
HashMap<ComputeJob, ClusterNode> map = new HashMap<>(subgrid.size());
diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/compute/model/NoopTask.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/compute/model/NoopTask.java
index 644b3de..35489e0 100644
--- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/compute/model/NoopTask.java
+++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/compute/model/NoopTask.java
@@ -29,6 +29,7 @@ import org.apache.ignite.compute.ComputeJob;
import org.apache.ignite.compute.ComputeJobResult;
import org.apache.ignite.compute.ComputeJobResultPolicy;
import org.apache.ignite.compute.ComputeTask;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
@@ -56,7 +57,7 @@ public class NoopTask implements ComputeTask<Object, Object> {
}
/** {@inheritDoc} */
- @Nullable @Override public Map<? extends ComputeJob, ClusterNode> map(
+ @NotNull @Override public Map<? extends ComputeJob, ClusterNode> map(
List<ClusterNode> subgrid,
@Nullable Object arg)
{