maobaolong commented on code in PR #2223:
URL:
https://github.com/apache/incubator-uniffle/pull/2223#discussion_r1818360869
##########
storage/src/main/java/org/apache/uniffle/storage/handler/impl/LocalFileWriteHandler.java:
##########
@@ -130,15 +130,17 @@ public synchronized void
write(Collection<ShufflePartitionedBlock> shuffleBlocks
String dataFileName =
ShuffleStorageUtils.generateDataFileName(fileNamePrefix);
String indexFileName =
ShuffleStorageUtils.generateIndexFileName(fileNamePrefix);
- try (LocalFileWriter dataWriter = createWriter(dataFileName,
dataBufferSize);
- LocalFileWriter indexWriter = createWriter(indexFileName,
indexBufferSize); ) {
+ try (FileWriter dataWriter =
+ LocalFileWriterFactory.getLocalFileWriter(
+ rssBaseConf, new File(basePath, dataFileName), dataBufferSize);
+ FileWriter indexWriter = createWriter(indexFileName, indexBufferSize))
{
Review Comment:
There are two reason.
- IndexFile is tiny which is not needed to use new writer to write.
- It is easy to serialize index structure to byte[] and write to file than
serialize to a bytebuf.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]