Interface TabularDataSource

All Known Implementing Classes:
CSVFileStoreConnector, PostgresTabularDataSourceConnector

public interface TabularDataSource
TabularDataSource defines the specific connector api for working with simple tabular data. Each row represents a record that is divided into columns. Each row has the same list of columns and so the data source is effectively a table of data.
  • Method Details

    • getRecordCount

      long getRecordCount() throws ConnectorCheckedException
      Return the number of records in the data source.
      Returns:
      count
      Throws:
      ConnectorCheckedException - there is a problem accessing the data
    • getColumnDescriptions

      Return the list of column names associated with this data source.
      Returns:
      a list of column descriptions or null if not available.
      Throws:
      ConnectorCheckedException - there is a problem accessing the data
    • setColumnDescriptions

      void setColumnDescriptions(List<TabularColumnDescription> columnDescriptions) throws ConnectorCheckedException
      Set up the columns associated with this tabular data source. These may be stored in the data set or kept in memory for this instance.
      Parameters:
      columnDescriptions - a list of column descriptions
      Throws:
      ConnectorCheckedException - there is a problem accessing the data
    • readRecord

      List<String> readRecord(long rowNumber) throws ConnectorCheckedException
      Return the requested data record. The first record is record 0.
      Parameters:
      rowNumber - long
      Returns:
      list of values (as strings) where each string is the value from a column. The order is the same as the columns
      Throws:
      ConnectorCheckedException - there is a problem accessing the data.
    • writeRecord

      void writeRecord(long rowNumber, List<String> dataValues) throws ConnectorCheckedException
      Write the requested data record. The first data record is record 0.
      Parameters:
      rowNumber - long
      dataValues - Map of column descriptions to strings, each string is the value for the column.
      Throws:
      ConnectorCheckedException - there is a problem accessing the data.
    • appendRecord

      void appendRecord(List<String> dataValues) throws ConnectorCheckedException
      Write the requested data record to the end of the data source.
      Parameters:
      dataValues - Map of column descriptions to strings, each string is the value for the column.
      Throws:
      ConnectorCheckedException - there is a problem accessing the data.