Class JdbcScanner

  • All Implemented Interfaces:
    java.lang.Iterable<Document>, java.lang.Runnable, java.util.Collection<Document>, java.util.concurrent.BlockingQueue<Document>, java.util.Queue<Document>, Active, Configurable, DeferredBuilding, Scanner, Step

    public class JdbcScanner
    extends ScannerImpl
    Scans a JDBC source such as an RDBMS (e.g. MySQL). Obtains a connection through the specified JDBC driver and extracts rows using the specified SQL statement; converts extracted rows to documents and passes the documents downstream.
    • Constructor Detail

      • JdbcScanner

        public JdbcScanner()
    • Method Detail

      • activate

        public void activate()
        Description copied from interface: Active
        Begin processing. This is the on switch.
        Specified by:
        activate in interface Active
        Overrides:
        activate in class ScannerImpl
      • deactivate

        public void deactivate()
        Description copied from interface: Active
        Stop processing. This is the stop switch.
        Specified by:
        deactivate in interface Active
        Overrides:
        deactivate in class ScannerImpl
      • getScanOperation

        public ScannerImpl.ScanOp getScanOperation()
        Description copied from class: ScannerImpl
        The default scan operation is to check the cassandra database for records marked dirty or restart and process those records using the scanner's document fetching logic (empty by default)
        Specified by:
        getScanOperation in interface Scanner
        Specified by:
        getScanOperation in class ScannerImpl
        Returns:
        a Runnable object that locates documents.
      • getDatabasePkColumnName

        protected java.lang.String getDatabasePkColumnName()
        The name of the column containing the database primary key.
        Returns:
        the configured pk column name or the docIdField name for the plan by default (which is 'id' by default).
      • isScanning

        public boolean isScanning()
        Description copied from interface: Scanner
        True if a new scan may be started. Implementations may choose not to start a new scan until the old one has completed. This value is independent of Active.isActive().
        Returns:
        true if a new scan should be started
      • fetchById

        public java.util.Optional<Document> fetchById​(java.lang.String id,
                                                      java.lang.String origination)
        Description copied from interface: Scanner
        Load a document based on the document's id.
        Parameters:
        id - the id of the document, see also Document.getId()
        origination - A constant indicating the source (scanner or fti) for debugging
        Returns:
        An optional that contains the document if it is possible to retrieve the document by ID
      • getJdbcDriver

        public java.lang.String getJdbcDriver()
      • getJdbcUrl

        public java.lang.String getJdbcUrl()
      • getJdbcUser

        public java.lang.String getJdbcUser()
      • getJdbcPassword

        public java.lang.String getJdbcPassword()
      • getSqlStatement

        public java.lang.String getSqlStatement()
      • getFetchSize

        public int getFetchSize()
      • isAutoCommit

        public boolean isAutoCommit()
      • getQueryTimeout

        public int getQueryTimeout()
      • getContentColumn

        public java.lang.String getContentColumn()