cbuescher commented on code in PR #12241:
URL: https://github.com/apache/lucene/pull/12241#discussion_r1177689578


##########
lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90CompoundFormat.java:
##########
@@ -102,11 +103,40 @@ public void write(Directory dir, SegmentInfo si, 
IOContext context) throws IOExc
     }
   }
 
+  private static class SizedFile {
+    String name;

Review Comment:
   done



##########
lucene/core/src/test/org/apache/lucene/codecs/lucene90/TestLucene90CompoundFormat.java:
##########
@@ -27,4 +36,58 @@ public class TestLucene90CompoundFormat extends 
BaseCompoundFormatTestCase {
   protected Codec getCodec() {
     return codec;
   }
+
+  public void testFileLengthOrdering() throws IOException {
+    Directory dir = newDirectory();
+    // Setup the test segment
+    String segment = "_123";
+    int chunk = 1024; // internal buffer size used by the stream
+    SegmentInfo si = newSegmentInfo(dir, segment);
+    byte[] segId = si.getId();
+    List<String> files = new ArrayList<>();
+    int randomFileSize = random().nextInt(0, chunk);
+    for (int i = 0; i < 10; i++) {
+      String filename = segment + "." + i;
+      createRandomFile(dir, filename, randomFileSize, segId);
+      // increase the next files size by a random amount
+      randomFileSize += random().nextInt(1, 100);
+      files.add(filename);
+    }
+    si.setFiles(files);

Review Comment:
   I added something for that



-- 
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: issues-unsubscr...@lucene.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to