Class RDMModelFarm<KEYTYPE,DATATYPE,ROWDATAMANAGERTYPE extends RowDataManager<KEYTYPE,DATATYPE>>

java.lang.Object
io.deephaven.modelfarm.ModelFarmBase<DATATYPE>
io.deephaven.modelfarm.RDMModelFarm<KEYTYPE,DATATYPE,ROWDATAMANAGERTYPE>
Type Parameters:
KEYTYPE - The type of keys.
DATATYPE - The type of data.
ROWDATAMANAGERTYPE - The type of RowDataManager.
All Implemented Interfaces:
ModelFarm
Direct Known Subclasses:
ModelFarmRealTime, ModelFarmTick

public abstract class RDMModelFarm<KEYTYPE,DATATYPE,ROWDATAMANAGERTYPE extends RowDataManager<KEYTYPE,DATATYPE>> extends ModelFarmBase<DATATYPE>
Abstract class for ModelFarm implementations that will take data from a RowDataManager. This class tracks the mappings between each key and the corresponding index in the RowDataManager's table. Each row of this table should contain all of the data necessary to populate an instance of DATATYPE, which will then be passed to the model.
  • Field Details

  • Constructor Details

    • RDMModelFarm

      public RDMModelFarm(int nThreads, Model<DATATYPE> model, ROWDATAMANAGERTYPE dataManager)
      Create a multithreaded resource to execute data driven models.
      Parameters:
      nThreads - number of worker threads.
      model - model to execute.
      dataManager - interface for accessing and querying data contained in rows of a dynamic table.
  • Method Details

    • modelFarmStarted

      protected void modelFarmStarted()
      Description copied from class: ModelFarmBase
      Method called after the model farm threads have been started. Implementing classes can override this to perform additional setup (e.g. creating and starting listeners). The default implementation does nothing.
      Specified by:
      modelFarmStarted in class ModelFarmBase<DATATYPE>
    • onDataUpdate

      protected abstract void onDataUpdate(RowSet added, RowSet removed, RowSet modified)
      Process a change to the data table. If the data table is being accessed, use the protected column source fields.
      Parameters:
      added - new indexes added to the data table
      removed - indexes removed from the data table
      modified - indexes modified in the data table.
    • getMostRecentDataFactory

      protected io.deephaven.modelfarm.ModelFarmBase.MostRecentDataGetter<KEYTYPE,DATATYPE> getMostRecentDataFactory(ModelFarmBase.GetDataLockType lockType)
      Returns a function that takes a key and returns an instance of DATATYPE that contains the most recent data for that key. The returned function will retrieve the data using the specified lockType.
      Parameters:
      lockType - locking algorithm used to ensure that data read from the table is consistent.
      Returns:
      function to retrieve the most recent row data for a unique identifier.