- All Implemented Interfaces:
Overrides some methods where the underlying implementation differs between on heap and on disk indexes.
The update method for disk persistence cannot be trusted. It only replaces an existing version by using the objects serialized form as its composite PK.
Methods inherited from class com.codingchili.core.storage.IndexedMap
addIndex, clear, context, get, getAttribute, getDatabase, put, putIfAbsent, query, remove, setMapper, size, update, values
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
IndexedMapPersistedpublic IndexedMapPersisted(io.vertx.core.Promise<AsyncStorage<Value>> promise, StorageContext<Value> context)Creates a possibly shared instance of the persisted IndexedMap. It is recommended to not call this directly and instead use the storage loader.
promise- completed when the storage is ready.
context- the storage context to set up file locations etc.
addIndexesForAttributepublic void addIndexesForAttribute(com.googlecode.cqengine.attribute.Attribute<Value,String> attribute)
reindexpublic static void reindex()Disk indexes are not discovered by CQEngine at startup. This means that CQEngine will not update existing indexes unless AsyncStorage#addIndex is called before any items are added.
To work around this there are two options,
a) Always add all indexes before inserting ANY items. b) Call this method before loading the IndexedMapPersisted plugin. Then items can be added before adding an index. Because when the index is added later it will be rebuilt. In the window between adding the object and adding the index the object will not be visible in the affected indexes.
If this method is called after an instance of IndexedMapPersisted has been loaded through the storage loader an exception is thrown.