Package org.yamcs.yarch
Class YarchDatabase
java.lang.Object
org.yamcs.yarch.YarchDatabase
Handles all tables/streams/indexes for a Yamcs server
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddStorageEngine(String name, StorageEngine engine) Registers a storage engine.Returns the names of the loaded databases.static Stringstatic StorageEngineReturns the default storage engine, used for the tables created without an explicit engine (unless the instance configures another one) and providing the bucket and protobuf databases and the sequences.static Stringstatic StringgetHome()static YarchDatabaseInstancegetInstance(String yamcsInstance) static StorageEnginegetStorageEngine(String storageEngineName) static Collection<StorageEngine>static booleanhasInstance(String dbname) static booleaninstanceExistsOnDisk(String yamcsInstance) static voidremoveInstance(String dbName) to be used for testingstatic voidstatic voidShuts down all the storage engines.
-
Field Details
-
RDB_ENGINE_NAME
- See Also:
-
-
Constructor Details
-
YarchDatabase
public YarchDatabase()
-
-
Method Details
-
addStorageEngine
Registers a storage engine.The engines are normally configured in the
storageEnginessection of yamcs.yaml; this method can be used to register an engine programmatically (e.g. in tests). The registration has to be done before the instances using the engine are loaded because the tables are loaded at instance creation.- Throws:
IllegalArgumentException- if an engine with the same name is already registered
-
getInstance
- Parameters:
yamcsInstance-
-
getDatabases
Returns the names of the loaded databases. -
hasInstance
-
instanceExistsOnDisk
-
removeInstance
to be used for testing- Parameters:
dbName- database name to be removed
-
setHome
-
getHome
-
getDataDir
-
getDefaultStorageEngine
Returns the default storage engine, used for the tables created without an explicit engine (unless the instance configures another one) and providing the bucket and protobuf databases and the sequences. -
getStorageEngine
-
getStorageEngines
-
getStorageEngineNames
-
getDefaultStorageEngineName
-
shutdownStorageEngines
public static void shutdownStorageEngines()Shuts down all the storage engines. Called when Yamcs is stopped, after all the instances have been closed.
-