
@Description(value="Database using an in-memory hashtable and at least providing linear scans.") public class HashmapDatabase extends AbstractDatabase implements UpdatableDatabase, Parameterizable
| Modifier and Type | Class and Description | 
|---|---|
static class  | 
HashmapDatabase.Parameterizer
Parameterization class. 
 | 
| Modifier and Type | Field and Description | 
|---|---|
protected DatabaseConnection | 
databaseConnection
The data source we get the initial data from. 
 | 
private DBIDView | 
idrep
The DBID representation we use 
 | 
private HashSetModifiableDBIDs | 
ids
IDs of this database 
 | 
private static Logging | 
LOG
Our logger 
 | 
eventManager, INDEX_ID, indexes, indexFactories, relationsDATABASE_CONNECTION_ID| Constructor and Description | 
|---|
HashmapDatabase()
Constructor with no indexes. 
 | 
HashmapDatabase(DatabaseConnection databaseConnection,
               Collection<IndexFactory<?,?>> indexFactories)
Constructor. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
private Relation<?> | 
addNewRelation(SimpleTypeInformation<?> meta)
Add a new representation for the given meta. 
 | 
protected Relation<?>[] | 
alignColumns(ObjectBundle pack)
Find a mapping from package columns to database columns, eventually adding
 new database columns when needed. 
 | 
SingleObjectBundle | 
delete(DBIDRef id)
Removes the object from the database (by calling  
doDelete(DBIDRef)
 ) and indexes and fires a deletion event. | 
MultipleObjectsBundle | 
delete(DBIDs ids)
Removes the objects from the database (by calling
  
doDelete(DBIDRef) for each object) and indexes and fires a
 deletion event. | 
private void | 
doDelete(DBIDRef id)
Removes the object with the specified id from this database. 
 | 
protected Logging | 
getLogger()  | 
void | 
initialize()
Initialize the database by getting the initial data from the database
 connection. 
 | 
DBIDs | 
insert(ObjectBundle objpackages)
Inserts the given object(s) and their associations into the database. 
 | 
accumulateDataStoreEvents, addDataStoreListener, addIndex, flushDataStoreEvents, getBundle, getDistanceQuery, getIndexes, getKNNQuery, getLongName, getRangeQuery, getRelation, getRelations, getRKNNQuery, getShortName, getSimilarityQuery, removeDataStoreListener, removeIndexaddChildResult, getHierarchy, setHierarchyclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaccumulateDataStoreEvents, addDataStoreListener, addIndex, flushDataStoreEvents, getBundle, getDistanceQuery, getIndexes, getKNNQuery, getRangeQuery, getRelation, getRelations, getRKNNQuery, getSimilarityQuery, removeDataStoreListener, removeIndexgetHierarchy, setHierarchygetLongName, getShortNameprivate static final Logging LOG
private HashSetModifiableDBIDs ids
private final DBIDView idrep
protected DatabaseConnection databaseConnection
public HashmapDatabase(DatabaseConnection databaseConnection, Collection<IndexFactory<?,?>> indexFactories)
databaseConnection - Database connection to get the initial data from.indexFactories - Indexes to addpublic HashmapDatabase()
public void initialize()
initialize in interface Databasepublic DBIDs insert(ObjectBundle objpackages)
UpdatableDatabaseinsert in interface UpdatableDatabaseobjpackages - the objects to be insertedprotected Relation<?>[] alignColumns(ObjectBundle pack)
pack - Package to processprivate Relation<?> addNewRelation(SimpleTypeInformation<?> meta)
meta - meta datapublic MultipleObjectsBundle delete(DBIDs ids)
doDelete(DBIDRef) for each object) and indexes and fires a
 deletion event.
 
 Removes and returns the specified objects with the given ids from the
 database.delete in interface UpdatableDatabaseids - the ids of the object to be removed from the databasepublic SingleObjectBundle delete(DBIDRef id)
doDelete(DBIDRef)
 ) and indexes and fires a deletion event.
 
 Removes and returns the specified objects with the given ids from the
 database.delete in interface UpdatableDatabaseid - the id of the object to be removed from the databaseprivate void doDelete(DBIDRef id)
id - id the id of the object to be removedprotected Logging getLogger()
getLogger in class AbstractDatabase