You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "nizhikov (via GitHub)" <gi...@apache.org> on 2025/06/10 12:17:20 UTC
[PR] IGNITE-25389 Explicit index cache path [ignite]
nizhikov opened a new pull request, #12133:
URL: https://github.com/apache/ignite/pull/12133
Thank you for submitting the pull request to the Apache Ignite.
In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:
### The Contribution Checklist
- [ ] There is a single JIRA ticket related to the pull request.
- [ ] The web-link to the pull request is attached to the JIRA ticket.
- [ ] The JIRA ticket has the _Patch Available_ state.
- [ ] The pull request body describes changes that have been made.
The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
- [ ] The pull request title is treated as the final commit message.
The following pattern must be used: `IGNITE-XXXX Change summary` where `XXXX` - number of JIRA issue.
- [ ] A reviewer has been mentioned through the JIRA comments
(see [the Maintainers list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers))
- [ ] The pull request has been checked by the Teamcity Bot and
the `green visa` attached to the JIRA ticket (see [TC.Bot: Check PR](https://mtcga.gridgain.com/prs.html))
### Notes
- [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
- [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
- [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
- [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com _#ignite_ channel.
--
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
Re: [PR] IGNITE-25389 Explicit index cache path [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12133:
URL: https://github.com/apache/ignite/pull/12133#issuecomment-2962002022
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12133) **Quality Gate passed**
Issues
 [1 New issue](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12133&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12133&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ignite&pullRequest=12133&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12133&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12133&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12133)
--
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
Re: [PR] IGNITE-25389 Explicit index cache path [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12133:
URL: https://github.com/apache/ignite/pull/12133#issuecomment-2960182983
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12133) **Quality Gate passed**
Issues
 [1 New issue](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12133&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12133&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ignite&pullRequest=12133&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12133&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12133&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12133)
--
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
Re: [PR] IGNITE-25389 Explicit index cache path [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12133:
URL: https://github.com/apache/ignite/pull/12133#issuecomment-2976856261
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12133) **Quality Gate passed**
Issues
 [1 New issue](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12133&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12133&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ignite&pullRequest=12133&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12133&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12133&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12133)
--
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
Re: [PR] IGNITE-25389 Explicit index cache path [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12133:
URL: https://github.com/apache/ignite/pull/12133#issuecomment-2981111591
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12133) **Quality Gate passed**
Issues
 [1 New issue](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12133&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12133&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ignite&pullRequest=12133&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12133&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12133&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12133)
--
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
Re: [PR] IGNITE-25389 Explicit index cache path [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12133:
URL: https://github.com/apache/ignite/pull/12133#issuecomment-2959460840
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12133) **Quality Gate passed**
Issues
 [1 New issue](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12133&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12133&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ignite&pullRequest=12133&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12133&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12133&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12133)
--
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
Re: [PR] IGNITE-25389 Explicit index cache path [ignite]
Posted by "nizhikovprivate (via GitHub)" <gi...@apache.org>.
nizhikovprivate commented on code in PR #12133:
URL: https://github.com/apache/ignite/pull/12133#discussion_r2152726258
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/filename/FileTreeUtils.java:
##########
@@ -70,6 +75,11 @@ public static void removeTmpSnapshotFiles(SnapshotFileTree sft, boolean err, Ign
* @return Storage path from config for partition.
*/
public static @Nullable String partitionStorage(CacheConfiguration<?, ?> ccfg, int part) {
+ if (part == INDEX_PARTITION) {
+ if (F.isEmpty(ccfg.getIndexPath()))
Review Comment:
> Maybe we should use !F.isEmpty(...) condition here?
Good catch! Thanks.
> If this comment makes sense I think we should add a test for it.
Actually, can't do it.
This method used to generate storagePath for SnapshotSender.
But, index partition loaded from local snapshot, only.
And result of this method used for loading partitions from remote node.
So, I fixed it, but can't test it.
--
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
Re: [PR] IGNITE-25389 Explicit index cache path [ignite]
Posted by "nizhikovprivate (via GitHub)" <gi...@apache.org>.
nizhikovprivate commented on code in PR #12133:
URL: https://github.com/apache/ignite/pull/12133#discussion_r2150073394
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/filename/FileTreeUtils.java:
##########
@@ -78,6 +88,23 @@ public static void removeTmpSnapshotFiles(SnapshotFileTree sft, boolean err, Ign
return resolveStorage(csp, part);
}
+ /**
+ * @param dsCfg Data storage configuration.
+ * @return All known storages.
+ * @throws IgniteCheckedException
+ */
+ public static Set<String> nodeStorages(@Nullable DataStorageConfiguration dsCfg) throws IgniteCheckedException {
Review Comment:
Removed
--
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
Re: [PR] IGNITE-25389 Explicit index cache path [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12133:
URL: https://github.com/apache/ignite/pull/12133#issuecomment-2980803729
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12133) **Quality Gate failed**
Failed conditions
 [2 New Code Smells](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12133) (required ≤ 1)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12133)
##
 Catch issues before they fail your Quality Gate with our IDE extension  [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
--
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
Re: [PR] IGNITE-25389 Explicit index cache path [ignite]
Posted by "nizhikovprivate (via GitHub)" <gi...@apache.org>.
nizhikovprivate commented on code in PR #12133:
URL: https://github.com/apache/ignite/pull/12133#discussion_r2150074667
##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/filename/CacheConfigStoragePathTest.java:
##########
@@ -75,6 +79,39 @@ public class CacheConfigStoragePathTest extends AbstractDataRegionRelativeStorag
};
}
+ /** Sanity checks - all pathes for all partitions are different and contains cacheDir. */
Review Comment:
Fixed
--
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
Re: [PR] IGNITE-25389 Explicit index cache path [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12133:
URL: https://github.com/apache/ignite/pull/12133#issuecomment-2981579259
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12133) **Quality Gate passed**
Issues
 [1 New issue](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12133&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12133&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ignite&pullRequest=12133&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12133&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12133&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12133)
--
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
Re: [PR] IGNITE-25389 Explicit index cache path [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12133:
URL: https://github.com/apache/ignite/pull/12133#issuecomment-2960088378
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12133) **Quality Gate passed**
Issues
 [1 New issue](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12133&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12133&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ignite&pullRequest=12133&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12133&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12133&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12133)
--
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
Re: [PR] IGNITE-25389 Explicit index cache path [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12133:
URL: https://github.com/apache/ignite/pull/12133#issuecomment-2961959748
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12133) **Quality Gate passed**
Issues
 [1 New issue](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12133&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12133&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ignite&pullRequest=12133&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12133&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12133&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12133)
--
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
Re: [PR] IGNITE-25389 Explicit index cache path [ignite]
Posted by "sergey-chugunov-1985 (via GitHub)" <gi...@apache.org>.
sergey-chugunov-1985 commented on code in PR #12133:
URL: https://github.com/apache/ignite/pull/12133#discussion_r2149627925
##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/filename/CacheConfigStoragePathTest.java:
##########
@@ -156,18 +193,27 @@ else if (storage == null)
snpRootF.apply(storagePath(STORAGE_PATH_2))
));
- assertEquals(path != null ? 1 : 3, roots.size());
+ boolean idxPathUsed = idxStorage && idxPartMustExistsInSnapshot();
+
+ if (idxPathUsed)
+ roots.add(snpRootF.apply(storagePath(IDX_PATH)));
+
+ // Sanity check storagePath returns different paths.
+ assertEquals(path != null ? 1 : (idxPathUsed ? 4 : 3), roots.size());
// Root -> cache -> partition set.
Map<File, Map<String, Set<Integer>>> snpFiles = new HashMap<>();
// Collecting all partition files under each snapshot root.
- roots.forEach(snpRoot -> {
+ for (File snpRoot : roots) {
assertTrue(snpRoot.exists());
assertTrue(snpRoot.isDirectory());
+ Predicate<Path> pathPredicate = p -> NodeFileTree.partitionFile(p.toFile())
Review Comment:
Side note. What do you think about renaming `NodeFileTree.partitionFile` into `NodeFileTree.isPartitionFile`? Not necessarily in this PR but in general.
My reason for that: when reviewing this PR I had to consult with source code to figure out that semantics of `partitionFile` and `partitionFileName` is very different despite their names are rather similar. Name like `isPartitionFile` immediately reveals that this method is for pattern matching and not for constructing a new File from an old one.
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/filename/FileTreeUtils.java:
##########
@@ -78,6 +88,23 @@ public static void removeTmpSnapshotFiles(SnapshotFileTree sft, boolean err, Ign
return resolveStorage(csp, part);
}
+ /**
+ * @param dsCfg Data storage configuration.
+ * @return All known storages.
+ * @throws IgniteCheckedException
+ */
+ public static Set<String> nodeStorages(@Nullable DataStorageConfiguration dsCfg) throws IgniteCheckedException {
Review Comment:
I think using `@Nullable` is misleading here as the method itself doesn't handle null values "normally" but throws exception instead.
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/filename/NodeFileTree.java:
##########
@@ -640,19 +656,35 @@ public File tmpCacheConfigurationFile(CacheConfiguration<?, ?> ccfg) {
* @return Partition file.
*/
public File partitionFile(CacheConfiguration<?, ?> ccfg, int part) {
- return new File(resolveStorage(cacheStorages(ccfg), part), partitionFileName(part));
+ if (part == INDEX_PARTITION) {
+ String idxPath = ccfg.getIndexPath();
+
+ if (!F.isEmpty(idxPath))
+ return new File(cacheStorage(idxPath, cacheDirName(ccfg)), partitionFileName(INDEX_PARTITION));
+ }
+
+ return new File(resolveStorage(cacheStorages(ccfg, false), part), partitionFileName(part));
Review Comment:
Side note (don't feel obligated to fix it right now or at all). It seems to me that we have somewhat disorienting naming of two methods here, `cacheStorage` and `resolveStorage` - one private and one static from utils class. They look very similar to each other, but their semantics is very different.
If we can come up with better naming, it would be great. I'm ready to participate in a brainstorm when I get more familiar with this class and its neighbours.
##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/filename/CacheConfigStoragePathTest.java:
##########
@@ -75,6 +79,39 @@ public class CacheConfigStoragePathTest extends AbstractDataRegionRelativeStorag
};
}
+ /** Sanity checks - all pathes for all partitions are different and contains cacheDir. */
Review Comment:
Minor notes: `paths` instead of `pathes`, `contain` instead of `contains` (as subject is in plural form).
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/filename/NodeFileTree.java:
##########
@@ -881,9 +925,10 @@ else if (name.equals(METASTORAGE_DIR_NAME))
* @param storagePath Value from config.
* @return File storage.
* @see CacheConfiguration#getStoragePaths()
+ * @see CacheConfiguration#getIndexPath()
*/
- private File cacheStorageRoot(@Nullable String storagePath) {
- return storagePath == null ? nodeStorage : extraStorages.getOrDefault(storagePath, nodeStorage);
+ private File cacheStorage(@Nullable String storagePath, String cacheDirName) {
Review Comment:
I suggest to add javadoc for new parameter `cacheDirName`. As far as I can see it is a subdirectory name under `storagePath` parent directory, but it is not possible to deduce this fact from param name itself.
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/filename/FileTreeUtils.java:
##########
@@ -70,6 +75,11 @@ public static void removeTmpSnapshotFiles(SnapshotFileTree sft, boolean err, Ign
* @return Storage path from config for partition.
*/
public static @Nullable String partitionStorage(CacheConfiguration<?, ?> ccfg, int part) {
+ if (part == INDEX_PARTITION) {
+ if (F.isEmpty(ccfg.getIndexPath()))
Review Comment:
Maybe we should use `!F.isEmpty(...)` condition here? Because right now logic looks counter-intuitive: if index path is not set, return index path.
If this comment makes sense I think we should add a test for it.
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/filename/NodeFileTree.java:
##########
Review Comment:
Side note (don't feel obligated to fix it right now or at all). One particular feature of this class makes its review a challenging exercise: there are pairs of methods named like `cacheStorage` and `cacheStorages` with overloaded versions on top of that. Difference in name in just one letter makes it quite hard to navigate the context and I'm afraid error-prone too.
If we can rename more specific methods (by this I mean `cacheStorage` here) to something `storageForCache` without compromizing its semantics, I believe it would simplify reading and modifying this class in the future.
--
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
Re: [PR] IGNITE-25389 Explicit index cache path [ignite]
Posted by "sergey-chugunov-1985 (via GitHub)" <gi...@apache.org>.
sergey-chugunov-1985 commented on code in PR #12133:
URL: https://github.com/apache/ignite/pull/12133#discussion_r2154103677
##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/filename/AbstractDataRegionRelativeStoragePathTest.java:
##########
@@ -86,14 +117,23 @@ public static List<Object[]> params() {
cleanPersistenceDir();
- if (absPath) {
+ if (pathMode == PathMode.ABS) {
U.delete(new File(storagePath(STORAGE_PATH)).getParentFile());
U.delete(new File(storagePath(STORAGE_PATH_2)).getParentFile());
+ U.delete(new File(storagePath(IDX_PATH)).getParentFile());
}
- else {
+ else if (pathMode == PathMode.RELATIVE) {
U.delete(new File(U.defaultWorkDirectory(), STORAGE_PATH));
U.delete(new File(U.defaultWorkDirectory(), STORAGE_PATH_2));
+ U.delete(new File(U.defaultWorkDirectory(), IDX_PATH));
}
+ else if (pathMode == PathMode.SEPARATE_ROOT) {
+ for (File f : new File(U.defaultWorkDirectory()).listFiles(f -> !f.getName().equals("log")))
+ U.delete(f);
+
Review Comment:
Unnecessary empty line
--
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
Re: [PR] IGNITE-25389 Explicit index cache path [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12133:
URL: https://github.com/apache/ignite/pull/12133#issuecomment-2959928306
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12133) **Quality Gate passed**
Issues
 [1 New issue](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12133&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12133&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ignite&pullRequest=12133&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12133&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12133&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12133)
--
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
Re: [PR] IGNITE-25389 Explicit index cache path [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12133:
URL: https://github.com/apache/ignite/pull/12133#issuecomment-2981080231
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12133) **Quality Gate passed**
Issues
 [2 New issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12133&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12133&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ignite&pullRequest=12133&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12133&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12133&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12133)
--
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
Re: [PR] IGNITE-25389 Explicit index cache path [ignite]
Posted by "nizhikov (via GitHub)" <gi...@apache.org>.
nizhikov merged PR #12133:
URL: https://github.com/apache/ignite/pull/12133
--
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
Re: [PR] IGNITE-25389 Explicit index cache path [ignite]
Posted by "nizhikovprivate (via GitHub)" <gi...@apache.org>.
nizhikovprivate commented on code in PR #12133:
URL: https://github.com/apache/ignite/pull/12133#discussion_r2150090335
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/filename/NodeFileTree.java:
##########
@@ -881,9 +925,10 @@ else if (name.equals(METASTORAGE_DIR_NAME))
* @param storagePath Value from config.
* @return File storage.
* @see CacheConfiguration#getStoragePaths()
+ * @see CacheConfiguration#getIndexPath()
*/
- private File cacheStorageRoot(@Nullable String storagePath) {
- return storagePath == null ? nodeStorage : extraStorages.getOrDefault(storagePath, nodeStorage);
+ private File cacheStorage(@Nullable String storagePath, String cacheDirName) {
Review Comment:
Done
--
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
Re: [PR] IGNITE-25389 Explicit index cache path [ignite]
Posted by "nizhikovprivate (via GitHub)" <gi...@apache.org>.
nizhikovprivate commented on code in PR #12133:
URL: https://github.com/apache/ignite/pull/12133#discussion_r2150101495
##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/filename/CacheConfigStoragePathTest.java:
##########
@@ -156,18 +193,27 @@ else if (storage == null)
snpRootF.apply(storagePath(STORAGE_PATH_2))
));
- assertEquals(path != null ? 1 : 3, roots.size());
+ boolean idxPathUsed = idxStorage && idxPartMustExistsInSnapshot();
+
+ if (idxPathUsed)
+ roots.add(snpRootF.apply(storagePath(IDX_PATH)));
+
+ // Sanity check storagePath returns different paths.
+ assertEquals(path != null ? 1 : (idxPathUsed ? 4 : 3), roots.size());
// Root -> cache -> partition set.
Map<File, Map<String, Set<Integer>>> snpFiles = new HashMap<>();
// Collecting all partition files under each snapshot root.
- roots.forEach(snpRoot -> {
+ for (File snpRoot : roots) {
assertTrue(snpRoot.exists());
assertTrue(snpRoot.isDirectory());
+ Predicate<Path> pathPredicate = p -> NodeFileTree.partitionFile(p.toFile())
Review Comment:
Personally, I don't have any preferences about naming.
But, our style guide states:
> Getters and setters should be implemented without is/get/set prefixes in internal APIs.
https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=57901455#CodingGuidelines-Gettersandsetters
Don't know, if this method match "getter" :)
Feel free to come up with the better naming.
--
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
Re: [PR] IGNITE-25389 Explicit index cache path [ignite]
Posted by "nizhikovprivate (via GitHub)" <gi...@apache.org>.
nizhikovprivate commented on code in PR #12133:
URL: https://github.com/apache/ignite/pull/12133#discussion_r2150093022
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/filename/NodeFileTree.java:
##########
@@ -640,19 +656,35 @@ public File tmpCacheConfigurationFile(CacheConfiguration<?, ?> ccfg) {
* @return Partition file.
*/
public File partitionFile(CacheConfiguration<?, ?> ccfg, int part) {
- return new File(resolveStorage(cacheStorages(ccfg), part), partitionFileName(part));
+ if (part == INDEX_PARTITION) {
+ String idxPath = ccfg.getIndexPath();
+
+ if (!F.isEmpty(idxPath))
+ return new File(cacheStorage(idxPath, cacheDirName(ccfg)), partitionFileName(INDEX_PARTITION));
+ }
+
+ return new File(resolveStorage(cacheStorages(ccfg, false), part), partitionFileName(part));
Review Comment:
First name of `resolveStorage` was `oneOf` as it don't relates to storage itself, but just selects one element from array.
--
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
Re: [PR] IGNITE-25389 Explicit index cache path [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12133:
URL: https://github.com/apache/ignite/pull/12133#issuecomment-2983535069
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12133) **Quality Gate passed**
Issues
 [1 New issue](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12133&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12133&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ignite&pullRequest=12133&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12133&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12133&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12133)
--
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
Re: [PR] IGNITE-25389 Explicit index cache path [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12133:
URL: https://github.com/apache/ignite/pull/12133#issuecomment-2959001567
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12133) **Quality Gate passed**
Issues
 [1 New issue](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12133&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12133&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ignite&pullRequest=12133&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12133&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12133&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12133)
--
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
Re: [PR] IGNITE-25389 Explicit index cache path [ignite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #12133:
URL: https://github.com/apache/ignite/pull/12133#issuecomment-2960000483
## [](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12133) **Quality Gate passed**
Issues
 [1 New issue](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12133&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_ignite&pullRequest=12133&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ignite&pullRequest=12133&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12133&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_ignite&pullRequest=12133&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_ignite&pullRequest=12133)
--
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