You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/05/10 11:34:10 UTC

[GitHub] [flink] Vancior opened a new pull request, #19687: [FLINK-27560][python] Refactor SimpleStateRequestHandler for PyFlink states

Vancior opened a new pull request, #19687:
URL: https://github.com/apache/flink/pull/19687

   
   
   ## What is the purpose of the change
   
   This PR refactors `SimpleStateRequestHandler` class, which serves as a bridge from Beam states in Python to Flink states in Java. State stores and state operations are decoupled, in purpose of implementing broadcast state in PyFlink.
   
   
   ## Brief change log
   
   - Introduce `BeamStateStore` and `BeamStateHandler` interfaces
   - Implement `BeamStateStore` with `BeamKeyedStateStore` and `BeamOperatorStateStore`
   - Implement `BeamStateHandler` with `BeamMapStateHandler` and `BeamBagStateHandler`
   - Replace `SimpleStateRequestHandler` with `BeamStateRequestHandler`
   
   ## Verifying this change
   
   This change is already covered by existing tests, such as `test_data_stream.py`.
   
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no)
     - The serializers: (no)
     - The runtime per-record code paths (performance sensitive): (no)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (no)
     - The S3 file system connector: (no)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (no)
     - If yes, how is the feature documented? (not applicable)
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] flinkbot commented on pull request #19687: [FLINK-27560][python] Refactor SimpleStateRequestHandler for PyFlink states

Posted by GitBox <gi...@apache.org>.
flinkbot commented on PR #19687:
URL: https://github.com/apache/flink/pull/19687#issuecomment-1122275112

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "518b3a41c8bb7cb5929ac6fc087813247361427b",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "518b3a41c8bb7cb5929ac6fc087813247361427b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 518b3a41c8bb7cb5929ac6fc087813247361427b UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] dianfu commented on a diff in pull request #19687: [FLINK-27560][python] Refactor SimpleStateRequestHandler for PyFlink states

Posted by GitBox <gi...@apache.org>.
dianfu commented on code in PR #19687:
URL: https://github.com/apache/flink/pull/19687#discussion_r871082331


##########
flink-python/src/main/java/org/apache/flink/streaming/api/runners/python/beam/state/BeamStateHandler.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.streaming.api.runners.python.beam.state;
+
+import org.apache.beam.model.fnexecution.v1.BeamFnApi;
+
+/** Interface for doing actual operations on Flink state based on {@link BeamFnApi.StateRequest}. */
+public interface BeamStateHandler<S> {
+
+    BeamFnApi.StateResponse.Builder handle(BeamFnApi.StateRequest request, S state)
+            throws Exception;
+
+    static BeamStateHandler<?> unsupported() {

Review Comment:
   It seems that this method is not used anywhere and could be removed.



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] dianfu closed pull request #19687: [FLINK-27560][python] Refactor SimpleStateRequestHandler for PyFlink states

Posted by GitBox <gi...@apache.org>.
dianfu closed pull request #19687: [FLINK-27560][python] Refactor SimpleStateRequestHandler for PyFlink states
URL: https://github.com/apache/flink/pull/19687


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org