mreutegg commented on code in PR #1800:
URL: https://github.com/apache/jackrabbit-oak/pull/1800#discussion_r1802485731


##########
oak-segment-remote/src/main/java/org/apache/jackrabbit/oak/segment/remote/RemoteUtilities.java:
##########
@@ -28,6 +28,7 @@
 public final class RemoteUtilities {
     public static final boolean OFF_HEAP = getBoolean("access.off.heap");
     public static final String SEGMENT_FILE_NAME_PATTERN = 
"^([0-9a-f]{4})\\.([0-9a-f-]+)$";
+    public static final int MAX_ENTRY_COUNT = 0x10000;

Review Comment:
   I think this is off by one. `SEGMENT_FILE_NAME_PATTERN` only allows for 4 
hex digits. Consider the following test.
   ```
       @Test
       public void maxEntryCount() {
           UUID uuid = UUID.randomUUID();
           String name = 
RemoteUtilities.getSegmentFileName(RemoteUtilities.MAX_ENTRY_COUNT, 
uuid.getMostSignificantBits(), uuid.getLeastSignificantBits());
           UUID parsed = RemoteUtilities.getSegmentUUID(name);
           assertEquals(uuid, parsed);
       }
   ```



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