Conversation
new ver 2.16 added ignite-indexing
| } | ||
| catch (Throwable t) { | ||
| if (verbose) { | ||
| log.warn("New keys type {} is not on classpath, will fallback to int[] (cause: {})", |
There was a problem hiding this comment.
At which circumstance we should proceed if class not found?
There was a problem hiding this comment.
Is it better to fail an entire build? Looks like in that case we can load third party constructor to proceed migration.
| try (Ignite ig = Ignition.start(cfg)) { | ||
| ig.cluster().state(ClusterState.ACTIVE); | ||
|
|
||
| Collection<String> cacheNames = new ArrayList<>(ig.cacheNames()); |
There was a problem hiding this comment.
Do we need scan all caches?
There was a problem hiding this comment.
Seems good to scan all caches to prevent cache data loss. There's CLI command --cache to specify caches' names to scan/apply if needed.
| * ./gradlew -p migrator run --args="--apply --report 500" # apply to all caches | ||
| */ | ||
|
|
||
| public final class GridIntListMigrator { |
There was a problem hiding this comment.
I see we have DbMigrations class with caches/data migrations. Can we built this code in the class?
There was a problem hiding this comment.
This is an online migration class that is called every time the bot is started. It doesnt seem necessary to add a one-time offline migration functionality there.
There was a problem hiding this 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?
| * limitations under the License. | ||
| */ | ||
|
|
||
| package src.main.java.migrate; |
| int[] res = new int[g.size()]; | ||
|
|
||
| for (int i = 0; i < res.length; i++) | ||
| res[i] = g.get(i); |
There was a problem hiding this comment.
Can we use System.arrayCopy instead?
| if (obj instanceof org.apache.ignite.internal.util.GridIntList) { | ||
| org.apache.ignite.internal.util.GridIntList g = (org.apache.ignite.internal.util.GridIntList)obj; | ||
|
|
||
| int[] res = new int[g.size()]; |
There was a problem hiding this comment.
Let's do not create new array for every record.
| } | ||
| catch (Throwable t) { | ||
| if (verbose) | ||
| log.info("Deserialize fallback: {}", t.toString()); |
There was a problem hiding this comment.
At which case we failed here?
| * or falls back to int[] if the class is not on the classpath. | ||
| */ | ||
| private Object buildNewKeys(int[] ints) { | ||
| if (newKeysCachedConstruct != null) { |
There was a problem hiding this comment.
At which case it is null?
There was a problem hiding this comment.
TO-DO: to reflect about ability to tune migrator with third-party constructor
fixed migrator module build file fixed build updated DbMigrations added GridIntList migration into DbMigration class fixed reportEvery to Int dedupl
… into ignite-21899
No description provided.