Re: btree on disk

"Cam Bazz" <[email protected]>
Newsgroups gmane.text.xml.xindice.devel
Message-ID <[email protected]>
Hello Vadim;

I have been looking and experimenting with BFiler. So far, I have been able
to insert into BTree,
but I have not been able to write to disk. (the initially created file stays
at same size).

Best Regards,
-C.B

//
Configuration config = new Configuration(DOMParser.toDocument(
Xindice.DEFAULT_CONFIGURATION), false);

BTreeFiler btf = new BTreeFiler();

btf.setConfig(config);

File file = new File("c:\\");
btf.setLocation(file, "test");
btf.create();

// this works and does indeed inserts to the btree
for(int i=0; i<100000; i++)
{
   btf.addValue(new Value("hello"+i), i);
}

// this throws an exception saying page file not open.
btf.writeRecord(new Key("key"), new Value("val"));

btf.close();

On 7/5/07, Vadim Gritsenko <[email protected]> wrote:
>
> Cam Bazz wrote:
> > Hello Developers,
> >
> > I have been looking for a solid implementation of a Java BTree on disk
> > for the longest time. Could it be possible to use xindices btree on disk
> > seperately.
> > If so, where would be a good place to start. I have looked at the source
> > code, instantiated a new BTree and added values to it, but I got a null
> > pointer exception saying that the file was not opened.
>
> I don't think you can use BTree class directly. Take a look at BTreeFiler
> - that
> should be better fit. Once you instantiate it, you need to pass in
> configuration
> and open it. Once you are done working with it, it needs to be closed.
>
> See also org.apache.xindice.core.Collection, there you can see how to work
> with
> Filers.
>
> PS Have you seen JISP?
>
> Vadim
>
> [1] http://www.coyotegulch.com/products/jisp/
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.