beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From echauc...@apache.org
Subject [beam] 16/50: apply spotless for e-formatting
Date Fri, 04 Jan 2019 10:38:38 GMT
This is an automated email from the ASF dual-hosted git repository.

echauchot pushed a commit to branch spark-runner_structured-streaming
in repository https://gitbox.apache.org/repos/asf/beam.git

commit 0cfa70d0bc09fd2594c4dfd328b8a5745664f80a
Author: Etienne Chauchot <echauchot@apache.org>
AuthorDate: Thu Nov 22 12:04:11 2018 +0100

    apply spotless for e-formatting
---
 .../structuredstreaming/SparkPipelineOptions.java  |  1 -
 .../structuredstreaming/SparkPipelineResult.java   | 32 +++++++++++---
 .../spark/structuredstreaming/SparkRunner.java     | 41 +++++++++++++----
 .../translation/PipelineTranslator.java            | 46 ++++++++++++-------
 .../translation/TransformTranslator.java           | 21 +++++++--
 .../translation/TranslationContext.java            | 27 +++++++++---
 .../batch/BatchCombinePerKeyTranslator.java        | 29 +++++++++---
 .../batch/BatchFlattenPCollectionTranslator.java   | 28 +++++++++---
 .../batch/BatchGroupByKeyTranslator.java           | 29 +++++++++---
 .../translation/batch/BatchParDoTranslator.java    | 28 +++++++++---
 .../translation/batch/BatchPipelineTranslator.java | 51 ++++++++++++++--------
 .../batch/BatchReadSourceTranslator.java           | 27 +++++++++---
 .../batch/BatchReshuffleTranslator.java            | 22 ++++++++--
 .../translation/batch/BatchTranslationContext.java | 24 +++++++---
 .../batch/BatchWindowAssignTranslator.java         | 27 +++++++++---
 .../streaming/StreamingPipelineTranslator.java     | 32 +++++++++++---
 .../streaming/StreamingTranslationContext.java     | 21 +++++++--
 17 files changed, 375 insertions(+), 111 deletions(-)

diff --git a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/SparkPipelineOptions.java
b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/SparkPipelineOptions.java
index d381b5f..2e6653b 100644
--- a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/SparkPipelineOptions.java
+++ b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/SparkPipelineOptions.java
@@ -89,7 +89,6 @@ public interface SparkPipelineOptions
 
   void setEnableSparkMetricSinks(Boolean enableSparkMetricSinks);
 
