public class SQLServerPagedDatabaseCollectionReader extends DatabaseCollectionReader
Modifier and Type | Field and Description |
---|---|
protected int |
currentBatch
Current batch number we are executing.
|
protected int |
firstOffset
the first row to start with.
|
protected int |
maxOffset
The maximum record offset to get.
|
protected int |
pageSize
Size of each batch to pull.
|
protected SQLServerPagedQuery |
sqlServerPagedQuery
The SQLServerPageQuery that creates the query for the specific page of records needed at any given time.
|
idColumn, noteColumn, query
dataManager, driver, mRecordList, mRowIndex, password, url, username
filters, textFilters
Constructor and Description |
---|
SQLServerPagedDatabaseCollectionReader()
Default constructor used during UIMA initialization.
|
SQLServerPagedDatabaseCollectionReader(DatabaseConnectionInformation databaseConnectionInformation,
DataQueryInformation dataQueryInformation,
int pageSize)
Initialize the reader using the database connection and query information provided, including the size of each
batch and optionally the number of random batches to execute.
|
SQLServerPagedDatabaseCollectionReader(DatabaseConnectionInformation databaseConnectionInformation,
DataQueryInformation dataQueryInformation,
int pageSize,
int firstOffset)
Initialize the reader using the database connection and query information provided, including the size of each
batch and optionally the number of random batches to execute.
|
SQLServerPagedDatabaseCollectionReader(String driver,
String url,
String username,
String password,
String query,
String idColumn,
String noteColumn,
int pageSize)
Initialize the reader using the provided connection and query information, including the size of each batch and
optionally the number of random batches to execute.
|
SQLServerPagedDatabaseCollectionReader(String driver,
String url,
String username,
String password,
String query,
String idColumn,
String noteColumn,
int pageSize,
int firstOffset)
Initialize the reader using the provided connection and query information, including the size of each batch and
optionally the number of random batches to execute.
|
SQLServerPagedDatabaseCollectionReader(String driver,
String url,
String username,
String password,
String query,
String idColumn,
String noteColumn,
int pageSize,
int firstOffset,
int maxOffset)
Initialize the reader using the provided connection and query information, including the size of each batch and
optionally the number of random batches to execute.
|
Modifier and Type | Method and Description |
---|---|
int |
getFirstOffset()
Get the first row offset.
|
int |
getMaxOffset()
Get the max offset.
|
int |
getPageSize()
Get the page size.
|
boolean |
hasNext() |
void |
initialize()
This method is called during initialization.
|
SQLServerPagedDatabaseCollectionReader |
setFirstOffset(int firstOffset)
Set the first row offset.
|
SQLServerPagedDatabaseCollectionReader |
setMaxOffset(int maxOffset)
Set the max offset.
|
SQLServerPagedDatabaseCollectionReader |
setPageSize(int pageSize)
Set the page size.
|
getData, getIdColumn, getNext, getNoteColumn, getProgress, getQuery, setIdColumn, setNoteColumn, setQuery, validateParams
getDataManager, getDriver, getPassword, getURL, getUsername, setDriver, setPassword, setURL, setUsername
addFilters, addFilters, close, generateCollectionReaderDescription, getFilters, produceCollectionReader
destroy, getCasInitializer, getProcessingResourceMetaData, initialize, isConsuming, reconfigure, setCasInitializer, typeSystemInit
getConfigParameterValue, getConfigParameterValue, setConfigParameterValue, setConfigParameterValue
getCasManager, getLogger, getMetaData, getResourceManager, getUimaContext, getUimaContextAdmin, setLogger, setMetaData
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
@LeoConfigurationParameter(mandatory=true) protected int pageSize
@LeoConfigurationParameter(mandatory=true) protected int firstOffset
@LeoConfigurationParameter(mandatory=true) protected int maxOffset
protected int currentBatch
protected SQLServerPagedQuery sqlServerPagedQuery
public SQLServerPagedDatabaseCollectionReader()
public SQLServerPagedDatabaseCollectionReader(DatabaseConnectionInformation databaseConnectionInformation, DataQueryInformation dataQueryInformation, int pageSize)
databaseConnectionInformation
- database connection information to use.dataQueryInformation
- database query for retrieving results, assumes one record per row.pageSize
- size of each batch to retrieve at a time. Optimal size will vary with the database environment.public SQLServerPagedDatabaseCollectionReader(DatabaseConnectionInformation databaseConnectionInformation, DataQueryInformation dataQueryInformation, int pageSize, int firstOffset)
databaseConnectionInformation
- database connection information to use.dataQueryInformation
- database query for retrieving results, assumes one record per row.pageSize
- size of each batch to retrieve at a time. Optimal size will vary with the database environment.firstOffset
- the first row to start with. Generally this will be 0.public SQLServerPagedDatabaseCollectionReader(String driver, String url, String username, String password, String query, String idColumn, String noteColumn, int pageSize)
driver
- JDBC driver classurl
- JDBC connection URLusername
- database user name.password
- database user password.query
- SQL query used to retrieve the data, one record per row of results.idColumn
- name of the ID column in the SQL query. Assumes only one column to use as the record ID.
Additional ID fields are propagated through the row results String array of the CSI annotation.noteColumn
- name of the note column in the SQL query. Assumes only one note column.pageSize
- size of each batch to retrieve at a time. Optimal size will vary with the database environment.public SQLServerPagedDatabaseCollectionReader(String driver, String url, String username, String password, String query, String idColumn, String noteColumn, int pageSize, int firstOffset)
driver
- JDBC driver classurl
- JDBC connection URLusername
- database user name.password
- database user password.query
- SQL query used to retrieve the data, one record per row of results.idColumn
- name of the ID column in the SQL query. Assumes only one column to use as the record ID.
Additional ID fields are propagated through the row results String array of the CSI annotation.noteColumn
- name of the note column in the SQL query. Assumes only one note column.pageSize
- size of each batch to retrieve at a time. Optimal size will vary with the database environment.firstOffset
- the first row to start with. Generally this will be 0.public SQLServerPagedDatabaseCollectionReader(String driver, String url, String username, String password, String query, String idColumn, String noteColumn, int pageSize, int firstOffset, int maxOffset)
driver
- JDBC driver classurl
- JDBC connection URLusername
- database user name.password
- database user password.query
- SQL query used to retrieve the data, one record per row of results.idColumn
- name of the ID column in the SQL query. Assumes only one column to use as the record ID.
Additional ID fields are propagated through the row results String array of the CSI annotation.noteColumn
- name of the note column in the SQL query. Assumes only one note column.pageSize
- size of each batch to retrieve at a time. Optimal size will vary with the database environment.firstOffset
- the first row to start with. Generally this will be 0.public int getPageSize()
public SQLServerPagedDatabaseCollectionReader setPageSize(int pageSize)
pageSize
- page sizepublic int getFirstOffset()
public SQLServerPagedDatabaseCollectionReader setFirstOffset(int firstOffset)
firstOffset
- first row offsetpublic int getMaxOffset()
public SQLServerPagedDatabaseCollectionReader setMaxOffset(int maxOffset)
maxOffset
- max offsetpublic void initialize() throws org.apache.uima.resource.ResourceInitializationException
initialize
in class BaseLeoCollectionReader
org.apache.uima.resource.ResourceInitializationException
- if a failure occurs during initialization.public boolean hasNext() throws org.apache.uima.collection.CollectionException
hasNext
in interface org.apache.uima.collection.base_cpm.BaseCollectionReader
hasNext
in class DatabaseCollectionReader
org.apache.uima.collection.CollectionException
Copyright © 2018 Department of Veterans Affairs. All Rights Reserved.