You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Michael McCandless <lu...@mikemccandless.com> on 2006/11/22 22:05:49 UTC

Making RAMDirectory non final?

Hi,

I'm working on a unit test for:

     http://issues.apache.org/jira/browse/LUCENE-702

which is the "disk full during addIndexes() can corrupt index" issue.

I think the simplest way to do this is to subclass RAMDirectory to
create a MockDiskFullRAMDirectory class (and a corresponding
MockDiskFullRAMOutputStream) that lets you set the max size and
then throws IOException to simulate disk full.

The recent commit for LUCENE-709 is wonderful because it incrementally
tracks total size so it's real simple to check :)

But to do this I'd need to make RAMDirectory non-final.  Any
objections to this?

If we do this we can also put other "test only" methods (eg the
"getRecomputedSizeInBytes()") into the same (or different) subclass,
over time.

Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Re: Making RAMDirectory non final?

Posted by Doug Cutting <cu...@apache.org>.
Michael McCandless wrote:
> But to do this I'd need to make RAMDirectory non-final.  Any
> objections to this?

I can think of no reason it must be final.

Doug

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org