LTS Writes and Reads should use BufferViews #4802
Labels
area/lts
area/performance
area/segmentstore
kind/enhancement
Improvements that should be made
tag/breaksAPI
Problem description
Storage.write
andSyncStorage.write
use InputStream as data input.Storage.read
andSyncStorage.read
expect a heap byte array to be allocated where data from LTS is copied into.This presents certain drawbacks:
FileChannel
. For S3, there may be better ways than just providing an InputStream and for HDFS, copying from an InputStream into an OutputStream is not too efficient (uses an intermediate buffer).Problem location
Storage, SyncStorage and implementations.
Call sites of Storage.
Suggestions for an improvement
Add the following APIs and implement them:
SyncStorage.write(SegmentHandle handle, long offset, BufferView data)
(similar in Storage)BufferView SyncStorage.read(SegmentHandle handle, long offset, int length)
The text was updated successfully, but these errors were encountered: