Class PostgresTabularDataSetConnector
java.lang.Object
org.odpi.openmetadata.frameworks.connectors.Connector
org.odpi.openmetadata.frameworks.connectors.ConnectorBase
org.odpi.openmetadata.adapters.connectors.postgres.tabulardatasource.PostgresTabularDataSetConnector
- All Implemented Interfaces:
SecureConnectorExtension
,WritableTabularDataSource
,VirtualConnectorExtension
- Direct Known Subclasses:
PostgresTabularDataSetCollectionConnector
public class PostgresTabularDataSetConnector
extends ConnectorBase
implements WritableTabularDataSource
PostgresTabularDataSourceConnector works with structured files to retrieve simple tables of data.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
ConnectorBase.ProtectedConnection
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final PropertyHelper
protected String
protected String
Fields inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
auditLog, connectionBean, connectorInstanceId, embeddedConnectors, messageFormatter, secretsStoreConnectorMap
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
appendRecord
(List<String> dataValues) Write the requested data record to the end of the data source.void
deleteRecord
(long rowNumber) Remove the requested data record.void
Close the filelong
Return the number of records in the file.void
setColumnDescriptions
(List<TabularColumnDescription> columnDescriptions) Set up the columns associated with this tabular data source.void
start()
Indicates that the connector is completely configured and can begin processing.void
writeRecord
(long requestedRowNumber, List<String> dataValues) Write the requested data record.Methods inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
combineConfigurationProperties, disconnectConnectors, equals, fromCanonicalToKebabCase, fromCanonicalToSnakeCase, fromKebabToCanonicalCase, fromSnakeToCanonicalCase, getArrayConfigurationProperty, getArrayConfigurationProperty, getArrayConfigurationProperty, getBooleanConfigurationProperty, getConnection, getConnectorInstanceId, getDateConfigurationProperty, getIntConfigurationProperty, getLongConfigurationProperty, getStringConfigurationProperty, getStringConfigurationProperty, getSuppliedPlaceholderProperties, hashCode, initialize, initializeEmbeddedConnectors, initializeSecretsStoreConnector, isActive, logExceptionRecord, logRecord, logRecord, throwMissingConfigurationProperty, throwMissingEndpointAddress, throwMissingResource, throwNoAsset, throwWrongTypeOfAsset, throwWrongTypeOfResource, throwWrongTypeOfRootSchema, toString
Methods inherited from class org.odpi.openmetadata.frameworks.connectors.Connector
clearStatisticProperty, clearStatisticTimestamp, getConnectorStatistics, getStatisticCounter, getStatisticProperty, getStatisticTimestamp, incrementStatisticCounter, initializeStatisticCounter, refreshStatistics, setStatisticProperty, setStatisticTimestamp
-
Field Details
-
tableName
-
tableDescription
-
propertyHelper
-
-
Constructor Details
-
PostgresTabularDataSetConnector
public PostgresTabularDataSetConnector()
-
-
Method Details
-
start
Indicates that the connector is completely configured and can begin processing.- Overrides:
start
in classConnectorBase
- Throws:
ConnectorCheckedException
- there is a problem within the connector.UserNotAuthorizedException
- the connector was disconnected before/during start
-
getRecordCount
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.- Specified by:
getRecordCount
in interfaceWritableTabularDataSource
- Returns:
- count
- Throws:
ConnectorCheckedException
- problem accessing the data
-
setColumnDescriptions
public void setColumnDescriptions(List<TabularColumnDescription> columnDescriptions) throws ConnectorCheckedException Set up the columns associated with this tabular data source. These are stored in the first record of the file. The rest of the file is cleared.- Specified by:
setColumnDescriptions
in interfaceWritableTabularDataSource
- Parameters:
columnDescriptions
- a list of column descriptions- Throws:
ConnectorCheckedException
- there is a problem accessing the data
-
writeRecord
public void writeRecord(long requestedRowNumber, List<String> dataValues) throws ConnectorCheckedException Write the requested data record. The first data record is record 0. This process reads the entire file, inserts the record in the right place and writes it out again.- Specified by:
writeRecord
in interfaceWritableTabularDataSource
- Parameters:
requestedRowNumber
- longdataValues
- Map of column descriptions to strings, each string is the value for the column.- Throws:
ConnectorCheckedException
- there is a problem accessing the data.
-
appendRecord
Write the requested data record to the end of the data source.- Specified by:
appendRecord
in interfaceWritableTabularDataSource
- Parameters:
dataValues
- Map of column descriptions to strings, each string is the value for the column.- Throws:
ConnectorCheckedException
- there is a problem accessing the data.
-
deleteRecord
Remove the requested data record. The first data record is record 0.- Specified by:
deleteRecord
in interfaceWritableTabularDataSource
- Parameters:
rowNumber
- long- Throws:
ConnectorCheckedException
- there is a problem accessing the data.
-
disconnect
public void disconnect()Close the file- Overrides:
disconnect
in classConnectorBase
-