public abstract class SQLMetadataConnector extends Object implements MetadataStorageConnector
Constructor and Description |
---|
SQLMetadataConnector(com.google.common.base.Supplier<MetadataStorageConnectorConfig> config,
com.google.common.base.Supplier<MetadataStorageTablesConfig> tablesConfigSupplier) |
Modifier and Type | Method and Description |
---|---|
void |
createAuditTable() |
void |
createConfigTable() |
void |
createConfigTable(org.skife.jdbi.v2.IDBI dbi,
String tableName) |
void |
createEntryTable(org.skife.jdbi.v2.IDBI dbi,
String tableName) |
void |
createLockTable(org.skife.jdbi.v2.IDBI dbi,
String tableName,
String entryTypeName) |
void |
createLogTable(org.skife.jdbi.v2.IDBI dbi,
String tableName,
String entryTypeName) |
void |
createRulesTable() |
void |
createRulesTable(org.skife.jdbi.v2.IDBI dbi,
String tableName) |
void |
createSegmentTable() |
void |
createSegmentTable(org.skife.jdbi.v2.IDBI dbi,
String tableName) |
void |
createTable(org.skife.jdbi.v2.IDBI dbi,
String tableName,
Iterable<String> sql) |
void |
createTaskTables() |
MetadataStorageConnectorConfig |
getConfig() |
protected org.apache.commons.dbcp2.BasicDataSource |
getDatasource() |
abstract org.skife.jdbi.v2.DBI |
getDBI() |
protected String |
getPayloadType()
SQL type to use for payload data (e.g.
|
protected abstract String |
getSerialType()
Auto-incrementing SQL type to use for IDs
Must be an integer type, which values will be automatically set by the database
The resulting string will be interpolated into the table creation statement, e.g.
|
String |
getValidationQuery() |
Void |
insertOrUpdate(String tableName,
String keyColumn,
String valueColumn,
String key,
byte[] value) |
protected boolean |
isTransientException(Throwable e) |
byte[] |
lookup(String tableName,
String keyColumn,
String valueColumn,
String key) |
abstract boolean |
tableExists(org.skife.jdbi.v2.Handle handle,
String tableName) |
public SQLMetadataConnector(com.google.common.base.Supplier<MetadataStorageConnectorConfig> config, com.google.common.base.Supplier<MetadataStorageTablesConfig> tablesConfigSupplier)
protected String getPayloadType()
CREATE TABLE druid_table ( payload NOT NULL, ... )
protected abstract String getSerialType()
CREATE TABLE druid_table ( id NOT NULL, ... )
public String getValidationQuery()
public abstract boolean tableExists(org.skife.jdbi.v2.Handle handle, String tableName)
protected boolean isTransientException(Throwable e)
public void createTable(org.skife.jdbi.v2.IDBI dbi, String tableName, Iterable<String> sql)
public void createSegmentTable(org.skife.jdbi.v2.IDBI dbi, String tableName)
public void createRulesTable(org.skife.jdbi.v2.IDBI dbi, String tableName)
public void createConfigTable(org.skife.jdbi.v2.IDBI dbi, String tableName)
public void createEntryTable(org.skife.jdbi.v2.IDBI dbi, String tableName)
public void createLogTable(org.skife.jdbi.v2.IDBI dbi, String tableName, String entryTypeName)
public void createLockTable(org.skife.jdbi.v2.IDBI dbi, String tableName, String entryTypeName)
public Void insertOrUpdate(String tableName, String keyColumn, String valueColumn, String key, byte[] value) throws Exception
insertOrUpdate
in interface MetadataStorageConnector
Exception
public abstract org.skife.jdbi.v2.DBI getDBI()
public void createSegmentTable()
createSegmentTable
in interface MetadataStorageConnector
public void createRulesTable()
createRulesTable
in interface MetadataStorageConnector
public void createConfigTable()
createConfigTable
in interface MetadataStorageConnector
public void createTaskTables()
createTaskTables
in interface MetadataStorageConnector
public byte[] lookup(String tableName, String keyColumn, String valueColumn, String key)
lookup
in interface MetadataStorageConnector
public MetadataStorageConnectorConfig getConfig()
protected org.apache.commons.dbcp2.BasicDataSource getDatasource()
public void createAuditTable()
createAuditTable
in interface MetadataStorageConnector
Copyright © 2011–2015. All rights reserved.