Package de.julielab.jcore.reader.db
Class DBSubsetReader
- java.lang.Object
-
- org.apache.uima.resource.Resource_ImplBase
-
- org.apache.uima.resource.ConfigurableResource_ImplBase
-
- org.apache.uima.collection.CollectionReader_ImplBase
-
- org.apache.uima.fit.component.JCasCollectionReader_ImplBase
-
- de.julielab.jcore.reader.db.DBReaderBase
-
- de.julielab.jcore.reader.db.DBSubsetReader
-
- All Implemented Interfaces:
org.apache.uima.collection.base_cpm.BaseCollectionReader,org.apache.uima.collection.CollectionReader,org.apache.uima.resource.ConfigurableResource,org.apache.uima.resource.Resource
- Direct Known Subclasses:
DBMultiplierReader,DBReader
public abstract class DBSubsetReader extends DBReaderBase
-
-
Field Summary
Fields Modifier and Type Field Description protected String[]additionalTableNamesprotected String[]additionalTableSchemasprotected StringdataTableThe name of the primary data table to read data from.protected BooleanfetchIdsProactivelyprotected StringhostNamestatic StringPARAM_ADDITIONAL_TABLESstatic StringPARAM_ADDITONAL_TABLES_STORAGE_PG_SCHEMAstatic StringPARAM_RESET_TABLEprotected Stringpidprotected BooleanreadDataTableThis is true if the table name provided by theDBReaderBase.PARAM_TABLEparameter is a data table.protected BooleanresetTableprotected String[]schemasThe list of table schemas of the tables to read from.protected String[]tablesThe list of tables to read data from.-
Fields inherited from class de.julielab.jcore.reader.db.DBReaderBase
batchSize, costosysConfig, dbc, driver, hasNext, joinTables, limitParameter, numberFetchedDocIDs, PARAM_BATCH_SIZE, PARAM_COSTOSYS_CONFIG_NAME, PARAM_TABLE, processedDocuments, selectionOrder, tableName, totalDocumentCount, whereCondition
-
-
Constructor Summary
Constructors Constructor Description DBSubsetReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckAdditionalTableParameters(String[] additionalTableNames, String[] additionalTableSchemas)This method checks whether the required parameters are set to meaningful values and throws an IllegalArgumentException when not.protected org.apache.commons.lang3.tuple.ImmutablePair<Integer,String[]>checkAndAdjustAdditionalTables(de.julielab.costosys.dbconnection.DataBaseConnector dbc, String dataTable, String[] additionalTableNames)Checks whether the given additional tables exist.protected List<Map<String,Object>>getAllRetrievedColumns()Convenience method for extending classes.voidinitialize(org.apache.uima.UimaContext context)-
Methods inherited from class org.apache.uima.fit.component.JCasCollectionReader_ImplBase
close, getLogger, getNext, getNext, initialize
-
Methods inherited from class org.apache.uima.collection.CollectionReader_ImplBase
destroy, getCasInitializer, getProcessingResourceMetaData, initialize, isConsuming, reconfigure, setCasInitializer, typeSystemInit
-
Methods inherited from class org.apache.uima.resource.ConfigurableResource_ImplBase
getConfigParameterValue, getConfigParameterValue, setConfigParameterValue, setConfigParameterValue
-
Methods inherited from class org.apache.uima.resource.Resource_ImplBase
getCasManager, getMetaData, getRelativePathResolver, getResourceManager, getUimaContext, getUimaContextAdmin, setLogger, setMetaData
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.uima.collection.base_cpm.BaseCollectionReader
getProgress, hasNext
-
-
-
-
Field Detail
-
PARAM_ADDITIONAL_TABLES
public static final String PARAM_ADDITIONAL_TABLES
- See Also:
- Constant Field Values
-
PARAM_RESET_TABLE
public static final String PARAM_RESET_TABLE
- See Also:
- Constant Field Values
-
PARAM_ADDITONAL_TABLES_STORAGE_PG_SCHEMA
public static final String PARAM_ADDITONAL_TABLES_STORAGE_PG_SCHEMA
- See Also:
- Constant Field Values
-
resetTable
protected Boolean resetTable
-
fetchIdsProactively
protected Boolean fetchIdsProactively
-
additionalTableNames
protected String[] additionalTableNames
-
additionalTableSchemas
protected String[] additionalTableSchemas
-
hostName
protected String hostName
-
pid
protected String pid
-
dataTable
protected String dataTable
The name of the primary data table to read data from. This is either the exact parameter value given withDBReaderBase.PARAM_TABLEor, if this parameter denotes a subset table, the data table referenced by the subset.
-
readDataTable
protected Boolean readDataTable
This is true if the table name provided by theDBReaderBase.PARAM_TABLEparameter is a data table. If this parameter is false it means that we read from a subset table.
-
tables
protected String[] tables
The list of tables to read data from. The first element is always the data table. The following entries reference the "additional tables".
-
-
Method Detail
-
initialize
public void initialize(org.apache.uima.UimaContext context) throws org.apache.uima.resource.ResourceInitializationException- Overrides:
initializein classDBReaderBase- Throws:
org.apache.uima.resource.ResourceInitializationException
-
getAllRetrievedColumns
protected List<Map<String,Object>> getAllRetrievedColumns()
Convenience method for extending classes.- Returns:
-
checkAdditionalTableParameters
protected void checkAdditionalTableParameters(String[] additionalTableNames, String[] additionalTableSchemas) throws org.apache.uima.resource.ResourceInitializationException
This method checks whether the required parameters are set to meaningful values and throws an IllegalArgumentException when not.- Throws:
org.apache.uima.resource.ResourceInitializationException
-
checkAndAdjustAdditionalTables
protected org.apache.commons.lang3.tuple.ImmutablePair<Integer,String[]> checkAndAdjustAdditionalTables(de.julielab.costosys.dbconnection.DataBaseConnector dbc, String dataTable, String[] additionalTableNames)
Checks whether the given additional tables exist. If not, it is checked if the table names contain dots which are reserved for schema qualification in Postgres. It is tried again to find the tables with underscores ('_'), then. In this case, a colon character is interpreted as the separation between a specified Postgres schema and a Java-style path to be converted to a valid table name by replacing dots with underscores. Always includes the data table.
-
-