Class TabularIndexHost

  • Direct Known Subclasses:
    EcoreIndexHost

    public abstract class TabularIndexHost
    extends java.lang.Object
    Simple tabular index host. Unlike traditional Viatra instances initialized on a model, this index host can be initialized and then queried, while its queriable "contents" (base relations) can be separately written using table writer API.

    Deriving classes are responsible for setting up the tables of this index and providing the writer API to clients. For the former, use newUnaryInputTable(IInputKey, boolean), newBinaryInputTable(IInputKey, boolean) to create input tables, or registerNewTable(IIndexTable) to register manually created derived tables. Instantiate such tables with runtimeContext as their table context.

    EXPERIMENTAL. This class or interface has been added as part of a work in progress. There is no guarantee that this API will work or that it will remain the same.

    Since:
    2.1
    See Also:
    EcoreIndexHost for EMF-specific example usage.
    • Method Detail

      • isQueryScopeEmulated

        protected abstract boolean isQueryScopeEmulated​(java.lang.Class<? extends QueryScope> queryScopeClass)
        Returns:
        true if this index host aims to serve queries that have a scope of the given type
      • startUpdateTransaction

        public void startUpdateTransaction()
        Marks the beginning of an update transaction. In transaction mode, index table updates may be temporarily delayed for better performance. Stateful query backends will not update their results during the index update transaction. (TODO actually achieve this)
      • finishUpdateTransaction

        public void finishUpdateTransaction()
        Marks the end of an update transaction. Any updates to index tables that were delayed during the transaction must now be flushed. Afterwards, stateful query backends will update their results. (TODO actually achieve this)
      • newUnaryInputTable

        protected ITableWriterUnary.Table<java.lang.Object> newUnaryInputTable​(IInputKey key,
                                                                               boolean unique)
        To be called by deriving class. Creates and registers a new unary input table.
      • newBinaryInputTable

        protected ITableWriterBinary.Table<java.lang.Object,​java.lang.Object> newBinaryInputTable​(IInputKey key,
                                                                                                        boolean unique)
        To be called by deriving class. Creates and registers a new binary input table.
      • registerNewTable

        protected <Table extends IIndexTable> Table registerNewTable​(Table newTable)
        To be called by deriving class. Registers the given freshly created table and also returns it for convenience.