Myasuka commented on a change in pull request #12078:
URL: https://github.com/apache/flink/pull/12078#discussion_r428672149
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/state/ttl/TtlMapStateAllEntriesTestContext.java
##########
@@ -66,4 +67,9 @@ public void update(Map<Integer, String> map) throws Exception
{
public Object getOriginal() throws Exception {
return ttlState.original.entries() == null ?
Collections.emptySet() : ttlState.original.entries();
}
+
+ @Override
+ public boolean isOriginalEmptyValue() throws Exception {
+ return !Sets.newHashSet(getOriginal()).equals(emptyValue);
Review comment:
Just wonder if this method check whether original state is empty value,
why we still need to return the opposite value? In other words, shall we just
return `Objects.equals(emptyValue, Sets.newHashSet(getOriginal()))`?
##########
File path:
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/collect/CollectSinkFunction.java
##########
@@ -229,7 +229,7 @@ public void open(Configuration parameters) throws Exception
{
// so that the client can know if the sink has been restarted
version = UUID.randomUUID().toString();
- serverThread = new ServerThread();
+ serverThread = new ServerThread(serializer);
Review comment:
Why we need to include this change?
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/state/ttl/TtlStateTestContextBase.java
##########
@@ -46,6 +46,10 @@
public abstract Object getOriginal() throws Exception;
+ public boolean isOriginalEmptyValue() throws Exception {
+ return getOriginal() == emptyValue ||
getOriginal().equals(emptyValue);
Review comment:
Why not just `Objects.equals(emptyValue, getOriginal())` ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]