Interface SQLitePersistence<O,A extends Comparable<A>>
-
- All Superinterfaces:
Persistence<O,A>
- All Known Implementing Classes:
DiskPersistence
,OffHeapPersistence
public interface SQLitePersistence<O,A extends Comparable<A>> extends Persistence<O,A>
AnPersistence
which persists to a SQLite database.- Author:
- Silvano Riz
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
compact()
Compacts the underlying persistence, which returns unused memory or disk space to the operating system.SQLiteIdentityIndex<A,O>
createIdentityIndex()
Creates aSQLiteIdentityIndex
which persists objects in this persistence.void
expand(long numBytes)
Expands the underlying persistence by the given number of bytes in a single operation.long
getBytesUsed()
Connection
getConnection(Index<?> index, QueryOptions queryOptions)
Returns aConnection
to the SQLite database used for persistence.-
Methods inherited from interface com.googlecode.cqengine.persistence.Persistence
closeRequestScopeResources, createObjectStore, getPrimaryKeyAttribute, openRequestScopeResources, supportsIndex
-
-
-
-
Method Detail
-
getConnection
Connection getConnection(Index<?> index, QueryOptions queryOptions)
Returns aConnection
to the SQLite database used for persistence.- Parameters:
index
- TheIndex
requesting the connection.queryOptions
- The query options for the request- Returns:
- The
Connection
-
getBytesUsed
long getBytesUsed()
- Returns:
- The number of bytes used to persist the collection and/or indexes.
-
compact
void compact()
Compacts the underlying persistence, which returns unused memory or disk space to the operating system.
-
expand
void expand(long numBytes)
Expands the underlying persistence by the given number of bytes in a single operation. This will usually result in the persistence being expanded into an additional contiguous chunk of memory or region on disk. After this method returns, the operating system will report that the memory or disk space used for persistence has increased by this amount, but internally the space will simply be reserved for future use. The reserved space will be used to store objects added to the collection subsequently, without needing to request more memory from the OS ad-hoc. This can reduce fragmentation of the persistence file on some OS filesystems, especially if used prior to bulk imports when the persistence is on a non-SSD disk.
-
createIdentityIndex
SQLiteIdentityIndex<A,O> createIdentityIndex()
Creates aSQLiteIdentityIndex
which persists objects in this persistence.- Returns:
- a
SQLiteIdentityIndex
which persists objects in this persistence.
-
-