Class SQLiteBufferStorage
java.lang.Object
uk.ac.manchester.spinnaker.storage.sqlite.SQLiteBufferStorage
- All Implemented Interfaces:
BufferManagerStorage,DatabaseAPI,ProxyAwareStorage
How to actually talk to an SQLite database.
- Author:
- Donal Fellows
-
Nested Class Summary
Nested classes/interfaces inherited from interface uk.ac.manchester.spinnaker.storage.BufferManagerStorage
BufferManagerStorage.Region -
Constructor Summary
ConstructorsConstructorDescriptionSQLiteBufferStorage(BufferManagerDatabaseEngine connectionProvider) Create an instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRecordingContents(BufferManagerStorage.Region region, byte[] contents) Extract some bytes to the database.byte[]Retrieves some bytes from the database.Get a list of all cores that have data stored in the database.Get the proxy information from the database.Get a list of all regions for a particular core that have data stored in the database.voidprotected static voidsetArguments(PreparedStatement statement, Object... args) Set the arguments to a prepared statement.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface uk.ac.manchester.spinnaker.storage.BufferManagerStorage
addRecordingContents, deleteRegionContents, storeDSEContents, storeRegionContentsMethods inherited from interface uk.ac.manchester.spinnaker.storage.ProxyAwareStorage
getProxyInformation
-
Constructor Details
-
SQLiteBufferStorage
Create an instance.- Parameters:
connectionProvider- The connection provider that will be asked for how to talk SQL to the database.
-
-
Method Details
-
insertMockExtraction
- Specified by:
insertMockExtractionin interfaceBufferManagerStorage- Throws:
StorageException
-
addRecordingContents
public void addRecordingContents(BufferManagerStorage.Region region, byte[] contents) throws StorageException Description copied from interface:BufferManagerStorageExtract some bytes to the database. The bytes represent the contents of a recording region of a particular SpiNNaker core.- Specified by:
addRecordingContentsin interfaceBufferManagerStorage- Parameters:
region- The recording region doing the recording.contents- The bytes to append.- Throws:
StorageException- If anything goes wrong.
-
getContents
Description copied from interface:BufferManagerStorageRetrieves some bytes from the database. The bytes represent the contents of a recording region of a particular SpiNNaker core.- Specified by:
getContentsin interfaceBufferManagerStorage- Parameters:
region- The (DSE) region descriptor.- Returns:
- The region contents.
- Throws:
StorageException- If anything goes wrong.
-
getCoresWithStorage
Description copied from interface:BufferManagerStorageGet a list of all cores that have data stored in the database. Warning: this is a potentially expensive operation!- Specified by:
getCoresWithStoragein interfaceBufferManagerStorage- Returns:
- A list of cores for which something is stored.
- Throws:
StorageException- If anything goes wrong.
-
getRegionsWithStorage
Description copied from interface:BufferManagerStorageGet a list of all regions for a particular core that have data stored in the database.- Specified by:
getRegionsWithStoragein interfaceBufferManagerStorage- Parameters:
core- The core that has the memory regions.- Returns:
- A list of region IDs for which something is stored.
- Throws:
StorageException- If anything goes wrong.
-
getProxyInformation
Description copied from interface:ProxyAwareStorageGet the proxy information from the database.- Specified by:
getProxyInformationin interfaceProxyAwareStorage- Returns:
- The proxy information, or
nullif none defined. When there is no proxy, only direct connections to SpiNNaker are possible. - Throws:
StorageException- If anything goes wrong.
-
setArguments
Set the arguments to a prepared statement. Convenience method.
-