Skip to content
m manifester.io
All Kafka APIs

DescribeLogDirs

This page encodes the smallest legal instance of the request and the response: numeric fields are zero, strings and byte arrays are empty, every array carries exactly one sample element, and any records field holds one empty 61-byte RecordBatch v2. Version 4 is a flexible version, so every struct is terminated by a uvarint tagged-field count and strings and arrays carry compact length-plus-one prefixes. Sizes below include the leading int32 size prefix.

API key
35
Encoded at
v4
Flexible versions
2+
Headers
req v2, resp v1
Request versions
1-4
Response versions
1-4
Request size
24 bytes
Response size
63 bytes
framerpc headerrequest bodyRecordBatchRecordresponse bodytagged_fields

Request

DescribeLogDirsRequest v4, request header v2, 24 bytes on the wire

byte layout (24 bytes, 16 bytes per row)

0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
0000
0010

object tree

DescribeLogDirsRequest                 message v4                                         [0x0000, 24B]
+-- Frame                                                                                 [0x0000, 4B]   length-delimited framing
|   +-- size                           int32                     = 20                     [0x0000, 4B]   number of bytes that follow, patched after encoding
+-- RequestHeader                      v2                                                 [0x0004, 11B]  common request header
|   +-- request_api_key                int16                     = 35 (DescribeLogDirs)   [0x0004, 2B]   numeric id of the API being invoked
|   +-- request_api_version            int16                     = 4                      [0x0006, 2B]   version of the API being invoked
|   +-- correlation_id                 int32                     = 0                      [0x0008, 4B]   echoed back by the broker in the response
|   +-- client_id                      nullable_string           = "" (int16 len=0)       [0x000c, 2B]   always a non-flexible int16-prefixed string
|   +-- tagged_fields                  uvarint                   = 0                      [0x000e, 1B]   number of tagged fields in the header
+-- DescribeLogDirsRequest             struct                                             [0x000f, 9B]   message body, version 4
    +-- Topics                         []DescribableLogDirTopic  = 1 element              [0x000f, 8B]   Each topic that we want to describe log directories for, or null for all to...
    |   +-- length                     uvarint                   = 2 (compact, n+1)       [0x000f, 1B]   one sample element follows
    |   +-- DescribableLogDirTopic[0]  DescribableLogDirTopic    = struct                 [0x0010, 7B]
    |       +-- Topic                  string                    = "" (compact, len+1=1)  [0x0010, 1B]   The topic name.
    |       +-- Partitions             []int32                   = 1 element              [0x0011, 5B]   The partition indexes.
    |       |   +-- length             uvarint                   = 2 (compact, n+1)       [0x0011, 1B]   one sample element follows
    |       |   +-- int32[0]           int32                     = 0                      [0x0012, 4B]
    |       +-- tagged_fields          uvarint                   = 0                      [0x0016, 1B]   number of tagged fields in this struct
    +-- tagged_fields                  uvarint                   = 0                      [0x0017, 1B]   number of tagged fields in this struct

kafka message schema (.json)

{
  "apiKey": 35,
  "type": "request",
  "listeners": ["broker"],
  "name": "DescribeLogDirsRequest",
  // Version 0 was removed in Apache Kafka 4.0, Version 1 is the new baseline.
  // Version 1 is the same as version 0.
  // Version 2 is the first flexible version.
  // Version 3 is the same as version 2 (new field in response).
  // Version 4 is the same as version 2 (new fields in response).
  "validVersions": "1-4",
  "flexibleVersions": "2+",
  "fields": [
    { "name": "Topics", "type": "[]DescribableLogDirTopic", "versions": "0+", "nullableVersions": "0+",
      "about": "Each topic that we want to describe log directories for, or null for all topics.", "fields": [
      { "name": "Topic", "type": "string", "versions": "0+", "entityType": "topicName", "mapKey": true,
        "about": "The topic name." },
      { "name": "Partitions", "type": "[]int32", "versions": "0+",
        "about": "The partition indexes." }
    ]}
  ]
}

Response

DescribeLogDirsResponse v4, response header v1, 63 bytes on the wire

byte layout (63 bytes, 16 bytes per row)

0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
0000
0010
0020
0030

object tree

