All Superinterfaces:
org.odpi.openmetadata.adapters.connectors.datastore.basicfile.BasicFileStore
All Known Implementing Classes:
CSVFileStoreConnector

public interface CSVFileStore extends org.odpi.openmetadata.adapters.connectors.datastore.basicfile.BasicFileStore
CSVFileStore defines the specific connector api for working with CSV files. A CSV file is one where each row represents a record that is divided into attributes that are separated by a special character (usually a space). Each row has the same list of attributes and so the file is effectively a table of data.
  • Method Summary

    Modifier and Type
    Method
    Description
    Return the list of column names associated with this structured file.
    long
    Return the number of records in the file.
    readRecord(int rowNumber)
    Return the requested data record.

    Methods inherited from interface org.odpi.openmetadata.adapters.connectors.datastore.basicfile.BasicFileStore

    getCreationDate, getFile, getFileLength, getFileName, getLastAccessDate, getLastUpdateDate
  • Method Details

    • getRecordCount

      long getRecordCount() throws org.odpi.openmetadata.adapters.connectors.datastore.basicfile.ffdc.exception.FileException, org.odpi.openmetadata.adapters.connectors.datastore.basicfile.ffdc.exception.FileReadException
      Return the number of records in the file. This is achieved by scanning the file and counting the records - not recommended for very large files.
      Returns:
      count
      Throws:
      org.odpi.openmetadata.adapters.connectors.datastore.basicfile.ffdc.exception.FileException - there is a problem accessing the file
      org.odpi.openmetadata.adapters.connectors.datastore.basicfile.ffdc.exception.FileReadException - unable to find, open or scan the file.
    • getColumnNames

      List<String> getColumnNames() throws org.odpi.openmetadata.adapters.connectors.datastore.basicfile.ffdc.exception.FileException, org.odpi.openmetadata.adapters.connectors.datastore.basicfile.ffdc.exception.FileReadException
      Return the list of column names associated with this structured file. This may be embedded in the first line of the file or encoded in the connection object used to create a connector instance.
      Returns:
      a list of column names
      Throws:
      org.odpi.openmetadata.adapters.connectors.datastore.basicfile.ffdc.exception.FileException - there is a problem accessing the file
      org.odpi.openmetadata.adapters.connectors.datastore.basicfile.ffdc.exception.FileReadException - unable to retrieve the column names
    • readRecord

      List<String> readRecord(int rowNumber) throws org.odpi.openmetadata.adapters.connectors.datastore.basicfile.ffdc.exception.FileException, org.odpi.openmetadata.adapters.connectors.datastore.basicfile.ffdc.exception.FileReadException
      Return the requested data record. The first record is record 0. If the first line of the file is the column names then record 0 is the line following the column names.
      Parameters:
      rowNumber - long
      Returns:
      List of strings, each string is the value from the column.
      Throws:
      org.odpi.openmetadata.adapters.connectors.datastore.basicfile.ffdc.exception.FileException - there is a problem accessing the file
      org.odpi.openmetadata.adapters.connectors.datastore.basicfile.ffdc.exception.FileReadException - unable to find, open or read the file, or the file does not include the requested record.