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
- Alphabetic
- By Inheritance
- FetchRequest
- Serializable
- Serializable
- Product
- Equals
- Request
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
FetchRequest(replica: @@[Int, Broker], maxWaitTime: FiniteDuration, minBytes: Int, maxBytes: Option[Int], topics: Vector[(@@[String, TopicName], Vector[(@@[Int, PartitionId], @@[Long, Offset], Int)])])
- 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
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
+(other: String): String
- Implicit
- This member is added by an implicit conversion from FetchRequest to any2stringadd[FetchRequest] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
-
def
->[B](y: B): (FetchRequest, B)
- Implicit
- 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()
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
ensuring(cond: (FetchRequest) ⇒ Boolean, msg: ⇒ Any): FetchRequest
- Implicit
- This member is added by an implicit conversion from FetchRequest to Ensuring[FetchRequest] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: (FetchRequest) ⇒ Boolean): FetchRequest
- Implicit
- This member is added by an implicit conversion from FetchRequest to Ensuring[FetchRequest] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean, msg: ⇒ Any): FetchRequest
- Implicit
- This member is added by an implicit conversion from FetchRequest to Ensuring[FetchRequest] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean): FetchRequest
- Implicit
- This member is added by an implicit conversion from FetchRequest to Ensuring[FetchRequest] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
formatted(fmtstr: String): String
- Implicit
- 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()
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val maxBytes: Option[Int]
- val maxWaitTime: FiniteDuration
- val minBytes: Int
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- val replica: @@[Int, Broker]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- val topics: Vector[(@@[String, TopicName], Vector[(@@[Int, PartitionId], @@[Long, Offset], Int)])]
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
→[B](y: B): (FetchRequest, B)
- Implicit
- This member is added by an implicit conversion from FetchRequest to ArrowAssoc[FetchRequest] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc