Hi Veit

Thanks for ou comments. See my below.
 

Borek

> -----Original Message-----
> From: Veit Jahns [mailto:nuncupa...@googlemail.com]
> Sent: Tuesday, August 10, 2010 9:48 PM
> To: clucene-developers@lists.sourceforge.net
> Subject: Re: [CLucene-dev] RAMDirectory testing (using MockRAMDirectory)
> 
> 2010/8/10 Kostka Bořivoj <kos...@tovek.cz>:
> > I added MockRAMDirectory ported by Veit into TestRAMDirectory and
> > found
> > following:
> >
> > 1)     sizeInBytes members in RAMDirectory and RAMFile aren’t correct,
> > I fixed this somehow, but I’m not sure if it shouldn’t be fixed
> > different way, could anybody look at it
> 
> The patch for RAMFile::getLength() seems correct. You will find the same line 
> in the
> corresponding method of JLucene.
> 
> For the patch of the RAMFile desctructor I'm in doubt. Looking at the 
> correspondong
> JLucene classes subtracting the file size is done in the deleteFile method of
> RAMDirectory (see diff).
> 
> By the way, I needed some inline keywords removed in _RAMDirectory.h.
> Otherwise, I couldn't compile it with gcc on FreeBSD.

I agree, it is better to do this in deleteFile than in RAMFile destructor.
The only thing I'm not sure about is the mutex used for sync - files_mutex is 
used in deleteFile.
Shouldn't it be RAMDirectory's THIS_LOCK?

> 
> > 2)     MockRAMDirectory::close always throws an exception because
> > segments.gen is in list of open files, no idea if this is a bug in
> > RAMDirectory or MockRAMDirectory
> 
> Why do you use MockRAMDirectory here? I ported this class from JLucene, 
> because I
> needed once a directory implementation that intentionally throws exceptions. 
> And
> because the close-methods of RAMDirectory and MockRAMDirectory are identical 
> to
> the JLucene methods, I'd say that's neither a bug of RAMDirectory nor
> MockRAMDirectory.

I use MockRAMDirectory just because it is used in original java test I ported. 
It is used
in many tests in test/index folder so I wanted to test MockRAMDirectory itself 
before
using it in other tests.

> 
> > 3)     Also fixed few things in MockRAMDirectory (Veit, can you look
> > at it in intensive_testing branch?)
> 
> Regarding LCG: Seems fine. Wasn't aware of that.
> Regarding maxSize: Seems fine. But there isn't a similar initialisation in 
> the JLucene
> class. Maybe by intention.

OK, I'll change it from max ulong to 0 as Java initializes members 
automatically to 0/null/false, 

> 
> Veit
------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
CLucene-developers mailing list
CLucene-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/clucene-developers

Reply via email to