Class DerbyConnector
- java.lang.Object
-
- org.apache.druid.metadata.SQLMetadataConnector
-
- org.apache.druid.metadata.storage.derby.DerbyConnector
-
- All Implemented Interfaces:
org.apache.druid.metadata.MetadataStorageConnector
public class DerbyConnector extends SQLMetadataConnector
-
-
Constructor Summary
Constructors Constructor Description DerbyConnector(MetadataStorage storage, com.google.common.base.Supplier<org.apache.druid.metadata.MetadataStorageConnectorConfig> config, com.google.common.base.Supplier<org.apache.druid.metadata.MetadataStorageTablesConfig> dbTables)DerbyConnector(MetadataStorage storage, com.google.common.base.Supplier<org.apache.druid.metadata.MetadataStorageConnectorConfig> config, com.google.common.base.Supplier<org.apache.druid.metadata.MetadataStorageTablesConfig> dbTables, org.skife.jdbi.v2.DBI dbi)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexportTable(String tableName, String outputPath)org.skife.jdbi.v2.DBIgetDBI()ResultSetgetIndexInfo(DatabaseMetaData databaseMetaData, String tableName)Get the ResultSet for indexInfo for given tableStringgetQuoteString()StringgetSerialType()Auto-incrementing integer SQL type to use for IDs.intgetStreamingFetchSize()Returns the value that should be passed to statement.setFetchSize to ensure results are streamed back from the database instead of fetching the entire result set in memory.StringgetValidationQuery()StringlimitClause(int limit)voidstart()voidstop()booleantableExists(org.skife.jdbi.v2.Handle handle, String tableName)booleantableHasColumn(String tableName, String columnName)Interrogate table metadata and return true or false depending on the existance of the indicated column public visibility because DerbyConnector needs to override thanks to uppercase table and column names.-
Methods inherited from class org.apache.druid.metadata.SQLMetadataConnector
alterSegmentTableAddUsedFlagLastUpdated, compareAndSwap, connectorIsTransientException, createAuditTable, createConfigTable, createConfigTable, createDataSourceTable, createDataSourceTable, createEntryTable, createIndex, createLockTable, createLogTable, createPendingSegmentsTable, createPendingSegmentsTable, createRulesTable, createRulesTable, createSegmentTable, createSegmentTable, createSupervisorsTable, createSupervisorsTable, createTable, createTaskTables, createUpgradeSegmentsTable, deleteAllRecords, getCollation, getConfig, getDatasource, getIndexOnTable, getPayloadType, inReadOnlyTransaction, insertOrUpdate, isRootCausePacketTooBigException, isTransientException, lookup, lookupWithHandle, makeDatasource, prepareTaskEntryTable, retryTransaction, retryWithHandle, retryWithHandle
-
-
-
-
Constructor Detail
-
DerbyConnector
@Inject public DerbyConnector(MetadataStorage storage, com.google.common.base.Supplier<org.apache.druid.metadata.MetadataStorageConnectorConfig> config, com.google.common.base.Supplier<org.apache.druid.metadata.MetadataStorageTablesConfig> dbTables)
-
DerbyConnector
public DerbyConnector(MetadataStorage storage, com.google.common.base.Supplier<org.apache.druid.metadata.MetadataStorageConnectorConfig> config, com.google.common.base.Supplier<org.apache.druid.metadata.MetadataStorageTablesConfig> dbTables, org.skife.jdbi.v2.DBI dbi)
-
-
Method Detail
-
tableExists
public boolean tableExists(org.skife.jdbi.v2.Handle handle, String tableName)- Specified by:
tableExistsin classSQLMetadataConnector
-
getSerialType
public String getSerialType()
Description copied from class:SQLMetadataConnectorAuto-incrementing integer SQL type to use for IDs. The returned string is interpolated into the table creation statement as follows:CREATE TABLE druid_table ( id <serial-type> NOT NULL, col_2 VARCHAR(255) NOT NULL, col_3 VARCHAR(255) NOT NULL ... )
- Specified by:
getSerialTypein classSQLMetadataConnector- Returns:
- String representing auto-incrementing SQL integer type to use for IDs.
-
getQuoteString
public String getQuoteString()
- Specified by:
getQuoteStringin classSQLMetadataConnector- Returns:
- the string that should be used to quote string fields
-
getDBI
public org.skife.jdbi.v2.DBI getDBI()
- Specified by:
getDBIin classSQLMetadataConnector
-
getStreamingFetchSize
public int getStreamingFetchSize()
Description copied from class:SQLMetadataConnectorReturns the value that should be passed to statement.setFetchSize to ensure results are streamed back from the database instead of fetching the entire result set in memory.- Specified by:
getStreamingFetchSizein classSQLMetadataConnector- Returns:
- optimal fetch size to stream results back
-
getValidationQuery
public String getValidationQuery()
- Overrides:
getValidationQueryin classSQLMetadataConnector
-
limitClause
public String limitClause(int limit)
- Specified by:
limitClausein classSQLMetadataConnector
-
getIndexInfo
public ResultSet getIndexInfo(DatabaseMetaData databaseMetaData, String tableName) throws SQLException
Get the ResultSet for indexInfo for given table- Overrides:
getIndexInfoin classSQLMetadataConnector- Parameters:
databaseMetaData- DatabaseMetaDatatableName- Name of table- Returns:
- ResultSet with index info
- Throws:
SQLException
-
tableHasColumn
public boolean tableHasColumn(String tableName, String columnName)
Interrogate table metadata and return true or false depending on the existance of the indicated column public visibility because DerbyConnector needs to override thanks to uppercase table and column names.- Overrides:
tableHasColumnin classSQLMetadataConnector- Parameters:
tableName- The table being interrogatedcolumnName- The column being looked for- Returns:
- boolean indicating the existence of the column in question
-
start
public void start()
-
stop
public void stop()
-
-