Skip to content

Commit

Permalink
IGNITE-24084 Remove V2 related code
Browse files Browse the repository at this point in the history
  • Loading branch information
maksaska committed Jan 13, 2025
1 parent b33b70a commit c6f7d22
Show file tree
Hide file tree
Showing 28 changed files with 111 additions and 111 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.GridKernalContextImpl;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.management.cache.IdleVerifyResultV2;
import org.apache.ignite.internal.management.cache.IdleVerifyResult;
import org.apache.ignite.internal.processors.cache.persistence.file.FileIO;
import org.apache.ignite.internal.processors.cache.persistence.file.RandomAccessFileIO;
import org.apache.ignite.internal.processors.compress.CompressionProcessor;
Expand Down Expand Up @@ -336,7 +336,7 @@ protected void createTestSnapshot() throws Exception {
for (String snpName : Arrays.asList(SNAPSHOT_WITH_HOLES, SNAPSHOT_WITHOUT_HOLES)) {
snp(ignite).createSnapshot(snpName, null, false, onlyPrimary).get(TIMEOUT);

IdleVerifyResultV2 res = ignite.context().cache().context().snapshotMgr().checkSnapshot(snpName, null)
IdleVerifyResult res = ignite.context().cache().context().snapshotMgr().checkSnapshot(snpName, null)
.get().idleVerifyResult();

StringBuilder b = new StringBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.apache.ignite.internal.GridKernalContext;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.TestRecordingCommunicationSpi;
import org.apache.ignite.internal.management.cache.IdleVerifyResultV2;
import org.apache.ignite.internal.management.cache.IdleVerifyResult;
import org.apache.ignite.internal.pagemem.wal.IgniteWriteAheadLogManager;
import org.apache.ignite.internal.pagemem.wal.record.DataRecord;
import org.apache.ignite.internal.pagemem.wal.record.TxRecord;
Expand Down Expand Up @@ -378,7 +378,7 @@ public void atomicCachesAreSkippedDuringTheCheck() throws Exception {

grid(0).snapshot().restoreSnapshot(atomicSnp, null, 1).get();

IdleVerifyResultV2 idleVerRes = idleVerify(grid(0), CACHE, atomicCache);
IdleVerifyResult idleVerRes = idleVerify(grid(0), CACHE, atomicCache);

idleVerRes.print(System.out::println, true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import org.apache.ignite.events.EventType;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.management.cache.IdleVerifyTaskV2;
import org.apache.ignite.internal.management.cache.IdleVerifyTask;
import org.apache.ignite.internal.management.cache.ValidateIndexesClosure;
import org.apache.ignite.internal.management.cache.ValidateIndexesTask;
import org.apache.ignite.internal.util.typedef.internal.S;
Expand All @@ -57,7 +57,7 @@ public class GridCommandHandlerInterruptCommandTest extends GridCommandHandlerAb
private static final int LOAD_LOOP = 500_000;

/** Idle verify task name. */
private static final String IDLE_VERIFY_TASK_V2 = IdleVerifyTaskV2.class.getName();
private static final String IDLE_VERIFY_TASK = IdleVerifyTask.class.getName();

/** Validate index task name. */
private static final String VALIDATE_INDEX_TASK = ValidateIndexesTask.class.getName();
Expand Down Expand Up @@ -234,7 +234,7 @@ public void testIdleVerifyCommand() throws Exception {

preloadeData(ignite);

CountDownLatch startTaskLatch = waitForTaskEvent(ignite, IDLE_VERIFY_TASK_V2);
CountDownLatch startTaskLatch = waitForTaskEvent(ignite, IDLE_VERIFY_TASK);

LogListener lnsrValidationCancelled = LogListener.matches("The check procedure was cancelled.").build();
LogListener lnsrIdleVerifyStart = LogListener.matches("Idle verify procedure has started").build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
import org.apache.ignite.internal.client.util.GridConcurrentHashSet;
import org.apache.ignite.internal.management.cache.FindAndDeleteGarbageInPersistenceTaskResult;
import org.apache.ignite.internal.management.cache.IdleVerifyDumpTask;
import org.apache.ignite.internal.management.cache.VerifyBackupPartitionsTaskV2;
import org.apache.ignite.internal.management.cache.VerifyBackupPartitionsTask;
import org.apache.ignite.internal.management.tx.TxInfo;
import org.apache.ignite.internal.management.tx.TxTaskResult;
import org.apache.ignite.internal.managers.communication.GridIoMessage;
Expand Down Expand Up @@ -772,7 +772,7 @@ public void testIdleVerifyOnInactiveClusterWithPersistence() throws Exception {

assertEquals(EXIT_CODE_UNEXPECTED_ERROR, execute("--cache", "idle_verify"));

assertContains(log, testOut.toString(), VerifyBackupPartitionsTaskV2.IDLE_VERIFY_ON_INACTIVE_CLUSTER_ERROR_MESSAGE);
assertContains(log, testOut.toString(), VerifyBackupPartitionsTask.IDLE_VERIFY_ON_INACTIVE_CLUSTER_ERROR_MESSAGE);
assertContains(log, testOut.toString(), "Failed to perform operation");

srv.cluster().state(ACTIVE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/**
* Represents a type of cache(s) that can be used for comparing update counters and checksums between primary and backup partitions.
* <br>
* @see VerifyBackupPartitionsTaskV2
* @see VerifyBackupPartitionsTask
*/
public enum CacheFilterEnum {
/** Default - user only, or all caches specified by name. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
/** Checks consistency of primary and backup partitions assuming no concurrent updates are happening in the cluster. */
@CliSubcommandsWithPrefix
public class CacheIdleVerifyCommand
extends CommandRegistryImpl<CacheIdleVerifyCommandArg, IdleVerifyResultV2>
implements ComputeCommand<CacheIdleVerifyCommandArg, IdleVerifyResultV2> {
extends CommandRegistryImpl<CacheIdleVerifyCommandArg, IdleVerifyResult>
implements ComputeCommand<CacheIdleVerifyCommandArg, IdleVerifyResult> {
/** */
public static final String IDLE_VERIFY_FILE_PREFIX = "idle_verify-";

Expand Down Expand Up @@ -70,12 +70,12 @@ public CacheIdleVerifyCommand() {
}

/** {@inheritDoc} */
@Override public Class<IdleVerifyTaskV2> taskClass() {
return IdleVerifyTaskV2.class;
@Override public Class<IdleVerifyTask> taskClass() {
return IdleVerifyTask.class;
}

/** {@inheritDoc} */
@Override public void printResult(CacheIdleVerifyCommandArg arg, IdleVerifyResultV2 res, Consumer<String> printer) {
@Override public void printResult(CacheIdleVerifyCommandArg arg, IdleVerifyResult res, Consumer<String> printer) {
logParsedArgs(arg, printer);

StringBuilder sb = new StringBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.apache.ignite.internal.util.typedef.F;

/**
* This exception is used to collect exceptions occured in {@link VerifyBackupPartitionsTaskV2} execution.
* This exception is used to collect exceptions occured in {@link VerifyBackupPartitionsTask} execution.
*/
public class IdleVerifyException extends IgniteException {
/** */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
import static org.apache.ignite.internal.util.IgniteUtils.nl;

/**
* Encapsulates result of {@link VerifyBackupPartitionsTaskV2}.
* Encapsulates result of {@link VerifyBackupPartitionsTask}.
*/
public class IdleVerifyResultV2 extends VisorDataTransferObject {
public class IdleVerifyResult extends VisorDataTransferObject {
/** */
private static final long serialVersionUID = 0L;

Expand Down Expand Up @@ -82,20 +82,20 @@ public class IdleVerifyResultV2 extends VisorDataTransferObject {
/**
* Default constructor for Externalizable.
*/
public IdleVerifyResultV2() {
public IdleVerifyResult() {
}

/**
* @param exceptions Occurred exceptions.
*/
public IdleVerifyResultV2(Map<ClusterNode, Exception> exceptions) {
public IdleVerifyResult(Map<ClusterNode, Exception> exceptions) {
this.exceptions = exceptions;
}

/**
* @param txHashConflicts Transaction hashes conflicts.
*/
public IdleVerifyResultV2(
public IdleVerifyResult(
Map<PartitionKeyV2, List<PartitionHashRecordV2>> clusterHashes,
@Nullable List<List<TransactionsHashRecord>> txHashConflicts,
@Nullable Map<ClusterNode, Collection<GridCacheVersion>> partiallyCommittedTxs
Expand All @@ -110,7 +110,7 @@ public IdleVerifyResultV2(
* @param clusterHashes Map of cluster partition hashes.
* @param exceptions Exceptions on each cluster node.
*/
public IdleVerifyResultV2(
public IdleVerifyResult(
Map<PartitionKeyV2, List<PartitionHashRecordV2>> clusterHashes,
Map<ClusterNode, Exception> exceptions
) {
Expand Down Expand Up @@ -390,12 +390,12 @@ private void printConflicts(Consumer<String> printer) {
if (o == null || getClass() != o.getClass())
return false;

IdleVerifyResultV2 v2 = (IdleVerifyResultV2)o;
IdleVerifyResult v = (IdleVerifyResult)o;

return Objects.equals(cntrConflicts, v2.cntrConflicts) && Objects.equals(hashConflicts, v2.hashConflicts) &&
Objects.equals(movingPartitions, v2.movingPartitions) && Objects.equals(lostPartitions, v2.lostPartitions) &&
Objects.equals(exceptions, v2.exceptions) && Objects.equals(txHashConflicts, v2.txHashConflicts) &&
Objects.equals(partiallyCommittedTxs, v2.partiallyCommittedTxs);
return Objects.equals(cntrConflicts, v.cntrConflicts) && Objects.equals(hashConflicts, v.hashConflicts) &&
Objects.equals(movingPartitions, v.movingPartitions) && Objects.equals(lostPartitions, v.lostPartitions) &&
Objects.equals(exceptions, v.exceptions) && Objects.equals(txHashConflicts, v.txHashConflicts) &&
Objects.equals(partiallyCommittedTxs, v.partiallyCommittedTxs);
}

/** {@inheritDoc} */
Expand All @@ -412,6 +412,6 @@ private void printConflicts(Consumer<String> printer) {

/** {@inheritDoc} */
@Override public String toString() {
return S.toString(IdleVerifyResultV2.class, this);
return S.toString(IdleVerifyResult.class, this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
* Task to verify checksums of backup partitions.
*/
@GridInternal
public class IdleVerifyTaskV2 extends VisorOneNodeTask<CacheIdleVerifyCommandArg, IdleVerifyResultV2> {
public class IdleVerifyTask extends VisorOneNodeTask<CacheIdleVerifyCommandArg, IdleVerifyResult> {
/** */
private static final long serialVersionUID = 0L;

/** {@inheritDoc} */
@Override protected VisorJob<CacheIdleVerifyCommandArg, IdleVerifyResultV2> job(CacheIdleVerifyCommandArg arg) {
@Override protected VisorJob<CacheIdleVerifyCommandArg, IdleVerifyResult> job(CacheIdleVerifyCommandArg arg) {
if (!ignite.context().state().publicApiActiveState(true))
throw new IgniteException(VerifyBackupPartitionsTaskV2.IDLE_VERIFY_ON_INACTIVE_CLUSTER_ERROR_MESSAGE);
throw new IgniteException(VerifyBackupPartitionsTask.IDLE_VERIFY_ON_INACTIVE_CLUSTER_ERROR_MESSAGE);

return new IdleVerifyJob<>(arg, debug, VerifyBackupPartitionsTaskV2.class);
return new IdleVerifyJob<>(arg, debug, VerifyBackupPartitionsTask.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import org.apache.ignite.IgniteException;

/**
* Runtime exception that can be thrown in {@link VerifyBackupPartitionsTaskV2} when no caches matching given
* Runtime exception that can be thrown in {@link VerifyBackupPartitionsTask} when no caches matching given
* filter options can be found.
*/
public class NoMatchingCachesException extends IgniteException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public class VerifyBackupPartitionsDumpTask extends ComputeTaskAdapter<CacheIdle
public static final String IDLE_DUMP_FILE_PREFIX = "idle-dump-";

/** Delegate for map execution */
private final VerifyBackupPartitionsTaskV2 delegate = new VerifyBackupPartitionsTaskV2();
private final VerifyBackupPartitionsTask delegate = new VerifyBackupPartitionsTask();

/** */
private CacheIdleVerifyDumpCommandArg taskArg;
Expand Down Expand Up @@ -172,7 +172,7 @@ record = records.get(i);
*/
private String writeHashes(
Map<PartitionKeyV2, List<PartitionHashRecordV2>> partitions,
IdleVerifyResultV2 conflictRes,
IdleVerifyResult conflictRes,
int skippedRecords
) throws IgniteException {
String wd = ignite.configuration().getWorkDirectory();
Expand Down Expand Up @@ -204,7 +204,7 @@ private String writeHashes(
/** */
private void writeResult(
Map<PartitionKeyV2, List<PartitionHashRecordV2>> partitions,
IdleVerifyResultV2 conflictRes,
IdleVerifyResult conflictRes,
int skippedRecords,
PrintWriter writer
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@
* <br>
* Argument: Set of cache names, 'null' will trigger verification for all caches.
* <br>
* Result: {@link IdleVerifyResultV2} with conflict partitions.
* Result: {@link IdleVerifyResult} with conflict partitions.
* <br>
* Works properly only on idle cluster - there may be false positive conflict reports if data in cluster is being
* concurrently updated.
*/
@GridInternal
public class VerifyBackupPartitionsTaskV2 extends ComputeTaskAdapter<CacheIdleVerifyCommandArg, IdleVerifyResultV2> {
public class VerifyBackupPartitionsTask extends ComputeTaskAdapter<CacheIdleVerifyCommandArg, IdleVerifyResult> {
/** Error thrown when idle_verify is called on an inactive cluster with persistence. */
public static final String IDLE_VERIFY_ON_INACTIVE_CLUSTER_ERROR_MESSAGE = "Cannot perform the operation because " +
"the cluster is inactive.";
Expand Down Expand Up @@ -111,13 +111,13 @@ public class VerifyBackupPartitionsTaskV2 extends ComputeTaskAdapter<CacheIdleVe
Map<ComputeJob, ClusterNode> jobs = new HashMap<>();

for (ClusterNode node : subgrid)
jobs.put(new VerifyBackupPartitionsJobV2(arg), node);
jobs.put(new VerifyBackupPartitionsJob(arg), node);

return jobs;
}

/** {@inheritDoc} */
@Nullable @Override public IdleVerifyResultV2 reduce(List<ComputeJobResult> results) throws IgniteException {
@Nullable @Override public IdleVerifyResult reduce(List<ComputeJobResult> results) throws IgniteException {
return reduce0(results);
}

Expand All @@ -134,7 +134,7 @@ public class VerifyBackupPartitionsTaskV2 extends ComputeTaskAdapter<CacheIdleVe
superRes = ComputeJobResultPolicy.WAIT;

if (log != null) {
log.warning("VerifyBackupPartitionsJobV2 failed on node " +
log.warning("VerifyBackupPartitionsJob failed on node " +
"[consistentId=" + res.getNode().consistentId() + "]", res.getException());
}
}
Expand All @@ -150,7 +150,7 @@ public class VerifyBackupPartitionsTaskV2 extends ComputeTaskAdapter<CacheIdleVe
* @param results Received results of broadcast remote requests.
* @return Idle verify job result constructed from results of remote executions.
*/
public static IdleVerifyResultV2 reduce0(List<ComputeJobResult> results) {
public static IdleVerifyResult reduce0(List<ComputeJobResult> results) {
Map<PartitionKeyV2, List<PartitionHashRecordV2>> clusterHashes = new HashMap<>();
Map<ClusterNode, Exception> ex = new HashMap<>();

Expand All @@ -171,15 +171,15 @@ public static IdleVerifyResultV2 reduce0(List<ComputeJobResult> results) {
}

if (results.size() != ex.size())
return new IdleVerifyResultV2(clusterHashes, ex);
return new IdleVerifyResult(clusterHashes, ex);
else
return new IdleVerifyResultV2(ex);
return new IdleVerifyResult(ex);
}

/**
* Job that collects update counters and hashes of local partitions.
*/
private static class VerifyBackupPartitionsJobV2 extends ComputeJobAdapter {
private static class VerifyBackupPartitionsJob extends ComputeJobAdapter {
/** */
private static final long serialVersionUID = 0L;

Expand All @@ -200,7 +200,7 @@ private static class VerifyBackupPartitionsJobV2 extends ComputeJobAdapter {
/**
* @param arg Argument.
*/
public VerifyBackupPartitionsJobV2(CacheIdleVerifyCommandArg arg) {
public VerifyBackupPartitionsJob(CacheIdleVerifyCommandArg arg) {
this.arg = arg;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException;
import org.apache.ignite.internal.cluster.DistributedConfigurationUtils;
import org.apache.ignite.internal.events.DiscoveryCustomEvent;
import org.apache.ignite.internal.management.cache.IdleVerifyResultV2;
import org.apache.ignite.internal.management.cache.IdleVerifyResult;
import org.apache.ignite.internal.managers.communication.GridIoManager;
import org.apache.ignite.internal.managers.communication.GridMessageListener;
import org.apache.ignite.internal.managers.communication.TransmissionCancelledException;
Expand Down Expand Up @@ -1832,7 +1832,7 @@ public IgniteFuture<Boolean> cancelLocalRestoreTask(String name) {
* @param name Snapshot name.
* @param snpPath Snapshot directory path.
* @return Future with the result of execution snapshot partitions verify task, which besides calculating partition
* hashes of {@link IdleVerifyResultV2} also contains the snapshot metadata distribution across the cluster.
* hashes of {@link IdleVerifyResult} also contains the snapshot metadata distribution across the cluster.
*/
public IgniteInternalFuture<SnapshotPartitionsVerifyTaskResult> checkSnapshot(String name, @Nullable String snpPath) {
return checkSnapshot(name, snpPath, -1);
Expand All @@ -1845,7 +1845,7 @@ public IgniteInternalFuture<SnapshotPartitionsVerifyTaskResult> checkSnapshot(St
* @param snpPath Snapshot directory path.
* @param incIdx Incremental snapshot index.
* @return Future with the result of execution snapshot partitions verify task, which besides calculating partition
* hashes of {@link IdleVerifyResultV2} also contains the snapshot metadata distribution across the cluster.
* hashes of {@link IdleVerifyResult} also contains the snapshot metadata distribution across the cluster.
*/
public IgniteInternalFuture<SnapshotPartitionsVerifyTaskResult> checkSnapshot(String name, @Nullable String snpPath, int incIdx) {
A.notNullOrEmpty(name, "Snapshot name cannot be null or empty.");
Expand Down Expand Up @@ -1876,7 +1876,7 @@ public IgniteInternalFuture<SnapshotPartitionsVerifyTaskResult> checkSnapshot(St
* @param incIdx Incremental snapshot index.
* @param check If {@code true} check snapshot integrity.
* @return Future with the result of execution snapshot partitions verify task, which besides calculating partition
* hashes of {@link IdleVerifyResultV2} also contains the snapshot metadata distribution across the cluster.
* hashes of {@link IdleVerifyResult} also contains the snapshot metadata distribution across the cluster.
*/
public IgniteInternalFuture<SnapshotPartitionsVerifyTaskResult> checkSnapshot(
String name,
Expand Down Expand Up @@ -1933,7 +1933,7 @@ public IgniteInternalFuture<SnapshotPartitionsVerifyTaskResult> checkSnapshot(
res.onDone(f1.result());
else if (f1.error() instanceof IgniteSnapshotVerifyException)
res.onDone(new SnapshotPartitionsVerifyTaskResult(metas,
new IdleVerifyResultV2(((IgniteSnapshotVerifyException)f1.error()).exceptions())));
new IdleVerifyResult(((IgniteSnapshotVerifyException)f1.error()).exceptions())));
else
res.onDone(f1.error());
});
Expand All @@ -1943,7 +1943,7 @@ else if (f1.error() instanceof IgniteSnapshotVerifyException)
res.onDone(new IgniteSnapshotVerifyException(metasRes.exceptions()));
else if (f0.error() instanceof IgniteSnapshotVerifyException)
res.onDone(new SnapshotPartitionsVerifyTaskResult(null,
new IdleVerifyResultV2(((IgniteSnapshotVerifyException)f0.error()).exceptions())));
new IdleVerifyResult(((IgniteSnapshotVerifyException)f0.error()).exceptions())));
else
res.onDone(f0.error());
}
Expand Down
Loading

0 comments on commit c6f7d22

Please sign in to comment.