Search in sources :

Example 1 with PropServerConfiguration

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").$();
}
Also used : PropServerConfiguration(io.questdb.PropServerConfiguration) GZIPInputStream(java.util.zip.GZIPInputStream) InputStream(java.io.InputStream) FileOutputStream(java.io.FileOutputStream) IOException(java.io.IOException) Properties(java.util.Properties) CairoEngine(io.questdb.cairo.CairoEngine) File(java.io.File) IOException(java.io.IOException)

Aggregations

PropServerConfiguration (io.questdb.PropServerConfiguration)1 CairoEngine (io.questdb.cairo.CairoEngine)1 File (java.io.File)1 FileOutputStream (java.io.FileOutputStream)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 Properties (java.util.Properties)1 GZIPInputStream (java.util.zip.GZIPInputStream)1