Search in sources :

Example 1 with MetadataStorageConnector

use of io.druid.metadata.MetadataStorageConnector in project druid by druid-io.

the class ResetCluster method resetMetadataStore.

private void resetMetadataStore(Injector injector) {
    log.info("===========================================================================");
    log.info("Deleting all Records from Metadata Storage.");
    log.info("===========================================================================");
    MetadataStorageConnector connector = injector.getInstance(MetadataStorageConnector.class);
    MetadataStorageTablesConfig tablesConfig = injector.getInstance(MetadataStorageTablesConfig.class);
    String[] tables = new String[] { tablesConfig.getDataSourceTable(), tablesConfig.getPendingSegmentsTable(), tablesConfig.getSegmentsTable(), tablesConfig.getRulesTable(), tablesConfig.getConfigTable(), tablesConfig.getTasksTable(), tablesConfig.getTaskLockTable(), tablesConfig.getTaskLogTable(), tablesConfig.getAuditTable(), tablesConfig.getSupervisorTable() };
    for (String table : tables) {
        connector.deleteAllRecords(table);
    }
}
Also used : MetadataStorageTablesConfig(io.druid.metadata.MetadataStorageTablesConfig) MetadataStorageConnector(io.druid.metadata.MetadataStorageConnector)

Example 2 with MetadataStorageConnector

use of io.druid.metadata.MetadataStorageConnector in project druid by druid-io.

the class CreateTables method run.

@Override
public void run() {
    final Injector injector = makeInjector();
    MetadataStorageConnector dbConnector = injector.getInstance(MetadataStorageConnector.class);
    dbConnector.createDataSourceTable();
    dbConnector.createPendingSegmentsTable();
    dbConnector.createSegmentTable();
    dbConnector.createRulesTable();
    dbConnector.createConfigTable();
    dbConnector.createTaskTables();
    dbConnector.createAuditTable();
    dbConnector.createSupervisorsTable();
}
Also used : Injector(com.google.inject.Injector) MetadataStorageConnector(io.druid.metadata.MetadataStorageConnector)

Aggregations

MetadataStorageConnector (io.druid.metadata.MetadataStorageConnector)2 Injector (com.google.inject.Injector)1 MetadataStorageTablesConfig (io.druid.metadata.MetadataStorageTablesConfig)1