On Thu, May 16, 2013 at 1:58 PM, Robert Muir <[email protected]> wrote:
> I dont get it. MDW wraps its IndexOutput so it "knows"... sounds like
> the counting is off.

The problem is that RAMDirectory delays the counting.
MockDirectoryWrapper.getRecomputedActualSizeInBytes sums all the
lengths of the existing RAMFiles to get the actual size, but
RAMFile.length is only updated after a RAMOutputStream seek or flush.
This means that if you write 5 bytes, then 3 bytes, RAMFile.length
will still be 0 and then suddenly upon flush it will become 5+3=8.

Using the Mock IndexOutput to track bytes is an option, but I was
thinking it could be interesting too to see what happens with
directories that buffer content so that the disk full exception
happens in flush instead of writeBytes?

-- 
Adrien

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to