Skip to content

Commit

Permalink
HPCC4J-545 Resume read test causes OOM error
Browse files Browse the repository at this point in the history
- Updated resume read to use a smaller read buffer size

Signed-off-by: James McMullan [email protected]
  • Loading branch information
jpmcmu committed Oct 26, 2023
1 parent ac4d149 commit 8259bbc
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,12 @@ public void readResumeTest() throws Exception
System.out.println("Messages from file part (" + i + ") read operation:\n" + fileReader.getRemoteReadMessages());
}

int readSizeKB = 100;
ArrayList<HPCCRecord> resumedRecords = new ArrayList<HPCCRecord>();
for (int i = 0; i < resumeInfo.size(); i++)
{
HPCCRecordBuilder recordBuilder = new HPCCRecordBuilder(file.getProjectedRecordDefinition());
HpccRemoteFileReader<HPCCRecord> fileReader = new HpccRemoteFileReader<HPCCRecord>(fileParts[resumeFilePart.get(i)], originalRD, recordBuilder, -1, -1, true, -1, resumeInfo.get(i));
HpccRemoteFileReader<HPCCRecord> fileReader = new HpccRemoteFileReader<HPCCRecord>(fileParts[resumeFilePart.get(i)], originalRD, recordBuilder, -1, -1, true, readSizeKB, resumeInfo.get(i));

if (fileReader.hasNext())
{
Expand All @@ -194,6 +195,10 @@ public void readResumeTest() throws Exception

resumedRecords.add(record);
}
fileReader.close();

fileReader = null;
recordBuilder = null;
}

assertEquals("Number of records did not match during read resume.", records.size(), resumedRecords.size());
Expand Down

0 comments on commit 8259bbc

Please sign in to comment.