Search in sources :

Example 1 with Configuration

use of io.deephaven.configuration.Configuration in project deephaven-core by deephaven.

the class HeapDump method generateHeapDumpPath.

public static String generateHeapDumpPath() {
    final Configuration configuration = Configuration.getInstance();
    final String processName = configuration.getProcessName();
    return configuration.getLogPath(processName + "_" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date(System.currentTimeMillis())) + ".hprof");
}
Also used : Configuration(io.deephaven.configuration.Configuration) SimpleDateFormat(java.text.SimpleDateFormat) Date(java.util.Date)

Example 2 with Configuration

use of io.deephaven.configuration.Configuration in project deephaven-core by deephaven.

the class NettyMain method main.

public static void main(String[] args) throws IOException, InterruptedException, ClassNotFoundException, TimeoutException {
    final Configuration config = init(args, Main.class);
    // defaults to 5 minutes
    int httpSessionExpireMs = config.getIntegerWithDefault("http.session.durationMs", 300000);
    int httpPort = config.getIntegerWithDefault("http.port", 8080);
    int schedulerPoolSize = config.getIntegerWithDefault("scheduler.poolSize", 4);
    int maxInboundMessageSize = config.getIntegerWithDefault("grpc.maxInboundMessageSize", 100 * 1024 * 1024);
    DaggerNettyServerComponent.builder().withPort(httpPort).withSchedulerPoolSize(schedulerPoolSize).withSessionTokenExpireTmMs(httpSessionExpireMs).withMaxInboundMessageSize(maxInboundMessageSize).withOut(PrintStreamGlobals.getOut()).withErr(PrintStreamGlobals.getErr()).build().getServer().run().join();
}
Also used : Configuration(io.deephaven.configuration.Configuration)

Example 3 with Configuration

use of io.deephaven.configuration.Configuration in project deephaven-core by deephaven.

the class PropertySaverTest method propertySaverRemoveSomeProp.

@Test
public void propertySaverRemoveSomeProp() throws Exception {
    Configuration configuration = Configuration.getInstance();
    final int initialSize = configuration.getProperties().size();
    log.info().append("configuration initialSize: " + initialSize).endl();
    Assert.assertTrue(initialSize > 0);
    final PropertySaver propertySaver = new PropertySaver();
    try {
        final String someProperty = configuration.getProperties().stringPropertyNames().iterator().next();
        log.info().append("Remove someProperty: " + someProperty).endl();
        propertySaver.remove(someProperty);
        log.info().append("configuration currentSize: " + configuration.getProperties().size()).endl();
        Assert.assertEquals(configuration.getProperties().size(), initialSize - 1);
    } finally {
        propertySaver.restore();
        log.info().append("configuration restored size: " + configuration.getProperties().size()).endl();
        Assert.assertEquals(initialSize, configuration.getProperties().size());
    }
}
Also used : Configuration(io.deephaven.configuration.Configuration) Test(org.junit.Test)

Example 4 with Configuration

use of io.deephaven.configuration.Configuration in project deephaven-core by deephaven.

the class PropertySaverTest method propertySaverRemoveAllProps.

@Test
public void propertySaverRemoveAllProps() throws Exception {
    Configuration configuration = Configuration.getInstance();
    final int initialSize = configuration.getProperties().size();
    log.info().append("configuration initialSize: " + initialSize).endl();
    Assert.assertTrue(initialSize > 0);
    final PropertySaver propertySaver = new PropertySaver();
    try {
        Set<String> props = configuration.getProperties().stringPropertyNames();
        props.forEach((k) -> propertySaver.remove(k));
        log.info().append("configuration currentSize: " + configuration.getProperties().size()).endl();
        Assert.assertEquals(configuration.getProperties().size(), 0);
    } finally {
        propertySaver.restore();
        log.info().append("configuration restored size: " + configuration.getProperties().size()).endl();
        Assert.assertEquals(initialSize, configuration.getProperties().size());
    }
}
Also used : Configuration(io.deephaven.configuration.Configuration) Test(org.junit.Test)

Example 5 with Configuration

use of io.deephaven.configuration.Configuration in project deephaven-core by deephaven.

the class PropertySaverTest method propertySaverRemoveNonExistentProp.

@Test
public void propertySaverRemoveNonExistentProp() throws Exception {
    Configuration configuration = Configuration.getInstance();
    final int initialSize = configuration.getProperties().size();
    log.info().append("configuration initialSize: " + initialSize).endl();
    Assert.assertTrue(initialSize > 0);
    final PropertySaver propertySaver = new PropertySaver();
    try {
        final String randomProperty = UUID.randomUUID().toString();
        try {
            // trying to get a non-existent property throws a PropertyException
            configuration.getProperty(randomProperty);
        } catch (Throwable th) {
            assertThat(th, instanceOf(PropertyException.class));
            log.info().append("====> Got expected exception: " + th).endl();
        }
        log.info().append("Remove random (non-existing) Property: " + randomProperty).endl();
        propertySaver.remove(randomProperty);
        log.info().append("configuration currentSize: " + configuration.getProperties().size()).endl();
        Assert.assertEquals(configuration.getProperties().size(), initialSize);
    } finally {
        propertySaver.restore();
        log.info().append("configuration restored size: " + configuration.getProperties().size()).endl();
        Assert.assertEquals(initialSize, configuration.getProperties().size());
    }
}
Also used : Configuration(io.deephaven.configuration.Configuration) Test(org.junit.Test)

Aggregations

Configuration (io.deephaven.configuration.Configuration)9 Test (org.junit.Test)3 NotNull (org.jetbrains.annotations.NotNull)2 com.squareup.javapoet (com.squareup.javapoet)1 UncheckedDeephavenException (io.deephaven.UncheckedDeephavenException)1 Assert (io.deephaven.base.verify.Assert)1 io.deephaven.chunk (io.deephaven.chunk)1 Values (io.deephaven.chunk.attributes.Values)1 CharChunkHasher (io.deephaven.chunk.util.hashing.CharChunkHasher)1 CompilerTools (io.deephaven.compilertools.CompilerTools)1 io.deephaven.engine.rowset (io.deephaven.engine.rowset)1 OrderedRowKeys (io.deephaven.engine.rowset.chunkattributes.OrderedRowKeys)1 RowKeys (io.deephaven.engine.rowset.chunkattributes.RowKeys)1 ColumnSource (io.deephaven.engine.table.ColumnSource)1 NaturalJoinModifiedSlotTracker (io.deephaven.engine.table.impl.NaturalJoinModifiedSlotTracker)1 RightIncrementalAsOfJoinStateManagerTypedBase (io.deephaven.engine.table.impl.asofjoin.RightIncrementalAsOfJoinStateManagerTypedBase)1 StaticAsOfJoinStateManagerTypedBase (io.deephaven.engine.table.impl.asofjoin.StaticAsOfJoinStateManagerTypedBase)1 TypedAsOfJoinFactory (io.deephaven.engine.table.impl.asofjoin.TypedAsOfJoinFactory)1 io.deephaven.engine.table.impl.by (io.deephaven.engine.table.impl.by)1 IncrementalNaturalJoinStateManagerTypedBase (io.deephaven.engine.table.impl.naturaljoin.IncrementalNaturalJoinStateManagerTypedBase)1