Skip to content

Commit

Permalink
Refactor: Use a single definition of MAX_SEGMENT_SIZE in Segment
Browse files Browse the repository at this point in the history
- Changed MAX_SEGMENT_SIZE in Segment.java to be public.
- Updated SegmentDataUtils.java to use the MAX_SEGMENT_SIZE from Segment by importing it statically.
- Removed the redundant definition of MAX_SEGMENT_SIZE in SegmentDataUtils to avoid duplication.
  • Loading branch information
JeonDaehong committed Sep 8, 2024
1 parent c47a8f6 commit 7e35424
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public class Segment {
/**
* Maximum segment size
*/
static final int MAX_SEGMENT_SIZE = 1 << 18; // 256kB
public static final int MAX_SEGMENT_SIZE = 1 << 18; // 256kB

/**
* The size limit for small values. The variable length of small values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@

import org.apache.commons.io.HexDump;
import org.apache.jackrabbit.oak.commons.Buffer;
import static org.apache.jackrabbit.oak.segment.Segment.MAX_SEGMENT_SIZE;


class SegmentDataUtils {

private SegmentDataUtils() {
// Prevent instantiation
}

private static final int MAX_SEGMENT_SIZE = 1 << 18;

static void hexDump(Buffer buffer, OutputStream stream) throws IOException {
byte[] data = new byte[buffer.remaining()];
buffer.duplicate().get(data);
Expand Down

0 comments on commit 7e35424

Please sign in to comment.