Re: RAMDirectory IndexInput and IndexOutput

2008-06-19 Thread Jason Rutherglen
Created a RAMDirectory like directory class that uses ByteArrayRandomAccessIO from http://reader.imagero.com/uio/ to allow concurrent random file access. On Thu, Jun 19, 2008 at 3:33 PM, Jason Rutherglen < [EMAIL PROTECTED]> wrote: > Looks like it cannot be used for a log system that needs concur

Re: RAMDirectory IndexInput and IndexOutput

2008-06-19 Thread Jason Rutherglen
Looks like it cannot be used for a log system that needs concurrent read write access to a file. Back to RandomAccessFile which will have buffering issues, any experience with http://reader.imagero.com/uio/ On Thu, Jun 19, 2008 at 3:20 PM, Yonik Seeley <[EMAIL PROTECTED]> wrote: > createOutput(

Re: RAMDirectory IndexInput and IndexOutput

2008-06-19 Thread Yonik Seeley
createOutput() creates a new file, overwriting the old one. If you open the IndexInput before you call createOutput() for the 2nd time, you should see the file. And you definitely shouldn't have more than one IndexOutput open on the same file (but that's not your problem here). -Yonik On Thu, Ju

Re: RAMDirectory IndexInput and IndexOutput

2008-06-19 Thread Jason Rutherglen
Here's code that reproduces it. public void testMain() throws IOException { RAMDirectory ramDirectory = new RAMDirectory(); IndexOutput output = ramDirectory.createOutput("test"); byte[] bytes = "hello world".getBytes("UTF-8"); output.writeBytes(bytes, bytes.length); output.flu

Re: RAMDirectory IndexInput and IndexOutput

2008-06-19 Thread Jason Rutherglen
Yes. Also close. But then reopen the IndexOutput again later, then open the IndexInput. I'm not sure if this is the recomended usage of these APIs. It seems everywhere else in the Lucene code base only one is open at a time. On Thu, Jun 19, 2008 at 12:50 PM, Yonik Seeley <[EMAIL PROTECTED]> wr

Re: RAMDirectory IndexInput and IndexOutput

2008-06-19 Thread Yonik Seeley
Did you try calling flush() on the IndexOutput before opening the IndexInput? -Yonik On Thu, Jun 19, 2008 at 12:13 PM, Jason Rutherglen <[EMAIL PROTECTED]> wrote: > Seeing strange behavior with RAMDirectory. Is a file designed to supported > IndexOutput being open concurrently with IndexInput?

RAMDirectory IndexInput and IndexOutput

2008-06-19 Thread Jason Rutherglen
Seeing strange behavior with RAMDirectory. Is a file designed to supported IndexOutput being open concurrently with IndexInput? I open an IndexInput with IndexOutput open, with data written to the file previously, and the IndexInput is reporting a filelength of 0, while Directory.fileLength() rep