Class DelayedShareFetch

java.lang.Object
org.apache.kafka.server.util.timer.TimerTask
org.apache.kafka.server.purgatory.DelayedOperation
kafka.server.share.DelayedShareFetch
All Implemented Interfaces:
Runnable

public class DelayedShareFetch extends org.apache.kafka.server.purgatory.DelayedOperation
A delayed share fetch operation has been introduced in case there is a share fetch request which cannot be completed instantaneously.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.kafka.server.purgatory.DelayedOperation

    org.apache.kafka.server.purgatory.DelayedOperation.Action
  • Field Summary

    Fields inherited from class org.apache.kafka.server.util.timer.TimerTask

    delayMs
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Complete the share fetch operation by fetching records for all partitions in the share fetch request irrespective of whether they have any acquired records.
    void
     
    boolean
    Try to complete the fetch operation if we can acquire records for any partition in the share fetch request.

    Methods inherited from class org.apache.kafka.server.purgatory.DelayedOperation

    forceComplete, isCompleted, run

    Methods inherited from class org.apache.kafka.server.util.timer.TimerTask

    cancel, isCancelled

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • onExpiration

      public void onExpiration()
      Specified by:
      onExpiration in class org.apache.kafka.server.purgatory.DelayedOperation
    • onComplete

      public void onComplete()
      Complete the share fetch operation by fetching records for all partitions in the share fetch request irrespective of whether they have any acquired records. This is called when the fetch operation is forced to complete either because records can be acquired for some partitions or due to MaxWaitMs timeout.
      Specified by:
      onComplete in class org.apache.kafka.server.purgatory.DelayedOperation
    • tryComplete

      public boolean tryComplete()
      Try to complete the fetch operation if we can acquire records for any partition in the share fetch request.
      Specified by:
      tryComplete in class org.apache.kafka.server.purgatory.DelayedOperation