W3C home > Mailing lists > Public > www-jigsaw@w3.org > January to February 1997

w3c.tools.dbm.jdbm for large data

From: Toshiki Murata <mura@kansai.oki.co.jp>
Date: Fri, 28 Feb 1997 18:39:13 +0900
Message-Id: <199702280939.SAA13911@emerald.carrot.kansai.oki.co.jp>
To: www-jigsaw@w3.org
I used w3c.tools.dbm.jdbm for very large data(size > 7000).
Then w3c.tools.dbm.jdbm#lookup(key) cause

    java.lang.ArrayIndexOutOfBoundsException: 362
	    at w3c.tools.dbm.jdbm.lookupBucket(jdbm.java:687)
	    at w3c.tools.dbm.jdbm.lookup(jdbm.java:738)

jdbm#splitBucket(jdbm.java:296)
		dir_size <<= 1 ;
		dir_adr    = allocateSpace(dir_size*4) ;
		int      ndiridx[] = new int[dir_size] ;
		for (int i = 0 ; i < (dir_size/2) ; i++) {
		    ndiridx[2*i]   = diridx[i] ;
		    ndiridx[2*i+1] = diridx[i] ;
		}
		diridx      = ndiridx ;
		dir_bits    = newbits ;
		dir_changed = true ;
So diridx[] is increased here.

jdbm#saveDirectory(jdbm.java:452)
	for (int i = 0 ; i < diridx.length ; i++)
	    out.writeInt(diridx[i]) ;
And increased diridx[] is written to jdbm file.

But I think jdbm#saveBucket(jdbm.java:439) perhaps over-writes
bucket data in diridx[] area.
( because (jdbm.java:556) fileptr is not changed. )

I tried to fix this problem,
but it is difficult for me.

Thanks.
(Sorry about bad English...)
--
                                     --------------------------------------
                                                             Toshiki Murata
                                            Oki Electric Industry Co., Ltd.
                                                          Kansai Laboratory
                                                      mura@kansai.oki.co.jp
                                     --------------------------------------
Received on Friday, 28 February 1997 04:38:56 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:26 GMT