lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shay Banon <>
Subject Re: 1.9 RC1
Date Thu, 02 Mar 2006 19:09:38 GMT

	I have just updated to lucene 1.9, and hit a problem with the  
mentioned optimization. I have applied it to the my  
JdbcBufferedOutput (I only duplicate the code because the BUFFER_SIZE  
is final), and I hit a problem. In the following code fragment (the  
method is writeBytes):

     } else {
       // is data larger then buffer?
       if (length > BUFFER_SIZE) {
         // we flush the buffer
         if (bufferPosition > 0)
         // and write data at once
         flushBuffer(b, length);
       } else {

the bufferStart is not incremented after the flushBuffer method is  
called. So if someone calls getFilePointer just afterwards, it will  
give the wrong result (hit it with the compound format). A simple fix  
would be to add bufferStart += length; just after flushBuffer.

By the way, is there a chance that BufferedIndexInput and  
BufferedIndexOutput will have the buffer size as a member variable,  
with a setter (or at least protected visibility), so I won't have to  
duplicate the buffer support in Jdbc?


On 15 Feb 2006, at 12:25, Maxim Patramanskij wrote:

> Doug,
> what about including optimization of BuffereIndexOutput.writeBytes()
> method:
> [ ]
> made by Lukas Zapletal, into 1.9?
> I'm wondering, because this can decrease index creation time, which I
> discovered as critical when using Lucene together with JDBCDirectory.
> Max
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message