Skip to content

Commit

Permalink
gchq#2627 Add processor filter and processor task id to meta.
Browse files Browse the repository at this point in the history
  • Loading branch information
stroomdev66 committed Dec 14, 2021
1 parent 31ae74f commit a6b70a8
Show file tree
Hide file tree
Showing 49 changed files with 864 additions and 488 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ plugins {
// Plugin for producing a tree of task dependencies, run task 'taskTree'
id "com.dorongold.task-tree" version "1.3.1" apply true

id "com.github.johnrengelman.shadow" version "5.2.0" apply false
id "com.github.johnrengelman.shadow" version "6.1.0" apply false

id 'nu.studer.jooq' version '4.1' apply false
id 'nu.studer.jooq' version '5.2' apply false

id 'org.flywaydb.flyway' version '5.2.4' apply false
id 'org.flywaydb.flyway' version '7.5.4' apply false

id "ca.cutterslade.analyze" version "1.4.3"

Expand Down
32 changes: 14 additions & 18 deletions stroom-activity/stroom-activity-impl-db-jooq/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,23 @@ dependencies {
permitUnusedDeclared libs.javax_annotation
compile libs.jooq

jooqRuntime libs.mysql_connector_java

// The following are required to put JAXB on the JOOQ classpath for the purpose of JOOQ code generation in J9+.
// Later versions of the JOOQ Gradle plugin should make this unnecessary.
jooqRuntime 'javax.activation:activation:1.1.1'
jooqRuntime 'javax.xml.bind:jaxb-api:2.3.0'
jooqRuntime 'com.sun.xml.bind:jaxb-core:2.3.0.1'
jooqRuntime 'com.sun.xml.bind:jaxb-impl:2.3.0.1'
runtime libs.mysql_connector_java
jooqGenerator libs.mysql_connector_java
}

def propNameJooqGeneration = 'jooqGeneration'
// Configure jooq plugin to generate code
jooq {
version = versions.jooq
edition = nu.studer.gradle.jooq.JooqEdition.OSS // default (can be omitted)

configurations {
main { // name of the jOOQ configuration

// Disable JOOQ code generation on build
generateSchemaSourceOnCompilation = false

// to run the jooq code generation add the following to the gradle command arguments
// -PjooqGeneration=true
if (getPropertyOrDefault(propNameJooqGeneration, "false") == "true") {
configure(project) {
//configure jooq plugin to generate code
jooq {
version = versions.jooq
edition = 'OSS'
sample(sourceSets.main) {
generationTool {
logging = org.jooq.meta.jaxb.Logging.WARN
jdbc {
driver = 'com.mysql.cj.jdbc.Driver'
url = 'jdbc:mysql://localhost:3307/stroom?useUnicode=yes&characterEncoding=UTF-8'
Expand Down
33 changes: 14 additions & 19 deletions stroom-annotation/stroom-annotation-impl-db-jooq/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,25 @@ ext.moduleName = 'stroom.annotation.impl.db.jooq'
dependencies {
compile libs.javax_annotation
permitUnusedDeclared libs.javax_annotation

compile libs.jooq

jooqRuntime libs.mysql_connector_java

// The following are required to put JAXB on the JOOQ classpath for the purpose of JOOQ code generation in J9+.
// Later versions of the JOOQ Gradle plugin should make this unnecessary.
jooqRuntime 'javax.activation:activation:1.1.1'
jooqRuntime 'javax.xml.bind:jaxb-api:2.3.0'
jooqRuntime 'com.sun.xml.bind:jaxb-core:2.3.0.1'
jooqRuntime 'com.sun.xml.bind:jaxb-impl:2.3.0.1'
runtime libs.mysql_connector_java
jooqGenerator libs.mysql_connector_java
}

def propNameJooqGeneration = 'jooqGeneration'
// Configure jooq plugin to generate code
jooq {
version = versions.jooq
edition = nu.studer.gradle.jooq.JooqEdition.OSS // default (can be omitted)

configurations {
main { // name of the jOOQ configuration

// Disable JOOQ code generation on build
generateSchemaSourceOnCompilation = false

// to run the jooq code generation add the following to the gradle command arguments
// -PjooqGeneration=true
if (getPropertyOrDefault(propNameJooqGeneration, "false") == "true") {
configure(project) {
//configure jooq plugin to generate code
jooq {
version = versions.jooq
edition = 'OSS'
sample(sourceSets.main) {
generationTool {
logging = org.jooq.meta.jaxb.Logging.WARN
jdbc {
driver = 'com.mysql.cj.jdbc.Driver'
url = 'jdbc:mysql://localhost:3307/stroom?useUnicode=yes&characterEncoding=UTF-8'
Expand Down
32 changes: 14 additions & 18 deletions stroom-cluster/stroom-cluster-lock-impl-db-jooq/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,23 @@ dependencies {
permitUnusedDeclared libs.javax_annotation
compile libs.jooq

jooqRuntime libs.mysql_connector_java

// The following are required to put JAXB on the JOOQ classpath for the purpose of JOOQ code generation in J9+.
// Later versions of the JOOQ Gradle plugin should make this unnecessary.
jooqRuntime 'javax.activation:activation:1.1.1'
jooqRuntime 'javax.xml.bind:jaxb-api:2.3.0'
jooqRuntime 'com.sun.xml.bind:jaxb-core:2.3.0.1'
jooqRuntime 'com.sun.xml.bind:jaxb-impl:2.3.0.1'
runtime libs.mysql_connector_java
jooqGenerator libs.mysql_connector_java
}

def propNameJooqGeneration = 'jooqGeneration'
// Configure jooq plugin to generate code
jooq {
version = versions.jooq
edition = nu.studer.gradle.jooq.JooqEdition.OSS // default (can be omitted)

configurations {
main { // name of the jOOQ configuration

// Disable JOOQ code generation on build
generateSchemaSourceOnCompilation = false

// to run the jooq code generation add the following to the gradle command arguments
// -PjooqGeneration=true
if (getPropertyOrDefault(propNameJooqGeneration, "false") == "true") {
configure(project) {
//configure jooq plugin to generate code
jooq {
version = versions.jooq
edition = 'OSS'
sample(sourceSets.main) {
generationTool {
logging = org.jooq.meta.jaxb.Logging.WARN
jdbc {
driver = 'com.mysql.cj.jdbc.Driver'
url = 'jdbc:mysql://localhost:3307/stroom?useUnicode=yes&characterEncoding=UTF-8'
Expand Down
32 changes: 14 additions & 18 deletions stroom-config/stroom-config-global-impl-db-jooq/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,23 @@ dependencies {
permitUnusedDeclared libs.javax_annotation
compile libs.jooq

jooqRuntime libs.mysql_connector_java

// The following are required to put JAXB on the JOOQ classpath for the purpose of JOOQ code generation in J9+.
// Later versions of the JOOQ Gradle plugin should make this unnecessary.
jooqRuntime 'javax.activation:activation:1.1.1'
jooqRuntime 'javax.xml.bind:jaxb-api:2.3.0'
jooqRuntime 'com.sun.xml.bind:jaxb-core:2.3.0.1'
jooqRuntime 'com.sun.xml.bind:jaxb-impl:2.3.0.1'
runtime libs.mysql_connector_java
jooqGenerator libs.mysql_connector_java
}

def propNameJooqGeneration = 'jooqGeneration'
// Configure jooq plugin to generate code
jooq {
version = versions.jooq
edition = nu.studer.gradle.jooq.JooqEdition.OSS // default (can be omitted)

configurations {
main { // name of the jOOQ configuration

// Disable JOOQ code generation on build
generateSchemaSourceOnCompilation = false

// to run the jooq code generation add the following to the gradle command arguments
// -PjooqGeneration=true
if (getPropertyOrDefault(propNameJooqGeneration, "false") == "true") {
configure(project) {
//configure jooq plugin to generate code
jooq {
version = versions.jooq
edition = 'OSS'
sample(sourceSets.main) {
generationTool {
logging = org.jooq.meta.jaxb.Logging.WARN
jdbc {
driver = 'com.mysql.cj.jdbc.Driver'
url = 'jdbc:mysql://localhost:3307/stroom?useUnicode=yes&characterEncoding=UTF-8'
Expand Down
40 changes: 40 additions & 0 deletions stroom-core-shared/src/main/java/stroom/meta/shared/Meta.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ public class Meta {
@JsonProperty
private String pipelineUuid;
@JsonProperty
private Integer processorFilterId;
@JsonProperty
private Long processorTaskId;
@JsonProperty
private Long parentMetaId;
@JsonProperty
private Status status;
Expand All @@ -56,6 +60,8 @@ public Meta(@JsonProperty("id") final long id,
@JsonProperty("typeName") final String typeName,
@JsonProperty("processorUuid") final String processorUuid,
@JsonProperty("pipelineUuid") final String pipelineUuid,
@JsonProperty("processorFilterId") final Integer processorFilterId,
@JsonProperty("processorTaskId") final Long processorTaskId,
@JsonProperty("parentMetaId") final Long parentMetaId,
@JsonProperty("status") final Status status,
@JsonProperty("statusMs") final Long statusMs,
Expand All @@ -66,6 +72,8 @@ public Meta(@JsonProperty("id") final long id,
this.typeName = typeName;
this.processorUuid = processorUuid;
this.pipelineUuid = pipelineUuid;
this.processorFilterId = processorFilterId;
this.processorTaskId = processorTaskId;
this.parentMetaId = parentMetaId;
this.status = status;
this.statusMs = statusMs;
Expand Down Expand Up @@ -113,6 +121,22 @@ public void setPipelineUuid(final String pipelineUuid) {
this.pipelineUuid = pipelineUuid;
}

public Integer getProcessorFilterId() {
return processorFilterId;
}

public void setProcessorFilterId(final Integer processorFilterId) {
this.processorFilterId = processorFilterId;
}

public Long getProcessorTaskId() {
return processorTaskId;
}

public void setProcessorTaskId(final Long processorTaskId) {
this.processorTaskId = processorTaskId;
}

public Long getParentMetaId() {
return parentMetaId;
}
Expand Down Expand Up @@ -190,6 +214,8 @@ public static final class Builder {
private String typeName;
private String processorUuid;
private String pipelineUuid;
private Integer processorFilterId;
private Long processorTaskId;
private Long parentMetaId;
private Status status;
private Long statusMs;
Expand All @@ -205,6 +231,8 @@ private Builder(final Meta meta) {
this.typeName = meta.typeName;
this.processorUuid = meta.processorUuid;
this.pipelineUuid = meta.pipelineUuid;
this.processorFilterId = meta.processorFilterId;
this.processorTaskId = meta.processorTaskId;
this.parentMetaId = meta.parentMetaId;
this.status = meta.status;
this.statusMs = meta.statusMs;
Expand Down Expand Up @@ -237,6 +265,16 @@ public Builder pipelineUuid(final String pipelineUuid) {
return this;
}

public Builder processorFilterId(final Integer processorFilterId) {
this.processorFilterId = processorFilterId;
return this;
}

public Builder processorTaskId(final Long processorTaskId) {
this.processorTaskId = processorTaskId;
return this;
}

public Builder parentDataId(final Long parentDataId) {
this.parentMetaId = parentDataId;
return this;
Expand Down Expand Up @@ -269,6 +307,8 @@ public Meta build() {
typeName,
processorUuid,
pipelineUuid,
processorFilterId,
processorTaskId,
parentMetaId,
status,
statusMs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public class MetaFields {
// Id's
public static final IdField ID = new IdField("Id");
public static final IdField META_INTERNAL_PROCESSOR_ID = new IdField("Processor Id");
public static final IdField META_PROCESSOR_FILTER_ID = new IdField("Processor Filter Id");
public static final IdField META_PROCESSOR_TASK_ID = new IdField("Processor Task Id");

// Times
public static final DateField CREATE_TIME = new DateField("Create Time");
Expand Down Expand Up @@ -78,6 +80,8 @@ public class MetaFields {
FIELDS.add(ID);
FIELDS.add(PARENT_ID);
FIELDS.add(META_INTERNAL_PROCESSOR_ID);
FIELDS.add(META_PROCESSOR_FILTER_ID);
FIELDS.add(META_PROCESSOR_TASK_ID);

// Times
FIELDS.add(CREATE_TIME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@ public OutputStream getOutputStream(final byte[] header, final byte[] footer) {
if (processInfoOutputStream == null) {
String processorUuid = null;
String processorFilterUuid = null;
Integer processorFilterId = null;
String pipelineUuid = null;
Long processorTaskId = null;

Expand All @@ -589,6 +590,7 @@ public OutputStream getOutputStream(final byte[] header, final byte[] footer) {
}
if (processorFilter != null) {
processorFilterUuid = processorFilter.getUuid();
processorFilterId = processorFilter.getId();
}
if (processorTask != null) {
processorTaskId = processorTask.getId();
Expand All @@ -602,6 +604,8 @@ public OutputStream getOutputStream(final byte[] header, final byte[] footer) {
.parent(meta)
.processorUuid(processorUuid)
.pipelineUuid(pipelineUuid)
.processorFilterId(processorFilterId)
.processorTaskId(processorTaskId)
.build();

processInfoStreamTarget = supersededOutputHelper.addTarget(() ->
Expand Down
33 changes: 14 additions & 19 deletions stroom-dashboard/stroom-storedquery-impl-db-jooq/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,25 @@ ext.moduleName = 'stroom.storedquery.impl.db.jooq'
dependencies {
compile libs.javax_annotation
permitUnusedDeclared libs.javax_annotation

compile libs.jooq

jooqRuntime libs.mysql_connector_java

// The following are required to put JAXB on the JOOQ classpath for the purpose of JOOQ code generation in J9+.
// Later versions of the JOOQ Gradle plugin should make this unnecessary.
jooqRuntime 'javax.activation:activation:1.1.1'
jooqRuntime 'javax.xml.bind:jaxb-api:2.3.0'
jooqRuntime 'com.sun.xml.bind:jaxb-core:2.3.0.1'
jooqRuntime 'com.sun.xml.bind:jaxb-impl:2.3.0.1'
runtime libs.mysql_connector_java
jooqGenerator libs.mysql_connector_java
}

def propNameJooqGeneration = 'jooqGeneration'
// Configure jooq plugin to generate code
jooq {
version = versions.jooq
edition = nu.studer.gradle.jooq.JooqEdition.OSS // default (can be omitted)

configurations {
main { // name of the jOOQ configuration

// Disable JOOQ code generation on build
generateSchemaSourceOnCompilation = false

// to run the jooq code generation add the following to the gradle command arguments
// -PjooqGeneration=true
if (getPropertyOrDefault(propNameJooqGeneration, "false") == "true") {
configure(project) {
//configure jooq plugin to generate code
jooq {
version = versions.jooq
edition = 'OSS'
sample(sourceSets.main) {
generationTool {
logging = org.jooq.meta.jaxb.Logging.WARN
jdbc {
driver = 'com.mysql.cj.jdbc.Driver'
url = 'jdbc:mysql://localhost:3307/stroom?useUnicode=yes&characterEncoding=UTF-8'
Expand Down
Loading

0 comments on commit a6b70a8

Please sign in to comment.