Class YarchDatabase

java.lang.Object
org.yamcs.yarch.YarchDatabase

public class YarchDatabase extends Object
Handles all tables/streams/indexes for a Yamcs server
  • Field Details

  • Constructor Details

    • YarchDatabase

      public YarchDatabase()
  • Method Details

    • addStorageEngine

      public static void addStorageEngine(String name, StorageEngine engine)
      Registers a storage engine.

      The engines are normally configured in the storageEngines section 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

      public static YarchDatabaseInstance getInstance(String yamcsInstance)
      Parameters:
      yamcsInstance -
    • getDatabases

      public static Set<String> getDatabases()
      Returns the names of the loaded databases.
    • hasInstance

      public static boolean hasInstance(String dbname)
    • instanceExistsOnDisk

      public static boolean instanceExistsOnDisk(String yamcsInstance)
    • removeInstance

      public static void removeInstance(String dbName)
      to be used for testing
      Parameters:
      dbName - database name to be removed
    • setHome

      public static void setHome(String home)
    • getHome

      public static String getHome()
    • getDataDir

      public static String getDataDir()
    • getDefaultStorageEngine

      public static StorageEngine 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

      public static StorageEngine getStorageEngine(String storageEngineName)
    • getStorageEngines

      public static Collection<StorageEngine> getStorageEngines()
    • getStorageEngineNames

      public static Set<String> getStorageEngineNames()
    • getDefaultStorageEngineName

      public static String getDefaultStorageEngineName()
    • shutdownStorageEngines

      public static void shutdownStorageEngines()
      Shuts down all the storage engines. Called when Yamcs is stopped, after all the instances have been closed.