From a8c4c48d7ddc2d0fd880535d7c7d24bd4f63c0d8 Mon Sep 17 00:00:00 2001 From: Stephan Ewen Date: Sun, 13 Dec 2015 18:57:26 +0100 Subject: [PATCH] [hotfix] Remove unused FileDataSourceBase and FileDataSinkBase --- .../operators/base/FileDataSinkBase.java | 83 ------------------- .../operators/base/FileDataSourceBase.java | 81 ------------------ .../examples/WordCountCompilerTest.java | 2 - 3 files changed, 166 deletions(-) delete mode 100644 flink-core/src/main/java/org/apache/flink/api/common/operators/base/FileDataSinkBase.java delete mode 100644 flink-core/src/main/java/org/apache/flink/api/common/operators/base/FileDataSourceBase.java diff --git a/flink-core/src/main/java/org/apache/flink/api/common/operators/base/FileDataSinkBase.java b/flink-core/src/main/java/org/apache/flink/api/common/operators/base/FileDataSinkBase.java deleted file mode 100644 index 8f5c4e3eb17..00000000000 --- a/flink-core/src/main/java/org/apache/flink/api/common/operators/base/FileDataSinkBase.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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.flink.api.common.operators.base; - -import org.apache.flink.api.common.io.FileOutputFormat; -import org.apache.flink.api.common.operators.GenericDataSinkBase; -import org.apache.flink.api.common.operators.UnaryOperatorInformation; -import org.apache.flink.api.common.operators.util.UserCodeWrapper; -import org.apache.flink.types.Nothing; - -/** - * Operator for nodes which act as data sinks, storing the data they receive in a file instead of sending it to another - * contract. The encoding of the data in the file is handled by the {@link org.apache.flink.api.common.io.FileOutputFormat}. - * - * @see org.apache.flink.api.common.io.FileOutputFormat - */ -public class FileDataSinkBase extends GenericDataSinkBase { - - protected final String filePath; - - // -------------------------------------------------------------------------------------------- - - /** - * Creates a FileDataSink with the provided {@link org.apache.flink.api.common.io.FileOutputFormat} implementation - * and the given name, writing to the file indicated by the given path. - * - * @param f The {@link org.apache.flink.api.common.io.FileOutputFormat} implementation used to encode the data. - * @param filePath The path to the file to write the contents to. - * @param name The given name for the sink, used in plans, logs and progress messages. - */ - public FileDataSinkBase(FileOutputFormat f, UnaryOperatorInformation operatorInfo, String filePath, String name) { - super(f, operatorInfo, name); - this.filePath = filePath; - this.parameters.setString(FileOutputFormat.FILE_PARAMETER_KEY, filePath); - } - - /** - * Creates a FileDataSink with the provided {@link org.apache.flink.api.common.io.FileOutputFormat} implementation - * and the given name, writing to the file indicated by the given path. - * - * @param f The {@link org.apache.flink.api.common.io.FileOutputFormat} implementation used to encode the data. - * @param filePath The path to the file to write the contents to. - * @param name The given name for the sink, used in plans, logs and progress messages. - */ - public FileDataSinkBase(UserCodeWrapper> f, UnaryOperatorInformation operatorInfo, String filePath, String name) { - super(f, operatorInfo, name); - this.filePath = filePath; - this.parameters.setString(FileOutputFormat.FILE_PARAMETER_KEY, filePath); - } - - // -------------------------------------------------------------------------------------------- - - /** - * Returns the configured file path where the output is written to. - * - * @return The path to which the output shall be written. - */ - public String getFilePath() { - return this.filePath; - } - - - @Override - public String toString() { - return this.filePath; - } -} diff --git a/flink-core/src/main/java/org/apache/flink/api/common/operators/base/FileDataSourceBase.java b/flink-core/src/main/java/org/apache/flink/api/common/operators/base/FileDataSourceBase.java deleted file mode 100644 index 907819fb275..00000000000 --- a/flink-core/src/main/java/org/apache/flink/api/common/operators/base/FileDataSourceBase.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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.flink.api.common.operators.base; - -import org.apache.flink.api.common.io.FileInputFormat; -import org.apache.flink.api.common.operators.GenericDataSourceBase; -import org.apache.flink.api.common.operators.OperatorInformation; - -import com.google.common.base.Preconditions; - -/** - * Operator for input nodes which read data from files. - */ -public class FileDataSourceBase extends GenericDataSourceBase> { - - protected final String filePath; - - // -------------------------------------------------------------------------------------------- - - /** - * Creates a new instance for the given file using the given file input format. - * - * @param f The {@link org.apache.flink.api.common.io.FileInputFormat} implementation used to read the data. - * @param operatorInfo The type information for the output type. - * @param filePath The file location. The file path must be a fully qualified URI, including the address schema. - * @param name The given name for the Pact, used in plans, logs and progress messages. - */ - public FileDataSourceBase(FileInputFormat f, OperatorInformation operatorInfo, String filePath, String name) { - super(f, operatorInfo, name); - - Preconditions.checkNotNull(filePath, "The file path may not be null."); - - this.filePath = filePath; - f.setFilePath(filePath); - } - - /** - * Creates a new instance for the given file using the given input format. The contract has the default name. - * - * @param f The {@link org.apache.flink.api.common.io.FileInputFormat} implementation used to read the data. - * @param operatorInfo The type information for the output type. - * @param filePath The file location. The file path must be a fully qualified URI, including the address schema. - */ - public FileDataSourceBase(FileInputFormat f, OperatorInformation operatorInfo, String filePath) { - this(f, operatorInfo, Preconditions.checkNotNull(filePath, "The file path may not be null."), "File " + filePath); - } - - // -------------------------------------------------------------------------------------------- - - /** - * Returns the file path from which the input is read. - * - * @return The path from which the input shall be read. - */ - public String getFilePath() { - return this.filePath; - } - - // -------------------------------------------------------------------------------------------- - - public String toString() { - return this.filePath; - } -} diff --git a/flink-tests/src/test/java/org/apache/flink/test/optimizer/examples/WordCountCompilerTest.java b/flink-tests/src/test/java/org/apache/flink/test/optimizer/examples/WordCountCompilerTest.java index 576717f77d8..ab4928261b8 100644 --- a/flink-tests/src/test/java/org/apache/flink/test/optimizer/examples/WordCountCompilerTest.java +++ b/flink-tests/src/test/java/org/apache/flink/test/optimizer/examples/WordCountCompilerTest.java @@ -24,8 +24,6 @@ import org.apache.flink.api.common.ExecutionConfig; import org.apache.flink.api.common.Plan; import org.apache.flink.api.common.functions.MapFunction; import org.apache.flink.api.common.operators.GenericDataSourceBase; -import org.apache.flink.api.common.operators.Order; -import org.apache.flink.api.common.operators.base.FileDataSourceBase; import org.apache.flink.api.common.operators.util.FieldList; import org.apache.flink.api.java.DataSet; import org.apache.flink.api.java.ExecutionEnvironment; -- GitLab