import org.apache.kafka.common.requests.MetadataRequest
val r = MetadataRequest.Builder.allTopics
scala> println(r)
(type=MetadataRequest, topics=<ALL>)
import collection.JavaConverters._
val topics = Seq("t1", "t2").asJava
val allowAutoTopicCreation = false
val r = new MetadataRequest.Builder(topics, allowAutoTopicCreation)
scala> println(r)
(type=MetadataRequest, topics=t1,t2)
MetadataRequest
MetadataRequest
is a request with Metadata API key and the following properties:
MetadataRequest
is created when:
-
MetadataRequest.Builder
is requested to build a MetadataRequest -
MetadataRequest
is requested to parse a byte buffer -
AbstractRequest
is requested to parse a request (with the Metadata API key)
MetadataRequest
can be created using the following factory methods:
Create MetadataRequest.Builder for All Topics — allTopics
Static Factory Method
// MetadataRequest.Builder.allTopics
Builder allTopics()
allTopics
creates a new MetadataRequest for all topics and allowAutoTopicCreation
flag enabled.
Note
|
|
MetadataRequest.Builder
Utility
MetadataRequest.Builder
is a AbstractRequest.Builder to build a MetadataRequest.
MetadataRequest build(short version)
UpdateMetadataRequest.Builder
is used when…FIXME