| java.lang.Object org.apache.derby.iapi.store.access.DiskHashtable
DiskHashtable | public class DiskHashtable (Code) | | This class is used by BackingStoreHashtable when the BackingStoreHashtable must spill to disk.
It implements the methods of a hash table: put, get, remove, elements, however it is not implemented
as a hash table. In order to minimize the amount of unique code it is implemented using a Btree and a heap
conglomerate. The Btree indexes the hash code of the row key. The actual key may be too long for
our Btree implementation.
Created: Fri Jan 28 13:58:03 2005
author: Jack Klebanoff version: 1.0 |
Method Summary | |
public void | close() | public Enumeration | elements() Return an Enumeration that can be used to scan entire table. | public Object | get(Object key) Get a row from the overflow structure.
Parameters: key - If the rows only have one key column then the key value. | public boolean | put(Object key, Object[] row) Put a new row in the overflow structure.
Parameters: row - The row to be inserted. | public Object | remove(Object key) remove all rows with a given key from the hash table.
Parameters: key - The key of the rows to remove. | public int | size() |
DiskHashtable | public DiskHashtable(TransactionController tc, DataValueDescriptor[] template, int[] key_column_numbers, boolean remove_duplicates, boolean keepAfterCommit) throws StandardException(Code) | | Creates a new DiskHashtable instance.
Parameters: tc - Parameters: template - An array of DataValueDescriptors that serves as a template for the rows. Parameters: key_column_numbers - The indexes of the key columns (0 based) Parameters: remove_duplicates - If true then rows with duplicate keys are removed Parameters: keepAfterCommit - If true then the hash table is kept after a commit |
get | public Object get(Object key) throws StandardException(Code) | | Get a row from the overflow structure.
Parameters: key - If the rows only have one key column then the key value. If there is more than onekey column then a KeyHasher null if there is no corresponding row,the row (DataValueDescriptor[]) if there is exactly one row with the keya Vector of all the rows with the key if there is more than one. exception: StandardException - |
put | public boolean put(Object key, Object[] row) throws StandardException(Code) | | Put a new row in the overflow structure.
Parameters: row - The row to be inserted. true if the row was added,false if it was not added (because it was a duplicate and we are eliminating duplicates). exception: StandardException - standard error policy |
size | public int size()(Code) | | The number of rows in the hash table |
|
|