dianfu commented on a change in pull request #13803:
URL: https://github.com/apache/flink/pull/13803#discussion_r517809674



##########
File path: flink-python/pyflink/datastream/functions.py
##########
@@ -19,6 +19,7 @@
 import abc
 from typing import Union, Any, Dict
 
+from apache_beam import TimeDomain

Review comment:
       I think we should import Flink's TimeDomain

##########
File path: flink-python/pyflink/datastream/data_stream.py
##########
@@ -444,6 +444,30 @@ def broadcast(self) -> 'DataStream':
         """
         return DataStream(self._j_data_stream.broadcast())
 
+    def process(self, func: ProcessFunction, output_type: TypeInformation = 
None):

Review comment:
       ```suggestion
       def process(self, func: ProcessFunction, output_type: TypeInformation = 
None) -> 'DataStream':
   ```

##########
File path: flink-python/pyflink/datastream/functions.py
##########
@@ -540,3 +541,161 @@ def __init__(self, sink_func: Union[str, JavaObject]):
         :param sink_func: The java SinkFunction object or the full name of the 
SinkFunction class.
         """
         super(SinkFunction, self).__init__(sink_func)
+
+
+class ProcessFunction(Function):

Review comment:
       Add ProcessFunction/Collector/TimerService to 
pyflink.datastream.__init__.py?

##########
File path: flink-python/pyflink/datastream/time_domain.py
##########
@@ -0,0 +1,42 @@
+################################################################################
+#  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.
+################################################################################
+from enum import Enum
+
+from pyflink.java_gateway import get_gateway
+
+
+class TimeDomain(Enum):
+    """
+    TimeDomain specifies whether a firing timer is based on event time or 
processing time.
+
+    EVENT_TIME: Time is based on timestamp of events.
+    PROCESSING_TIME: Time is based on the current processing-time of a machine 
where processing
+                     happens.
+    """
+
+    EVENT_TIME = 0
+    PROCESSING_TIME = 1
+
+    @staticmethod

Review comment:
       Remove the following two methods as I think they are not necessary.

##########
File path: flink-python/pyflink/datastream/time_domain.py
##########
@@ -0,0 +1,42 @@
+################################################################################
+#  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.
+################################################################################
+from enum import Enum
+
+from pyflink.java_gateway import get_gateway
+
+
+class TimeDomain(Enum):

Review comment:
       Add TimeDomain to pyflink.datastream.__init__.py?




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


Reply via email to