GET /topics/{topic: string}/partitions/{partition_id: string}

Retrieves metadata about a specific partition within a topic.

Description

Depending on the configuration, the type of information retrieved has different behavior. See the streams.default.stream and rest.proxy.backend parameters in Configuration Parameters.

Table 1. Response Behavior
Parameters Defined Response
streams.default.stream is defined Gets metadata about a specific partition within a MapR Streams topic. The user could pass fully qualified topic name or not. If a fully qualified topic name is not used, metadata is retrieved and appended to the default stream path.
streams.default.stream is not defined and rest.proxy.backend=streams Gets metadata about specific MapR Streams partitions within a topic. The user could only pass fully qualified topic names that contains stream path
streams.default.stream is not defined and rest.proxy.backend=hybrid Gets metadata about a specific partition within MapR Streams topic if the topic name starts with ‘/’ and contains ‘:’. Otherwise, gets metadata about a specific partition within an Apache Kafka topic
Table 2. Parameters
Parameters Description
topic_name (string) Name of the topic.
partition_id (int) ID of the partition to inspect.

Syntax

http://<host>:8082/topics/<topic_name>/partitions/<partition_id>

Request Example

The following MapR Streams example reads from partition 0 of the topic: /streaming_data/stream:testtopic1.

curl -X GET http://localhost:8082/topics/%2Fstreaming_data%2Fstream%3Atesttopic1/partitions/0

The following Kafka example reads from the kafka topic: kafkatopic1 partition 0.

curl -X GET http://localhost:8082/topics/kafkatopic1/partitions/0

Response Example

{
  "partition":0,
  "leader":0,
  "replicas":
    [{
      "broker":0,
      "leader":true,
      "in_sync":true
      }]
}