Package org.yamcs.yarch
Interface StorageEngine
-
- All Known Implementing Classes:
RdbStorageEngine
public interface StorageEngine
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidcreateTable(YarchDatabaseInstance ydb, TableDefinition tblDef)Create a new table based on definition.voiddropTable(YarchDatabaseInstance ydb, TableDefinition tblDef)Drop the table (removing all data)BucketDatabasegetBucketDatabase(YarchDatabaseInstance yarchDatabaseInstance)HistogramIteratorgetHistogramIterator(YarchDatabaseInstance ydb, TableDefinition tblDef, String columnName, TimeInterval interval)ProtobufDatabasegetProtobufDatabase(YarchDatabaseInstance ydb)TagDbgetTagDb(YarchDatabaseInstance ydb)List<TableDefinition>loadTables(YarchDatabaseInstance ydb)Loads the table definitions from the disk for all the tables belonging to the instance.default voidmigrateTableDefinition(YarchDatabaseInstance ydb, TableDefinition tblDef)In Yamcs version 4 the table definitions were stored in yaml serialized format (in the /storage/yamcs-data// .def) StreamnewTableReaderStream(YarchDatabaseInstance ydb, TableDefinition tblDef, boolean ascending, boolean follow)Creates a new table reader.TableWriternewTableWriter(YarchDatabaseInstance ydb, TableDefinition tblDef, TableWriter.InsertMode insertMode)Creates a new table writervoidsaveTableDefinition(YarchDatabaseInstance ydb, TableDefinition tblDef)Persist the table definition to diks (called when the table definition modifies)
-
-
-
Method Detail
-
loadTables
List<TableDefinition> loadTables(YarchDatabaseInstance ydb) throws YarchException
Loads the table definitions from the disk for all the tables belonging to the instance.called at startup.
- Parameters:
ydb-- Throws:
YarchException
-
createTable
void createTable(YarchDatabaseInstance ydb, TableDefinition tblDef) throws YarchException
Create a new table based on definition.- Parameters:
ydb-tblDef-- Throws:
YarchException
-
saveTableDefinition
void saveTableDefinition(YarchDatabaseInstance ydb, TableDefinition tblDef) throws YarchException
Persist the table definition to diks (called when the table definition modifies)- Parameters:
ydb-tblDef-- Throws:
YarchException
-
dropTable
void dropTable(YarchDatabaseInstance ydb, TableDefinition tblDef) throws YarchException
Drop the table (removing all data)- Parameters:
ydb-tblDef-- Throws:
YarchException
-
newTableWriter
TableWriter newTableWriter(YarchDatabaseInstance ydb, TableDefinition tblDef, TableWriter.InsertMode insertMode) throws YarchException
Creates a new table writer- Parameters:
ydb-tblDef-insertMode-- Returns:
- Throws:
YarchException
-
newTableReaderStream
Stream newTableReaderStream(YarchDatabaseInstance ydb, TableDefinition tblDef, boolean ascending, boolean follow)
Creates a new table reader.- Parameters:
ydb-tblDef-
-
getTagDb
TagDb getTagDb(YarchDatabaseInstance ydb) throws YarchException
- Throws:
YarchException
-
getHistogramIterator
HistogramIterator getHistogramIterator(YarchDatabaseInstance ydb, TableDefinition tblDef, String columnName, TimeInterval interval) throws YarchException
- Throws:
YarchException
-
getBucketDatabase
BucketDatabase getBucketDatabase(YarchDatabaseInstance yarchDatabaseInstance) throws YarchException
- Throws:
YarchException
-
getProtobufDatabase
ProtobufDatabase getProtobufDatabase(YarchDatabaseInstance ydb) throws YarchException
- Throws:
YarchException
-
migrateTableDefinition
default void migrateTableDefinition(YarchDatabaseInstance ydb, TableDefinition tblDef) throws YarchException
In Yamcs version 4 the table definitions were stored in yaml serialized format (in the /storage/yamcs-data// .def) This function is called to migrate them inside the storage engine where they are stored starting with Yamcs 5
- Throws:
YarchException
-
-