use of org.apache.druid.metadata.MetadataStorageConnectorConfig in project druid by druid-io.
the class TaskActionTestKit method before.
@Override
public void before() {
taskStorage = new HeapMemoryTaskStorage(new TaskStorageConfig(new Period("PT24H")));
testDerbyConnector = new TestDerbyConnector(Suppliers.ofInstance(new MetadataStorageConnectorConfig()), Suppliers.ofInstance(metadataStorageTablesConfig));
final ObjectMapper objectMapper = new TestUtils().getTestObjectMapper();
metadataStorageCoordinator = new IndexerSQLMetadataStorageCoordinator(objectMapper, metadataStorageTablesConfig, testDerbyConnector) {
@Override
public int getSqlMetadataMaxRetry() {
return 2;
}
};
taskLockbox = new TaskLockbox(taskStorage, metadataStorageCoordinator);
segmentsMetadataManager = new SqlSegmentsMetadataManager(objectMapper, Suppliers.ofInstance(new SegmentsMetadataManagerConfig()), Suppliers.ofInstance(metadataStorageTablesConfig), testDerbyConnector);
taskActionToolbox = new TaskActionToolbox(taskLockbox, taskStorage, metadataStorageCoordinator, new NoopServiceEmitter(), EasyMock.createMock(SupervisorManager.class));
testDerbyConnector.createDataSourceTable();
testDerbyConnector.createPendingSegmentsTable();
testDerbyConnector.createSegmentTable();
testDerbyConnector.createRulesTable();
testDerbyConnector.createConfigTable();
testDerbyConnector.createTaskTables();
testDerbyConnector.createAuditTable();
}
use of org.apache.druid.metadata.MetadataStorageConnectorConfig in project druid by druid-io.
the class MySQLFirehoseDatabaseConnectorTest method testSuccessOnlyValidPropertyMariaDb.
@Test
public void testSuccessOnlyValidPropertyMariaDb() {
MetadataStorageConnectorConfig connectorConfig = new MetadataStorageConnectorConfig() {
@Override
public String getConnectURI() {
return "jdbc:mariadb://localhost:3306/test?user=maytas&password=secret&keyonly";
}
};
JdbcAccessSecurityConfig securityConfig = newSecurityConfigEnforcingAllowList(ImmutableSet.of("user", "password", "keyonly", "etc"));
new MySQLFirehoseDatabaseConnector(connectorConfig, null, securityConfig, mySQLConnectorDriverConfig);
}
use of org.apache.druid.metadata.MetadataStorageConnectorConfig in project druid by druid-io.
the class MySQLFirehoseDatabaseConnectorTest method testSuccessWhenAllowlistAndNoProperty.
@Test
public void testSuccessWhenAllowlistAndNoProperty() {
MetadataStorageConnectorConfig connectorConfig = new MetadataStorageConnectorConfig() {
@Override
public String getConnectURI() {
return "jdbc:mysql://localhost:3306/test";
}
};
JdbcAccessSecurityConfig securityConfig = newSecurityConfigEnforcingAllowList(ImmutableSet.of("user"));
new MySQLFirehoseDatabaseConnector(connectorConfig, null, securityConfig, mySQLConnectorDriverConfig);
}
use of org.apache.druid.metadata.MetadataStorageConnectorConfig in project druid by druid-io.
the class MySQLFirehoseDatabaseConnectorTest method testFailValidAndInvalidProperty.
@Test
public void testFailValidAndInvalidProperty() {
MetadataStorageConnectorConfig connectorConfig = new MetadataStorageConnectorConfig() {
@Override
public String getConnectURI() {
return "jdbc:mysql://localhost:3306/test?user=maytas&password=secret&keyonly";
}
};
JdbcAccessSecurityConfig securityConfig = newSecurityConfigEnforcingAllowList(ImmutableSet.of("user", "nonenone"));
expectedException.expectMessage("The property [password] is not in the allowed list");
expectedException.expect(IllegalArgumentException.class);
new MySQLFirehoseDatabaseConnector(connectorConfig, null, securityConfig, mySQLConnectorDriverConfig);
}
use of org.apache.druid.metadata.MetadataStorageConnectorConfig in project druid by druid-io.
the class MySQLFirehoseDatabaseConnectorTest method testFailOnlyInvalidProperty.
@Test
public void testFailOnlyInvalidProperty() {
MetadataStorageConnectorConfig connectorConfig = new MetadataStorageConnectorConfig() {
@Override
public String getConnectURI() {
return "jdbc:mysql://localhost:3306/test?user=maytas&password=secret&keyonly";
}
};
JdbcAccessSecurityConfig securityConfig = newSecurityConfigEnforcingAllowList(ImmutableSet.of("none", "nonenone"));
expectedException.expectMessage("The property [password] is not in the allowed list");
expectedException.expect(IllegalArgumentException.class);
new MySQLFirehoseDatabaseConnector(connectorConfig, null, securityConfig, mySQLConnectorDriverConfig);
}
Aggregations