[hotfix] [streaming api] Add proper deprecation JavaDocs

Also includes minor style cleanup of a test.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/349d06d6
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/349d06d6
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/349d06d6

Branch: refs/heads/master
Commit: 349d06d6c67a4b48e8ec3b507a98616580a8d863
Parents: db45da7
Author: Stephan Ewen <se...@apache.org>
Authored: Tue Sep 20 18:53:46 2016 +0200
Committer: Stephan Ewen <se...@apache.org>
Committed: Wed Sep 21 17:53:32 2016 +0200

----------------------------------------------------------------------
 .../api/environment/StreamExecutionEnvironment.java   | 14 ++++++++++++--
 .../org/apache/flink/streaming/api/TypeFillTest.java  | 10 +++++-----
 2 files changed, 17 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/349d06d6/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java
----------------------------------------------------------------------
diff --git 
a/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java
 
b/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java
index 78aab97..06823d5 100644
--- 
a/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java
+++ 
b/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java
@@ -577,8 +577,8 @@ public abstract class StreamExecutionEnvironment {
         * @param serializerClass
         *              The class of the serializer to use.
         */
-       public void registerTypeWithKryoSerializer(Class<?> type,
-                       Class<? extends Serializer<?>> serializerClass) {
+       public void registerTypeWithKryoSerializer(Class<?> type, 
+                                       Class<? extends Serializer<?>> 
serializerClass) {
                config.registerTypeWithKryoSerializer(type, serializerClass);
        }
 
@@ -1094,8 +1094,11 @@ public abstract class StreamExecutionEnvironment {
         *              contents
         *              of files.
         * @return The DataStream containing the given directory.
+        * 
+        * @deprecated Use {@link #readFile(FileInputFormat, String, 
FileProcessingMode, long)} instead.
         */
        @Deprecated
+       @SuppressWarnings("deprecation")
        public DataStream<String> readFileStream(String filePath, long 
intervalMillis,
                                                                                
        FileMonitoringFunction.WatchType watchType) {
                DataStream<Tuple3<String, Long, Long>> source = addSource(new 
FileMonitoringFunction(
@@ -1169,6 +1172,8 @@ public abstract class StreamExecutionEnvironment {
         *              while
         *              a       negative value ensures retrying forever.
         * @return A data stream containing the strings received from the socket
+        * 
+        * @deprecated Use {@link #socketTextStream(String, int, String, long)} 
instead.
         */
        @Deprecated
        public DataStreamSource<String> socketTextStream(String hostname, int 
port, char delimiter, long maxRetry) {
@@ -1215,8 +1220,11 @@ public abstract class StreamExecutionEnvironment {
         * @param delimiter
         *              A character which splits received strings into records
         * @return A data stream containing the strings received from the socket
+        * 
+        * @deprecated Use {@link #socketTextStream(String, int, String)} 
instead.
         */
        @Deprecated
+       @SuppressWarnings("deprecation")
        public DataStreamSource<String> socketTextStream(String hostname, int 
port, char delimiter) {
                return socketTextStream(hostname, port, delimiter, 0);
        }
@@ -1313,7 +1321,9 @@ public abstract class StreamExecutionEnvironment {
                DataStreamSource<OUT> source;
 
                if (inputFormat instanceof FileInputFormat) {
+                       @SuppressWarnings("unchecked")
                        FileInputFormat<OUT> format = (FileInputFormat<OUT>) 
inputFormat;
+                       
                        source = createFileInput(format, typeInfo, "Custom File 
source",
                                FileProcessingMode.PROCESS_ONCE, -1);
                } else {

http://git-wip-us.apache.org/repos/asf/flink/blob/349d06d6/flink-streaming-java/src/test/java/org/apache/flink/streaming/api/TypeFillTest.java
----------------------------------------------------------------------
diff --git 
a/flink-streaming-java/src/test/java/org/apache/flink/streaming/api/TypeFillTest.java
 
b/flink-streaming-java/src/test/java/org/apache/flink/streaming/api/TypeFillTest.java
index d931f7b..a4abbcb 100644
--- 
a/flink-streaming-java/src/test/java/org/apache/flink/streaming/api/TypeFillTest.java
+++ 
b/flink-streaming-java/src/test/java/org/apache/flink/streaming/api/TypeFillTest.java
@@ -96,7 +96,7 @@ public class TypeFillTest {
 
        }
 
-       private class TestSource<T> implements SourceFunction<T> {
+       private static class TestSource<T> implements SourceFunction<T> {
                private static final long serialVersionUID = 1L;
 
                @Override
@@ -106,19 +106,19 @@ public class TypeFillTest {
                public void cancel() {}
        }
 
-       private class TestMap<T, O> implements MapFunction<T, O> {
+       private static class TestMap<T, O> implements MapFunction<T, O> {
                @Override
                public O map(T value) throws Exception {
                        return null;
                }
        }
 
-       private class TestFlatMap<T, O> implements FlatMapFunction<T, O> {
+       private static class TestFlatMap<T, O> implements FlatMapFunction<T, O> 
{
                @Override
                public void flatMap(T value, Collector<O> out) throws Exception 
{}
        }
 
-       private class TestCoMap<IN1, IN2, OUT> implements CoMapFunction<IN1, 
IN2, OUT> {
+       private static class TestCoMap<IN1, IN2, OUT> implements 
CoMapFunction<IN1, IN2, OUT> {
 
                @Override
                public OUT map1(IN1 value) {
@@ -132,7 +132,7 @@ public class TypeFillTest {
 
        }
 
-       private class TestCoFlatMap<IN1, IN2, OUT> implements 
CoFlatMapFunction<IN1, IN2, OUT> {
+       private static class TestCoFlatMap<IN1, IN2, OUT> implements 
CoFlatMapFunction<IN1, IN2, OUT> {
 
                @Override
                public void flatMap1(IN1 value, Collector<OUT> out) throws 
Exception {}

Reply via email to