diff --git a/cdap-app-templates/cdap-etl/cdap-etl-proto/src/main/java/io/cdap/cdap/etl/proto/v2/DataStreamsConfig.java b/cdap-app-templates/cdap-etl/cdap-etl-proto/src/main/java/io/cdap/cdap/etl/proto/v2/DataStreamsConfig.java index 9420c82301ea..e170bfc946dd 100644 --- a/cdap-app-templates/cdap-etl/cdap-etl-proto/src/main/java/io/cdap/cdap/etl/proto/v2/DataStreamsConfig.java +++ b/cdap-app-templates/cdap-etl/cdap-etl-proto/src/main/java/io/cdap/cdap/etl/proto/v2/DataStreamsConfig.java @@ -38,7 +38,8 @@ public final class DataStreamsConfig extends ETLConfig { // See comments in DataStreamsSparkLauncher for explanation on why we need this. private final boolean isUnitTest; - private DataStreamsConfig(Set stages, + private DataStreamsConfig(String description, + Set stages, Set connections, Resources resources, Resources driverResources, @@ -52,9 +53,8 @@ private DataStreamsConfig(Set stages, @Nullable Integer numOfRecordsPreview, @Nullable Boolean stopGracefully, Map properties) { - super(stages, connections, resources, driverResources, clientResources, stageLoggingEnabled, - processTimingEnabled, - numOfRecordsPreview, properties); + super(description, stages, connections, resources, driverResources, clientResources, + stageLoggingEnabled, processTimingEnabled, numOfRecordsPreview, properties); this.batchInterval = batchInterval; this.isUnitTest = isUnitTest; this.extraJavaOpts = ""; @@ -144,10 +144,9 @@ public DataStreamsConfig updateConfig(ApplicationUpdateContext applicationUpdate updatedStages.add(stage.updateStage(applicationUpdateContext)); } - return new DataStreamsConfig(updatedStages, connections, resources, driverResources, - clientResources, - stageLoggingEnabled, processTimingEnabled, batchInterval, isUnitTest, - disableCheckpoints, checkpointDir, numOfRecordsPreview, stopGracefully, + return new DataStreamsConfig(description, updatedStages, connections, resources, + driverResources, clientResources, stageLoggingEnabled, processTimingEnabled, batchInterval, + isUnitTest, disableCheckpoints, checkpointDir, numOfRecordsPreview, stopGracefully, properties); } @@ -190,10 +189,9 @@ public Builder disableCheckpoints() { } public DataStreamsConfig build() { - return new DataStreamsConfig(stages, connections, resources, driverResources, clientResources, - stageLoggingEnabled, processTimingEnabled, batchInterval, isUnitTest, - disableCheckpoints, checkpointDir, numOfRecordsPreview, stopGraceFully, - properties); + return new DataStreamsConfig(description, stages, connections, resources, driverResources, + clientResources, stageLoggingEnabled, processTimingEnabled, batchInterval, isUnitTest, + disableCheckpoints, checkpointDir, numOfRecordsPreview, stopGraceFully, properties); } } } diff --git a/cdap-app-templates/cdap-etl/cdap-etl-proto/src/main/java/io/cdap/cdap/etl/proto/v2/ETLBatchConfig.java b/cdap-app-templates/cdap-etl/cdap-etl-proto/src/main/java/io/cdap/cdap/etl/proto/v2/ETLBatchConfig.java index 4bbe6a760cf7..cb32f89409d7 100644 --- a/cdap-app-templates/cdap-etl/cdap-etl-proto/src/main/java/io/cdap/cdap/etl/proto/v2/ETLBatchConfig.java +++ b/cdap-app-templates/cdap-etl/cdap-etl-proto/src/main/java/io/cdap/cdap/etl/proto/v2/ETLBatchConfig.java @@ -51,7 +51,8 @@ public final class ETLBatchConfig extends ETLConfig { private final Boolean pushdownEnabled; private final ETLTransformationPushdown transformationPushdown; - private ETLBatchConfig(Set stages, + private ETLBatchConfig(String description, + Set stages, Set connections, List postActions, Resources resources, @@ -69,9 +70,8 @@ private ETLBatchConfig(Set stages, List comments, @Nullable Boolean pushdownEnabled, @Nullable ETLTransformationPushdown transformationPushdown) { - super(stages, connections, resources, driverResources, clientResources, stageLoggingEnabled, - processTimingEnabled, - numOfRecordsPreview, engineProperties, comments); + super(description,stages, connections, resources, driverResources, clientResources, + stageLoggingEnabled, processTimingEnabled, numOfRecordsPreview, engineProperties, comments); this.postActions = ImmutableList.copyOf(postActions); this.engine = engine; this.schedule = schedule; @@ -163,11 +163,10 @@ public ETLBatchConfig updateBatchConfig(ApplicationUpdateContext upgradeContext) for (ETLStage postAction : getPostActions()) { upgradedPostActions.add(postAction.updateStage(upgradeContext)); } - return new ETLBatchConfig(upgradedStages, connections, upgradedPostActions, resources, - stageLoggingEnabled, - processTimingEnabled, engine, schedule, driverResources, clientResources, - numOfRecordsPreview, maxConcurrentRuns, properties, service, connectionConfig, comments, - pushdownEnabled, transformationPushdown); + return new ETLBatchConfig(description, upgradedStages, connections, upgradedPostActions, + resources, stageLoggingEnabled, processTimingEnabled, engine, schedule, driverResources, + clientResources, numOfRecordsPreview, maxConcurrentRuns, properties, service, + connectionConfig, comments, pushdownEnabled, transformationPushdown); } @Override @@ -259,6 +258,7 @@ public Builder(String schedule) { public Builder(ETLBatchConfig config) { super(); + this.description = config.getDescription(); this.stages = config.getStages(); this.connections = config.getConnections(); this.endingActions = config.getPostActions(); @@ -318,10 +318,10 @@ public Builder setTransformationPushdown(ETLTransformationPushdown transformatio } public ETLBatchConfig build() { - return new ETLBatchConfig(stages, connections, endingActions, resources, stageLoggingEnabled, - processTimingEnabled, engine, schedule, driverResources, clientResources, - numOfRecordsPreview, maxConcurrentRuns, properties, false, null, comments, - pushdownEnabled, transformationPushdown); + return new ETLBatchConfig(description, stages, connections, endingActions, resources, + stageLoggingEnabled, processTimingEnabled, engine, schedule, driverResources, + clientResources, numOfRecordsPreview, maxConcurrentRuns, properties, false, null, + comments, pushdownEnabled, transformationPushdown); } } } diff --git a/cdap-app-templates/cdap-etl/cdap-etl-proto/src/main/java/io/cdap/cdap/etl/proto/v2/ETLConfig.java b/cdap-app-templates/cdap-etl/cdap-etl-proto/src/main/java/io/cdap/cdap/etl/proto/v2/ETLConfig.java index 8f651c81b023..6a4ec4db2eb3 100644 --- a/cdap-app-templates/cdap-etl/cdap-etl-proto/src/main/java/io/cdap/cdap/etl/proto/v2/ETLConfig.java +++ b/cdap-app-templates/cdap-etl/cdap-etl-proto/src/main/java/io/cdap/cdap/etl/proto/v2/ETLConfig.java @@ -59,11 +59,11 @@ public class ETLConfig extends Config implements UpgradeableConfig { // For serialization purpose for upgrade compatibility. protected List comments; - protected ETLConfig(Set stages, Set connections, Resources resources, - Resources driverResources, Resources clientResources, + protected ETLConfig(String description, Set stages, Set connections, + Resources resources, Resources driverResources, Resources clientResources, @Nullable Boolean stageLoggingEnabled, @Nullable Boolean processTimingEnabled, @Nullable Integer numOfRecordsPreview, Map properties) { - this.description = null; + this.description = description; this.stages = Collections.unmodifiableSet(stages); this.connections = Collections.unmodifiableSet(connections); this.resources = resources; @@ -80,14 +80,13 @@ protected ETLConfig(Set stages, Set connections, Resources this.comments = new ArrayList<>(); } - protected ETLConfig(Set stages, Set connections, + protected ETLConfig(String descrition, Set stages, Set connections, Resources resources, Resources driverResources, Resources clientResources, @Nullable Boolean stageLoggingEnabled, @Nullable Boolean processTimingEnabled, @Nullable Integer numOfRecordsPreview, Map properties, List comments) { - this(stages, connections, resources, driverResources, clientResources, stageLoggingEnabled, - processTimingEnabled, - numOfRecordsPreview, properties); + this(descrition, stages, connections, resources, driverResources, clientResources, + stageLoggingEnabled, processTimingEnabled, numOfRecordsPreview, properties); this.comments = comments; this.sinks = null; this.transforms = null; @@ -257,6 +256,7 @@ public String toString() { @SuppressWarnings("unchecked") public abstract static class Builder { + protected String description; protected List comments; public static final Resources DEFAULT_TEST_RESOURCES = new Resources(2048, 1); protected Set stages; @@ -350,5 +350,10 @@ public T setComments(List comments) { this.comments = comments; return (T) this; } + + public T setDescription(String description) { + this.description = description; + return (T) this; + } } }