Class SQLiteDataSpecStorage
java.lang.Object
uk.ac.manchester.spinnaker.storage.sqlite.SQLiteDataSpecStorage
- All Implemented Interfaces:
DatabaseAPI,DSEStorage,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.DSEStorage
DSEStorage.Ethernet -
Constructor Summary
ConstructorsConstructorDescriptionSQLiteDataSpecStorage(DSEDatabaseEngine connectionProvider) Create an instance. -
Method Summary
Modifier and TypeMethodDescriptionintgetAppId()Get the system wide app id.Get the machine dimensions.Get the proxy information from the database.Gets a map of region ids to pointers and content Maps only regions with a none zero size.getRegionSizes(CoreLocation core) Get a map of region id to size for regions with a none zero size.Gets the start address for the metadata on this core.listCoresToLoad(DSEStorage.Ethernet ethernet, boolean loadSystemCores) Get a list of all cores that need to be done for a particular ethernet.Get a list of all ethernets that need to have DSE loading done on them.protected static voidsetArguments(PreparedStatement statement, Object... args) Set the arguments to a prepared statement.voidsetRegionPointer(CoreLocation xyp, int regionNum, int pointer) Set the pointer for where to write the region data to.voidsetStartAddress(CoreLocation xyp, MemoryLocation start) Record the start address for the metadata on this core.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.ProxyAwareStorage
getProxyInformation
-
Constructor Details
-
SQLiteDataSpecStorage
Create an instance.- Parameters:
connectionProvider- The connection provider that will be asked for how to talk SQL to the database.
-
-
Method Details
-
listEthernetsToLoad
Description copied from interface:DSEStorageGet a list of all ethernets that need to have DSE loading done on them.- Specified by:
listEthernetsToLoadin interfaceDSEStorage- Returns:
- The list of ethernets.
- Throws:
StorageException- If the database access fails.
-
listCoresToLoad
public List<CoreLocation> listCoresToLoad(DSEStorage.Ethernet ethernet, boolean loadSystemCores) throws StorageException Description copied from interface:DSEStorageGet a list of all cores that need to be done for a particular ethernet.- Specified by:
listCoresToLoadin interfaceDSEStorage- Parameters:
ethernet- The ethernet we're loading onto.loadSystemCores- Iftrue, just list system cores. Iffalse, just list application (non-system) cores.- Returns:
- The list of core locations.
- Throws:
StorageException- If the database access fails.
-
getRegionSizes
Description copied from interface:DSEStorageGet a map of region id to size for regions with a none zero size.- Specified by:
getRegionSizesin interfaceDSEStorage- Parameters:
core- Coordinates to get the region sizes for- Returns:
- Sorted Map of Region number to size. For the regions with a none zero size
- Throws:
StorageException- If the database access fails.
-
getRegionPointersAndContent
public HashMap<Integer,RegionInfo> getRegionPointersAndContent(CoreLocation xyp) throws StorageException Description copied from interface:DSEStorageGets a map of region ids to pointers and content Maps only regions with a none zero size. The content may be null is no data added- Specified by:
getRegionPointersAndContentin interfaceDSEStorage- Parameters:
xyp- Coordinates for the core- Returns:
- map of region number to object holding pointer and content
- Throws:
StorageException- If the database access fails.
-
setStartAddress
Description copied from interface:DSEStorageRecord the start address for the metadata on this core.- Specified by:
setStartAddressin interfaceDSEStorage- Parameters:
xyp- Coordinates for the corestart- Where the load metadata starts.- Throws:
StorageException- If the database access fails.
-
getStartAddress
Description copied from interface:DSEStorageGets the start address for the metadata on this core.- Specified by:
getStartAddressin interfaceDSEStorage- Parameters:
xyp- Coordinates for the core- Returns:
- The location of the start of the metadata region
- Throws:
StorageException- If the database access fails.
-
setRegionPointer
Description copied from interface:DSEStorageSet the pointer for where to write the region data to.- Specified by:
setRegionPointerin interfaceDSEStorage- Parameters:
xyp- Coordinates for the coreregionNum- region number for this pointerpointer- start address for this regions metadata- Throws:
StorageException- If the database access fails.
-
getAppId
Description copied from interface:DSEStorageGet the system wide app id.- Specified by:
getAppIdin interfaceDSEStorage- Returns:
- the app id
- Throws:
StorageException- If the database access fails.
-
getMachineDimensions
Description copied from interface:DSEStorageGet the machine dimensions.- Specified by:
getMachineDimensionsin interfaceDSEStorage- Returns:
- The machine dimensions.
- Throws:
StorageException- If the database access fails.
-
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.
-