All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----java.util.Dictionary | +----Acme.Dbz
DBZ files are similar to DBM files. From the Java point of view, they are just on-disk hash tables. Comments from the C version:
The dbz database exploits the fact that when news stores a
The basic format of the database is a simple hash table containing the
values. A value is stored by indexing into the table using a hash value
computed from the key; collisions are resolved by linear probing (just
search forward for an empty slot, wrapping around to the beginning of
the table if necessary). Linear probing is a performance disaster when
the table starts to get full, so a complication is introduced. The
database is actually one *or more* tables, stored sequentially in the
.pag file, and the length of linear-probe sequences is limited. The
search (for an existing item or an empty slot) always starts in the
first table, and whenever MAXRUN probes have been done in table N,
probing continues in table N+1. This behaves reasonably well even in
cases of massive overflow. There are some other small complications
added, see comments below.
The table size is fixed for any particular database, but is determined
dynamically when a database is rebuilt. The strategy is to try to pick
the size so the first table will be no more than 2/3 full, that being
slightly before the point where performance starts to degrade. (It is
desirable to be a bit conservative because the overflow strategy tends
to produce files with holes in them, which is a nuisance.)
Fetch the software.
Fetch the entire Acme package.
Dbz
public Dbz(File file) throws IOException
size
public int size()
isEmpty
public boolean isEmpty()
keys
public Enumeration keys()
elements
public Enumeration elements()
get
public Object get(Object key)
put
public Object put(Object key,
Object value)
remove
public Object remove(Object key)
main
public static void main(String args[])
dbzsize
public int dbzsize(int contents)
dbmclose
public void dbmclose()
dbzsync
public void dbzsync()
dbzcancel
public void dbzcancel()
fetch
public Object fetch(Object key)
store
public Object store(Object key,
Object value)
dbzincore
public void dbzincore(boolean value)
All Packages Class Hierarchy This Package Previous Next Index
ACME Java ACME Labs