use of org.apache.druid.metadata.MetadataStorageTablesConfig in project druid by druid-io.
the class CoordinatorBasicAuthenticatorMetadataStorageUpdaterTest method setUp.
@Before
public void setUp() {
objectMapper = new ObjectMapper(new SmileFactory());
TestDerbyConnector connector = derbyConnectorRule.getConnector();
MetadataStorageTablesConfig tablesConfig = derbyConnectorRule.metadataTablesConfigSupplier().get();
connector.createConfigTable();
updater = new CoordinatorBasicAuthenticatorMetadataStorageUpdater(new AuthenticatorMapper(ImmutableMap.of("test", new BasicHTTPAuthenticator(null, "test", "test", null, null, null, null, null, false, null))), connector, tablesConfig, new BasicAuthCommonCacheConfig(null, null, null, null), objectMapper, new NoopBasicAuthenticatorCacheNotifier(), null);
updater.start();
}
use of org.apache.druid.metadata.MetadataStorageTablesConfig in project druid by druid-io.
the class CoordinatorBasicAuthorizerMetadataStorageUpdaterTest method setUp.
@Before
public void setUp() {
objectMapper = new ObjectMapper(new SmileFactory());
TestDerbyConnector connector = derbyConnectorRule.getConnector();
MetadataStorageTablesConfig tablesConfig = derbyConnectorRule.metadataTablesConfigSupplier().get();
connector.createConfigTable();
updater = new CoordinatorBasicAuthorizerMetadataStorageUpdater(new AuthorizerMapper(ImmutableMap.of(AUTHORIZER_NAME, new BasicRoleBasedAuthorizer(null, AUTHORIZER_NAME, null, null, null, null, null, null))), connector, tablesConfig, new BasicAuthCommonCacheConfig(null, null, null, null), objectMapper, new NoopBasicAuthorizerCacheNotifier(), null);
updater.start();
}
use of org.apache.druid.metadata.MetadataStorageTablesConfig in project druid by druid-io.
the class CoordinatorBasicAuthenticatorResourceTest method setUp.
@Before
public void setUp() {
req = EasyMock.createStrictMock(HttpServletRequest.class);
objectMapper = new ObjectMapper(new SmileFactory());
TestDerbyConnector connector = derbyConnectorRule.getConnector();
MetadataStorageTablesConfig tablesConfig = derbyConnectorRule.metadataTablesConfigSupplier().get();
connector.createConfigTable();
ObjectMapper objectMapper = new ObjectMapper(new SmileFactory());
AuthenticatorMapper authenticatorMapper = new AuthenticatorMapper(ImmutableMap.of(AUTHENTICATOR_NAME, new BasicHTTPAuthenticator(null, AUTHENTICATOR_NAME, null, new DefaultPasswordProvider("druid"), new DefaultPasswordProvider("druid"), null, null, null, false, null), AUTHENTICATOR_NAME2, new BasicHTTPAuthenticator(null, AUTHENTICATOR_NAME2, null, new DefaultPasswordProvider("druid"), new DefaultPasswordProvider("druid"), null, null, null, false, null), AUTHENTICATOR_NAME_LDAP, new BasicHTTPAuthenticator(null, AUTHENTICATOR_NAME2, null, new DefaultPasswordProvider("druid"), new DefaultPasswordProvider("druid"), null, null, null, false, null)));
storageUpdater = new CoordinatorBasicAuthenticatorMetadataStorageUpdater(authenticatorMapper, connector, tablesConfig, new BasicAuthCommonCacheConfig(null, null, null, null), objectMapper, new NoopBasicAuthenticatorCacheNotifier(), null);
resource = new BasicAuthenticatorResource(new CoordinatorBasicAuthenticatorResourceHandler(storageUpdater, authenticatorMapper, objectMapper), authValidator);
storageUpdater.start();
}
use of org.apache.druid.metadata.MetadataStorageTablesConfig in project druid by druid-io.
the class MetadataStorageTablesConfigTest method testSerdeMetadataStorageTablesConfig.
@Test
public void testSerdeMetadataStorageTablesConfig() {
Injector injector = Guice.createInjector(new Module() {
@Override
public void configure(Binder binder) {
binder.install(new PropertiesModule(Collections.singletonList("test.runtime.properties")));
binder.install(new ConfigModule());
binder.install(new DruidGuiceExtensions());
JsonConfigProvider.bind(binder, "druid.metadata.storage.tables", MetadataStorageTablesConfig.class);
}
@Provides
@LazySingleton
public ObjectMapper jsonMapper() {
return new DefaultObjectMapper();
}
});
Properties props = injector.getInstance(Properties.class);
MetadataStorageTablesConfig config = injector.getInstance(MetadataStorageTablesConfig.class);
Assert.assertEquals(props.getProperty("druid.metadata.storage.tables.base"), config.getBase());
Assert.assertEquals(props.getProperty("druid.metadata.storage.tables.segments"), config.getSegmentsTable());
Assert.assertEquals(props.getProperty("druid.metadata.storage.tables.rules"), config.getRulesTable());
Assert.assertEquals(props.getProperty("druid.metadata.storage.tables.config"), config.getConfigTable());
Assert.assertEquals(props.getProperty("druid.metadata.storage.tables.tasks"), config.getEntryTable(MetadataStorageTablesConfig.TASK_ENTRY_TYPE));
Assert.assertEquals(props.getProperty("druid.metadata.storage.tables.taskLog"), config.getLogTable(MetadataStorageTablesConfig.TASK_ENTRY_TYPE));
Assert.assertEquals(props.getProperty("druid.metadata.storage.tables.taskLock"), config.getLockTable(MetadataStorageTablesConfig.TASK_ENTRY_TYPE));
Assert.assertEquals(props.getProperty("druid.metadata.storage.tables.dataSource"), config.getDataSourceTable());
Assert.assertEquals(props.getProperty("druid.metadata.storage.tables.supervisors"), config.getSupervisorTable());
}
use of org.apache.druid.metadata.MetadataStorageTablesConfig 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);
}
}
Aggregations