class_docstr: The WatermarkStrategy defines how to generate Watermarks in the stream sources. The
  WatermarkStrategy is a builder/factory for the WatermarkGenerator that generates the watermarks
  and the TimestampAssigner which assigns the internal timestamp of a record.
  
  The convenience methods, for example forBoundedOutOfOrderness(Duration), create a
  WatermarkStrategy for common built in strategies.
class_docstr_tok: ["The","WatermarkStrategy","defines","how","to","generate","Watermarks","in","the","stream","sources",".","The","WatermarkStrategy","is","a","builder\/factory","for","the","WatermarkGenerator","that","generates","the","watermarks","and","the","TimestampAssigner","which","assigns","the","internal","timestamp","of","a","record",".","The","convenience","methods",",","for","example","forBoundedOutOfOrderness","(","Duration",")",",","create","a","WatermarkStrategy","for","common","built","in","strategies","."]
docstr: Creates a new :class:`WatermarkStrategy` that configures the maximum watermark drift from
  other sources/tasks/partitions in the same watermark group. The group may contain completely
  independent sources (e.g. File and Kafka).
  
  Once configured Flink will "pause" consuming from a source/task/partition that is ahead
  of the emitted watermark in the group by more than the maxAllowedWatermarkDrift.
  
  Example:
  ::
  
      >>> WatermarkStrategy \
      ...     .for_bounded_out_of_orderness(Duration.of_seconds(20)) \
      ...     .with_watermark_alignment("alignment-group-1", Duration.of_seconds(20),
      ...         Duration.of_seconds(1))
  
  :param watermark_group: A group of sources to align watermarks
  :param max_allowed_watermark_drift: Maximal drift, before we pause consuming from the
      source/task/partition
  :param update_interval: How often tasks should notify coordinator about the current
      watermark and how often the coordinator should announce the maximal aligned watermark.
      If is None, default update interval (1000ms) is used.
  :return: A new WatermarkStrategy with watermark alignment configured.
  
  .. versionadded:: 1.16.0
docstr_tok: ["Creates","a","new",":","class",":","`","WatermarkStrategy","`","that","configures","the","maximum","watermark","drift","from","other","sources\/tasks\/partitions","in","the","same","watermark","group",".","The","group","may","contain","completely","independent","sources","(","e.g",".","File","and","Kafka",")",".","Once","configured","Flink","will","``","pause","''","consuming","from","a","source\/task\/partition","that","is","ahead","of","the","emitted","watermark","in","the","group","by","more","than","the","maxAllowedWatermarkDrift",".","Example",":",":",":",">",">",">","WatermarkStrategy","\\","...",".for_bounded_out_of_orderness","(","Duration.of_seconds","(","20",")",")","\\","...",".with_watermark_alignment","(","``","alignment-group-1","''",",","Duration.of_seconds","(","20",")",",","...","Duration.of_seconds","(","1",")",")",":","param","watermark_group",":","A","group","of","sources","to","align","watermarks",":","param","max_allowed_watermark_drift",":","Maximal","drift",",","before","we","pause","consuming","from","the","source\/task\/partition",":","param","update_interval",":","How","often","tasks","should","notify","coordinator","about","the","current","watermark","and","how","often","the","coordinator","should","announce","the","maximal","aligned","watermark",".","If","is","None",",","default","update","interval","(","1000ms",")","is","used",".",":","return",":","A","new","WatermarkStrategy","with","watermark","alignment","configured",".","..","versionadded",":",":","1.16.0"]
code: def with_watermark_alignment(
      self,
      watermark_group: str,
      max_allowed_watermark_drift: Duration,
      update_interval: Optional[Duration] = None,
  ) -> "WatermarkStrategy":
      """
          Creates a new :class:`WatermarkStrategy` that configures the maximum watermark drift from
          other sources/tasks/partitions in the same watermark group. The group may contain completely
          independent sources (e.g. File and Kafka).
  
          Once configured Flink will "pause" consuming from a source/task/partition that is ahead
          of the emitted watermark in the group by more than the maxAllowedWatermarkDrift.
  
          Example:
          ::
  
              >>> WatermarkStrategy \\
              ...     .for_bounded_out_of_orderness(Duration.of_seconds(20)) \\
              ...     .with_watermark_alignment("alignment-group-1", Duration.of_seconds(20),
              ...         Duration.of_seconds(1))
  
          :param watermark_group: A group of sources to align watermarks
          :param max_allowed_watermark_drift: Maximal drift, before we pause consuming from the
              source/task/partition
          :param update_interval: How often tasks should notify coordinator about the current
              watermark and how often the coordinator should announce the maximal aligned watermark.
              If is None, default update interval (1000ms) is used.
          :return: A new WatermarkStrategy with watermark alignment configured.
  
          .. versionadded:: 1.16.0
          """
      if update_interval is None:
          return WatermarkStrategy(
              self._j_watermark_strategy.withWatermarkAlignment(
                  watermark_group,
                  max_allowed_watermark_drift._j_duration,
              )
          )
      else:
          return WatermarkStrategy(
              self._j_watermark_strategy.withWatermarkAlignment(
                  watermark_group,
                  max_allowed_watermark_drift._j_duration,
                  update_interval._j_duration,
              )
          )
  
file_path: flink/flink-python/pyflink/common/watermark_strategy.py
imports: import abc
  from typing import Any, Optional
  from pyflink.common.time import Duration
  from pyflink.java_gateway import get_gateway
label_desc: Use image node_id 4 for calling the WatermarkStrategy obj's underlying member method code with example usage: obj.with_watermark_alignment(watermark_group, max_allowed_watermark_drift, update_interval) and returns: WatermarkStrategy, WatermarkStrategy