Package org.apache.druid.metadata
Interface MetadataStorageConnector
-
public interface MetadataStorageConnector
-
-
Field Summary
Fields Modifier and Type Field Description static String
CONFIG_TABLE_KEY_COLUMN
static String
CONFIG_TABLE_VALUE_COLUMN
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default boolean
compareAndSwap(List<MetadataCASUpdate> updates)
Atomic compare-and-swap variant of insertOrUpdate().void
createAuditTable()
void
createConfigTable()
void
createDataSourceTable()
void
createPendingSegmentsTable()
void
createRulesTable()
void
createSegmentSchemasTable()
SegmentSchema table is created only when CentralizedDatasourceSchema feature is enabled.void
createSegmentTable()
void
createSupervisorsTable()
void
createTaskTables()
void
createUpgradeSegmentsTable()
void
deleteAllRecords(String tableName)
default void
exportTable(String tableName, String outputPath)
Void
insertOrUpdate(String tableName, String keyColumn, String valueColumn, String key, byte[] value)
byte[]
lookup(String tableName, String keyColumn, String valueColumn, String key)
Returns the value of the valueColumn when there is only one row matched to the given key.
-
-
-
Field Detail
-
CONFIG_TABLE_KEY_COLUMN
static final String CONFIG_TABLE_KEY_COLUMN
- See Also:
- Constant Field Values
-
CONFIG_TABLE_VALUE_COLUMN
static final String CONFIG_TABLE_VALUE_COLUMN
- See Also:
- Constant Field Values
-
-
Method Detail
-
insertOrUpdate
Void insertOrUpdate(String tableName, String keyColumn, String valueColumn, String key, byte[] value)
-
lookup
@Nullable byte[] lookup(String tableName, String keyColumn, String valueColumn, String key)
Returns the value of the valueColumn when there is only one row matched to the given key. This method returns null if there is no such row and throws an error if there are more than one rows.
-
compareAndSwap
default boolean compareAndSwap(List<MetadataCASUpdate> updates)
Atomic compare-and-swap variant of insertOrUpdate().- Parameters:
updates
- Set of updates to be made. If compare checks succeed for all updates, perform all updates. If any compare check fails, reject all updates.- Returns:
- true if updates were made, false otherwise
- Throws:
Exception
-
createDataSourceTable
void createDataSourceTable()
-
createPendingSegmentsTable
void createPendingSegmentsTable()
-
createSegmentTable
void createSegmentTable()
-
createUpgradeSegmentsTable
void createUpgradeSegmentsTable()
-
createRulesTable
void createRulesTable()
-
createConfigTable
void createConfigTable()
-
createTaskTables
void createTaskTables()
-
createAuditTable
void createAuditTable()
-
createSupervisorsTable
void createSupervisorsTable()
-
deleteAllRecords
void deleteAllRecords(String tableName)
-
createSegmentSchemasTable
void createSegmentSchemasTable()
SegmentSchema table is created only when CentralizedDatasourceSchema feature is enabled.
-
-