Package org.jesterj.ingest.scanners
Class JdbcScanner.Builder
- java.lang.Object
-
- org.jesterj.ingest.model.impl.NamedBuilder<StepImpl>
-
- org.jesterj.ingest.model.impl.StepImpl.Builder
-
- org.jesterj.ingest.model.impl.ScannerImpl.Builder
-
- org.jesterj.ingest.scanners.JdbcScanner.Builder
-
- All Implemented Interfaces:
Buildable<StepImpl>,ConfiguredBuildable<StepImpl>
- Enclosing class:
- JdbcScanner
public static class JdbcScanner.Builder extends ScannerImpl.Builder
Handles configuration parameters for the JDBC scanner.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
-
Methods inherited from class org.jesterj.ingest.model.impl.StepImpl.Builder
getStepName
-
Methods inherited from class org.jesterj.ingest.model.impl.NamedBuilder
isValid
-
-
-
-
Method Detail
-
detectChangesViaHashing
public JdbcScanner.Builder detectChangesViaHashing(boolean hash)
Description copied from class:ScannerImpl.BuilderTurn on change detection via hashing. When this feature is enabled, the raw bytes of the document and the backing multimap's contents (e.g. field data from scans of data stores such as databases) will be used to create an md5 hash which is stored and compared on subsequent scans. If the previous hash differs from the current hash, the document will be considered dirty, and eligible for reprocessing. Note that this has no effect unlessScannerImpl.Builder.rememberScannedIds(boolean)is turned on, because without that option, all documents are considered dirty every time.- Overrides:
detectChangesViaHashingin classScannerImpl.Builder- Parameters:
hash- whether or not to perform hashing to track document changes- Returns:
- This builder object for further configuration
-
rememberScannedIds
public JdbcScanner.Builder rememberScannedIds(boolean remember)
Description copied from class:ScannerImpl.BuilderTurn on document id based memory. When enabled this option will cause the scanner not to submit documents that have already been indexed a second time unless they have been marked dirty, the scanner's heuristics determine that the document is dirty, or hash based change detection has indicated that the document has changed.- Overrides:
rememberScannedIdsin classScannerImpl.Builder- Parameters:
remember- whether to track which documents have already been submitted- Returns:
- This builder object for further configuration
-
retryErroredDocsUpTo
public JdbcScanner.Builder retryErroredDocsUpTo(int retries)
Description copied from class:ScannerImpl.BuilderThe number of times to retry a document that has errored out previously before ignoring it.- Overrides:
retryErroredDocsUpToin classScannerImpl.Builder- Parameters:
retries- the number of time to retry an erroring document before giving up- Returns:
- this builder for further configuration.
-
withShutdownWait
public StepImpl.Builder withShutdownWait(int millis)
- Overrides:
withShutdownWaitin classStepImpl.Builder
-
withProcessor
public StepImpl.Builder withProcessor(ConfiguredBuildable<? extends DocumentProcessor> processor)
- Overrides:
withProcessorin classStepImpl.Builder
-
withJdbcDriver
public JdbcScanner.Builder withJdbcDriver(java.lang.String jdbcDriver)
-
withJdbcUrl
public JdbcScanner.Builder withJdbcUrl(java.lang.String jdbcUrl)
-
withJdbcUser
public JdbcScanner.Builder withJdbcUser(java.lang.String jdbcUser)
-
withJdbcPassword
public JdbcScanner.Builder withJdbcPassword(java.lang.String jdbcPassword)
-
withSqlStatement
public JdbcScanner.Builder withSqlStatement(java.lang.String sqlStatement)
-
representingTable
public JdbcScanner.Builder representingTable(java.lang.String table)
-
withContentColumn
public JdbcScanner.Builder withContentColumn(java.lang.String contentColumn)
-
withPKColumn
public JdbcScanner.Builder withPKColumn(java.lang.String pkCol)
-
testingConnectionWith
public JdbcScanner.Builder testingConnectionWith(java.lang.String query)
-
withFetchSize
public JdbcScanner.Builder withFetchSize(int fetchSize)
-
withAutoCommit
public JdbcScanner.Builder withAutoCommit(boolean autoCommit)
-
withQueryTimeout
public JdbcScanner.Builder withQueryTimeout(int queryTimeout)
-
batchSize
public JdbcScanner.Builder batchSize(int size)
- Overrides:
batchSizein classScannerImpl.Builder
-
named
public JdbcScanner.Builder named(java.lang.String stepName)
- Overrides:
namedin classScannerImpl.Builder
-
routingBy
public JdbcScanner.Builder routingBy(RouterBase.Builder<? extends Router> router)
- Overrides:
routingByin classScannerImpl.Builder
-
scanFreqMS
public JdbcScanner.Builder scanFreqMS(long interval)
Description copied from class:ScannerImpl.BuilderThe scanning frequency. 25ms is the minimum. Smaller intervals will be treated as 25ms- Overrides:
scanFreqMSin classScannerImpl.Builder- Parameters:
interval- a number of milliseconds >= 25- Returns:
- This builder object for further configuration.
-
build
public ScannerImpl build()
Description copied from class:StepImpl.BuilderShould only be called by a PlanImpl- Specified by:
buildin interfaceBuildable<StepImpl>- Overrides:
buildin classStepImpl.Builder- Returns:
- the immutable step instance.
-
getObj
protected JdbcScanner getObj()
- Specified by:
getObjin classScannerImpl.Builder
-
-