Skip to content

Commit

Permalink
Cleaned up application script creation. Got barrage-examples running. (
Browse files Browse the repository at this point in the history
  • Loading branch information
devinrsmith authored Nov 30, 2021
1 parent 5c1b52c commit b59e6fe
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 315 deletions.
52 changes: 16 additions & 36 deletions java-client/barrage-examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies {
Classpaths.inheritAssertJ(project)
testImplementation 'org.junit.jupiter:junit-jupiter'

Classpaths.inheritSlf4j(project, 'slf4j-api', 'implementation')
runtimeOnly project(':log-to-slf4j')
Classpaths.inheritLogbackClassic(project)
}

Expand All @@ -23,44 +23,24 @@ test {

startScripts.enabled = false

task createSubscribeBarrageScripts(type: CreateStartScripts) {
mainClassName = 'io.deephaven.client.examples.SubscribeApplicationField'
applicationName = 'subscribe-application-field'
outputDir = new File(project.buildDir, name)
classpath = startScripts.classpath
defaultJvmOpts = [
'-server',
'-XX:+UseG1GC',
'-XX:MaxGCPauseMillis=100',
'-XX:+UseStringDeduplication' ]
}

task createSubscribeQST(type: CreateStartScripts) {
mainClassName = 'io.deephaven.client.examples.SubscribeQST'
applicationName = 'subscribe-qst'
outputDir = new File(project.buildDir, name)
classpath = startScripts.classpath
defaultJvmOpts = [
'-server',
'-XX:+UseG1GC',
'-XX:MaxGCPauseMillis=100',
'-XX:+UseStringDeduplication' ]
}

task createSubscribeQueryScope(type: CreateStartScripts) {
mainClassName = 'io.deephaven.client.examples.SubscribeQueryScope'
applicationName = 'subscribe-query-scope'
outputDir = new File(project.buildDir, name)
classpath = startScripts.classpath
defaultJvmOpts = [
'-server',
'-XX:+UseG1GC',
'-XX:MaxGCPauseMillis=100',
'-XX:+UseStringDeduplication' ]
def createApplication = { String name, String mainClass ->
project.tasks.register("create-${name}", CreateStartScripts) {script ->
script.mainClass.set mainClass
script.applicationName = name
script.outputDir = project.layout.buildDirectory.dir(name).get().asFile
script.classpath = startScripts.classpath
script.defaultJvmOpts = [
'-server',
'-XX:+UseG1GC',
'-XX:MaxGCPauseMillis=100',
'-XX:+UseStringDeduplication',
'-DConfiguration.rootFile=dh-defaults.prop']
}
}

applicationDistribution.into('bin') {
from(createSubscribeBarrageScripts)
from(createApplication('subscribe-application-field', 'io.deephaven.client.examples.SubscribeApplicationField'))
from(createApplication('subscribe-qs', 'io.deephaven.client.examples.SubscribeQueryScope'))
fileMode = 0755
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import picocli.CommandLine.Command;
import picocli.CommandLine.Parameters;

@Command(name = "subscribe-app-field", mixinStandardHelpOptions = true,
@Command(name = "subscribe-application-field", mixinStandardHelpOptions = true,
description = "Request a table from an Application and subscribe over barrage", version = "0.1.0")
class SubscribeApplicationField extends SubscribeExampleBase {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
/*
* Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending
*/

package io.deephaven.client.examples;

import io.deephaven.client.impl.BarrageSession;
import io.deephaven.client.impl.BarrageSubscription;
import io.deephaven.client.impl.TableHandle;
import io.deephaven.client.impl.TableHandleManager;
import io.deephaven.engine.table.TableUpdate;
import io.deephaven.engine.table.impl.InstrumentedTableUpdateListener;
import io.deephaven.extensions.barrage.BarrageSubscriptionOptions;
import io.deephaven.client.impl.BarrageSession;
import io.deephaven.client.impl.TableHandle;
import io.deephaven.client.impl.TableHandleManager;
import io.deephaven.extensions.barrage.table.BarrageTable;
import io.deephaven.qst.TableCreationLogic;
import io.deephaven.util.process.ProcessEnvironment;
/*
* Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending
*/

import io.deephaven.util.process.ShutdownManager;
import picocli.CommandLine;

import java.util.concurrent.CountDownLatch;
Expand Down Expand Up @@ -61,8 +59,6 @@ public void onUpdate(final TableUpdate upstream) {
System.out.println(upstream);
}
});
ProcessEnvironment.getGlobalShutdownManager().registerTask(
ShutdownManager.OrderingCategory.FIRST, countDownLatch::countDown);

countDownLatch.await();
}
Expand Down
216 changes: 28 additions & 188 deletions java-client/flight-examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,202 +22,42 @@ test {

startScripts.enabled = false

task createGetSchemaScripts(type: CreateStartScripts) {
mainClassName = 'io.deephaven.client.examples.GetSchema'
applicationName = 'get-schema'
outputDir = new File(project.buildDir, name)
classpath = startScripts.classpath
defaultJvmOpts = [
'-server',
'-XX:+UseG1GC',
'-XX:MaxGCPauseMillis=100',
'-XX:+UseStringDeduplication' ]
def createApplication = { String name, String mainClass ->
project.tasks.register("create-${name}", CreateStartScripts) {script ->
script.mainClass.set mainClass
script.applicationName = name
script.outputDir = project.layout.buildDirectory.dir(name).get().asFile
script.classpath = startScripts.classpath
script.defaultJvmOpts = [
'-server',
'-XX:+UseG1GC',
'-XX:MaxGCPauseMillis=100',
'-XX:+UseStringDeduplication' ]
}
}

task createGetTsvScripts(type: CreateStartScripts) {
mainClassName = 'io.deephaven.client.examples.GetTsv'
applicationName = 'get-tsv'
outputDir = new File(project.buildDir, name)
classpath = startScripts.classpath
defaultJvmOpts = [
'-server',
'-XX:+UseG1GC',
'-XX:MaxGCPauseMillis=100',
'-XX:+UseStringDeduplication' ]
}

task createPollTsvScripts(type: CreateStartScripts) {
mainClassName = 'io.deephaven.client.examples.PollTsv'
applicationName = 'poll-tsv'
outputDir = new File(project.buildDir, name)
classpath = startScripts.classpath
defaultJvmOpts = [
'-server',
'-XX:+UseG1GC',
'-XX:MaxGCPauseMillis=100',
'-XX:+UseStringDeduplication' ]
}

task createListTablesScripts(type: CreateStartScripts) {
mainClassName = 'io.deephaven.client.examples.ListTables'
applicationName = 'list-tables'
outputDir = new File(project.buildDir, name)
classpath = startScripts.classpath
defaultJvmOpts = [
'-server',
'-XX:+UseG1GC',
'-XX:MaxGCPauseMillis=100',
'-XX:+UseStringDeduplication' ]
}

task createExcessiveScript(type: CreateStartScripts) {
mainClassName = 'io.deephaven.client.examples.ExampleExcessive'
applicationName = 'excessive'
outputDir = new File(project.buildDir, name)
classpath = startScripts.classpath
defaultJvmOpts = [
'-server',
'-XX:+UseG1GC',
'-XX:MaxGCPauseMillis=100',
'-XX:+UseStringDeduplication' ]
}

task createGetTicketTableScript(type: CreateStartScripts) {
mainClassName = 'io.deephaven.client.examples.GetTicketTable'
applicationName = 'get-ticket-table'
outputDir = new File(project.buildDir, name)
classpath = startScripts.classpath
defaultJvmOpts = [
'-server',
'-XX:+UseG1GC',
'-XX:MaxGCPauseMillis=100',
'-XX:+UseStringDeduplication' ]
}

task createDoPutNewScript(type: CreateStartScripts) {
mainClassName = 'io.deephaven.client.examples.DoPutNew'
applicationName = 'do-put-new'
outputDir = new File(project.buildDir, name)
classpath = startScripts.classpath
defaultJvmOpts = [
'-server',
'-XX:+UseG1GC',
'-XX:MaxGCPauseMillis=100',
'-XX:+UseStringDeduplication' ]
}

task createDoPutSprayScript(type: CreateStartScripts) {
mainClassName = 'io.deephaven.client.examples.DoPutSpray'
applicationName = 'do-put-spray'
outputDir = new File(project.buildDir, name)
classpath = startScripts.classpath
defaultJvmOpts = [
'-server',
'-XX:+UseG1GC',
'-XX:MaxGCPauseMillis=100',
'-XX:+UseStringDeduplication' ]
}

task createDoPutTableScript(type: CreateStartScripts) {
mainClassName = 'io.deephaven.client.examples.DoPutTable'
applicationName = 'do-put-table'
outputDir = new File(project.buildDir, name)
classpath = startScripts.classpath
defaultJvmOpts = [
'-server',
'-XX:+UseG1GC',
'-XX:MaxGCPauseMillis=100',
'-XX:+UseStringDeduplication' ]
}

task createAddToInputTableScript(type: CreateStartScripts) {
mainClassName = 'io.deephaven.client.examples.AddToInputTable'
applicationName = 'add-to-input-table'
outputDir = new File(project.buildDir, name)
classpath = startScripts.classpath
defaultJvmOpts = [
'-server',
'-XX:+UseG1GC',
'-XX:MaxGCPauseMillis=100',
'-XX:+UseStringDeduplication' ]
}
applicationDistribution.into('bin') {
from(createApplication('get-schema', 'io.deephaven.client.examples.GetSchema'))
from(createApplication('get-tsv', 'io.deephaven.client.examples.GetTsv'))
from(createApplication('poll-tsv', 'io.deephaven.client.examples.PollTsv'))
from(createApplication('list-tables', 'io.deephaven.client.examples.ListTables'))
from(createApplication('excessive', 'io.deephaven.client.examples.ExampleExcessive'))

task createKeyValueInputTableScript(type: CreateStartScripts) {
mainClassName = 'io.deephaven.client.examples.KeyValueInputTable'
applicationName = 'kv-input-table'
outputDir = new File(project.buildDir, name)
classpath = startScripts.classpath
defaultJvmOpts = [
'-server',
'-XX:+UseG1GC',
'-XX:MaxGCPauseMillis=100',
'-XX:+UseStringDeduplication' ]
}
from(createApplication('do-put-new', 'io.deephaven.client.examples.DoPutNew'))
from(createApplication('do-put-spray', 'io.deephaven.client.examples.DoPutSpray'))
from(createApplication('do-put-table', 'io.deephaven.client.examples.DoPutTable'))

task createGetApplicationTableScript(type: CreateStartScripts) {
mainClassName = 'io.deephaven.client.examples.GetApplicationTable'
applicationName = 'get-application-table'
outputDir = new File(project.buildDir, name)
classpath = startScripts.classpath
defaultJvmOpts = [
'-server',
'-XX:+UseG1GC',
'-XX:MaxGCPauseMillis=100',
'-XX:+UseStringDeduplication' ]
}
from(createApplication('add-to-input-table', 'io.deephaven.client.examples.AddToInputTable'))
from(createApplication('kv-input-table', 'io.deephaven.client.examples.KeyValueInputTable'))

task createGetScopeTableScript(type: CreateStartScripts) {
mainClassName = 'io.deephaven.client.examples.GetScopeTable'
applicationName = 'get-scope-table'
outputDir = new File(project.buildDir, name)
classpath = startScripts.classpath
defaultJvmOpts = [
'-server',
'-XX:+UseG1GC',
'-XX:MaxGCPauseMillis=100',
'-XX:+UseStringDeduplication' ]
}
from(createApplication('get-ticket-table', 'io.deephaven.client.examples.GetTicketTable'))

task createGetApplicationSchemaScript(type: CreateStartScripts) {
mainClassName = 'io.deephaven.client.examples.GetApplicationSchema'
applicationName = 'get-application-schema'
outputDir = new File(project.buildDir, name)
classpath = startScripts.classpath
defaultJvmOpts = [
'-server',
'-XX:+UseG1GC',
'-XX:MaxGCPauseMillis=100',
'-XX:+UseStringDeduplication' ]
}
from(createApplication('get-application-schema', 'io.deephaven.client.examples.GetApplicationSchema'))
from(createApplication('get-application-table', 'io.deephaven.client.examples.GetApplicationTable'))

task createGetScopeSchemaScript(type: CreateStartScripts) {
mainClassName = 'io.deephaven.client.examples.GetScopeSchema'
applicationName = 'get-scope-schema'
outputDir = new File(project.buildDir, name)
classpath = startScripts.classpath
defaultJvmOpts = [
'-server',
'-XX:+UseG1GC',
'-XX:MaxGCPauseMillis=100',
'-XX:+UseStringDeduplication' ]
}
from(createApplication('get-scope-schema', 'io.deephaven.client.examples.GetScopeSchema'))
from(createApplication('get-scope-table', 'io.deephaven.client.examples.GetScopeTable'))

applicationDistribution.into('bin') {
from(createGetSchemaScripts)
from(createGetTsvScripts)
from(createPollTsvScripts)
from(createListTablesScripts)
from(createExcessiveScript)
from(createGetTicketTableScript)
from(createDoPutNewScript)
from(createDoPutSprayScript)
from(createDoPutTableScript)
from(createAddToInputTableScript)
from(createKeyValueInputTableScript)
from(createGetApplicationTableScript)
from(createGetScopeTableScript)
from(createGetApplicationSchemaScript)
from(createGetScopeSchemaScript)
fileMode = 0755
}

Expand Down
Loading

0 comments on commit b59e6fe

Please sign in to comment.