use of io.questdb.PropServerConfiguration in project questdb by bluestreak01.
the class LineTcpO3Test method setUp.
@Override
@Before
public void setUp() {
LOG.info().$("setup engine").$();
try {
root = temp.newFolder("dbRoot").getAbsolutePath();
} catch (IOException e) {
throw new ExceptionInInitializerError();
}
PropServerConfiguration serverConf;
Properties properties = new Properties();
try (InputStream is = LineTcpO3Test.class.getResourceAsStream(LineTcpO3Test.class.getSimpleName() + ".server.conf")) {
File mimeTypesFile = new File(new File(root.toString(), PropServerConfiguration.CONFIG_DIRECTORY), "mime.types");
if (!mimeTypesFile.exists()) {
mimeTypesFile.getParentFile().mkdirs();
FileOutputStream fos = new FileOutputStream(mimeTypesFile);
fos.write('\n');
fos.close();
}
properties.load(is);
serverConf = new PropServerConfiguration(root.toString(), properties, null, LOG, null);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
configuration = serverConf.getCairoConfiguration();
lineConfiguration = serverConf.getLineTcpReceiverConfiguration();
sharedWorkerPoolConfiguration = serverConf.getWorkerPoolConfiguration();
engine = new CairoEngine(configuration);
messageBus = engine.getMessageBus();
LOG.info().$("setup engine completed").$();
}
Aggregations