Skip to content

Commit 0e5dfe0

Browse files
IGNITE-26730 Rename SnapshotPartitionsVerifyTaskResult class (#12428)
1 parent 7f5aa0b commit 0e5dfe0

File tree

10 files changed

+43
-43
lines changed

10 files changed

+43
-43
lines changed

modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
import org.apache.ignite.internal.processors.cache.persistence.snapshot.DataStreamerUpdatesHandler;
110110
import org.apache.ignite.internal.processors.cache.persistence.snapshot.IgniteSnapshotManager;
111111
import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotPartitionsQuickVerifyHandler;
112-
import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotPartitionsVerifyTaskResult;
112+
import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotPartitionsVerifyResult;
113113
import org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx;
114114
import org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry;
115115
import org.apache.ignite.internal.processors.cache.transactions.TransactionProxyImpl;
@@ -3256,7 +3256,7 @@ public void testCheckSnapshot() throws Exception {
32563256

32573257
StringBuilder sb = new StringBuilder();
32583258

3259-
((SnapshotPartitionsVerifyTaskResult)h.getLastOperationResult()).print(sb::append);
3259+
((SnapshotPartitionsVerifyResult)h.getLastOperationResult()).print(sb::append);
32603260

32613261
assertContains(log, sb.toString(), "The check procedure has finished, no conflicts have been found");
32623262
}

modules/core/src/main/java/org/apache/ignite/internal/management/snapshot/SnapshotCheckCommand.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
package org.apache.ignite.internal.management.snapshot;
1919

2020
import java.util.function.Consumer;
21-
import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotPartitionsVerifyTaskResult;
21+
import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotPartitionsVerifyResult;
2222

2323
/** */
24-
public class SnapshotCheckCommand extends AbstractSnapshotCommand<SnapshotCheckCommandArg, SnapshotPartitionsVerifyTaskResult> {
24+
public class SnapshotCheckCommand extends AbstractSnapshotCommand<SnapshotCheckCommandArg, SnapshotPartitionsVerifyResult> {
2525
/** {@inheritDoc} */
2626
@Override public String description() {
2727
return "Check snapshot";
@@ -38,7 +38,7 @@ public class SnapshotCheckCommand extends AbstractSnapshotCommand<SnapshotCheckC
3838
}
3939

4040
/** {@inheritDoc} */
41-
@Override public void printResult(SnapshotCheckCommandArg arg, SnapshotPartitionsVerifyTaskResult res, Consumer<String> printer) {
41+
@Override public void printResult(SnapshotCheckCommandArg arg, SnapshotPartitionsVerifyResult res, Consumer<String> printer) {
4242
res.print(printer);
4343
}
4444
}

modules/core/src/main/java/org/apache/ignite/internal/management/snapshot/SnapshotCheckTask.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import org.apache.ignite.IgniteException;
2121
import org.apache.ignite.internal.processors.cache.persistence.snapshot.IgniteSnapshotManager;
22-
import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotPartitionsVerifyTaskResult;
22+
import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotPartitionsVerifyResult;
2323
import org.apache.ignite.internal.processors.task.GridInternal;
2424
import org.apache.ignite.internal.util.future.IgniteFutureImpl;
2525
import org.apache.ignite.internal.visor.VisorJob;
@@ -29,17 +29,17 @@
2929
* @see IgniteSnapshotManager#checkSnapshot(String, String)
3030
*/
3131
@GridInternal
32-
public class SnapshotCheckTask extends VisorOneNodeTask<SnapshotCheckCommandArg, SnapshotPartitionsVerifyTaskResult> {
32+
public class SnapshotCheckTask extends VisorOneNodeTask<SnapshotCheckCommandArg, SnapshotPartitionsVerifyResult> {
3333
/** Serial version uid. */
3434
private static final long serialVersionUID = 0L;
3535

3636
/** {@inheritDoc} */
37-
@Override protected VisorJob<SnapshotCheckCommandArg, SnapshotPartitionsVerifyTaskResult> job(SnapshotCheckCommandArg arg) {
37+
@Override protected VisorJob<SnapshotCheckCommandArg, SnapshotPartitionsVerifyResult> job(SnapshotCheckCommandArg arg) {
3838
return new SnapshotCheckJob(arg, debug);
3939
}
4040

4141
/** */
42-
private static class SnapshotCheckJob extends SnapshotJob<SnapshotCheckCommandArg, SnapshotPartitionsVerifyTaskResult> {
42+
private static class SnapshotCheckJob extends SnapshotJob<SnapshotCheckCommandArg, SnapshotPartitionsVerifyResult> {
4343
/** Serial version uid. */
4444
private static final long serialVersionUID = 0L;
4545

@@ -52,7 +52,7 @@ protected SnapshotCheckJob(SnapshotCheckCommandArg arg, boolean debug) {
5252
}
5353

5454
/** {@inheritDoc} */
55-
@Override protected SnapshotPartitionsVerifyTaskResult run(SnapshotCheckCommandArg arg) throws IgniteException {
55+
@Override protected SnapshotPartitionsVerifyResult run(SnapshotCheckCommandArg arg) throws IgniteException {
5656
IgniteSnapshotManager snpMgr = ignite.context().cache().context().snapshotMgr();
5757

5858
return new IgniteFutureImpl<>(snpMgr.checkSnapshot(arg.snapshotName(), arg.src(), arg.increment())).get();

modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotManager.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1663,7 +1663,7 @@ public IgniteFuture<Boolean> cancelLocalRestoreTask(String name) {
16631663
* @return Future with the result of execution snapshot partitions verify task, which besides calculating partition
16641664
* hashes of {@link IdleVerifyResult} also contains the snapshot metadata distribution across the cluster.
16651665
*/
1666-
public IgniteInternalFuture<SnapshotPartitionsVerifyTaskResult> checkSnapshot(String name, @Nullable String snpPath) {
1666+
public IgniteInternalFuture<SnapshotPartitionsVerifyResult> checkSnapshot(String name, @Nullable String snpPath) {
16671667
return checkSnapshot(name, snpPath, -1);
16681668
}
16691669

@@ -1676,7 +1676,7 @@ public IgniteInternalFuture<SnapshotPartitionsVerifyTaskResult> checkSnapshot(St
16761676
* @return Future with the result of execution snapshot partitions verify task, which besides calculating partition
16771677
* hashes of {@link IdleVerifyResult} also contains the snapshot metadata distribution across the cluster.
16781678
*/
1679-
public IgniteInternalFuture<SnapshotPartitionsVerifyTaskResult> checkSnapshot(String name, @Nullable String snpPath, int incIdx) {
1679+
public IgniteInternalFuture<SnapshotPartitionsVerifyResult> checkSnapshot(String name, @Nullable String snpPath, int incIdx) {
16801680
A.notNullOrEmpty(name, "Snapshot name cannot be null or empty.");
16811681
A.ensure(U.alphanumericUnderscore(name), "Snapshot name must satisfy the following name pattern: a-zA-Z0-9_");
16821682

@@ -1707,7 +1707,7 @@ public IgniteInternalFuture<SnapshotPartitionsVerifyTaskResult> checkSnapshot(St
17071707
* @return Future with the result of execution snapshot partitions verify task, which besides calculating partition
17081708
* hashes of {@link IdleVerifyResult} also contains the snapshot metadata distribution across the cluster.
17091709
*/
1710-
public IgniteInternalFuture<SnapshotPartitionsVerifyTaskResult> checkSnapshot(
1710+
public IgniteInternalFuture<SnapshotPartitionsVerifyResult> checkSnapshot(
17111711
String name,
17121712
@Nullable String snpPath,
17131713
@Nullable Collection<String> grps,
@@ -1726,7 +1726,7 @@ public IgniteInternalFuture<SnapshotPartitionsVerifyTaskResult> checkSnapshot(
17261726
", incIdx=" + incIdx + ", grps=" + grps + ", validateParts=" + check + ']');
17271727
}
17281728

1729-
IgniteInternalFuture<SnapshotPartitionsVerifyTaskResult> res = checkSnpProc.start(
1729+
IgniteInternalFuture<SnapshotPartitionsVerifyResult> res = checkSnpProc.start(
17301730
name, snpPath, grps, check, incIdx, includeCustomHandlers);
17311731

17321732
res.listen(lsnr -> {

modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotCheckProcess.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public class SnapshotCheckProcess {
7373
private final Map<String, SnapshotCheckContext> contexts = new ConcurrentHashMap<>();
7474

7575
/** Cluster-wide operation futures per snapshot called from current node. */
76-
private final Map<UUID, GridFutureAdapter<SnapshotPartitionsVerifyTaskResult>> clusterOpFuts = new ConcurrentHashMap<>();
76+
private final Map<UUID, GridFutureAdapter<SnapshotPartitionsVerifyResult>> clusterOpFuts = new ConcurrentHashMap<>();
7777

7878
/** Check metas first phase subprocess. */
7979
private final DistributedProcess<SnapshotCheckProcessRequest, SnapshotCheckResponse> phase1CheckMetas;
@@ -127,7 +127,7 @@ private IgniteInternalFuture<?> reduceValidatePartsAndFinish(
127127
try {
128128
contexts.remove(ctx.req.snapshotName());
129129

130-
GridFutureAdapter<SnapshotPartitionsVerifyTaskResult> clusterOpFut = clusterOpFuts.get(reqId);
130+
GridFutureAdapter<SnapshotPartitionsVerifyResult> clusterOpFut = clusterOpFuts.get(reqId);
131131

132132
if (clusterOpFut == null)
133133
return new GridFinishedFuture<>();
@@ -170,7 +170,7 @@ private void reduceIncrementalResults(
170170
Map<ClusterNode, List<SnapshotMetadata>> clusterMetas,
171171
Map<UUID, SnapshotCheckResponse> results,
172172
Map<UUID, Throwable> errors,
173-
GridFutureAdapter<SnapshotPartitionsVerifyTaskResult> fut
173+
GridFutureAdapter<SnapshotPartitionsVerifyResult> fut
174174
) {
175175
Map<ClusterNode, IncrementalSnapshotVerifyResult> perNodeResults = new HashMap<>(results.size(), 1.0f);
176176

@@ -192,15 +192,15 @@ private void reduceIncrementalResults(
192192

193193
IdleVerifyResult chkRes = snpChecker.reduceIncrementalResults(sft, incIdx, perNodeResults, mapErrors(errors));
194194

195-
fut.onDone(new SnapshotPartitionsVerifyTaskResult(clusterMetas, chkRes));
195+
fut.onDone(new SnapshotPartitionsVerifyResult(clusterMetas, chkRes));
196196
}
197197

198198
/** */
199199
private void reduceCustomHandlersResults(
200200
SnapshotCheckContext ctx,
201201
Map<UUID, SnapshotCheckResponse> results,
202202
Map<UUID, Throwable> errors,
203-
GridFutureAdapter<SnapshotPartitionsVerifyTaskResult> fut
203+
GridFutureAdapter<SnapshotPartitionsVerifyResult> fut
204204
) {
205205
try {
206206
if (!errors.isEmpty())
@@ -234,7 +234,7 @@ private void reduceCustomHandlersResults(
234234

235235
snpChecker.checkCustomHandlersResults(ctx.req.snapshotName(), reduced);
236236

237-
fut.onDone(new SnapshotPartitionsVerifyTaskResult(ctx.clusterMetas, null));
237+
fut.onDone(new SnapshotPartitionsVerifyResult(ctx.clusterMetas, null));
238238
}
239239
catch (Throwable err) {
240240
fut.onDone(err);
@@ -246,7 +246,7 @@ private void reducePartitionsHashesResults(
246246
Map<ClusterNode, List<SnapshotMetadata>> clusterMetas,
247247
Map<UUID, SnapshotCheckResponse> results,
248248
Map<UUID, Throwable> errors,
249-
GridFutureAdapter<SnapshotPartitionsVerifyTaskResult> fut
249+
GridFutureAdapter<SnapshotPartitionsVerifyResult> fut
250250
) {
251251
IdleVerifyResult.Builder bldr = IdleVerifyResult.builder();
252252

@@ -273,7 +273,7 @@ private void reducePartitionsHashesResults(
273273
partsHashesRes.forEach((consId, partsPerConsId) -> bldr.addPartitionHashes(partsPerConsId));
274274
}
275275

276-
fut.onDone(new SnapshotPartitionsVerifyTaskResult(clusterMetas, bldr.build()));
276+
fut.onDone(new SnapshotPartitionsVerifyResult(clusterMetas, bldr.build()));
277277
}
278278
else
279279
fut.onDone(new IgniteSnapshotVerifyException(errors0));
@@ -469,7 +469,7 @@ private void reducePreparationAndMetasCheck(
469469
SnapshotCheckContext ctx = context(null, reqId);
470470

471471
// The context is not stored in the case of concurrent check of the same snapshot but the operation future is registered.
472-
GridFutureAdapter<SnapshotPartitionsVerifyTaskResult> clusterOpFut = clusterOpFuts.get(reqId);
472+
GridFutureAdapter<SnapshotPartitionsVerifyResult> clusterOpFut = clusterOpFuts.get(reqId);
473473

474474
try {
475475
if (!errors.isEmpty())
@@ -592,7 +592,7 @@ private void reducePreparationAndMetasCheck(
592592
* {@link SnapshotHandlerType#RESTORE} are invoked. Otherwise, only snapshot metadatas and partition
593593
* hashes are validated.
594594
*/
595-
public IgniteInternalFuture<SnapshotPartitionsVerifyTaskResult> start(
595+
public IgniteInternalFuture<SnapshotPartitionsVerifyResult> start(
596596
String snpName,
597597
@Nullable String snpPath,
598598
@Nullable Collection<String> grpNames,
@@ -617,7 +617,7 @@ public IgniteInternalFuture<SnapshotPartitionsVerifyTaskResult> start(
617617
allRestoreHandlers
618618
);
619619

620-
GridFutureAdapter<SnapshotPartitionsVerifyTaskResult> clusterOpFut = new GridFutureAdapter<>();
620+
GridFutureAdapter<SnapshotPartitionsVerifyResult> clusterOpFut = new GridFutureAdapter<>();
621621

622622
clusterOpFut.listen(fut -> clusterOpFuts.remove(reqId));
623623

modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotPartitionsVerifyTaskResult.java renamed to modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotPartitionsVerifyResult.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
* The result of execution snapshot partitions verify task which besides calculating partition hashes of
3939
* {@link IdleVerifyResult} also contains the snapshot metadata distribution across the cluster.
4040
*/
41-
public class SnapshotPartitionsVerifyTaskResult extends IgniteDataTransferObject {
41+
public class SnapshotPartitionsVerifyResult extends IgniteDataTransferObject {
4242
/** Serial version uid. */
4343
private static final long serialVersionUID = 0L;
4444

@@ -49,15 +49,15 @@ public class SnapshotPartitionsVerifyTaskResult extends IgniteDataTransferObject
4949
@Nullable private IdleVerifyResult idleRes;
5050

5151
/** Default constructor. */
52-
public SnapshotPartitionsVerifyTaskResult() {
52+
public SnapshotPartitionsVerifyResult() {
5353
// No-op.
5454
}
5555

5656
/**
5757
* @param metas Map of snapshot metadata information found on each cluster node.
5858
* @param idleRes Result of cluster nodes partitions comparison.
5959
*/
60-
SnapshotPartitionsVerifyTaskResult(
60+
SnapshotPartitionsVerifyResult(
6161
Map<ClusterNode, List<SnapshotMetadata>> metas,
6262
@Nullable IdleVerifyResult idleRes
6363
) {

modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotCheckTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ public void testClusterSnapshotCheckHashesSameAsIdleVerifyHashes() throws Except
526526
/** @throws Exception If fails. */
527527
@Test
528528
public void testClusterSnapshotCheckWithTwoCachesCheckNullInput() throws Exception {
529-
SnapshotPartitionsVerifyTaskResult res = checkSnapshotWithTwoCachesWhenOneIsCorrupted(null);
529+
SnapshotPartitionsVerifyResult res = checkSnapshotWithTwoCachesWhenOneIsCorrupted(null);
530530

531531
StringBuilder b = new StringBuilder();
532532
res.idleVerifyResult().print(b::append, true);
@@ -540,7 +540,7 @@ public void testClusterSnapshotCheckWithTwoCachesCheckNullInput() throws Excepti
540540
/** @throws Exception If fails. */
541541
@Test
542542
public void testClusterSnapshotCheckWithTwoCachesCheckNotCorrupted() throws Exception {
543-
SnapshotPartitionsVerifyTaskResult res = checkSnapshotWithTwoCachesWhenOneIsCorrupted(Collections.singletonList(
543+
SnapshotPartitionsVerifyResult res = checkSnapshotWithTwoCachesWhenOneIsCorrupted(Collections.singletonList(
544544
OPTIONAL_CACHE_NAME));
545545

546546
StringBuilder b = new StringBuilder();
@@ -597,7 +597,7 @@ public void testCheckFromLesserTopology() throws Exception {
597597
/** @throws Exception If fails. */
598598
@Test
599599
public void testClusterSnapshotCheckWithTwoCachesCheckTwoCaches() throws Exception {
600-
SnapshotPartitionsVerifyTaskResult res = checkSnapshotWithTwoCachesWhenOneIsCorrupted(Arrays.asList(
600+
SnapshotPartitionsVerifyResult res = checkSnapshotWithTwoCachesWhenOneIsCorrupted(Arrays.asList(
601601
OPTIONAL_CACHE_NAME, DEFAULT_CACHE_NAME));
602602

603603
StringBuilder b = new StringBuilder();
@@ -1318,7 +1318,7 @@ public void testClusterSnapshotCheckWithExpiring() throws Exception {
13181318

13191319
snp(ignite).createSnapshot(SNAPSHOT_NAME).get(timeout);
13201320

1321-
SnapshotPartitionsVerifyTaskResult res = snp(ignite).checkSnapshot(SNAPSHOT_NAME, null).get(timeout);
1321+
SnapshotPartitionsVerifyResult res = snp(ignite).checkSnapshot(SNAPSHOT_NAME, null).get(timeout);
13221322

13231323
assertFalse(res.idleVerifyResult().hasConflicts());
13241324
}
@@ -1363,7 +1363,7 @@ private void saveHashes(Class<?> cls, List<ComputeJobResult> results) {
13631363
* @return Check result.
13641364
* @throws Exception If fails.
13651365
*/
1366-
private SnapshotPartitionsVerifyTaskResult checkSnapshotWithTwoCachesWhenOneIsCorrupted(
1366+
private SnapshotPartitionsVerifyResult checkSnapshotWithTwoCachesWhenOneIsCorrupted(
13671367
Collection<String> cachesToCheck
13681368
) throws Exception {
13691369
Random rnd = new Random();

modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotStreamerTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ private void doTestDataStreamerWhileSnapshot(IgniteEx snpHnd, boolean allowOverw
351351
String notExpWrn = allowOverwrite ? null : SnapshotPartitionsQuickVerifyHandler.WRN_MSG;
352352

353353
try {
354-
SnapshotPartitionsVerifyTaskResult checkRes = createAndCheckSnapshot(snpHnd, true, expectedWrn,
354+
SnapshotPartitionsVerifyResult checkRes = createAndCheckSnapshot(snpHnd, true, expectedWrn,
355355
notExpWrn);
356356

357357
if (expectedWrn != null) {
@@ -462,7 +462,7 @@ private IgniteInternalFuture<?> runLoad(Ignite ldr, boolean allowOverwrite, Atom
462462
}
463463

464464
/** */
465-
private SnapshotPartitionsVerifyTaskResult createAndCheckSnapshot(IgniteEx snpHnd, boolean create,
465+
private SnapshotPartitionsVerifyResult createAndCheckSnapshot(IgniteEx snpHnd, boolean create,
466466
String expWrn, String notExpWrn) throws Exception {
467467
assert notExpWrn == null || expWrn != null;
468468

@@ -498,7 +498,7 @@ private SnapshotPartitionsVerifyTaskResult createAndCheckSnapshot(IgniteEx snpHn
498498
}
499499
}
500500

501-
SnapshotPartitionsVerifyTaskResult checkRes = snp(snpHnd).checkSnapshot(SNAPSHOT_NAME, null).get();
501+
SnapshotPartitionsVerifyResult checkRes = snp(snpHnd).checkSnapshot(SNAPSHOT_NAME, null).get();
502502

503503
assertTrue(checkRes.exceptions().isEmpty());
504504

modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/incremental/ConcurrentTxsIncrementalSnapshotTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import org.apache.ignite.configuration.IgniteConfiguration;
3333
import org.apache.ignite.configuration.NearCacheConfiguration;
3434
import org.apache.ignite.internal.IgniteInternalFuture;
35-
import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotPartitionsVerifyTaskResult;
35+
import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotPartitionsVerifyResult;
3636
import org.apache.ignite.internal.util.typedef.F;
3737
import org.apache.ignite.testframework.GridTestUtils;
3838
import org.apache.ignite.transactions.Transaction;
@@ -267,7 +267,7 @@ private void testConcurrentTransactionsAndSnapshots(Supplier<Boolean> tx) throws
267267
checkWalsConsistency(txCnt.get(), SNP_CNT);
268268

269269
for (int i = 0; i < SNP_CNT; i++) {
270-
SnapshotPartitionsVerifyTaskResult res = snp(grid(0)).checkSnapshot(SNP, null, i).get(getTestTimeout());
270+
SnapshotPartitionsVerifyResult res = snp(grid(0)).checkSnapshot(SNP, null, i).get(getTestTimeout());
271271

272272
assertTrue(F.isEmpty(res.exceptions()));
273273
assertFalse(res.idleVerifyResult().hasConflicts());

0 commit comments

Comments
 (0)