This is an automated email from the ASF dual-hosted git repository.
namelchev 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 b0467938fb0 IGNITE-22401 Code cleanup of snapshot classes (#11366)
b0467938fb0 is described below
commit b0467938fb02cd7276109d608bb1e4ac22796598
Author: Vladimir Steshin <[email protected]>
AuthorDate: Tue Jun 4 10:15:35 2024 +0300
IGNITE-22401 Code cleanup of snapshot classes (#11366)
---
.../apache/ignite/util/GridCommandHandlerTest.java | 3 +-
.../java/org/apache/ignite/dump/DumpConsumer.java | 2 +-
.../management/cache/IdleVerifyResultV2.java | 4 +-
.../cache/GridCachePartitionExchangeManager.java | 5 +--
.../processors/cache/GridCacheProcessor.java | 2 +-
.../internal/processors/cache/GridCacheUtils.java | 3 +-
.../snapshot/IgniteSnapshotManager.java | 48 +++++++++-------------
.../snapshot/SnapshotFilesRequestMessage.java | 10 ++---
.../snapshot/SnapshotMetadataVerificationTask.java | 3 +-
.../snapshot/SnapshotRestoreProcess.java | 7 ++--
.../processors/cache/verify/IdleVerifyUtility.java | 8 ++--
.../ClientClusterGroupGetNodeIdsRequest.java | 5 ++-
.../internal/util/future/GridFutureAdapter.java | 1 -
.../ignite/internal/util/nio/GridNioServer.java | 3 +-
.../snapshot/EncryptedSnapshotTest.java | 18 ++++----
.../snapshot/IgniteClusterSnapshotSelfTest.java | 3 +-
.../IncrementalSnapshotCheckBeforeRestoreTest.java | 4 +-
.../IncrementalSnapshotRestoreTest.java | 6 +--
.../IgniteCacheContinuousQueryBackupQueueTest.java | 12 ++----
.../tcp/TcpDiscoveryNetworkIssuesTest.java | 2 +-
.../cache/index/DynamicIndexAbstractSelfTest.java | 4 +-
21 files changed, 67 insertions(+), 86 deletions(-)
diff --git
a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java
b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java
index e6129be3662..429f818348b 100644
---
a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java
+++
b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java
@@ -3313,8 +3313,7 @@ public class GridCommandHandlerTest extends
GridCommandHandlerClusterPerMethodAb
createCacheAndPreload(ig, 1000);
- snp(ig).createSnapshot(snpName)
- .get();
+ snp(ig).createSnapshot(snpName).get();
TestCommandHandler h = newCommandHandler();
diff --git
a/modules/core/src/main/java/org/apache/ignite/dump/DumpConsumer.java
b/modules/core/src/main/java/org/apache/ignite/dump/DumpConsumer.java
index d06ab32d36a..4c5a4c181ad 100644
--- a/modules/core/src/main/java/org/apache/ignite/dump/DumpConsumer.java
+++ b/modules/core/src/main/java/org/apache/ignite/dump/DumpConsumer.java
@@ -62,7 +62,7 @@ public interface DumpConsumer {
/**
* Handles cache data.
- * This method can be invoced by several threads concurrently.
+ * This method can be invoked by several threads concurrently.
* Note, there can be several copies of group partition in the dump.
* This can happen if dump contains data from several nodes.
* In this case callback will be invoked several time for the same pair of
[grp, part] values.
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/management/cache/IdleVerifyResultV2.java
b/modules/core/src/main/java/org/apache/ignite/internal/management/cache/IdleVerifyResultV2.java
index 52e7deb93f4..f6dfb7afb7a 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/management/cache/IdleVerifyResultV2.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/management/cache/IdleVerifyResultV2.java
@@ -97,8 +97,8 @@ public class IdleVerifyResultV2 extends
VisorDataTransferObject {
*/
public IdleVerifyResultV2(
Map<PartitionKeyV2, List<PartitionHashRecordV2>> clusterHashes,
- List<List<TransactionsHashRecord>> txHashConflicts,
- Map<ClusterNode, Collection<GridCacheVersion>> partiallyCommittedTxs
+ @Nullable List<List<TransactionsHashRecord>> txHashConflicts,
+ @Nullable Map<ClusterNode, Collection<GridCacheVersion>>
partiallyCommittedTxs
) {
this(clusterHashes, Collections.emptyMap());
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 8b5832ab20f..b2971b859c1 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
@@ -629,7 +629,7 @@ public class GridCachePartitionExchangeManager<K, V>
extends GridCacheSharedMana
&& state.previousBaselineTopology() == null;
}
- exchFut.listen(f -> onClusterStateChangeFinish(f,
exchActions, baselineChanging));
+ exchFut.listen(f ->
onClusterStateChangeFinish(exchActions, baselineChanging));
}
}
else if (customMsg instanceof DynamicCacheChangeBatch) {
@@ -735,8 +735,7 @@ public class GridCachePartitionExchangeManager<K, V>
extends GridCacheSharedMana
}
/** */
- private void
onClusterStateChangeFinish(IgniteInternalFuture<AffinityTopologyVersion> fut,
- ExchangeActions exchActions, boolean baselineChanging) {
+ private void onClusterStateChangeFinish(ExchangeActions exchActions,
boolean baselineChanging) {
A.notNull(exchActions, "exchActions");
GridEventStorageManager evtMngr = cctx.kernalContext().event();
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index 040ea53384f..dd494991b95 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -653,7 +653,7 @@ public class GridCacheProcessor extends
GridProcessorAdapter {
* @param cacheObjCtx Cache object context.
* @throws IgniteCheckedException If configuration is not valid.
*/
- void initialize(CacheConfiguration cfg, CacheObjectContext cacheObjCtx)
throws IgniteCheckedException {
+ void initialize(CacheConfiguration<?, ?> cfg, CacheObjectContext
cacheObjCtx) throws IgniteCheckedException {
CU.initializeConfigDefaults(log, cfg, cacheObjCtx);
}
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
index 35936cc27b3..c0a5a176865 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
@@ -1642,8 +1642,7 @@ public class GridCacheUtils {
* @throws IgniteCheckedException If configuration is not valid.
*/
public static void initializeConfigDefaults(IgniteLogger log,
CacheConfiguration cfg,
- CacheObjectContext cacheObjCtx)
- throws IgniteCheckedException {
+ CacheObjectContext cacheObjCtx) throws IgniteCheckedException {
if (cfg.getCacheMode() == null)
cfg.setCacheMode(DFLT_CACHE_MODE);
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotManager.java
index 3b5f294bb06..be0d9afd6c9 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotManager.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotManager.java
@@ -398,7 +398,7 @@ public class IgniteSnapshotManager extends
GridCacheSharedManagerAdapter
private final BasicRateLimiter transferRateLimiter = new
BasicRateLimiter(DFLT_SNAPSHOT_TRANSFER_RATE_BYTES);
/** Resolved persistent data storage settings. */
- private volatile PdsFolderSettings pdsSettings;
+ private volatile PdsFolderSettings<?> pdsSettings;
/** Fully initialized metastorage. */
private volatile ReadWriteMetastorage metaStorage;
@@ -1809,8 +1809,8 @@ public class IgniteSnapshotManager extends
GridCacheSharedManagerAdapter
}
/** {@inheritDoc} */
- @Override public IgniteFuture<Void> createDump(String name, @Nullable
Collection<String> cacheGroupNames) {
- return createSnapshot(name, null, cacheGroupNames, false, false, true,
false, false);
+ @Override public IgniteFuture<Void> createDump(String name, @Nullable
Collection<String> cacheGrpNames) {
+ return createSnapshot(name, null, cacheGrpNames, false, false, true,
false, false);
}
/**
@@ -2144,7 +2144,7 @@ public class IgniteSnapshotManager extends
GridCacheSharedManagerAdapter
*
* @param name Snapshot unique name which satisfies the following name
pattern [a-zA-Z0-9_].
* @param snpPath Snapshot directory path.
- * @param cacheGroupNames Cache groups to include in snapshot or {@code
null} to include all.
+ * @param cacheGrpNames Cache groups to include in snapshot or {@code
null} to include all.
* @param incremental Incremental snapshot flag.
* @param onlyPrimary If {@code true} snapshot only primary copies of
partitions.
* @param dump If {@code true} cache dump must be created.
@@ -2155,7 +2155,7 @@ public class IgniteSnapshotManager extends
GridCacheSharedManagerAdapter
public IgniteFutureImpl<Void> createSnapshot(
String name,
@Nullable String snpPath,
- @Nullable Collection<String> cacheGroupNames,
+ @Nullable Collection<String> cacheGrpNames,
boolean incremental,
boolean onlyPrimary,
boolean dump,
@@ -2166,7 +2166,7 @@ public class IgniteSnapshotManager extends
GridCacheSharedManagerAdapter
A.ensure(U.alphanumericUnderscore(name), "Snapshot name must satisfy
the following name pattern: a-zA-Z0-9_");
A.ensure(!(incremental && onlyPrimary), "Only primary not supported
for incremental snapshots");
A.ensure(!(dump && incremental), "Incremental dump not supported");
- A.ensure(!(cacheGroupNames != null && !dump), "Cache group names
filter supported only for dump");
+ A.ensure(!(cacheGrpNames != null && !dump), "Cache group names filter
supported only for dump");
A.ensure(!compress || dump, "Compression is supported only for dumps");
try {
@@ -2192,7 +2192,7 @@ public class IgniteSnapshotManager extends
GridCacheSharedManagerAdapter
return new
IgniteSnapshotFutureImpl(cctx.kernalContext().closure()
.callAsync(
BALANCE,
- new CreateSnapshotCallable(name, cacheGroupNames,
incremental, onlyPrimary, dump, compress, encrypt),
+ new CreateSnapshotCallable(name, cacheGrpNames,
incremental, onlyPrimary, dump, compress, encrypt),
options(Collections.singletonList(crd)).withFailoverDisabled()
));
}
@@ -2258,7 +2258,7 @@ public class IgniteSnapshotManager extends
GridCacheSharedManagerAdapter
lastSeenSnpFut = snpFut0;
}
- Set<String> cacheGrpNames0 = cacheGroupNames == null ? null : new
HashSet<>(cacheGroupNames);
+ Set<String> cacheGrpNames0 = cacheGrpNames == null ? null : new
HashSet<>(cacheGrpNames);
List<String> grps = (dump ?
cctx.cache().cacheGroupDescriptors().values() :
cctx.cache().persistentGroups()).stream()
.map(CacheGroupDescriptor::cacheOrGroupName)
@@ -2677,7 +2677,7 @@ public class IgniteSnapshotManager extends
GridCacheSharedManagerAdapter
* @param snpName Unique snapshot name.
* @param snpPath Snapshot path.
* @param srcNodeId Node id which cause snapshot operation.
- * @param requestId Snapshot operation request ID.
+ * @param reqId Snapshot operation request ID.
* @param parts Collection of pairs group and appropriate cache partition
to be snapshot.
* @param withMetaStorage {@code true} if all metastorage data must be
also included into snapshot.
* @param dump {@code true} if cache group dump must be created.
@@ -2690,7 +2690,7 @@ public class IgniteSnapshotManager extends
GridCacheSharedManagerAdapter
String snpName,
@Nullable String snpPath,
UUID srcNodeId,
- UUID requestId,
+ UUID reqId,
Map<Integer, Set<Integer>> parts,
boolean withMetaStorage,
boolean dump,
@@ -2701,7 +2701,7 @@ public class IgniteSnapshotManager extends
GridCacheSharedManagerAdapter
AbstractSnapshotFutureTask<?> task = registerTask(snpName, dump
? new CreateDumpFutureTask(cctx,
srcNodeId,
- requestId,
+ reqId,
snpName,
snapshotLocalDir(snpName, snpPath),
ioFactory,
@@ -2711,7 +2711,7 @@ public class IgniteSnapshotManager extends
GridCacheSharedManagerAdapter
compress,
encrypt
)
- : new SnapshotFutureTask(cctx, srcNodeId, requestId, snpName,
tmpWorkDir, ioFactory, snpSndr, parts, withMetaStorage, locBuff));
+ : new SnapshotFutureTask(cctx, srcNodeId, reqId, snpName,
tmpWorkDir, ioFactory, snpSndr, parts, withMetaStorage, locBuff));
if (!withMetaStorage) {
for (Integer grpId : parts.keySet()) {
@@ -2742,11 +2742,6 @@ public class IgniteSnapshotManager extends
GridCacheSharedManagerAdapter
}
try {
- if (locSnpTasks.containsKey(rqId)) {
- return new SnapshotFinishedFutureTask(new
IgniteCheckedException("Snapshot with requested name is already scheduled: " +
- rqId));
- }
-
AbstractSnapshotFutureTask<?> prev = locSnpTasks.putIfAbsent(rqId,
task);
if (prev != null)
@@ -4510,14 +4505,11 @@ public class IgniteSnapshotManager extends
GridCacheSharedManagerAdapter
private final boolean needExchange;
/**
- * @param processId Unique process id.
+ * @param procId Unique process id.
* @param req Snapshot initial request.
*/
- public SnapshotStartDiscoveryMessage(
- UUID processId,
- SnapshotOperationRequest req
- ) {
- super(processId, START_SNAPSHOT, req, req.incremental());
+ public SnapshotStartDiscoveryMessage(UUID procId,
SnapshotOperationRequest req) {
+ super(procId, START_SNAPSHOT, req, req.incremental());
needExchange = !req.incremental();
}
@@ -4619,7 +4611,7 @@ public class IgniteSnapshotManager extends
GridCacheSharedManagerAdapter
private final String snpName;
/** Cache group names to include in snapshot. */
- private final @Nullable Collection<String> cacheGroupNames;
+ private final @Nullable Collection<String> cacheGrpNames;
/** Incremental flag. */
private final boolean incremental;
@@ -4642,7 +4634,7 @@ public class IgniteSnapshotManager extends
GridCacheSharedManagerAdapter
/**
* @param snpName Snapshot name.
- * @param cacheGroupNames Cache group names to include in snapshot.
+ * @param cacheGrpNames Cache group names to include in snapshot.
* @param incremental If {@code true} then incremental snapshot must
be created.
* @param onlyPrimary If {@code true} then only copy of primary
partitions will be created.
* @param dump If {@code true} then cache dump must be created.
@@ -4651,7 +4643,7 @@ public class IgniteSnapshotManager extends
GridCacheSharedManagerAdapter
*/
public CreateSnapshotCallable(
String snpName,
- @Nullable Collection<String> cacheGroupNames,
+ @Nullable Collection<String> cacheGrpNames,
boolean incremental,
boolean onlyPrimary,
boolean dump,
@@ -4659,7 +4651,7 @@ public class IgniteSnapshotManager extends
GridCacheSharedManagerAdapter
boolean encrypt
) {
this.snpName = snpName;
- this.cacheGroupNames = cacheGroupNames;
+ this.cacheGrpNames = cacheGrpNames;
this.incremental = incremental;
this.onlyPrimary = onlyPrimary;
this.dump = dump;
@@ -4675,7 +4667,7 @@ public class IgniteSnapshotManager extends
GridCacheSharedManagerAdapter
ignite.context().cache().context().snapshotMgr().createSnapshot(
snpName,
null,
- cacheGroupNames,
+ cacheGrpNames,
false,
onlyPrimary,
dump,
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotFilesRequestMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotFilesRequestMessage.java
index 8a17ad551f2..56c882b455e 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotFilesRequestMessage.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotFilesRequestMessage.java
@@ -46,7 +46,7 @@ public class SnapshotFilesRequestMessage extends
AbstractSnapshotMessage {
private static final long serialVersionUID = 0L;
/** Snapshot operation request ID. */
- private UUID requestId;
+ private UUID reqId;
/** Snapshot name to request. */
private String snpName;
@@ -83,7 +83,7 @@ public class SnapshotFilesRequestMessage extends
AbstractSnapshotMessage {
assert parts != null && !parts.isEmpty();
- this.requestId = requestId;
+ this.reqId = requestId;
this.snpName = snpName;
this.snpPath = snpPath;
this.parts = new HashMap<>();
@@ -122,7 +122,7 @@ public class SnapshotFilesRequestMessage extends
AbstractSnapshotMessage {
* @return Snapshot operation request ID.
*/
public UUID requestId() {
- return requestId;
+ return reqId;
}
/** {@inheritDoc} */
@@ -147,7 +147,7 @@ public class SnapshotFilesRequestMessage extends
AbstractSnapshotMessage {
writer.incrementState();
case 2:
- if (!writer.writeUuid("requestId", requestId))
+ if (!writer.writeUuid("requestId", reqId))
return false;
writer.incrementState();
@@ -189,7 +189,7 @@ public class SnapshotFilesRequestMessage extends
AbstractSnapshotMessage {
reader.incrementState();
case 2:
- requestId = reader.readUuid("requestId");
+ reqId = reader.readUuid("requestId");
if (!reader.isLastRead())
return false;
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotMetadataVerificationTask.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotMetadataVerificationTask.java
index c1e38b8c7b8..fc6d4e431c3 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotMetadataVerificationTask.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotMetadataVerificationTask.java
@@ -282,8 +282,7 @@ public class SnapshotMetadataVerificationTask
continue;
}
- reduceRes.computeIfAbsent(res.getNode(), n -> new
ArrayList<>())
- .add(meta);
+ reduceRes.computeIfAbsent(res.getNode(), n -> new
ArrayList<>()).add(meta);
}
}
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotRestoreProcess.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotRestoreProcess.java
index 70ab72f39bd..16511cb3c4e 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotRestoreProcess.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotRestoreProcess.java
@@ -1050,9 +1050,8 @@ public class SnapshotRestoreProcess {
.orElse(Collections.emptySet())
.contains(partFut.partId);
- if (doCopy) {
+ if (doCopy)
copyLocalAsync(opCtx0, snpCacheDir, tmpCacheDir,
partFut);
- }
return doCopy;
});
@@ -1333,6 +1332,8 @@ public class SnapshotRestoreProcess {
if (!U.isLocalNodeCoordinator(ctx.discovery()))
return new GridFinishedFuture<>();
+ assert opCtx.reqId == reqId;
+
SnapshotRestoreContext opCtx0 = opCtx;
Collection<String> stopCaches = opCtx0.cfgs.values()
@@ -1341,7 +1342,7 @@ public class SnapshotRestoreProcess {
.collect(Collectors.toSet());
if (log.isInfoEnabled())
- log.info("Stopping caches [reqId=" + opCtx0.reqId + ", caches=" +
stopCaches + ']');
+ log.info("Stopping caches [reqId=" + reqId + ", caches=" +
stopCaches + ']');
// Skip deleting cache files as they will be removed during rollback.
return ctx.cache().dynamicDestroyCaches(stopCaches, false, false)
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/IdleVerifyUtility.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/IdleVerifyUtility.java
index e2d22e61a0d..bc54704746a 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/IdleVerifyUtility.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/verify/IdleVerifyUtility.java
@@ -94,13 +94,13 @@ public class IdleVerifyUtility {
* @param partId Partition id.
* @param pageType Page type. Possible types {@link
PageIdAllocator#FLAG_DATA}, {@link PageIdAllocator#FLAG_IDX}
* and {@link PageIdAllocator#FLAG_AUX}.
- * @param pagePostProcessor Page post processor closure.
+ * @param pagePostProc Page post processor closure.
*/
public static void checkPartitionsPageCrcSum(
IgniteThrowableSupplier<FilePageStore> pageStoreSup,
int partId,
byte pageType,
- @Nullable BiConsumer<Long, ByteBuffer> pagePostProcessor
+ @Nullable BiConsumer<Long, ByteBuffer> pagePostProc
) {
assert pageType == FLAG_DATA || pageType == FLAG_IDX || pageType ==
FLAG_AUX : pageType;
@@ -118,8 +118,8 @@ public class IdleVerifyUtility {
pageStore.read(pageId, buf, true, true);
- if (pagePostProcessor != null)
- pagePostProcessor.accept(pageId, buf);
+ if (pagePostProc != null)
+ pagePostProc.accept(pageId, buf);
}
}
catch (Throwable e) {
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cluster/ClientClusterGroupGetNodeIdsRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cluster/ClientClusterGroupGetNodeIdsRequest.java
index df56baf6ae5..8e6f81ab5d1 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cluster/ClientClusterGroupGetNodeIdsRequest.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cluster/ClientClusterGroupGetNodeIdsRequest.java
@@ -68,9 +68,10 @@ public class ClientClusterGroupGetNodeIdsRequest extends
ClientRequest {
Collection<ClusterNode> nodes = clusterGrp.nodes();
UUID[] nodeIds = new UUID[nodes.size()];
int i = 0;
- for (ClusterNode node : nodes) {
+
+ for (ClusterNode node : nodes)
nodeIds[i++] = node.id();
- }
+
return nodeIds;
}
}
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java
index b49a494b792..f477c8b4da9 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridFutureAdapter.java
@@ -581,7 +581,6 @@ public class GridFutureAdapter<R> implements
IgniteInternalFuture<R> {
return false;
if (compareAndSetState(oldState, newState)) {
-
if (oldState != INIT)
unblockAll((Node)oldState);
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
index b3a614b495d..7c86e5737a1 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
@@ -170,7 +170,7 @@ public class GridNioServer<T> {
public static final String SESSIONS_CNT_METRIC_NAME =
"ActiveSessionsCount";
/** Defines how many times selector should do {@code selectNow()} before
doing {@code select(long)}. */
- private long selectorSpins;
+ private final long selectorSpins;
/** Accept worker. */
@GridToStringExclude
@@ -1478,7 +1478,6 @@ public class GridNioServer<T> {
}
}
- Message msg;
boolean finished = false;
List<SessionWriteRequest> pendingRequests = new
ArrayList<>(2);
diff --git
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/EncryptedSnapshotTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/EncryptedSnapshotTest.java
index 53faea615ca..b1a719687e7 100644
---
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/EncryptedSnapshotTest.java
+++
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/EncryptedSnapshotTest.java
@@ -36,7 +36,6 @@ import org.apache.ignite.internal.util.typedef.internal.CU;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteFuture;
import org.apache.ignite.spi.IgniteSpiException;
-import org.apache.ignite.testframework.GridTestUtils;
import org.junit.Test;
import org.junit.runners.Parameterized;
@@ -44,6 +43,7 @@ import static org.apache.ignite.cluster.ClusterState.ACTIVE;
import static
org.apache.ignite.configuration.IgniteConfiguration.DFLT_SNAPSHOT_DIRECTORY;
import static
org.apache.ignite.internal.util.distributed.DistributedProcess.DistributedProcessType.CACHE_GROUP_KEY_CHANGE_PREPARE;
import static
org.apache.ignite.internal.util.distributed.DistributedProcess.DistributedProcessType.MASTER_KEY_CHANGE_PREPARE;
+import static
org.apache.ignite.testframework.GridTestUtils.assertThrowsAnyCause;
/**
* Snapshot test for encrypted-only snapshots.
@@ -140,7 +140,7 @@ public class EncryptedSnapshotTest extends
AbstractSnapshotSelfTest {
ig1.cluster().state(ACTIVE);
- GridTestUtils.assertThrowsAnyCause(
+ assertThrowsAnyCause(
log,
() -> snp(ig1).restoreSnapshot(SNAPSHOT_NAME,
Collections.singletonList(dfltCacheCfg.getName())).get(TIMEOUT),
IllegalStateException.class,
@@ -201,7 +201,7 @@ public class EncryptedSnapshotTest extends
AbstractSnapshotSelfTest {
IgniteEx ig2 = startGrids(2);
- GridTestUtils.assertThrowsAnyCause(
+ assertThrowsAnyCause(
log,
() -> snp(ig2).checkSnapshot(SNAPSHOT_NAME,
null).get().idleVerifyResult(),
IllegalStateException.class,
@@ -241,7 +241,7 @@ public class EncryptedSnapshotTest extends
AbstractSnapshotSelfTest {
ig.cluster().state(ACTIVE);
- GridTestUtils.assertThrowsAnyCause(
+ assertThrowsAnyCause(
log,
() -> snp(ig).checkSnapshot(SNAPSHOT_NAME,
null).get().idleVerifyResult(),
IllegalStateException.class,
@@ -269,7 +269,7 @@ public class EncryptedSnapshotTest extends
AbstractSnapshotSelfTest {
masterKeyName = AbstractEncryptionTest.MASTER_KEY_NAME_2;
- GridTestUtils.assertThrowsAnyCause(
+ assertThrowsAnyCause(
log,
() -> startGridsFromSnapshot(2, SNAPSHOT_NAME),
IgniteSpiException.class,
@@ -283,7 +283,7 @@ public class EncryptedSnapshotTest extends
AbstractSnapshotSelfTest {
// Start grid node with data before each test.
IgniteEx ig = startGridsWithCache(1, CACHE_KEYS_RANGE, valueBuilder(),
dfltCacheCfg);
- GridTestUtils.assertThrowsAnyCause(log,
+ assertThrowsAnyCause(log,
() -> snp(ig).registerSnapshotTask(SNAPSHOT_NAME,
null,
ig.localNode().id(),
@@ -399,7 +399,7 @@ public class EncryptedSnapshotTest extends
AbstractSnapshotSelfTest {
spi0.waitBlocked(TIMEOUT);
- GridTestUtils.assertThrowsAnyCause(log, () ->
action.apply(2).get(TIMEOUT), errType,
+ assertThrowsAnyCause(log, () -> action.apply(2).get(TIMEOUT), errType,
errPrefix + " Snapshot operation is in progress.");
spi0.unblock();
@@ -441,12 +441,12 @@ public class EncryptedSnapshotTest extends
AbstractSnapshotSelfTest {
discoSpi.waitBlocked(TIMEOUT);
- GridTestUtils.assertThrowsAnyCause(log,
+ assertThrowsAnyCause(log,
() -> grid(1).snapshot().restoreSnapshot(SNAPSHOT_NAME,
Collections.singletonList(CACHE2)).get(TIMEOUT),
IgniteCheckedException.class,
expectedError);
- GridTestUtils.assertThrowsAnyCause(log,
+ assertThrowsAnyCause(log,
() -> snp(grid(2)).createSnapshot(SNAPSHOT_NAME + "_v2", null,
false, onlyPrimary).get(TIMEOUT), IgniteCheckedException.class,
expectedError);
diff --git
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotSelfTest.java
index 686d17681bf..b95452fc6f5 100644
---
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotSelfTest.java
+++
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotSelfTest.java
@@ -321,9 +321,8 @@ public class IgniteClusterSnapshotSelfTest extends
AbstractSnapshotSelfTest {
TestRecordingCommunicationSpi.stopBlockAll();
}
- else {
+ else
snpIg0.cluster().state(ACTIVE);
- }
assertPartitionsSame(idleVerify(snpIg0, dfltCacheCfg.getName(),
atomicCcfg.getName()));
}
diff --git
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/incremental/IncrementalSnapshotCheckBeforeRestoreTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/incremental/IncrementalSnapshotCheckBeforeRestoreTest.java
index 6ebc4b64610..ad94d401065 100644
---
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/incremental/IncrementalSnapshotCheckBeforeRestoreTest.java
+++
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/incremental/IncrementalSnapshotCheckBeforeRestoreTest.java
@@ -124,7 +124,7 @@ public class IncrementalSnapshotCheckBeforeRestoreTest
extends AbstractSnapshotS
for (IgniteEx n : F.asList(grid(0), grid(GRID_CNT))) {
SnapshotPartitionsVerifyTaskResult res = snp(n).checkSnapshot(SNP,
null, null, false, 1, DFLT_CHECK_ON_RESTORE)
- .get(getTestTimeout());
+ .get(getTestTimeout());
assertTrue(res.exceptions().isEmpty());
assertTrue(res.idleVerifyResult().exceptions().isEmpty());
@@ -161,7 +161,7 @@ public class IncrementalSnapshotCheckBeforeRestoreTest
extends AbstractSnapshotS
for (IgniteEx n : F.asList(srv, grid(GRID_CNT))) {
SnapshotPartitionsVerifyTaskResult res = snp(n).checkSnapshot(SNP,
null, null, false, 0, DFLT_CHECK_ON_RESTORE)
- .get(getTestTimeout());
+ .get(getTestTimeout());
assertTrue(res.exceptions().isEmpty());
assertTrue(res.idleVerifyResult().exceptions().isEmpty());
diff --git
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/incremental/IncrementalSnapshotRestoreTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/incremental/IncrementalSnapshotRestoreTest.java
index ac58c9cba57..e311718e857 100644
---
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/incremental/IncrementalSnapshotRestoreTest.java
+++
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/incremental/IncrementalSnapshotRestoreTest.java
@@ -433,13 +433,11 @@ public class IncrementalSnapshotRestoreTest extends
AbstractIncrementalSnapshotT
// Corrupted WAL segment leads to different errors.
if (ex instanceof IgniteException) {
if (ex.getMessage().contains("Failed to read WAL record at
position")
- || ex.getMessage().contains("WAL tail reached not in the last
available segment")) {
+ || ex.getMessage().contains("WAL tail reached not in the last
available segment"))
expExc = true;
- }
}
- else if (ex instanceof AssertionError) {
+ else if (ex instanceof AssertionError)
expExc = true;
- }
assertTrue(ex.getMessage(), expExc);
diff --git
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryBackupQueueTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryBackupQueueTest.java
index af36d117afd..752860f950f 100644
---
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryBackupQueueTest.java
+++
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryBackupQueueTest.java
@@ -113,11 +113,9 @@ public class IgniteCacheContinuousQueryBackupQueueTest
extends GridCommonAbstrac
return TimeUnit.MINUTES.toMillis(10);
}
- /**
- * @throws Exception If failed.
- */
+ /** */
@Test
- public void testBackupQueue() throws Exception {
+ public void testBackupQueue() {
final CacheEventListener lsnr = new CacheEventListener();
ContinuousQuery<Object, Object> qry = new ContinuousQuery<>();
@@ -137,11 +135,9 @@ public class IgniteCacheContinuousQueryBackupQueueTest
extends GridCommonAbstrac
}
}
- /**
- * @throws Exception If failed.
- */
+ /** */
@Test
- public void testManyQueryBackupQueue() throws Exception {
+ public void testManyQueryBackupQueue() {
List<QueryCursor> qryCursors = new ArrayList<>();
for (int i = 0; i < QUERY_COUNT; i++) {
diff --git
a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryNetworkIssuesTest.java
b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryNetworkIssuesTest.java
index 12b655b3ec2..ea4ca2f0353 100644
---
a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryNetworkIssuesTest.java
+++
b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryNetworkIssuesTest.java
@@ -584,7 +584,7 @@ public class TcpDiscoveryNetworkIssuesTest extends
GridCommonAbstractTest {
private final Collection<InetSocketAddress> testAddrs;
/**
- * Creates test tco discovery spi.
+ * Creates test TCP discovery spi.
*
* @param node Original node.
* @param simulatedAddrs Simulated addresses of {@code node}
diff --git
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractSelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractSelfTest.java
index 69a43c3cb01..6e7ef9b047c 100644
---
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractSelfTest.java
+++
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractSelfTest.java
@@ -17,7 +17,6 @@
package org.apache.ignite.internal.processors.cache.index;
-import java.io.Serializable;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
@@ -46,6 +45,7 @@ import org.apache.ignite.internal.binary.BinaryMarshaller;
import org.apache.ignite.internal.util.typedef.T2;
import org.apache.ignite.internal.util.typedef.X;
import org.apache.ignite.lang.IgnitePredicate;
+
import static
org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree.CONC_DESTROY_MSG;
/**
@@ -455,7 +455,7 @@ public abstract class DynamicIndexAbstractSelfTest extends
AbstractSchemaSelfTes
/**
* Node filter.
*/
- protected static class NodeFilter implements IgnitePredicate<ClusterNode>,
Serializable {
+ protected static class NodeFilter implements IgnitePredicate<ClusterNode> {
/** */
private static final long serialVersionUID = 0L;