|
|
|||||||||||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||||||||||
java.lang.Objectde.lmu.ifi.dbs.elki.logging.AbstractLoggable
de.lmu.ifi.dbs.elki.index.tree.TreeIndex<O,N,E>
O - the type of DatabaseObject to be stored in the indexN - the type of Node used in the indexE - the type of Entry used in the indexpublic abstract class TreeIndex<O extends DatabaseObject,N extends Node<N,E>,E extends Entry>
Abstract super class for all tree based index classes.
| Field Summary | |
|---|---|
static OptionID |
CACHE_SIZE_ID
OptionID for CACHE_SIZE_PARAM |
private LongParameter |
CACHE_SIZE_PARAM
Parameter to specify the size of the cache in bytes, must be an integer equal to or greater than 0. |
protected long |
cacheSize
Holds the value of CACHE_SIZE_PARAM. |
protected int |
dirCapacity
The capacity of a directory node (= 1 + maximum number of entries in a directory node). |
protected int |
dirMinimum
The minimum number of entries in a directory node. |
protected PageFile<N> |
file
The file storing the entries of this index. |
static OptionID |
FILE_ID
OptionID for FILE_PARAM |
private FileParameter |
FILE_PARAM
Optional parameter that specifies the name of the file storing the index. |
private String |
fileName
Holds the name of the file storing the index specified by FILE_PARAM, null if FILE_PARAM is not specified. |
protected boolean |
initialized
True if this index is already initialized. |
protected int |
leafCapacity
The capacity of a leaf node (= 1 + maximum number of entries in a leaf node). |
protected int |
leafMinimum
The minimum number of entries in a leaf node. |
static OptionID |
PAGE_SIZE_ID
OptionID for PAGE_SIZE_PARAM |
private IntParameter |
PAGE_SIZE_PARAM
Parameter to specify the size of a page in bytes, must be an integer greater than 0. |
protected int |
pageSize
Holds the value of PAGE_SIZE_PARAM. |
private E |
rootEntry
The entry representing the root node. |
| Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
|---|
debug, logger |
| Constructor Summary | |
|---|---|
TreeIndex(Parameterization config)
Constructor, adhering to Parameterizable |
|
| Method Summary | |
|---|---|
void |
close()
Closes this index. |
protected abstract void |
createEmptyRoot(O object)
Creates an empty root node and writes it to file. |
protected TreeIndexHeader |
createHeader()
Creates a header for this index structure which is an instance of TreeIndexHeader. |
protected abstract N |
createNewDirectoryNode(int capacity)
Creates a new directory node with the specified capacity. |
protected abstract N |
createNewLeafNode(int capacity)
Creates a new leaf node with the specified capacity. |
protected abstract E |
createRootEntry()
Creates an entry representing the root node. |
String |
getFileName()
|
long |
getLogicalPageAccess()
Returns the logical page access of this index. |
N |
getNode(E entry)
Returns the node that is represented by the specified entry. |
N |
getNode(int nodeID)
Returns the node with the specified id. |
protected abstract Class<N> |
getNodeClass()
Get the node class of this index |
long |
getPhysicalReadAccess()
Returns the physical read access of this index. |
long |
getPhysicalWriteAccess()
Returns the physical write access of this index. |
protected N |
getRoot()
Reads the root node of this index from the file. |
E |
getRootEntry()
Returns the entry representing the root if this index. |
protected TreeIndexPath<E> |
getRootPath()
Returns the path to the root of this tree. |
protected void |
initialize(O object)
Initializes the index. |
protected abstract void |
initializeCapacities(O object,
boolean verbose)
Determines the maximum and minimum number of entries in a node. |
void |
initializeFromFile()
Initializes this index from an existing persistent file. |
protected abstract void |
postDelete(O o)
Performs necessary operations after deleting the specified object. |
protected abstract void |
preInsert(E entry)
Performs necessary operations before inserting the specified entry. |
void |
resetPageAccess()
Resets the three counters for page access, i.e., the counters for physical read and write access, and the counter for logical page access. |
| Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
|---|
debugFine, debugFiner, debugFinest, exception, progress, verbose, warning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface de.lmu.ifi.dbs.elki.index.Index |
|---|
delete, insert, insert, setDatabase |
| Field Detail |
|---|
public static final OptionID FILE_ID
FILE_PARAM
private final FileParameter FILE_PARAM
Key: -treeindex.file
private String fileName
FILE_PARAM, null if FILE_PARAM is not specified.
public static final OptionID PAGE_SIZE_ID
PAGE_SIZE_PARAM
private final IntParameter PAGE_SIZE_PARAM
Default value: 4000
Key: -treeindex.pagesize
protected int pageSize
PAGE_SIZE_PARAM.
public static final OptionID CACHE_SIZE_ID
CACHE_SIZE_PARAM
private final LongParameter CACHE_SIZE_PARAM
Default value: Integer.MAX_VALUE
Key: -treeindex.cachesize
protected long cacheSize
CACHE_SIZE_PARAM.
protected PageFile<N extends Node<N,E>> file
protected boolean initialized
protected int dirCapacity
protected int leafCapacity
protected int dirMinimum
protected int leafMinimum
private E extends Entry rootEntry
| Constructor Detail |
|---|
public TreeIndex(Parameterization config)
Parameterizable
config - Parameterization| Method Detail |
|---|
public final long getPhysicalReadAccess()
Index
getPhysicalReadAccess in interface Index<O extends DatabaseObject>resetPageAccess.public final long getPhysicalWriteAccess()
Index
getPhysicalWriteAccess in interface Index<O extends DatabaseObject>resetPageAccess.public final long getLogicalPageAccess()
Index
getLogicalPageAccess in interface Index<O extends DatabaseObject>resetPageAccess.public final void resetPageAccess()
Index
resetPageAccess in interface Index<O extends DatabaseObject>public final void close()
Index
close in interface Index<O extends DatabaseObject>public final E getRootEntry()
public N getNode(int nodeID)
nodeID - the page id of the node to be returned
public final N getNode(E entry)
entry - the entry representing the node to be returned
protected TreeIndexHeader createHeader()
TreeIndexHeader. Subclasses may need to overwrite this method if
they need a more specialized header.
public void initializeFromFile()
protected final void initialize(O object)
object - an object that will be stored in the indexprotected final TreeIndexPath<E> getRootPath()
protected N getRoot()
protected abstract void initializeCapacities(O object,
boolean verbose)
object - an object that will be stored in the indexverbose - flag to allow verbose messagesprotected abstract void createEmptyRoot(O object)
object - an object that will be stored in the indexprotected abstract E createRootEntry()
protected abstract N createNewLeafNode(int capacity)
capacity - the capacity of the new node
protected abstract N createNewDirectoryNode(int capacity)
capacity - the capacity of the new node
protected abstract void preInsert(E entry)
entry - the entry to be insertedprotected abstract void postDelete(O o)
o - the object to be deletedprotected abstract Class<N> getNodeClass()
public String getFileName()
|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||