1
0

[HUDI-1133] Tune buffer sizes for the diskbased external spillable map

This commit is contained in:
Balajee Nagasubramaniam
2020-08-25 08:21:21 -07:00
committed by n3nash
parent 492ddcbb06
commit cc555ba188
2 changed files with 3 additions and 3 deletions

View File

@@ -79,7 +79,7 @@ public final class BufferedRandomAccessFile extends RandomAccessFile {
*/ */
public BufferedRandomAccessFile(File file, String mode) throws IOException { public BufferedRandomAccessFile(File file, String mode) throws IOException {
super(file, mode); super(file, mode);
this.init(0); this.init(DEFAULT_BUFFER_SIZE);
} }
/** /**
@@ -102,7 +102,7 @@ public final class BufferedRandomAccessFile extends RandomAccessFile {
*/ */
public BufferedRandomAccessFile(String name, String mode) throws IOException { public BufferedRandomAccessFile(String name, String mode) throws IOException {
super(name, mode); super(name, mode);
this.init(0); this.init(DEFAULT_BUFFER_SIZE);
} }
/** /**

View File

@@ -93,7 +93,7 @@ public final class DiskBasedMap<T extends Serializable, R extends Serializable>
try { try {
BufferedRandomAccessFile readHandle = randomAccessFile.get(); BufferedRandomAccessFile readHandle = randomAccessFile.get();
if (readHandle == null) { if (readHandle == null) {
readHandle = new BufferedRandomAccessFile(filePath, "r"); readHandle = new BufferedRandomAccessFile(filePath, "r", BUFFER_SIZE);
readHandle.seek(0); readHandle.seek(0);
randomAccessFile.set(readHandle); randomAccessFile.set(readHandle);
openedAccessFiles.offer(readHandle); openedAccessFiles.offer(readHandle);