tihom88 commented on code in PR #1123:
URL: https://github.com/apache/jackrabbit-oak/pull/1123#discussion_r1329681323


##########
oak-run-commons/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/flatfile/TraverseWithSortStrategy.java:
##########
@@ -92,17 +93,22 @@ class TraverseWithSortStrategy implements SortStrategy {
     private File sortWorkDir;
     private List<File> sortedFiles = new ArrayList<>();
     private ArrayList<NodeStateHolder> entryBatch = new ArrayList<>();
-    private Predicate<String> pathPredicate;
-
+    TraverseWithSortStrategy(NodeStateEntryTraverserFactory nodeStatesFactory, 
Set<String> preferredPaths,
+                             NodeStateEntryWriter entryWriter, File storeDir, 
Compression algorithm,
+                             Predicate<String> pathPredicate, String 
checkpoint) {
+        super(storeDir, algorithm, pathPredicate, preferredPaths, checkpoint);
+        this.nodeStatesFactory = nodeStatesFactory;
+        this.entryWriter = entryWriter;
+        this.comparator = (e1, e2) -> new 
PathElementComparator(preferredPaths).compare(e1.getPathElements(), 
e2.getPathElements());
+    }
 
+    @Deprecated
     TraverseWithSortStrategy(NodeStateEntryTraverserFactory nodeStatesFactory, 
PathElementComparator pathComparator,
                              NodeStateEntryWriter entryWriter, File storeDir, 
Compression algorithm, Predicate<String> pathPredicate) {
+        super(storeDir, algorithm, pathPredicate,null, null);
         this.nodeStatesFactory = nodeStatesFactory;
         this.entryWriter = entryWriter;
-        this.storeDir = storeDir;
         this.comparator = (e1, e2) -> 
pathComparator.compare(e1.getPathElements(), e2.getPathElements());
-        this.pathPredicate = pathPredicate;
-        this.algorithm = algorithm;

Review Comment:
   this is not possible as we get comparator from preferredPaths in another 
constructor and missing comparator. I didn't wanted to add both comparator and 
preferredPaths in new constructor. 



-- 
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]

Reply via email to