nizhikovprivate commented on code in PR #12106:
URL: https://github.com/apache/ignite/pull/12106#discussion_r2134566543
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/filename/NodeFileTree.java:
##########
@@ -925,6 +948,16 @@ protected List<File> existingCacheDirs(boolean
includeMeta, Predicate<File> filt
return filesInStorages(f -> f.isDirectory() && dirFilter.test(f) &&
filter.test(f)).collect(Collectors.toList());
}
+ /** @return An array of WAL files. */
+ public File[] walFiles() {
+ return wal().listFiles(WAL_SEGMENT_FILE_FILTER);
+ }
+
+ /** @return An array of WAL files for CDC. */
+ public File[] walCdcFiles() {
Review Comment:
walCdcFiles -> walCdcSegments
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/filename/NodeFileTree.java:
##########
@@ -925,6 +948,16 @@ protected List<File> existingCacheDirs(boolean
includeMeta, Predicate<File> filt
return filesInStorages(f -> f.isDirectory() && dirFilter.test(f) &&
filter.test(f)).collect(Collectors.toList());
}
+ /** @return An array of WAL files. */
+ public File[] walFiles() {
+ return wal().listFiles(WAL_SEGMENT_FILE_FILTER);
Review Comment:
`wal().listFiles(NodeFileTree::walFile)` or
`wal().listFiles(NodeFileTree::walFileName)`
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/filename/NodeFileTree.java:
##########
@@ -741,6 +748,22 @@ public static boolean notTmpFile(File f) {
return !f.getName().endsWith(TMP_SUFFIX);
}
+ /**
+ * @param f File.
+ * @return {@code True} if file name matches the WAL pattern.
+ */
+ public static boolean walFileName(File f) {
Review Comment:
`walSegment` ?
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/filename/NodeFileTree.java:
##########
@@ -925,6 +948,16 @@ protected List<File> existingCacheDirs(boolean
includeMeta, Predicate<File> filt
return filesInStorages(f -> f.isDirectory() && dirFilter.test(f) &&
filter.test(f)).collect(Collectors.toList());
}
+ /** @return An array of WAL files. */
+ public File[] walFiles() {
+ return wal().listFiles(WAL_SEGMENT_FILE_FILTER);
Review Comment:
walFiles -> walSegments
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/filename/NodeFileTree.java:
##########
@@ -741,6 +748,22 @@ public static boolean notTmpFile(File f) {
return !f.getName().endsWith(TMP_SUFFIX);
}
+ /**
+ * @param f File.
+ * @return {@code True} if file name matches the WAL pattern.
+ */
+ public static boolean walFileName(File f) {
+ return WAL_NAME_PATTERN.matcher(f.getName()).matches();
+ }
+
+ /**
+ * @param f File.
+ * @return {@code True} if file matches WAL file criteria.
+ */
+ public static boolean walFile(File f) {
Review Comment:
`walSegment ` ?
I wondering what is the different between `walFileName` and `walFile`?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]