Class

spinoco.protocol.kafka.Request

FetchRequest

Related Doc: package Request

Permalink

case class FetchRequest(replica: @@[Int, Broker], maxWaitTime: FiniteDuration, minBytes: Int, maxBytes: Option[Int], topics: Vector[(@@[String, TopicName], Vector[(@@[Int, PartitionId], @@[Long, Offset], Int)])]) extends Request with Product with Serializable

The fetch API is used to fetch a chunk of one or more logs for some topic-partitions. Logically one specifies the topics, partitions, and starting offset at which to begin the fetch and gets back a chunk of messages.

In general, the return messages will have offsets larger than or equal to the starting offset. However, with compressed messages, it's possible for the returned messages to have offsets smaller than the starting offset. The number of such messages is typically small and the caller is responsible for filtering out those messages.

Fetch requests follow a long poll model so they can be made to block for a period of time if sufficient data is not immediately available. As an optimization the server is allowed to return a partial message at the end of the message set. Clients should handle this case.

replica

The replica id indicates the node id of the replica initiating this request. Normal client consumers should always specify this as -1 as they have no node id. Other brokers set this to be their own node id. The value -2 is accepted to allow a non-broker to issue fetch requests as if it were a replica broker for debugging purposes.

maxWaitTime

The max wait time is the maximum amount of time in milliseconds to block waiting if insufficient data is available at the time the request is issued.

minBytes

This is the minimum number of bytes of messages that must be available to give a response. If the client sets this to 0 the server will always respond immediately, however if there is no new data since their last request they will just get back empty message sets. If this is set to 1, the server will respond as soon as at least one partition has at least 1 byte of data or the specified timeout occurs. By setting higher values in combination with the timeout the consumer can tune for throughput and trade a little additional latency for reading only large chunks of data (e.g. setting MaxWaitTime to 100 ms and setting MinBytes to 64k would allow the server to wait up to 100ms to try to accumulate 64k of data before responding).

maxBytes

If specified, contains max bytes of the fetch request to return, across all topics//partitions. Only available in Kafka 0.10.2+

topics

Specifies name of topic, its partition and offset to read from. The last Int specifies max bytes to read, that bounds message size received.

Source
Request.scala
Linear Supertypes
Serializable, Serializable, Product, Equals, Request, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FetchRequest
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Request
  7. AnyRef
  8. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new FetchRequest(replica: @@[Int, Broker], maxWaitTime: FiniteDuration, minBytes: Int, maxBytes: Option[Int], topics: Vector[(@@[String, TopicName], Vector[(@@[Int, PartitionId], @@[Long, Offset], Int)])])

    Permalink

    replica

    The replica id indicates the node id of the replica initiating this request. Normal client consumers should always specify this as -1 as they have no node id. Other brokers set this to be their own node id. The value -2 is accepted to allow a non-broker to issue fetch requests as if it were a replica broker for debugging purposes.

    maxWaitTime

    The max wait time is the maximum amount of time in milliseconds to block waiting if insufficient data is available at the time the request is issued.

    minBytes

    This is the minimum number of bytes of messages that must be available to give a response. If the client sets this to 0 the server will always respond immediately, however if there is no new data since their last request they will just get back empty message sets. If this is set to 1, the server will respond as soon as at least one partition has at least 1 byte of data or the specified timeout occurs. By setting higher values in combination with the timeout the consumer can tune for throughput and trade a little additional latency for reading only large chunks of data (e.g. setting MaxWaitTime to 100 ms and setting MinBytes to 64k would allow the server to wait up to 100ms to try to accumulate 64k of data before responding).

    maxBytes

    If specified, contains max bytes of the fetch request to return, across all topics//partitions. Only available in Kafka 0.10.2+

    topics

    Specifies name of topic, its partition and offset to read from. The last Int specifies max bytes to read, that bounds message size received.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from FetchRequest to any2stringadd[FetchRequest] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (FetchRequest, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from FetchRequest to ArrowAssoc[FetchRequest] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def ensuring(cond: (FetchRequest) ⇒ Boolean, msg: ⇒ Any): FetchRequest

    Permalink
    Implicit information
    This member is added by an implicit conversion from FetchRequest to Ensuring[FetchRequest] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  9. def ensuring(cond: (FetchRequest) ⇒ Boolean): FetchRequest

    Permalink
    Implicit information
    This member is added by an implicit conversion from FetchRequest to Ensuring[FetchRequest] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: Boolean, msg: ⇒ Any): FetchRequest

    Permalink
    Implicit information
    This member is added by an implicit conversion from FetchRequest to Ensuring[FetchRequest] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean): FetchRequest

    Permalink
    Implicit information
    This member is added by an implicit conversion from FetchRequest to Ensuring[FetchRequest] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from FetchRequest to StringFormat[FetchRequest] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  15. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  17. val maxBytes: Option[Int]

    Permalink

    If specified, contains max bytes of the fetch request to return, across all topics//partitions.

    If specified, contains max bytes of the fetch request to return, across all topics//partitions. Only available in Kafka 0.10.2+

  18. val maxWaitTime: FiniteDuration

    Permalink

    The max wait time is the maximum amount of time in milliseconds to block waiting if insufficient data is available at the time the request is issued.

  19. val minBytes: Int

    Permalink

    This is the minimum number of bytes of messages that must be available to give a response.

    This is the minimum number of bytes of messages that must be available to give a response. If the client sets this to 0 the server will always respond immediately, however if there is no new data since their last request they will just get back empty message sets. If this is set to 1, the server will respond as soon as at least one partition has at least 1 byte of data or the specified timeout occurs. By setting higher values in combination with the timeout the consumer can tune for throughput and trade a little additional latency for reading only large chunks of data (e.g. setting MaxWaitTime to 100 ms and setting MinBytes to 64k would allow the server to wait up to 100ms to try to accumulate 64k of data before responding).

  20. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  21. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. val replica: @@[Int, Broker]

    Permalink

    The replica id indicates the node id of the replica initiating this request.

    The replica id indicates the node id of the replica initiating this request. Normal client consumers should always specify this as -1 as they have no node id. Other brokers set this to be their own node id. The value -2 is accepted to allow a non-broker to issue fetch requests as if it were a replica broker for debugging purposes.

  24. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  25. val topics: Vector[(@@[String, TopicName], Vector[(@@[Int, PartitionId], @@[Long, Offset], Int)])]

    Permalink

    Specifies name of topic, its partition and offset to read from.

    Specifies name of topic, its partition and offset to read from. The last Int specifies max bytes to read, that bounds message size received.

  26. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. def [B](y: B): (FetchRequest, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from FetchRequest to ArrowAssoc[FetchRequest] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Request

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from FetchRequest to any2stringadd[FetchRequest]

Inherited by implicit conversion StringFormat from FetchRequest to StringFormat[FetchRequest]

Inherited by implicit conversion Ensuring from FetchRequest to Ensuring[FetchRequest]

Inherited by implicit conversion ArrowAssoc from FetchRequest to ArrowAssoc[FetchRequest]

Ungrouped