public abstract class AbstractDataConnectorProvider extends Object implements IDataConnectorProvider
| Modifier and Type | Field and Description |
|---|---|
protected DataConnector |
connector |
protected String |
driverClassName |
protected Object |
handle |
protected String |
scoped_db |
DERBY_TYPE, HIVE_JDBC_TYPE, MSSQL_TYPE, MYSQL_TYPE, ORACLE_TYPE, POSTGRES_TYPE| Constructor and Description |
|---|
AbstractDataConnectorProvider(String dbName,
DataConnector connector,
String driverClassName) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
alterTable(String tableName,
Table table)
Alter an existing table in the remote data source.
|
protected Table |
buildTableFromColsList(String tableName,
List<FieldSchema> cols) |
void |
close()
Closes a transport/connection to the datasource.
|
boolean |
createTable(Table table)
Creates a table with the given name in the remote data source.
|
boolean |
dropTable(String tableName)
Drop an existing table with the given name in the remote data source.
|
protected abstract String |
getDatasourceType() |
protected abstract String |
getInputClass() |
protected abstract String |
getOutputClass() |
Table |
getTable(String tableName)
Fetch a single table with the given name, returns a Hive Table object from the remote database
|
protected abstract String |
getTableLocation(String tblName) |
List<String> |
getTableNames()
Returns a list of all table names from the remote database.
|
List<Table> |
getTables(String regex)
Returns Hive Table objects from the remote database for tables that match a name pattern.
|
void |
open()
Opens a transport/connection to the datasource.
|
void |
setScope(String scoped_db)
Set the scope of this object.
|
protected String scoped_db
protected Object handle
protected DataConnector connector
protected String driverClassName
public AbstractDataConnectorProvider(String dbName, DataConnector connector, String driverClassName)
public final void setScope(String scoped_db)
IDataConnectorProvidersetScope in interface IDataConnectorProviderpublic void open()
throws ConnectException,
MetaException
open in interface IDataConnectorProviderMetaException - Throws MetaException if the connector does not have all info for a connection to be setup.ConnectException - if the connection could not be established for some reason.public void close()
throws ConnectException
close in interface IDataConnectorProviderConnectException - if the connection could not be closed.public List<Table> getTables(String regex) throws MetaException
getTables in interface IDataConnectorProviderregex - MetaException - To indicate any failures with executing this APIpublic List<String> getTableNames() throws MetaException
getTableNames in interface IDataConnectorProviderMetaException - To indicate any failures with executing this APIpublic Table getTable(String tableName) throws MetaException
getTable in interface IDataConnectorProvidertableName - MetaException - To indicate any failures with executing this APIpublic boolean createTable(Table table) throws MetaException
IDataConnectorProvidercreateTable in interface IDataConnectorProvidertable - A Hive table object to translate and create in remote data source.MetaException - To indicate any failures in executing this operation.public boolean dropTable(String tableName) throws MetaException
IDataConnectorProviderdropTable in interface IDataConnectorProvidertableName - Table name to drop from the remote data source.MetaException - To indicate any failures in executing this operation.public boolean alterTable(String tableName, Table table) throws MetaException
IDataConnectorProvideralterTable in interface IDataConnectorProvidertableName - Table name to alter in the remote datasource.table - New Table object to modify the existing table with.MetaException - To indicate any failures in executing this operation.protected Table buildTableFromColsList(String tableName, List<FieldSchema> cols)
protected abstract String getInputClass()
protected abstract String getOutputClass()
protected abstract String getDatasourceType()
Copyright © 2024 The Apache Software Foundation. All rights reserved.