You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by se...@apache.org on 2018/03/21 10:37:50 UTC
flink git commit: [hotfix] [core] Fix checkstyle in
'org.apache.flink.api.common.state'
Repository: flink
Updated Branches:
refs/heads/master f9df13c50 -> 363e8d2d6
[hotfix] [core] Fix checkstyle in 'org.apache.flink.api.common.state'
Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/363e8d2d
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/363e8d2d
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/363e8d2d
Branch: refs/heads/master
Commit: 363e8d2d6513e49929dfb280c3be420fb1af0bcd
Parents: f9df13c
Author: Stephan Ewen <se...@apache.org>
Authored: Tue Mar 20 15:15:08 2018 +0100
Committer: Stephan Ewen <se...@apache.org>
Committed: Wed Mar 21 11:37:29 2018 +0100
----------------------------------------------------------------------
.../api/common/state/AggregatingState.java | 10 +++---
.../state/AggregatingStateDescriptor.java | 6 ++--
.../flink/api/common/state/AppendingState.java | 26 +++++++--------
.../flink/api/common/state/BroadcastState.java | 4 +--
.../flink/api/common/state/FoldingState.java | 4 +--
.../common/state/FoldingStateDescriptor.java | 2 +-
.../flink/api/common/state/KeyedStateStore.java | 2 +-
.../flink/api/common/state/ListState.java | 9 +++---
.../api/common/state/ListStateDescriptor.java | 8 ++---
.../apache/flink/api/common/state/MapState.java | 16 ++++-----
.../api/common/state/MapStateDescriptor.java | 12 +++----
.../flink/api/common/state/MergingState.java | 2 +-
.../api/common/state/OperatorStateStore.java | 11 ++-----
.../flink/api/common/state/ReducingState.java | 4 +--
.../common/state/ReducingStateDescriptor.java | 8 ++---
.../flink/api/common/state/StateBinder.java | 4 +--
.../flink/api/common/state/StateDescriptor.java | 12 +++----
.../flink/api/common/state/ValueState.java | 14 ++++----
.../api/common/state/ValueStateDescriptor.java | 9 +++---
.../state/AggregatingStateDescriptorTest.java | 8 +++--
.../common/state/ListStateDescriptorTest.java | 23 +++++++------
.../common/state/MapStateDescriptorTest.java | 19 ++++++-----
.../state/ReducingStateDescriptorTest.java | 34 +++++++++++---------
.../common/state/ValueStateDescriptorTest.java | 33 ++++++++++---------
tools/maven/suppressions-core.xml | 4 ---
25 files changed, 144 insertions(+), 140 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flink/blob/363e8d2d/flink-core/src/main/java/org/apache/flink/api/common/state/AggregatingState.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/api/common/state/AggregatingState.java b/flink-core/src/main/java/org/apache/flink/api/common/state/AggregatingState.java
index e69fdb4..5c72650 100644
--- a/flink-core/src/main/java/org/apache/flink/api/common/state/AggregatingState.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/state/AggregatingState.java
@@ -22,22 +22,22 @@ import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.api.common.functions.AggregateFunction;
/**
- * {@link State} interface for aggregating state, based on an
+ * {@link State} interface for aggregating state, based on an
* {@link AggregateFunction}. Elements that are added to this type of state will
* be eagerly pre-aggregated using a given {@code AggregateFunction}.
- *
+ *
* <p>The state holds internally always the accumulator type of the {@code AggregateFunction}.
- * When accessing the result of the state, the function's
+ * When accessing the result of the state, the function's
* {@link AggregateFunction#getResult(Object)} method.
*
* <p>The state is accessed and modified by user functions, and checkpointed consistently
* by the system as part of the distributed snapshots.
- *
+ *
* <p>The state is only accessible by functions applied on a {@code KeyedStream}. The key is
* automatically supplied by the system, so the function always sees the value mapped to the
* key of the current element. That way, the system can handle stream and state partitioning
* consistently together.
- *
+ *
* @param <IN> Type of the value added to the state.
* @param <OUT> Type of the value extracted from the state.
*/
http://git-wip-us.apache.org/repos/asf/flink/blob/363e8d2d/flink-core/src/main/java/org/apache/flink/api/common/state/AggregatingStateDescriptor.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/api/common/state/AggregatingStateDescriptor.java b/flink-core/src/main/java/org/apache/flink/api/common/state/AggregatingStateDescriptor.java
index b7378d6..6f6d2f9 100644
--- a/flink-core/src/main/java/org/apache/flink/api/common/state/AggregatingStateDescriptor.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/state/AggregatingStateDescriptor.java
@@ -30,7 +30,7 @@ import static org.apache.flink.util.Preconditions.checkNotNull;
*
* <p>The type internally stored in the state is the type of the {@code Accumulator} of the
* {@code AggregateFunction}.
- *
+ *
* @param <IN> The type of the values that are added to the state.
* @param <ACC> The type of the accumulator (intermediate aggregation state).
* @param <OUT> The type of the values that are returned from the state.
@@ -39,7 +39,7 @@ import static org.apache.flink.util.Preconditions.checkNotNull;
public class AggregatingStateDescriptor<IN, ACC, OUT> extends StateDescriptor<AggregatingState<IN, OUT>, ACC> {
private static final long serialVersionUID = 1L;
- /** The aggregation function for the state */
+ /** The aggregation function for the state. */
private final AggregateFunction<IN, ACC, OUT> aggFunction;
/**
@@ -49,7 +49,7 @@ public class AggregatingStateDescriptor<IN, ACC, OUT> extends StateDescriptor<Ag
* consider using the {@link #AggregatingStateDescriptor(String, AggregateFunction, TypeInformation)} constructor.
*
* @param name The (unique) name for the state.
- * @param aggFunction The {@code AggregateFunction} used to aggregate the state.
+ * @param aggFunction The {@code AggregateFunction} used to aggregate the state.
* @param stateType The type of the accumulator. The accumulator is stored in the state.
*/
public AggregatingStateDescriptor(
http://git-wip-us.apache.org/repos/asf/flink/blob/363e8d2d/flink-core/src/main/java/org/apache/flink/api/common/state/AppendingState.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/api/common/state/AppendingState.java b/flink-core/src/main/java/org/apache/flink/api/common/state/AppendingState.java
index 9723654..4624438 100644
--- a/flink-core/src/main/java/org/apache/flink/api/common/state/AppendingState.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/state/AppendingState.java
@@ -20,20 +20,18 @@ package org.apache.flink.api.common.state;
import org.apache.flink.annotation.PublicEvolving;
-import java.io.IOException;
-
/**
* Base interface for partitioned state that supports adding elements and inspecting the current
* state. Elements can either be kept in a buffer (list-like) or aggregated into one value.
*
* <p>The state is accessed and modified by user functions, and checkpointed consistently
* by the system as part of the distributed snapshots.
- *
+ *
* <p>The state is only accessible by functions applied on a {@code KeyedStream}. The key is
* automatically supplied by the system, so the function always sees the value mapped to the
* key of the current element. That way, the system can handle stream and state partitioning
* consistently together.
- *
+ *
* @param <IN> Type of the value that can be added to the state.
* @param <OUT> Type of the value that can be retrieved from the state.
*/
@@ -47,29 +45,27 @@ public interface AppendingState<IN, OUT> extends State {
* depends on the current operator input, as the operator maintains an
* independent state for each partition.
*
- * <p>
- * <b>NOTE TO IMPLEMENTERS:</b> if the state is empty, then this method
- * should return {@code null}.
- * </p>
+ * <p><b>NOTE TO IMPLEMENTERS:</b> if the state is empty, then this method
+ * should return {@code null}.
*
* @return The operator state value corresponding to the current input or {@code null}
* if the state is empty.
- *
+ *
* @throws Exception Thrown if the system cannot access the state.
*/
- OUT get() throws Exception ;
+ OUT get() throws Exception;
/**
* Updates the operator state accessible by {@link #get()} by adding the given value
* to the list of values. The next time {@link #get()} is called (for the same state
* partition) the returned state will represent the updated list.
*
- * If `null` is passed in, the state value will remain unchanged
- *
+ * <p>If null is passed in, the state value will remain unchanged.
+ *
* @param value The new value for the state.
- *
- * @throws IOException Thrown if the system cannot access the state.
+ *
+ * @throws Exception Thrown if the system cannot access the state.
*/
void add(IN value) throws Exception;
-
+
}
http://git-wip-us.apache.org/repos/asf/flink/blob/363e8d2d/flink-core/src/main/java/org/apache/flink/api/common/state/BroadcastState.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/api/common/state/BroadcastState.java b/flink-core/src/main/java/org/apache/flink/api/common/state/BroadcastState.java
index 0cece41..fcc8bbf 100644
--- a/flink-core/src/main/java/org/apache/flink/api/common/state/BroadcastState.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/state/BroadcastState.java
@@ -29,7 +29,7 @@ import java.util.Map;
*
* <p><b>CAUTION:</b> the user has to guarantee that all task instances store the same elements in this type of state.
*
- * <p> Each operator instance individually maintains and stores elements in the broadcast state. The fact that the
+ * <p>Each operator instance individually maintains and stores elements in the broadcast state. The fact that the
* incoming stream is a broadcast one guarantees that all instances see all the elements. Upon recovery
* or re-scaling, the same state is given to each of the instances. To avoid hotspots, each task reads its previous
* partition, and if there are more tasks (scale up), then the new instances read from the old instances in a round
@@ -80,7 +80,7 @@ public interface BroadcastState<K, V> extends ReadOnlyBroadcastState<K, V> {
Iterator<Map.Entry<K, V>> iterator() throws Exception;
/**
- * Returns all the mappings in the state
+ * Returns all the mappings in the state.
*
* @return An iterable view of all the key-value pairs in the state.
*
http://git-wip-us.apache.org/repos/asf/flink/blob/363e8d2d/flink-core/src/main/java/org/apache/flink/api/common/state/FoldingState.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/api/common/state/FoldingState.java b/flink-core/src/main/java/org/apache/flink/api/common/state/FoldingState.java
index df9a0c6..928e62b 100644
--- a/flink-core/src/main/java/org/apache/flink/api/common/state/FoldingState.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/state/FoldingState.java
@@ -27,12 +27,12 @@ import org.apache.flink.annotation.PublicEvolving;
*
* <p>The state is accessed and modified by user functions, and checkpointed consistently
* by the system as part of the distributed snapshots.
- *
+ *
* <p>The state is only accessible by functions applied on a {@code KeyedStream}. The key is
* automatically supplied by the system, so the function always sees the value mapped to the
* key of the current element. That way, the system can handle stream and state partitioning
* consistently together.
- *
+ *
* @param <T> Type of the values folded into the state
* @param <ACC> Type of the value in the state
*
http://git-wip-us.apache.org/repos/asf/flink/blob/363e8d2d/flink-core/src/main/java/org/apache/flink/api/common/state/FoldingStateDescriptor.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/api/common/state/FoldingStateDescriptor.java b/flink-core/src/main/java/org/apache/flink/api/common/state/FoldingStateDescriptor.java
index 0954047..261d1fe 100644
--- a/flink-core/src/main/java/org/apache/flink/api/common/state/FoldingStateDescriptor.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/state/FoldingStateDescriptor.java
@@ -98,7 +98,7 @@ public class FoldingStateDescriptor<T, ACC> extends StateDescriptor<FoldingState
}
// ------------------------------------------------------------------------
-
+
@Override
public FoldingState<T, ACC> bind(StateBinder stateBinder) throws Exception {
return stateBinder.createFoldingState(this);
http://git-wip-us.apache.org/repos/asf/flink/blob/363e8d2d/flink-core/src/main/java/org/apache/flink/api/common/state/KeyedStateStore.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/api/common/state/KeyedStateStore.java b/flink-core/src/main/java/org/apache/flink/api/common/state/KeyedStateStore.java
index a1038a8..e3726b6 100644
--- a/flink-core/src/main/java/org/apache/flink/api/common/state/KeyedStateStore.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/state/KeyedStateStore.java
@@ -281,5 +281,5 @@ public interface KeyedStateStore {
* function (function is not part of a KeyedStream).
*/
@PublicEvolving
- <UK, UV> MapState<UK,UV> getMapState(MapStateDescriptor<UK, UV> stateProperties);
+ <UK, UV> MapState<UK, UV> getMapState(MapStateDescriptor<UK, UV> stateProperties);
}
http://git-wip-us.apache.org/repos/asf/flink/blob/363e8d2d/flink-core/src/main/java/org/apache/flink/api/common/state/ListState.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/api/common/state/ListState.java b/flink-core/src/main/java/org/apache/flink/api/common/state/ListState.java
index 74f275b..254dc1d 100644
--- a/flink-core/src/main/java/org/apache/flink/api/common/state/ListState.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/state/ListState.java
@@ -26,22 +26,23 @@ import java.util.List;
* {@link State} interface for partitioned list state in Operations.
* The state is accessed and modified by user functions, and checkpointed consistently
* by the system as part of the distributed snapshots.
- *
+ *
* <p>The state is only accessible by functions applied on a {@code KeyedStream}. The key is
* automatically supplied by the system, so the function always sees the value mapped to the
* key of the current element. That way, the system can handle stream and state partitioning
* consistently together.
- *
+ *
* @param <T> Type of values that this list state keeps.
*/
@PublicEvolving
public interface ListState<T> extends MergingState<T, Iterable<T>> {
+
/**
* Updates the operator state accessible by {@link #get()} by updating existing values to
* to the given list of values. The next time {@link #get()} is called (for the same state
* partition) the returned state will represent the updated list.
*
- * If `null` or an empty list is passed in, the state value will be null
+ * <p>If null or an empty list is passed in, the state value will be null.
*
* @param values The new values for the state.
*
@@ -54,7 +55,7 @@ public interface ListState<T> extends MergingState<T, Iterable<T>> {
* to existing list of values. The next time {@link #get()} is called (for the same state
* partition) the returned state will represent the updated list.
*
- * If `null` or an empty list is passed in, the state value remains unchanged
+ * <p>If null or an empty list is passed in, the state value remains unchanged.
*
* @param values The new values to be added to the state.
*
http://git-wip-us.apache.org/repos/asf/flink/blob/363e8d2d/flink-core/src/main/java/org/apache/flink/api/common/state/ListStateDescriptor.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/api/common/state/ListStateDescriptor.java b/flink-core/src/main/java/org/apache/flink/api/common/state/ListStateDescriptor.java
index e59d6ee..38e5680 100644
--- a/flink-core/src/main/java/org/apache/flink/api/common/state/ListStateDescriptor.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/state/ListStateDescriptor.java
@@ -29,12 +29,12 @@ import java.util.List;
/**
* A {@link StateDescriptor} for {@link ListState}. This can be used to create state where the type
* is a list that can be appended and iterated over.
- *
+ *
* <p>Using {@code ListState} is typically more efficient than manually maintaining a list in a
* {@link ValueState}, because the backing implementation can support efficient appends, rather than
* replacing the full list on write.
- *
- * <p>To create keyed list state (on a KeyedStream), use
+ *
+ * <p>To create keyed list state (on a KeyedStream), use
* {@link org.apache.flink.api.common.functions.RuntimeContext#getListState(ListStateDescriptor)}.
*
* @param <T> The type of the values that can be added to the list state.
@@ -85,7 +85,7 @@ public class ListStateDescriptor<T> extends StateDescriptor<ListState<T>, List<T
/**
* Gets the serializer for the elements contained in the list.
- *
+ *
* @return The serializer for the elements in the list.
*/
public TypeSerializer<T> getElementSerializer() {
http://git-wip-us.apache.org/repos/asf/flink/blob/363e8d2d/flink-core/src/main/java/org/apache/flink/api/common/state/MapState.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/api/common/state/MapState.java b/flink-core/src/main/java/org/apache/flink/api/common/state/MapState.java
index f37fddd..7a130d4 100644
--- a/flink-core/src/main/java/org/apache/flink/api/common/state/MapState.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/state/MapState.java
@@ -60,7 +60,7 @@ public interface MapState<UK, UV> extends State {
* @throws Exception Thrown if the system cannot access the state.
*/
void put(UK key, UV value) throws Exception;
-
+
/**
* Copies all of the mappings from the given map into the state.
*
@@ -90,19 +90,19 @@ public interface MapState<UK, UV> extends State {
boolean contains(UK key) throws Exception;
/**
- * Returns all the mappings in the state
+ * Returns all the mappings in the state.
*
* @return An iterable view of all the key-value pairs in the state.
- *
+ *
* @throws Exception Thrown if the system cannot access the state.
*/
Iterable<Map.Entry<UK, UV>> entries() throws Exception;
-
+
/**
- * Returns all the keys in the state
+ * Returns all the keys in the state.
*
* @return An iterable view of all the keys in the state.
- *
+ *
* @throws Exception Thrown if the system cannot access the state.
*/
Iterable<UK> keys() throws Exception;
@@ -111,7 +111,7 @@ public interface MapState<UK, UV> extends State {
* Returns all the values in the state.
*
* @return An iterable view of all the values in the state.
- *
+ *
* @throws Exception Thrown if the system cannot access the state.
*/
Iterable<UV> values() throws Exception;
@@ -120,7 +120,7 @@ public interface MapState<UK, UV> extends State {
* Iterates over all the mappings in the state.
*
* @return An iterator over all the mappings in the state
- *
+ *
* @throws Exception Thrown if the system cannot access the state.
*/
Iterator<Map.Entry<UK, UV>> iterator() throws Exception;
http://git-wip-us.apache.org/repos/asf/flink/blob/363e8d2d/flink-core/src/main/java/org/apache/flink/api/common/state/MapStateDescriptor.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/api/common/state/MapStateDescriptor.java b/flink-core/src/main/java/org/apache/flink/api/common/state/MapStateDescriptor.java
index 16c00cb..2e7ac98 100644
--- a/flink-core/src/main/java/org/apache/flink/api/common/state/MapStateDescriptor.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/state/MapStateDescriptor.java
@@ -29,12 +29,12 @@ import java.util.Map;
/**
* A {@link StateDescriptor} for {@link MapState}. This can be used to create state where the type
* is a map that can be updated and iterated over.
- *
+ *
* <p>Using {@code MapState} is typically more efficient than manually maintaining a map in a
* {@link ValueState}, because the backing implementation can support efficient updates, rather then
* replacing the full map on write.
- *
- * <p>To create keyed map state (on a KeyedStream), use
+ *
+ * <p>To create keyed map state (on a KeyedStream), use
* {@link org.apache.flink.api.common.functions.RuntimeContext#getMapState(MapStateDescriptor)}.
*
* @param <UK> The type of the keys that can be added to the map state.
@@ -90,7 +90,7 @@ public class MapStateDescriptor<UK, UV> extends StateDescriptor<MapState<UK, UV>
/**
* Gets the serializer for the keys in the state.
- *
+ *
* @return The serializer for the keys in the state.
*/
public TypeSerializer<UK> getKeySerializer() {
@@ -115,7 +115,7 @@ public class MapStateDescriptor<UK, UV> extends StateDescriptor<MapState<UK, UV>
return ((MapSerializer<UK, UV>) rawSerializer).getValueSerializer();
}
-
+
@Override
public int hashCode() {
int result = serializer.hashCode();
@@ -128,7 +128,7 @@ public class MapStateDescriptor<UK, UV> extends StateDescriptor<MapState<UK, UV>
if (this == o) {
return true;
}
-
+
if (o == null || getClass() != o.getClass()) {
return false;
}
http://git-wip-us.apache.org/repos/asf/flink/blob/363e8d2d/flink-core/src/main/java/org/apache/flink/api/common/state/MergingState.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/api/common/state/MergingState.java b/flink-core/src/main/java/org/apache/flink/api/common/state/MergingState.java
index e79f907..8c16313 100644
--- a/flink-core/src/main/java/org/apache/flink/api/common/state/MergingState.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/state/MergingState.java
@@ -24,7 +24,7 @@ import org.apache.flink.annotation.PublicEvolving;
* Extension of {@link AppendingState} that allows merging of state. That is, two instances
* of {@link MergingState} can be combined into a single instance that contains all the
* information of the two merged states.
- *
+ *
* @param <IN> Type of the value that can be added to the state.
* @param <OUT> Type of the value that can be retrieved from the state.
*/
http://git-wip-us.apache.org/repos/asf/flink/blob/363e8d2d/flink-core/src/main/java/org/apache/flink/api/common/state/OperatorStateStore.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/api/common/state/OperatorStateStore.java b/flink-core/src/main/java/org/apache/flink/api/common/state/OperatorStateStore.java
index c2037e0..7a998e6 100644
--- a/flink-core/src/main/java/org/apache/flink/api/common/state/OperatorStateStore.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/state/OperatorStateStore.java
@@ -49,8 +49,7 @@ public interface OperatorStateStore {
* @param <K> The type of the keys in the broadcast state.
* @param <V> The type of the values in the broadcast state.
*
- * @return The {@link BroadcastState Broadcast State}.
- * @throws Exception
+ * @return The Broadcast State
*/
<K, V> BroadcastState<K, V> getBroadcastState(MapStateDescriptor<K, V> stateDescriptor) throws Exception;
@@ -73,7 +72,6 @@ public interface OperatorStateStore {
* @param <S> The generic type of the state
*
* @return A list for all state partitions.
- * @throws Exception
*/
<S> ListState<S> getListState(ListStateDescriptor<S> stateDescriptor) throws Exception;
@@ -97,7 +95,6 @@ public interface OperatorStateStore {
* @param <S> The generic type of the state
*
* @return A list for all state partitions.
- * @throws Exception
*/
<S> ListState<S> getUnionListState(ListStateDescriptor<S> stateDescriptor) throws Exception;
@@ -123,13 +120,12 @@ public interface OperatorStateStore {
* Creates (or restores) a list state. Each state is registered under a unique name.
* The provided serializer is used to de/serialize the state in case of checkpointing (snapshot/restore).
*
- * The items in the list are repartitionable by the system in case of changed operator parallelism.
+ * <p>The items in the list are repartitionable by the system in case of changed operator parallelism.
*
* @param stateDescriptor The descriptor for this state, providing a name and serializer.
* @param <S> The generic type of the state
*
* @return A list for all state partitions.
- * @throws Exception
*
* @deprecated since 1.3.0. This was deprecated as part of a refinement to the function names.
* Please use {@link #getListState(ListStateDescriptor)} instead.
@@ -140,13 +136,12 @@ public interface OperatorStateStore {
/**
* Creates a state of the given name that uses Java serialization to persist the state. The items in the list
* are repartitionable by the system in case of changed operator parallelism.
- *
+ *
* <p>This is a simple convenience method. For more flexibility on how state serialization
* should happen, use the {@link #getListState(ListStateDescriptor)} method.
*
* @param stateName The name of state to create
* @return A list state using Java serialization to serialize state objects.
- * @throws Exception
*
* @deprecated since 1.3.0. Using Java serialization for persisting state is not encouraged.
* Please use {@link #getListState(ListStateDescriptor)} instead.
http://git-wip-us.apache.org/repos/asf/flink/blob/363e8d2d/flink-core/src/main/java/org/apache/flink/api/common/state/ReducingState.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/api/common/state/ReducingState.java b/flink-core/src/main/java/org/apache/flink/api/common/state/ReducingState.java
index 25777eb..0fe3ed9 100644
--- a/flink-core/src/main/java/org/apache/flink/api/common/state/ReducingState.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/state/ReducingState.java
@@ -26,12 +26,12 @@ import org.apache.flink.annotation.PublicEvolving;
*
* <p>The state is accessed and modified by user functions, and checkpointed consistently
* by the system as part of the distributed snapshots.
- *
+ *
* <p>The state is only accessible by functions applied on a {@code KeyedStream}. The key is
* automatically supplied by the system, so the function always sees the value mapped to the
* key of the current element. That way, the system can handle stream and state partitioning
* consistently together.
- *
+ *
* @param <T> Type of the value in the operator state
*/
@PublicEvolving
http://git-wip-us.apache.org/repos/asf/flink/blob/363e8d2d/flink-core/src/main/java/org/apache/flink/api/common/state/ReducingStateDescriptor.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/api/common/state/ReducingStateDescriptor.java b/flink-core/src/main/java/org/apache/flink/api/common/state/ReducingStateDescriptor.java
index 3edf1ca..a14b4bd 100644
--- a/flink-core/src/main/java/org/apache/flink/api/common/state/ReducingStateDescriptor.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/state/ReducingStateDescriptor.java
@@ -35,9 +35,9 @@ import static java.util.Objects.requireNonNull;
*/
@PublicEvolving
public class ReducingStateDescriptor<T> extends StateDescriptor<ReducingState<T>, T> {
+
private static final long serialVersionUID = 1L;
-
-
+
private final ReduceFunction<T> reduceFunction;
/**
@@ -47,7 +47,7 @@ public class ReducingStateDescriptor<T> extends StateDescriptor<ReducingState<T>
* consider using the {@link #ReducingStateDescriptor(String, ReduceFunction, TypeInformation)} constructor.
*
* @param name The (unique) name for the state.
- * @param reduceFunction The {@code ReduceFunction} used to aggregate the state.
+ * @param reduceFunction The {@code ReduceFunction} used to aggregate the state.
* @param typeClass The type of the values in the state.
*/
public ReducingStateDescriptor(String name, ReduceFunction<T> reduceFunction, Class<T> typeClass) {
@@ -84,7 +84,7 @@ public class ReducingStateDescriptor<T> extends StateDescriptor<ReducingState<T>
}
// ------------------------------------------------------------------------
-
+
@Override
public ReducingState<T> bind(StateBinder stateBinder) throws Exception {
return stateBinder.createReducingState(this);
http://git-wip-us.apache.org/repos/asf/flink/blob/363e8d2d/flink-core/src/main/java/org/apache/flink/api/common/state/StateBinder.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/api/common/state/StateBinder.java b/flink-core/src/main/java/org/apache/flink/api/common/state/StateBinder.java
index a1f7d8d..871b4a8 100644
--- a/flink-core/src/main/java/org/apache/flink/api/common/state/StateBinder.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/state/StateBinder.java
@@ -56,8 +56,8 @@ public interface StateBinder {
* @param stateDesc The {@code StateDescriptor} that contains the name of the state.
*
* @param <IN> The type of the values that go into the aggregating state
- * @param <ACC> The type of the values that are stored in the aggregating state
- * @param <OUT> The type of the values that come out of the aggregating state
+ * @param <ACC> The type of the values that are stored in the aggregating state
+ * @param <OUT> The type of the values that come out of the aggregating state
*/
<IN, ACC, OUT> AggregatingState<IN, OUT> createAggregatingState(
AggregatingStateDescriptor<IN, ACC, OUT> stateDesc) throws Exception;
http://git-wip-us.apache.org/repos/asf/flink/blob/363e8d2d/flink-core/src/main/java/org/apache/flink/api/common/state/StateDescriptor.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/api/common/state/StateDescriptor.java b/flink-core/src/main/java/org/apache/flink/api/common/state/StateDescriptor.java
index b603c71..841f710 100644
--- a/flink-core/src/main/java/org/apache/flink/api/common/state/StateDescriptor.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/state/StateDescriptor.java
@@ -82,7 +82,7 @@ public abstract class StateDescriptor<S extends State, T> implements Serializabl
/** Name for queries against state created from this StateDescriptor. */
private String queryableStateName;
- /** The default value returned by the state when no other value is bound to a key */
+ /** The default value returned by the state when no other value is bound to a key. */
protected transient T defaultValue;
/** The type information describing the value type. Only used to lazily create the serializer
@@ -111,7 +111,7 @@ public abstract class StateDescriptor<S extends State, T> implements Serializabl
* @param name The name of the {@code StateDescriptor}.
* @param typeInfo The type information for the values in the state.
* @param defaultValue The default value that will be set when requesting state without setting
- * a value before.
+ * a value before.
*/
protected StateDescriptor(String name, TypeInformation<T> typeInfo, T defaultValue) {
this.name = requireNonNull(name, "name must not be null");
@@ -301,8 +301,8 @@ public abstract class StateDescriptor<S extends State, T> implements Serializabl
byte[] serializedDefaultValue;
try (ByteArrayOutputStream baos = new ByteArrayOutputStream();
- DataOutputViewStreamWrapper outView = new DataOutputViewStreamWrapper(baos))
- {
+ DataOutputViewStreamWrapper outView = new DataOutputViewStreamWrapper(baos)) {
+
TypeSerializer<T> duplicateSerializer = serializer.duplicate();
duplicateSerializer.serialize(defaultValue, outView);
@@ -333,8 +333,8 @@ public abstract class StateDescriptor<S extends State, T> implements Serializabl
in.readFully(buffer);
try (ByteArrayInputStream bais = new ByteArrayInputStream(buffer);
- DataInputViewStreamWrapper inView = new DataInputViewStreamWrapper(bais))
- {
+ DataInputViewStreamWrapper inView = new DataInputViewStreamWrapper(bais)) {
+
defaultValue = serializer.deserialize(inView);
}
catch (Exception e) {
http://git-wip-us.apache.org/repos/asf/flink/blob/363e8d2d/flink-core/src/main/java/org/apache/flink/api/common/state/ValueState.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/api/common/state/ValueState.java b/flink-core/src/main/java/org/apache/flink/api/common/state/ValueState.java
index ac55715..777e84a 100644
--- a/flink-core/src/main/java/org/apache/flink/api/common/state/ValueState.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/state/ValueState.java
@@ -28,12 +28,12 @@ import java.io.IOException;
*
* <p>The state is accessed and modified by user functions, and checkpointed consistently
* by the system as part of the distributed snapshots.
- *
+ *
* <p>The state is only accessible by functions applied on a {@code KeyedStream}. The key is
* automatically supplied by the system, so the function always sees the value mapped to the
* key of the current element. That way, the system can handle stream and state partitioning
* consistently together.
- *
+ *
* @param <T> Type of the value in the state.
*/
@PublicEvolving
@@ -50,7 +50,7 @@ public interface ValueState<T> extends State {
* this will return {@code null} when to value was previously set using {@link #update(Object)}.
*
* @return The state value corresponding to the current input.
- *
+ *
* @throws IOException Thrown if the system cannot access the state.
*/
T value() throws IOException;
@@ -59,13 +59,13 @@ public interface ValueState<T> extends State {
* Updates the operator state accessible by {@link #value()} to the given
* value. The next time {@link #value()} is called (for the same state
* partition) the returned state will represent the updated value. When a
- * partitioned state is updated with null, the state for the current key
+ * partitioned state is updated with null, the state for the current key
* will be removed and the default value is returned on the next access.
- *
+ *
* @param value The new value for the state.
- *
+ *
* @throws IOException Thrown if the system cannot access the state.
*/
void update(T value) throws IOException;
-
+
}
http://git-wip-us.apache.org/repos/asf/flink/blob/363e8d2d/flink-core/src/main/java/org/apache/flink/api/common/state/ValueStateDescriptor.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/api/common/state/ValueStateDescriptor.java b/flink-core/src/main/java/org/apache/flink/api/common/state/ValueStateDescriptor.java
index 3afc8a7..ef18d74 100644
--- a/flink-core/src/main/java/org/apache/flink/api/common/state/ValueStateDescriptor.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/state/ValueStateDescriptor.java
@@ -34,11 +34,12 @@ import org.apache.flink.api.common.typeutils.TypeSerializer;
*/
@PublicEvolving
public class ValueStateDescriptor<T> extends StateDescriptor<ValueState<T>, T> {
+
private static final long serialVersionUID = 1L;
-
+
/**
* Creates a new {@code ValueStateDescriptor} with the given name, type, and default value.
- *
+ *
* <p>If this constructor fails (because it is not possible to describe the type via a class),
* consider using the {@link #ValueStateDescriptor(String, TypeInformation, Object)} constructor.
*
@@ -46,7 +47,7 @@ public class ValueStateDescriptor<T> extends StateDescriptor<ValueState<T>, T> {
* the default value by checking whether the contents of the state is {@code null}.
*
* @param name The (unique) name for the state.
- * @param typeClass The type of the values in the state.
+ * @param typeClass The type of the values in the state.
* @param defaultValue The default value that will be set when requesting state without setting
* a value before.
*/
@@ -122,7 +123,7 @@ public class ValueStateDescriptor<T> extends StateDescriptor<ValueState<T>, T> {
}
// ------------------------------------------------------------------------
-
+
@Override
public ValueState<T> bind(StateBinder stateBinder) throws Exception {
return stateBinder.createValueState(this);
http://git-wip-us.apache.org/repos/asf/flink/blob/363e8d2d/flink-core/src/test/java/org/apache/flink/api/common/state/AggregatingStateDescriptorTest.java
----------------------------------------------------------------------
diff --git a/flink-core/src/test/java/org/apache/flink/api/common/state/AggregatingStateDescriptorTest.java b/flink-core/src/test/java/org/apache/flink/api/common/state/AggregatingStateDescriptorTest.java
index 1b27ebd..155f23a 100644
--- a/flink-core/src/test/java/org/apache/flink/api/common/state/AggregatingStateDescriptorTest.java
+++ b/flink-core/src/test/java/org/apache/flink/api/common/state/AggregatingStateDescriptorTest.java
@@ -21,6 +21,7 @@ package org.apache.flink.api.common.state;
import org.apache.flink.api.common.functions.AggregateFunction;
import org.apache.flink.api.common.typeutils.TypeSerializer;
import org.apache.flink.util.TestLogger;
+
import org.junit.Test;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
@@ -29,12 +30,15 @@ import static org.junit.Assert.assertNotSame;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
+/**
+ * Tests for the {@link AggregatingStateDescriptor}.
+ */
public class AggregatingStateDescriptorTest extends TestLogger {
/**
- * FLINK-6775
+ * FLINK-6775.
*
- * Tests that the returned serializer is duplicated. This allows to
+ * <p>Tests that the returned serializer is duplicated. This allows to
* share the state descriptor.
*/
@SuppressWarnings("unchecked")
http://git-wip-us.apache.org/repos/asf/flink/blob/363e8d2d/flink-core/src/test/java/org/apache/flink/api/common/state/ListStateDescriptorTest.java
----------------------------------------------------------------------
diff --git a/flink-core/src/test/java/org/apache/flink/api/common/state/ListStateDescriptorTest.java b/flink-core/src/test/java/org/apache/flink/api/common/state/ListStateDescriptorTest.java
index 0b230ad..c6d086e 100644
--- a/flink-core/src/test/java/org/apache/flink/api/common/state/ListStateDescriptorTest.java
+++ b/flink-core/src/test/java/org/apache/flink/api/common/state/ListStateDescriptorTest.java
@@ -41,16 +41,19 @@ import static org.junit.Assert.fail;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
+/**
+ * Tests for the {@link ListStateDescriptor}.
+ */
public class ListStateDescriptorTest {
-
+
@Test
public void testValueStateDescriptorEagerSerializer() throws Exception {
TypeSerializer<String> serializer = new KryoSerializer<>(String.class, new ExecutionConfig());
-
- ListStateDescriptor<String> descr =
- new ListStateDescriptor<String>("testName", serializer);
-
+
+ ListStateDescriptor<String> descr =
+ new ListStateDescriptor<>("testName", serializer);
+
assertEquals("testName", descr.getName());
assertNotNull(descr.getSerializer());
assertTrue(descr.getSerializer() instanceof ListSerializer);
@@ -74,8 +77,8 @@ public class ListStateDescriptorTest {
cfg.registerKryoType(TaskInfo.class);
ListStateDescriptor<Path> descr =
- new ListStateDescriptor<Path>("testName", Path.class);
-
+ new ListStateDescriptor<>("testName", Path.class);
+
try {
descr.getSerializer();
fail("should cause an exception");
@@ -96,7 +99,7 @@ public class ListStateDescriptorTest {
public void testValueStateDescriptorAutoSerializer() throws Exception {
ListStateDescriptor<String> descr =
- new ListStateDescriptor<String>("testName", String.class);
+ new ListStateDescriptor<>("testName", String.class);
ListStateDescriptor<String> copy = CommonTestUtils.createCopySerializable(descr);
@@ -110,9 +113,9 @@ public class ListStateDescriptorTest {
}
/**
- * FLINK-6775
+ * FLINK-6775.
*
- * Tests that the returned serializer is duplicated. This allows to
+ * <p>Tests that the returned serializer is duplicated. This allows to
* share the state descriptor.
*/
@SuppressWarnings("unchecked")
http://git-wip-us.apache.org/repos/asf/flink/blob/363e8d2d/flink-core/src/test/java/org/apache/flink/api/common/state/MapStateDescriptorTest.java
----------------------------------------------------------------------
diff --git a/flink-core/src/test/java/org/apache/flink/api/common/state/MapStateDescriptorTest.java b/flink-core/src/test/java/org/apache/flink/api/common/state/MapStateDescriptorTest.java
index d710911..e2aa940 100644
--- a/flink-core/src/test/java/org/apache/flink/api/common/state/MapStateDescriptorTest.java
+++ b/flink-core/src/test/java/org/apache/flink/api/common/state/MapStateDescriptorTest.java
@@ -42,17 +42,20 @@ import static org.junit.Assert.fail;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
+/**
+ * Tests for the {@link MapStateDescriptor}.
+ */
public class MapStateDescriptorTest {
-
+
@Test
public void testMapStateDescriptorEagerSerializer() throws Exception {
TypeSerializer<Integer> keySerializer = new KryoSerializer<>(Integer.class, new ExecutionConfig());
TypeSerializer<String> valueSerializer = new KryoSerializer<>(String.class, new ExecutionConfig());
-
- MapStateDescriptor<Integer, String> descr =
+
+ MapStateDescriptor<Integer, String> descr =
new MapStateDescriptor<>("testName", keySerializer, valueSerializer);
-
+
assertEquals("testName", descr.getName());
assertNotNull(descr.getSerializer());
assertTrue(descr.getSerializer() instanceof MapSerializer);
@@ -81,7 +84,7 @@ public class MapStateDescriptorTest {
MapStateDescriptor<Path, String> descr =
new MapStateDescriptor<>("testName", Path.class, String.class);
-
+
try {
descr.getSerializer();
fail("should cause an exception");
@@ -96,7 +99,7 @@ public class MapStateDescriptorTest {
assertTrue(descr.getKeySerializer() instanceof KryoSerializer);
assertTrue(((KryoSerializer<?>) descr.getKeySerializer()).getKryo().getRegistration(TaskInfo.class).getId() > 0);
-
+
assertNotNull(descr.getValueSerializer());
assertTrue(descr.getValueSerializer() instanceof StringSerializer);
}
@@ -121,9 +124,9 @@ public class MapStateDescriptorTest {
}
/**
- * FLINK-6775
+ * FLINK-6775.
*
- * Tests that the returned serializer is duplicated. This allows to
+ * <p>Tests that the returned serializer is duplicated. This allows to
* share the state descriptor.
*/
@SuppressWarnings("unchecked")
http://git-wip-us.apache.org/repos/asf/flink/blob/363e8d2d/flink-core/src/test/java/org/apache/flink/api/common/state/ReducingStateDescriptorTest.java
----------------------------------------------------------------------
diff --git a/flink-core/src/test/java/org/apache/flink/api/common/state/ReducingStateDescriptorTest.java b/flink-core/src/test/java/org/apache/flink/api/common/state/ReducingStateDescriptorTest.java
index aec7140..ef39f14 100644
--- a/flink-core/src/test/java/org/apache/flink/api/common/state/ReducingStateDescriptorTest.java
+++ b/flink-core/src/test/java/org/apache/flink/api/common/state/ReducingStateDescriptorTest.java
@@ -26,8 +26,8 @@ import org.apache.flink.api.common.typeutils.base.StringSerializer;
import org.apache.flink.api.java.typeutils.runtime.kryo.KryoSerializer;
import org.apache.flink.core.fs.Path;
import org.apache.flink.core.testutils.CommonTestUtils;
-
import org.apache.flink.util.TestLogger;
+
import org.junit.Test;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
@@ -36,24 +36,26 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertTrue;
-
import static org.junit.Assert.fail;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
+/**
+ * Tests for the {@link ReducingStateDescriptor}.
+ */
public class ReducingStateDescriptorTest extends TestLogger {
-
+
@Test
public void testValueStateDescriptorEagerSerializer() throws Exception {
@SuppressWarnings("unchecked")
- ReduceFunction<String> reducer = mock(ReduceFunction.class);
-
+ ReduceFunction<String> reducer = mock(ReduceFunction.class);
+
TypeSerializer<String> serializer = new KryoSerializer<>(String.class, new ExecutionConfig());
-
- ReducingStateDescriptor<String> descr =
- new ReducingStateDescriptor<String>("testName", reducer, serializer);
-
+
+ ReducingStateDescriptor<String> descr =
+ new ReducingStateDescriptor<>("testName", reducer, serializer);
+
assertEquals("testName", descr.getName());
assertNotNull(descr.getSerializer());
assertEquals(serializer, descr.getSerializer());
@@ -70,13 +72,13 @@ public class ReducingStateDescriptorTest extends TestLogger {
@SuppressWarnings("unchecked")
ReduceFunction<Path> reducer = mock(ReduceFunction.class);
-
+
// some different registered value
ExecutionConfig cfg = new ExecutionConfig();
cfg.registerKryoType(TaskInfo.class);
ReducingStateDescriptor<Path> descr =
- new ReducingStateDescriptor<Path>("testName", reducer, Path.class);
+ new ReducingStateDescriptor<>("testName", reducer, Path.class);
try {
descr.getSerializer();
@@ -84,7 +86,7 @@ public class ReducingStateDescriptorTest extends TestLogger {
} catch (IllegalStateException ignored) {}
descr.initializeSerializerUnlessSet(cfg);
-
+
assertNotNull(descr.getSerializer());
assertTrue(descr.getSerializer() instanceof KryoSerializer);
@@ -98,7 +100,7 @@ public class ReducingStateDescriptorTest extends TestLogger {
ReduceFunction<String> reducer = mock(ReduceFunction.class);
ReducingStateDescriptor<String> descr =
- new ReducingStateDescriptor<String>("testName", reducer, String.class);
+ new ReducingStateDescriptor<>("testName", reducer, String.class);
ReducingStateDescriptor<String> copy = CommonTestUtils.createCopySerializable(descr);
@@ -108,9 +110,9 @@ public class ReducingStateDescriptorTest extends TestLogger {
}
/**
- * FLINK-6775
+ * FLINK-6775.
*
- * Tests that the returned serializer is duplicated. This allows to
+ * <p>Tests that the returned serializer is duplicated. This allows to
* share the state descriptor.
*/
@SuppressWarnings("unchecked")
@@ -134,5 +136,5 @@ public class ReducingStateDescriptorTest extends TestLogger {
// check that the retrieved serializers are not the same
assertNotSame(serializerA, serializerB);
}
-
+
}
http://git-wip-us.apache.org/repos/asf/flink/blob/363e8d2d/flink-core/src/test/java/org/apache/flink/api/common/state/ValueStateDescriptorTest.java
----------------------------------------------------------------------
diff --git a/flink-core/src/test/java/org/apache/flink/api/common/state/ValueStateDescriptorTest.java b/flink-core/src/test/java/org/apache/flink/api/common/state/ValueStateDescriptorTest.java
index e434e01..b43e5ad 100644
--- a/flink-core/src/test/java/org/apache/flink/api/common/state/ValueStateDescriptorTest.java
+++ b/flink-core/src/test/java/org/apache/flink/api/common/state/ValueStateDescriptorTest.java
@@ -26,8 +26,8 @@ import org.apache.flink.api.java.typeutils.runtime.kryo.KryoSerializer;
import org.apache.flink.configuration.ConfigConstants;
import org.apache.flink.core.fs.Path;
import org.apache.flink.core.testutils.CommonTestUtils;
-
import org.apache.flink.util.TestLogger;
+
import org.junit.Test;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
@@ -42,17 +42,20 @@ import static org.junit.Assert.fail;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
+/**
+ * Tests for the {@link ValueStateDescriptor}.
+ */
public class ValueStateDescriptorTest extends TestLogger {
-
+
@Test
public void testValueStateDescriptorEagerSerializer() throws Exception {
TypeSerializer<String> serializer = new KryoSerializer<>(String.class, new ExecutionConfig());
String defaultValue = "le-value-default";
-
- ValueStateDescriptor<String> descr =
- new ValueStateDescriptor<String>("testName", serializer, defaultValue);
-
+
+ ValueStateDescriptor<String> descr =
+ new ValueStateDescriptor<>("testName", serializer, defaultValue);
+
assertEquals("testName", descr.getName());
assertEquals(defaultValue, descr.getDefaultValue());
assertNotNull(descr.getSerializer());
@@ -68,16 +71,16 @@ public class ValueStateDescriptorTest extends TestLogger {
@Test
public void testValueStateDescriptorLazySerializer() throws Exception {
-
+
// some default value that goes to the generic serializer
Path defaultValue = new Path(new File(ConfigConstants.DEFAULT_TASK_MANAGER_TMP_PATH).toURI());
-
+
// some different registered value
ExecutionConfig cfg = new ExecutionConfig();
cfg.registerKryoType(TaskInfo.class);
ValueStateDescriptor<Path> descr =
- new ValueStateDescriptor<Path>("testName", Path.class, defaultValue);
+ new ValueStateDescriptor<>("testName", Path.class, defaultValue);
try {
descr.getSerializer();
@@ -85,7 +88,7 @@ public class ValueStateDescriptorTest extends TestLogger {
} catch (IllegalStateException ignored) {}
descr.initializeSerializerUnlessSet(cfg);
-
+
assertNotNull(descr.getSerializer());
assertTrue(descr.getSerializer() instanceof KryoSerializer);
@@ -94,11 +97,11 @@ public class ValueStateDescriptorTest extends TestLogger {
@Test
public void testValueStateDescriptorAutoSerializer() throws Exception {
-
+
String defaultValue = "le-value-default";
ValueStateDescriptor<String> descr =
- new ValueStateDescriptor<String>("testName", String.class, defaultValue);
+ new ValueStateDescriptor<>("testName", String.class, defaultValue);
ValueStateDescriptor<String> copy = CommonTestUtils.createCopySerializable(descr);
@@ -122,7 +125,7 @@ public class ValueStateDescriptorTest extends TestLogger {
String defaultValue = new String(data, ConfigConstants.DEFAULT_CHARSET);
ValueStateDescriptor<String> descr =
- new ValueStateDescriptor<String>("testName", serializer, defaultValue);
+ new ValueStateDescriptor<>("testName", serializer, defaultValue);
assertEquals("testName", descr.getName());
assertEquals(defaultValue, descr.getDefaultValue());
@@ -138,9 +141,9 @@ public class ValueStateDescriptorTest extends TestLogger {
}
/**
- * FLINK-6775
+ * FLINK-6775.
*
- * Tests that the returned serializer is duplicated. This allows to
+ * <p>Tests that the returned serializer is duplicated. This allows to
* share the state descriptor.
*/
@SuppressWarnings("unchecked")
http://git-wip-us.apache.org/repos/asf/flink/blob/363e8d2d/tools/maven/suppressions-core.xml
----------------------------------------------------------------------
diff --git a/tools/maven/suppressions-core.xml b/tools/maven/suppressions-core.xml
index e613fb0..ff9c203 100644
--- a/tools/maven/suppressions-core.xml
+++ b/tools/maven/suppressions-core.xml
@@ -72,10 +72,6 @@ under the License.
checks="AvoidStarImport"/>
<suppress
- files="(.*)api[/\\]common[/\\]state[/\\](.*)"
- checks="NewlineAtEndOfFile|RegexpSingleline|TodoComment|RedundantImport|ImportOrder|RedundantModifier|JavadocMethod|JavadocParagraph|JavadocType|JavadocStyle|PackageName|TypeNameCheck|ConstantNameCheck|StaticVariableNameCheck|MemberNameCheck|MethodNameCheck|ParameterName|LocalFinalVariableName|LocalVariableName|LeftCurly|UpperEll|FallThrough|reliefPattern|SimplifyBooleanExpression|EmptyStatement|ModifierOrder|EmptyLineSeparator|WhitespaceAround|WhitespaceAfter|NoWhitespaceAfter|NoWhitespaceBefore|OperatorWrap|ParenPad"/>
-
- <suppress
files="(.*)api[/\\]common[/\\]typeutils[/\\](.*)"
checks="NewlineAtEndOfFile|RegexpSingleline|TodoComment|RedundantImport|ImportOrder|RedundantModifier|JavadocMethod|JavadocParagraph|JavadocType|JavadocStyle|PackageName|TypeNameCheck|ConstantNameCheck|StaticVariableNameCheck|MemberNameCheck|MethodNameCheck|ParameterName|LocalFinalVariableName|LocalVariableName|LeftCurly|UpperEll|FallThrough|reliefPattern|SimplifyBooleanExpression|EmptyStatement|ModifierOrder|EmptyLineSeparator|WhitespaceAround|WhitespaceAfter|NoWhitespaceAfter|NoWhitespaceBefore|OperatorWrap|ParenPad"/>
<!--Only additional checks for test sources. Those checks were present in the "pre-strict" checkstyle but were not applied to test sources. We do not want to suppress them for sources directory-->