You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "timoninmaxim (via GitHub)" <gi...@apache.org> on 2025/09/02 09:00:34 UTC

Re: [PR] IGNITE-21899 added GridInt utils [ignite-teamcity-bot]

timoninmaxim commented on code in PR #200:
URL: https://github.com/apache/ignite-teamcity-bot/pull/200#discussion_r2315410785


##########
migrator/src/main/java/migrate/GridIntListMigrator.java:
##########
@@ -0,0 +1,532 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package migrate;
+
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.binary.BinaryObject;
+import org.apache.ignite.binary.BinaryObjectBuilder;
+import org.apache.ignite.cache.query.QueryCursor;
+import org.apache.ignite.cache.query.ScanQuery;
+import org.apache.ignite.cluster.ClusterState;
+import org.apache.ignite.configuration.BinaryConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.cache.Cache;
+import java.io.File;
+import java.lang.reflect.Constructor;
+import java.util.*;
+import java.util.concurrent.atomic.AtomicLong;
+
+/**
+ * Offline migrator for TeamCity Bot Ignite persistence.
+ * <p>
+ * Recursively scans all entries in Ignite caches and replaces any occurrence of the legacy type
+ * org.apache.ignite.internal.util.GridIntList with the new type
+ * org.apache.ignite.tcbot.common.util.GridIntList, preserving the int[] payload.
+ * <p>
+ * Usage:
+ * export IGNITE_WORK_DIR=/abs/path/to/work_backup
+ * ./gradlew -p migrator run --args="--verbose --report 200"      # dry run with verbose report
+ * ./gradlew -p migrator run --args="--apply --report 500"        # apply to all caches
+ */
+
+public final class GridIntListMigrator {

Review Comment:
   Most of migrations are one-shot tasks, see DbMigrations#applyMigration - it skips a migration if it had been already applied. Is there other reason to keep this migration in a separate module?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org