[ 
https://issues.apache.org/jira/browse/OAK-1925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14048612#comment-14048612
 ] 

Thomas Mueller commented on OAK-1925:
-------------------------------------

As an alternative, what about using FileChannel instead of RandomAccessFile? 
That way, no buffer is needed, and no synchronization. Instead, positioned 
reads and writes can be used: read(ByteBuffer dst, long position), 
write(ByteBuffer src, long position). We could also use add a cache layer if 
needed ([I implemented 
one|https://code.google.com/p/h2database/source/browse/trunk/h2/src/main/org/h2/mvstore/cache/FilePathCache.java]
  that I could contribute)

> Use streamed io instead of RandomAccessFile in TarWriter
> --------------------------------------------------------
>
>                 Key: OAK-1925
>                 URL: https://issues.apache.org/jira/browse/OAK-1925
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: segmentmk
>            Reporter: Chetan Mehrotra
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: OAK-1925.patch
>
>
> TarWriter currently uses RandomAccessFile to 
> * Write the tar entries
> * Read written entries
> The write however are currently sequential. It might be better to use 
> streamed buffered io for the write and maintain an in memory cache of written 
> tar entries to serve the reads.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to