-
   /**
    * List of local files to make available to workers.
    *
diff --git a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/SparkPipelineResult.java
b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/SparkPipelineResult.java
index 82d1b90..a8b3640 100644
--- a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/SparkPipelineResult.java
+++ b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/SparkPipelineResult.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.beam.runners.spark.structuredstreaming;
 
 import java.io.IOException;
@@ -7,23 +24,28 @@ import org.joda.time.Duration;
 
 public class SparkPipelineResult implements PipelineResult {
 
-  @Override public State getState() {
+  @Override
+  public State getState() {
     return null;
   }
 
-  @Override public State cancel() throws IOException {
+  @Override
+  public State cancel() throws IOException {
     return null;
   }
 
-  @Override public State waitUntilFinish(Duration duration) {
+  @Override
+  public State waitUntilFinish(Duration duration) {
     return null;
   }
 
-  @Override public State waitUntilFinish() {
+  @Override
+  public State waitUntilFinish() {
     return null;
   }
 
-  @Override public MetricResults metrics() {
+  @Override
+  public MetricResults metrics() {
     return null;
   }
 }
diff --git a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/SparkRunner.java
b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/SparkRunner.java
index de20133..3a530f0 100644
--- a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/SparkRunner.java
+++ b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/SparkRunner.java
@@ -1,9 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.beam.runners.spark.structuredstreaming;
 
 import static org.apache.beam.runners.core.construction.PipelineResources.detectClassPathResourcesToStage;
 
-import org.apache.beam.runners.spark.structuredstreaming.translation.batch.BatchPipelineTranslator;
 import org.apache.beam.runners.spark.structuredstreaming.translation.PipelineTranslator;
+import org.apache.beam.runners.spark.structuredstreaming.translation.batch.BatchPipelineTranslator;
 import org.apache.beam.runners.spark.structuredstreaming.translation.streaming.StreamingPipelineTranslator;
 import org.apache.beam.sdk.Pipeline;
 import org.apache.beam.sdk.PipelineRunner;
@@ -65,12 +82,14 @@ public final class SparkRunner extends PipelineRunner<SparkPipelineResult>
{
    * @return A pipeline runner that will execute with specified options.
    */
   public static SparkRunner fromOptions(PipelineOptions options) {
-    SparkPipelineOptions sparkOptions = PipelineOptionsValidator
-        .validate(SparkPipelineOptions.class, options);
+    SparkPipelineOptions sparkOptions =
+        PipelineOptionsValidator.validate(SparkPipelineOptions.class, options);
 
     if (sparkOptions.getFilesToStage() == null) {
-      sparkOptions.setFilesToStage(detectClassPathResourcesToStage(SparkRunner.class.getClassLoader()));
-      LOG.info("PipelineOptions.filesToStage was not specified. "
+      sparkOptions.setFilesToStage(
+          detectClassPathResourcesToStage(SparkRunner.class.getClassLoader()));
+      LOG.info(
+          "PipelineOptions.filesToStage was not specified. "
               + "Defaulting to files from the classpath: will stage {} files. "
               + "Enable logging at DEBUG level to see which files will be staged.",
           sparkOptions.getFilesToStage().size());
@@ -88,19 +107,23 @@ public final class SparkRunner extends PipelineRunner<SparkPipelineResult>
{
     this.options = options;
   }
 
-  @Override public SparkPipelineResult run(final Pipeline pipeline) {
+  @Override
+  public SparkPipelineResult run(final Pipeline pipeline) {
     translatePipeline(pipeline);
     executePipeline(pipeline);
     return new SparkPipelineResult();
   }
 
-  private void translatePipeline(Pipeline pipeline){
+  private void translatePipeline(Pipeline pipeline) {
     PipelineTranslator.detectTranslationMode(pipeline, options);
     PipelineTranslator.replaceTransforms(pipeline, options);
     PipelineTranslator.prepareFilesToStageForRemoteClusterExecution(options);
-    PipelineTranslator pipelineTranslator = options.isStreaming() ? new StreamingPipelineTranslator(options)
: new BatchPipelineTranslator(options);
+    PipelineTranslator pipelineTranslator =
+        options.isStreaming()
+            ? new StreamingPipelineTranslator(options)
+            : new BatchPipelineTranslator(options);
     pipelineTranslator.translate(pipeline);
   }
-  private void executePipeline(Pipeline pipeline) {}
 
+  private void executePipeline(Pipeline pipeline) {}
 }
diff --git a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/PipelineTranslator.java
b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/PipelineTranslator.java
index c05fc92..bb40631 100644
--- a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/PipelineTranslator.java
+++ b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/PipelineTranslator.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.beam.runners.spark.structuredstreaming.translation;
 
 import org.apache.beam.runners.core.construction.PTransformTranslation;
@@ -14,17 +31,16 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 /**
  * {@link Pipeline.PipelineVisitor} that translates the Beam operators to their Spark counterparts.
- * It also does the pipeline preparation: mode detection, transforms replacement, classpath
preparation.
- * If we have a streaming job, it is instantiated as a {@link StreamingPipelineTranslator}.
- * If we have a batch job, it is instantiated as a {@link BatchPipelineTranslator}.
+ * It also does the pipeline preparation: mode detection, transforms replacement, classpath
+ * preparation. If we have a streaming job, it is instantiated as a {@link
+ * StreamingPipelineTranslator}. If we have a batch job, it is instantiated as a {@link
+ * BatchPipelineTranslator}.
  */
-
-public abstract class PipelineTranslator extends Pipeline.PipelineVisitor.Defaults{
+public abstract class PipelineTranslator extends Pipeline.PipelineVisitor.Defaults {
   private int depth = 0;
   private static final Logger LOG = LoggerFactory.getLogger(PipelineTranslator.class);
   protected TranslationContext translationContext;
 
-
   // --------------------------------------------------------------------------------------------
   //  Pipeline preparation methods
   // --------------------------------------------------------------------------------------------
@@ -41,13 +57,14 @@ public abstract class PipelineTranslator extends Pipeline.PipelineVisitor.Defaul
     }
   }
 
-  public static void replaceTransforms(Pipeline pipeline, SparkPipelineOptions options){
+  public static void replaceTransforms(Pipeline pipeline, SparkPipelineOptions options) {
     pipeline.replaceAll(SparkTransformOverrides.getDefaultOverrides(options.isStreaming()));
-
   }
 
-
-  /** Visit the pipeline to determine the translation mode (batch/streaming) and update options
accordingly. */
+  /**
+   * Visit the pipeline to determine the translation mode (batch/streaming) and update options
+   * accordingly.
+   */
   public static void detectTranslationMode(Pipeline pipeline, SparkPipelineOptions options)
{
     TranslationModeDetector detector = new TranslationModeDetector();
     pipeline.traverseTopologically(detector);
@@ -117,17 +134,15 @@ public abstract class PipelineTranslator extends Pipeline.PipelineVisitor.Defaul
 
   /**
    * get a {@link TransformTranslator} for the given {@link TransformHierarchy.Node}
+   *
    * @param node
    * @return
    */
   protected abstract TransformTranslator<?> getTransformTranslator(TransformHierarchy.Node
node);
 
-  /**
-   * Apply the given TransformTranslator to the given node.
-   */
+  /** Apply the given TransformTranslator to the given node. */
   private <T extends PTransform<?, ?>> void applyTransformTranslator(
-      TransformHierarchy.Node node,
-      TransformTranslator<?> transformTranslator) {
+      TransformHierarchy.Node node, TransformTranslator<?> transformTranslator) {
     // create the applied PTransform on the translationContext
     translationContext.setCurrentTransform(node.toAppliedPTransform(getPipeline()));
 
@@ -141,7 +156,6 @@ public abstract class PipelineTranslator extends Pipeline.PipelineVisitor.Defaul
     typedTransformTranslator.translateTransform(typedTransform, translationContext);
   }
 
-
   // --------------------------------------------------------------------------------------------
   //  Pipeline visitor entry point
   // --------------------------------------------------------------------------------------------
diff --git a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/TransformTranslator.java
b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/TransformTranslator.java
index 54b0a85..fc55a9e 100644
--- a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/TransformTranslator.java
+++ b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/TransformTranslator.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.beam.runners.spark.structuredstreaming.translation;
 
 import org.apache.beam.sdk.transforms.PTransform;
@@ -5,7 +22,5 @@ import org.apache.beam.sdk.transforms.PTransform;
 public interface TransformTranslator<TransformT extends PTransform> {
 
   /** Base class for translators of {@link PTransform}. */
-
   void translateTransform(TransformT transform, TranslationContext context);
-  }
-
+}
diff --git a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/TranslationContext.java
b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/TranslationContext.java
index e651e70..8f61d0c 100644
--- a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/TranslationContext.java
+++ b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/TranslationContext.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.beam.runners.spark.structuredstreaming.translation;
 
 import java.util.HashMap;
@@ -11,8 +28,8 @@ import org.apache.spark.sql.Dataset;
 import org.apache.spark.sql.SparkSession;
 
 /**
- * Base class that gives a context for {@link PTransform} translation: keeping track of the
datasets,
- * the {@link SparkSession}, the current transform being translated.
+ * Base class that gives a context for {@link PTransform} translation: keeping track of the
+ * datasets, the {@link SparkSession}, the current transform being translated.
  */
 public class TranslationContext {
 
@@ -33,12 +50,8 @@ public class TranslationContext {
       sparkConf.setJars(options.getFilesToStage().toArray(new String[0]));
     }
 
-    this.sparkSession = SparkSession
-        .builder()
-        .config(sparkConf)
-        .getOrCreate();
+    this.sparkSession = SparkSession.builder().config(sparkConf).getOrCreate();
     this.options = options;
     this.datasets = new HashMap<>();
   }
-
 }
diff --git a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchCombinePerKeyTranslator.java
b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchCombinePerKeyTranslator.java
index 858df18..4a10329 100644
--- a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchCombinePerKeyTranslator.java
+++ b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchCombinePerKeyTranslator.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.beam.runners.spark.structuredstreaming.translation.batch;
 
 import org.apache.beam.runners.spark.structuredstreaming.translation.TransformTranslator;
@@ -6,12 +23,12 @@ import org.apache.beam.sdk.transforms.PTransform;
 import org.apache.beam.sdk.values.KV;
 import org.apache.beam.sdk.values.PCollection;
 
-class BatchCombinePerKeyTranslator<K, InputT, AccumT, OutputT> implements
-    TransformTranslator<PTransform<PCollection<KV<K, InputT>>, PCollection<KV<K,
OutputT>>>> {
+class BatchCombinePerKeyTranslator<K, InputT, AccumT, OutputT>
+    implements TransformTranslator<
+        PTransform<PCollection<KV<K, InputT>>, PCollection<KV<K, OutputT>>>>
{
 
-  @Override public void translateTransform(
+  @Override
+  public void translateTransform(
       PTransform<PCollection<KV<K, InputT>>, PCollection<KV<K, OutputT>>>
transform,
-      TranslationContext context) {
-
-  }
+      TranslationContext context) {}
 }
diff --git a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchFlattenPCollectionTranslator.java
b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchFlattenPCollectionTranslator.java
index 90c487a..d24f60c 100644
--- a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchFlattenPCollectionTranslator.java
+++ b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchFlattenPCollectionTranslator.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.beam.runners.spark.structuredstreaming.translation.batch;
 
 import org.apache.beam.runners.spark.structuredstreaming.translation.TransformTranslator;
@@ -6,11 +23,10 @@ import org.apache.beam.sdk.transforms.PTransform;
 import org.apache.beam.sdk.values.PCollection;
 import org.apache.beam.sdk.values.PCollectionList;
 
-class BatchFlattenPCollectionTranslator<T> implements
-    TransformTranslator<PTransform<PCollectionList<T>, PCollection<T>>>
{
+class BatchFlattenPCollectionTranslator<T>
+    implements TransformTranslator<PTransform<PCollectionList<T>, PCollection<T>>>
{
 
-  @Override public void translateTransform(PTransform<PCollectionList<T>, PCollection<T>>
transform,
-      TranslationContext context) {
-
-  }
+  @Override
+  public void translateTransform(
+      PTransform<PCollectionList<T>, PCollection<T>> transform, TranslationContext
context) {}
 }
diff --git a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchGroupByKeyTranslator.java
b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchGroupByKeyTranslator.java
index 52a3c39..829ba8a 100644
--- a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchGroupByKeyTranslator.java
+++ b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchGroupByKeyTranslator.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.beam.runners.spark.structuredstreaming.translation.batch;
 
 import org.apache.beam.runners.spark.structuredstreaming.translation.TransformTranslator;
@@ -6,12 +23,12 @@ import org.apache.beam.sdk.transforms.PTransform;
 import org.apache.beam.sdk.values.KV;
 import org.apache.beam.sdk.values.PCollection;
 
-class BatchGroupByKeyTranslator<K, InputT> implements
-    TransformTranslator<PTransform<PCollection<KV<K, InputT>>, PCollection<KV<K,
Iterable<InputT>>>>> {
+class BatchGroupByKeyTranslator<K, InputT>
+    implements TransformTranslator<
+        PTransform<PCollection<KV<K, InputT>>, PCollection<KV<K, Iterable<InputT>>>>>
{
 
-  @Override public void translateTransform(
+  @Override
+  public void translateTransform(
       PTransform<PCollection<KV<K, InputT>>, PCollection<KV<K, Iterable<InputT>>>>
transform,
-      TranslationContext context) {
-
-  }
+      TranslationContext context) {}
 }
diff --git a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchParDoTranslator.java
b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchParDoTranslator.java
index 6e7f342..56aa504 100644
--- a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchParDoTranslator.java
+++ b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchParDoTranslator.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.beam.runners.spark.structuredstreaming.translation.batch;
 
 import org.apache.beam.runners.spark.structuredstreaming.translation.TransformTranslator;
@@ -6,11 +23,10 @@ import org.apache.beam.sdk.transforms.PTransform;
 import org.apache.beam.sdk.values.PCollection;
 import org.apache.beam.sdk.values.PCollectionTuple;
 
-class BatchParDoTranslator<InputT, OutputT> implements
-    TransformTranslator<PTransform<PCollection<InputT>, PCollectionTuple>>
{
+class BatchParDoTranslator<InputT, OutputT>
+    implements TransformTranslator<PTransform<PCollection<InputT>, PCollectionTuple>>
{
 
-  @Override public void translateTransform(PTransform<PCollection<InputT>, PCollectionTuple>
transform,
-      TranslationContext context) {
-
-  }
+  @Override
+  public void translateTransform(
+      PTransform<PCollection<InputT>, PCollectionTuple> transform, TranslationContext
context) {}
 }
diff --git a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchPipelineTranslator.java
b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchPipelineTranslator.java
index 38324c0..6648539 100644
--- a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchPipelineTranslator.java
+++ b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchPipelineTranslator.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.beam.runners.spark.structuredstreaming.translation.batch;
 
 import java.util.HashMap;
@@ -11,13 +28,13 @@ import org.apache.beam.sdk.Pipeline;
 import org.apache.beam.sdk.runners.TransformHierarchy;
 import org.apache.beam.sdk.transforms.PTransform;
 
-/** {@link PipelineTranslator} for executing a {@link Pipeline} in Spark in batch mode.
- * This contains only the components specific to batch: {@link BatchTranslationContext},
- * registry of batch {@link TransformTranslator} and registry lookup code. */
-
+/**
+ * {@link PipelineTranslator} for executing a {@link Pipeline} in Spark in batch mode. This
contains
+ * only the components specific to batch: {@link BatchTranslationContext}, registry of batch
{@link
+ * TransformTranslator} and registry lookup code.
+ */
 public class BatchPipelineTranslator extends PipelineTranslator {
 
-
   // --------------------------------------------------------------------------------------------
   //  Transform Translator Registry
   // --------------------------------------------------------------------------------------------
@@ -26,21 +43,23 @@ public class BatchPipelineTranslator extends PipelineTranslator {
   private static final Map<String, TransformTranslator> TRANSFORM_TRANSLATORS = new
HashMap<>();
 
   static {
-    TRANSFORM_TRANSLATORS.put(PTransformTranslation.COMBINE_PER_KEY_TRANSFORM_URN,
-        new BatchCombinePerKeyTranslator());
-    TRANSFORM_TRANSLATORS
-        .put(PTransformTranslation.GROUP_BY_KEY_TRANSFORM_URN, new BatchGroupByKeyTranslator());
+    TRANSFORM_TRANSLATORS.put(
+        PTransformTranslation.COMBINE_PER_KEY_TRANSFORM_URN, new BatchCombinePerKeyTranslator());
+    TRANSFORM_TRANSLATORS.put(
+        PTransformTranslation.GROUP_BY_KEY_TRANSFORM_URN, new BatchGroupByKeyTranslator());
     TRANSFORM_TRANSLATORS.put(PTransformTranslation.RESHUFFLE_URN, new BatchReshuffleTranslator());
 
-    TRANSFORM_TRANSLATORS
-        .put(PTransformTranslation.FLATTEN_TRANSFORM_URN, new BatchFlattenPCollectionTranslator());
+    TRANSFORM_TRANSLATORS.put(
+        PTransformTranslation.FLATTEN_TRANSFORM_URN, new BatchFlattenPCollectionTranslator());
 
-    TRANSFORM_TRANSLATORS
-        .put(PTransformTranslation.ASSIGN_WINDOWS_TRANSFORM_URN, new BatchWindowAssignTranslator());
+    TRANSFORM_TRANSLATORS.put(
+        PTransformTranslation.ASSIGN_WINDOWS_TRANSFORM_URN, new BatchWindowAssignTranslator());
 
-    TRANSFORM_TRANSLATORS.put(PTransformTranslation.PAR_DO_TRANSFORM_URN, new BatchParDoTranslator());
+    TRANSFORM_TRANSLATORS.put(
+        PTransformTranslation.PAR_DO_TRANSFORM_URN, new BatchParDoTranslator());
 
-    TRANSFORM_TRANSLATORS.put(PTransformTranslation.READ_TRANSFORM_URN, new BatchReadSourceTranslator());
+    TRANSFORM_TRANSLATORS.put(
+        PTransformTranslation.READ_TRANSFORM_URN, new BatchReadSourceTranslator());
   }
 
   public BatchPipelineTranslator(SparkPipelineOptions options) {
@@ -58,6 +77,4 @@ public class BatchPipelineTranslator extends PipelineTranslator {
     @Nullable String urn = PTransformTranslation.urnForTransformOrNull(transform);
     return (urn == null) ? null : TRANSFORM_TRANSLATORS.get(urn);
   }
-
-
 }
diff --git a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchReadSourceTranslator.java
b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchReadSourceTranslator.java
index 4236b1c..d9fcfbb 100644
--- a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchReadSourceTranslator.java
+++ b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchReadSourceTranslator.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.beam.runners.spark.structuredstreaming.translation.batch;
 
 import org.apache.beam.runners.spark.structuredstreaming.translation.TransformTranslator;
@@ -6,10 +23,10 @@ import org.apache.beam.sdk.transforms.PTransform;
 import org.apache.beam.sdk.values.PBegin;
 import org.apache.beam.sdk.values.PCollection;
 
-class BatchReadSourceTranslator<T> implements TransformTranslator<PTransform<PBegin,
PCollection<T>>> {
+class BatchReadSourceTranslator<T>
+    implements TransformTranslator<PTransform<PBegin, PCollection<T>>>
{
 
-  @Override public void translateTransform(PTransform<PBegin, PCollection<T>>
transform,
-      TranslationContext context) {
-
-  }
+  @Override
+  public void translateTransform(
+      PTransform<PBegin, PCollection<T>> transform, TranslationContext context)
{}
 }
diff --git a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchReshuffleTranslator.java
b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchReshuffleTranslator.java
index 5baa331..1423308 100644
--- a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchReshuffleTranslator.java
+++ b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchReshuffleTranslator.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.beam.runners.spark.structuredstreaming.translation.batch;
 
 import org.apache.beam.runners.spark.structuredstreaming.translation.TransformTranslator;
@@ -6,7 +23,6 @@ import org.apache.beam.sdk.transforms.Reshuffle;
 
 class BatchReshuffleTranslator<K, InputT> implements TransformTranslator<Reshuffle<K,
InputT>> {
 
-  @Override public void translateTransform(Reshuffle<K, InputT> transform, TranslationContext
context) {
-
-  }
+  @Override
+  public void translateTransform(Reshuffle<K, InputT> transform, TranslationContext
context) {}
 }
diff --git a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchTranslationContext.java
b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchTranslationContext.java
index 02aad71..6f50895 100644
--- a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchTranslationContext.java
+++ b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchTranslationContext.java
@@ -1,18 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.beam.runners.spark.structuredstreaming.translation.batch;
 
 import java.util.HashMap;
 import java.util.Map;
 import org.apache.beam.runners.spark.structuredstreaming.SparkPipelineOptions;
 import org.apache.beam.runners.spark.structuredstreaming.translation.TranslationContext;
-import org.apache.beam.sdk.runners.AppliedPTransform;
 import org.apache.beam.sdk.values.PValue;
-import org.apache.spark.SparkConf;
 import org.apache.spark.sql.Dataset;
-import org.apache.spark.sql.SparkSession;
 
-/**
- * This class contains only batch specific context components.
- */
+/** This class contains only batch specific context components. */
 public class BatchTranslationContext extends TranslationContext {
 
   /**
diff --git a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchWindowAssignTranslator.java
b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchWindowAssignTranslator.java
index 1a8f68b..65a7cae 100644
--- a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchWindowAssignTranslator.java
+++ b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/batch/BatchWindowAssignTranslator.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.beam.runners.spark.structuredstreaming.translation.batch;
 
 import org.apache.beam.runners.spark.structuredstreaming.translation.TransformTranslator;
@@ -5,10 +22,10 @@ import org.apache.beam.runners.spark.structuredstreaming.translation.Translation
 import org.apache.beam.sdk.transforms.PTransform;
 import org.apache.beam.sdk.values.PCollection;
 
-class BatchWindowAssignTranslator<T> implements
-    TransformTranslator<PTransform<PCollection<T>, PCollection<T>>>
{
+class BatchWindowAssignTranslator<T>
+    implements TransformTranslator<PTransform<PCollection<T>, PCollection<T>>>
{
 
-  @Override public void translateTransform(PTransform<PCollection<T>, PCollection<T>>
transform,
-      TranslationContext context) {
-  }
+  @Override
+  public void translateTransform(
+      PTransform<PCollection<T>, PCollection<T>> transform, TranslationContext
context) {}
 }
diff --git a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/streaming/StreamingPipelineTranslator.java
b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/streaming/StreamingPipelineTranslator.java
index 9cbfbed..437aa25 100644
--- a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/streaming/StreamingPipelineTranslator.java
+++ b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/streaming/StreamingPipelineTranslator.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.beam.runners.spark.structuredstreaming.translation.streaming;
 
 import org.apache.beam.runners.spark.structuredstreaming.SparkPipelineOptions;
@@ -6,16 +23,17 @@ import org.apache.beam.runners.spark.structuredstreaming.translation.TransformTr
 import org.apache.beam.sdk.Pipeline;
 import org.apache.beam.sdk.runners.TransformHierarchy;
 
-/** {@link PipelineTranslator} for executing a {@link Pipeline} in Spark in streaming mode.
- * This contains only the components specific to streaming: {@link StreamingTranslationContext},
- * registry of batch {@link TransformTranslator} and registry lookup code. */
-
+/**
+ * {@link PipelineTranslator} for executing a {@link Pipeline} in Spark in streaming mode.
This
+ * contains only the components specific to streaming: {@link StreamingTranslationContext},
registry
+ * of batch {@link TransformTranslator} and registry lookup code.
+ */
 public class StreamingPipelineTranslator extends PipelineTranslator {
 
-  public StreamingPipelineTranslator(SparkPipelineOptions options) {
-  }
+  public StreamingPipelineTranslator(SparkPipelineOptions options) {}
 
-  @Override protected TransformTranslator<?> getTransformTranslator(TransformHierarchy.Node
node) {
+  @Override
+  protected TransformTranslator<?> getTransformTranslator(TransformHierarchy.Node node)
{
     return null;
   }
 }
diff --git a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/streaming/StreamingTranslationContext.java
b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/streaming/StreamingTranslationContext.java
index ebccfa7..f827cc4 100644
--- a/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/streaming/StreamingTranslationContext.java
+++ b/runners/spark-structured-streaming/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/streaming/StreamingTranslationContext.java
@@ -1,11 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.beam.runners.spark.structuredstreaming.translation.streaming;
 
 import org.apache.beam.runners.spark.structuredstreaming.SparkPipelineOptions;
 import org.apache.beam.runners.spark.structuredstreaming.translation.TranslationContext;
 
-/**
- * This class contains only streaming specific context components.
- */
+/** This class contains only streaming specific context components. */
 public class StreamingTranslationContext extends TranslationContext {
 
   public StreamingTranslationContext(SparkPipelineOptions options) {


Mime
View raw message