KarmaGYZ commented on a change in pull request #16405:
URL: https://github.com/apache/flink/pull/16405#discussion_r665097343



##########
File path: flink-python/pyflink/datastream/slot_sharing_group.py
##########
@@ -0,0 +1,281 @@
+################################################################################
+#  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.
+################################################################################
+
+__all__ = ['MemorySize', 'SlotSharingGroup']
+
+from typing import Optional
+
+from pyflink.java_gateway import get_gateway
+
+
+class MemorySize(object):
+    """
+    MemorySize is a representation of a number of bytes, viewable in different 
units.
+    """
+
+    def __init__(self, j_memory_size=None, bytes_size: int = None):
+        self._j_memory_size = get_gateway().jvm \
+            .org.apache.flink.configuration.MemorySize(bytes_size) \
+            if j_memory_size is None else j_memory_size
+
+    @staticmethod
+    def of_mebi_bytes(mebi_bytes: int) -> 'MemorySize':
+        return MemorySize(
+            
get_gateway().jvm.org.apache.flink.configuration.MemorySize.ofMebiBytes(mebi_bytes))
+
+    def get_bytes(self) -> int:
+        """
+        Gets the memory size in bytes.
+
+        :return: The memory size in bytes.
+        """
+        return self._j_memory_size.getBytes()
+
+    def get_kibi_bytes(self) -> int:
+        """
+        Gets the memory size in Kibibytes (= 1024 bytes).
+
+        :return: The memory size in Kibibytes.
+        """
+        return self._j_memory_size.getKibiBytes()
+
+    def get_mebi_bytes(self) -> int:
+        """
+        Gets the memory size in Mebibytes (= 1024 Kibibytes).
+
+        :return: The memory size in Mebibytes.
+        """
+        return self._j_memory_size.getMebiBytes()
+
+    def get_gibi_bytes(self) -> int:
+        """
+        Gets the memory size in Gibibytes (= 1024 Mebibytes).
+
+        :return: The memory size in Gibibytes.
+        """
+        return self._j_memory_size.getGibiBytes()
+
+    def get_tebi_bytes(self) -> int:
+        """
+        Gets the memory size in Tebibytes (= 1024 Gibibytes).
+
+        :return: The memory size in Tebibytes.
+        """
+        return self._j_memory_size.getTebiBytes()
+
+    def get_java_memory_size(self):
+        """
+        Get the Java MemorySize object.
+
+        :return: The Java MemorySize object.
+        """
+        return self._j_memory_size
+
+    def __eq__(self, other):
+        return isinstance(other, self.__class__) and self._j_memory_size == 
other._j_memory_size
+
+    def __hash__(self):
+        return self._j_memory_size.hashCode()
+
+
+class SlotSharingGroup(object):
+    """
+    Describe the name and the the different resource components of a slot 
sharing group.
+    """
+
+    def __init__(self, j_slot_sharing_group):
+        self._j_slot_sharing_group = j_slot_sharing_group
+
+    def get_name(self) -> str:
+        """
+        Get the name of this SlotSharingGroup.

Review comment:
       May I ask why we use the singular here? Isn't it an impressive mood? 
Also search in Linggle, the "Get the" is used more frequently. [1][2]
   
   [1] https://linggle.com/?q=Get+the
   [2] https://linggle.com/?q=Gets+the




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to