DescribeLogDirsResponse                                  message v4                                           [0x0000, 63B]
+-- Frame                                                                                                     [0x0000, 4B]   length-delimited framing
|   +-- size                                             int32                       = 59                     [0x0000, 4B]   number of bytes that follow, patched after encoding
+-- ResponseHeader                                       v1                                                   [0x0004, 5B]   common response header
|   +-- correlation_id                                   int32                       = 0                      [0x0004, 4B]   matches the correlation_id of the request
|   +-- tagged_fields                                    uvarint                     = 0                      [0x0008, 1B]   number of tagged fields in the header
+-- DescribeLogDirsResponse                              struct                                               [0x0009, 54B]  message body, version 4
    +-- ThrottleTimeMs                                   int32                       = 0                      [0x0009, 4B]   The duration in milliseconds for which the request was throttled due to a q...
    +-- ErrorCode                                        int16                       = 0                      [0x000d, 2B]   The error code, or 0 if there was no error.
    +-- Results                                          []DescribeLogDirsResult     = 1 element              [0x000f, 47B]  The log directories.
    |   +-- length                                       uvarint                     = 2 (compact, n+1)       [0x000f, 1B]   one sample element follows
    |   +-- DescribeLogDirsResult[0]                     DescribeLogDirsResult       = struct                 [0x0010, 46B]
    |       +-- ErrorCode                                int16                       = 0                      [0x0010, 2B]   The error code, or 0 if there was no error.
    |       +-- LogDir                                   string                      = "" (compact, len+1=1)  [0x0012, 1B]   The absolute log directory path.
    |       +-- Topics                                   []DescribeLogDirsTopic      = 1 element              [0x0013, 26B]  The topics.
    |       |   +-- length                               uvarint                     = 2 (compact, n+1)       [0x0013, 1B]   one sample element follows
    |       |   +-- DescribeLogDirsTopic[0]              DescribeLogDirsTopic        = struct                 [0x0014, 25B]
    |       |       +-- Name                             string                      = "" (compact, len+1=1)  [0x0014, 1B]   The topic name.
    |       |       +-- Partitions                       []DescribeLogDirsPartition  = 1 element              [0x0015, 23B]  The partitions.
    |       |       |   +-- length                       uvarint                     = 2 (compact, n+1)       [0x0015, 1B]   one sample element follows
    |       |       |   +-- DescribeLogDirsPartition[0]  DescribeLogDirsPartition    = struct                 [0x0016, 22B]
    |       |       |       +-- PartitionIndex           int32                       = 0                      [0x0016, 4B]   The partition index.
    |       |       |       +-- PartitionSize            int64                       = 0                      [0x001a, 8B]   The size of the log segments in this partition in bytes.
    |       |       |       +-- OffsetLag                int64                       = 0                      [0x0022, 8B]   The lag of the log's LEO w.r.t. partition's HW (if it is the current log fo...
    |       |       |       +-- IsFutureKey              bool                        = false                  [0x002a, 1B]   True if this log is created by AlterReplicaLogDirsRequest and will replace ...
    |       |       |       +-- tagged_fields            uvarint                     = 0                      [0x002b, 1B]   number of tagged fields in this struct
    |       |       +-- tagged_fields                    uvarint                     = 0                      [0x002c, 1B]   number of tagged fields in this struct
    |       +-- TotalBytes                               int64                       = 0                      [0x002d, 8B]   The total size in bytes of the volume the log directory is in.
    |       +-- UsableBytes                              int64                       = 0                      [0x0035, 8B]   The usable size in bytes of the volume the log directory is in.
    |       +-- tagged_fields                            uvarint                     = 0                      [0x003d, 1B]   number of tagged fields in this struct
    +-- tagged_fields                                    uvarint                     = 0                      [0x003e, 1B]   number of tagged fields in this struct

kafka message schema (.json)

{
  "apiKey": 35,
  "type": "response",
  "name": "DescribeLogDirsResponse",
  // Version 0 was removed in Apache Kafka 4.0, Version 1 is the new baseline.
  // Starting in version 1, on quota violation, brokers send out responses before throttling.
  // Version 2 is the first flexible version.
  // Version 3 adds the top-level ErrorCode field
  // Version 4 adds the TotalBytes and UsableBytes fields
  "validVersions": "1-4",
  "flexibleVersions": "2+",
  "fields": [
    { "name": "ThrottleTimeMs", "type": "int32", "versions": "0+",
      "about": "The duration in milliseconds for which the request was throttled due to a quota violation, or zero if the request did not violate any quota." },
    { "name": "ErrorCode", "type": "int16", "versions": "3+",
      "ignorable": true, "about": "The error code, or 0 if there was no error." },
    { "name": "Results", "type": "[]DescribeLogDirsResult", "versions": "0+",
      "about": "The log directories.", "fields": [
      { "name": "ErrorCode", "type": "int16", "versions": "0+",
        "about": "The error code, or 0 if there was no error." },
      { "name": "LogDir", "type": "string", "versions": "0+",
        "about": "The absolute log directory path." },
      { "name": "Topics", "type": "[]DescribeLogDirsTopic", "versions": "0+",
        "about": "The topics.", "fields": [
        { "name": "Name", "type": "string", "versions": "0+", "entityType": "topicName",
          "about": "The topic name." },
        { "name": "Partitions", "type": "[]DescribeLogDirsPartition", "versions": "0+",
          "about": "The partitions.", "fields": [
          { "name": "PartitionIndex", "type": "int32", "versions": "0+",
            "about": "The partition index." },
          { "name": "PartitionSize", "type": "int64", "versions": "0+",
            "about": "The size of the log segments in this partition in bytes." },
          { "name": "OffsetLag", "type": "int64", "versions": "0+",
            "about": "The lag of the log's LEO w.r.t. partition's HW (if it is the current log for the partition) or current replica's LEO (if it is the future log for the partition)." },
          { "name": "IsFutureKey", "type": "bool", "versions": "0+",
            "about": "True if this log is created by AlterReplicaLogDirsRequest and will replace the current log of the replica in the future." }]}
      ]},
      { "name": "TotalBytes", "type": "int64", "versions": "4+", "ignorable": true, "default": "-1",
        "about": "The total size in bytes of the volume the log directory is in."
      },
      { "name": "UsableBytes", "type": "int64", "versions": "4+", "ignorable": true, "default": "-1",
        "about": "The usable size in bytes of the volume the log directory is in."
      }
    ]}
  ]
}