Skip to content
m manifester.io
All Kafka APIs

AlterReplicaLogDirs

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 2 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
34
Encoded at
v2
Flexible versions
2+
Headers
req v2, resp v1
Request versions
1-2
Response versions
1-2
Request size
27 bytes
Response size
25 bytes
framerpc headerrequest bodyRecordBatchRecordresponse bodytagged_fields

Request

AlterReplicaLogDirsRequest v2, request header v2, 27 bytes on the wire

byte layout (27 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

AlterReplicaLogDirsRequest                      message v2                                             [0x0000, 27B]
+-- Frame                                                                                              [0x0000, 4B]   length-delimited framing
|   +-- size                                    int32                      = 23                        [0x0000, 4B]   number of bytes that follow, patched after encoding
+-- RequestHeader                               v2                                                     [0x0004, 11B]  common request header
|   +-- request_api_key                         int16                      = 34 (AlterReplicaLogDirs)  [0x0004, 2B]   numeric id of the API being invoked
|   +-- request_api_version                     int16                      = 2                         [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
+-- AlterReplicaLogDirsRequest                  struct                                                 [0x000f, 12B]  message body, version 2
    +-- Dirs                                    []AlterReplicaLogDir       = 1 element                 [0x000f, 11B]  The alterations to make for each directory.
    |   +-- length                              uvarint                    = 2 (compact, n+1)          [0x000f, 1B]   one sample element follows
    |   +-- AlterReplicaLogDir[0]               AlterReplicaLogDir         = struct                    [0x0010, 10B]
    |       +-- Path                            string                     = "" (compact, len+1=1)     [0x0010, 1B]   The absolute directory path.
    |       +-- Topics                          []AlterReplicaLogDirTopic  = 1 element                 [0x0011, 8B]   The topics to add to the directory.
    |       |   +-- length                      uvarint                    = 2 (compact, n+1)          [0x0011, 1B]   one sample element follows
    |       |   +-- AlterReplicaLogDirTopic[0]  AlterReplicaLogDirTopic    = struct                    [0x0012, 7B]
    |       |       +-- Name                    string                     = "" (compact, len+1=1)     [0x0012, 1B]   The topic name.
    |       |       +-- Partitions              []int32                    = 1 element                 [0x0013, 5B]   The partition indexes.
    |       |       |   +-- length              uvarint                    = 2 (compact, n+1)          [0x0013, 1B]   one sample element follows
    |       |       |   +-- int32[0]            int32                      = 0                         [0x0014, 4B]
    |       |       +-- tagged_fields           uvarint                    = 0                         [0x0018, 1B]   number of tagged fields in this struct
    |       +-- tagged_fields                   uvarint                    = 0                         [0x0019, 1B]   number of tagged fields in this struct
    +-- tagged_fields                           uvarint                    = 0                         [0x001a, 1B]   number of tagged fields in this struct

kafka message schema (.json)

{
  "apiKey": 34,
  "type": "request",
  "listeners": ["broker"],
  "name": "AlterReplicaLogDirsRequest",
  // 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 enables flexible versions.
  "validVersions": "1-2",
  "flexibleVersions": "2+",
  "fields": [
    { "name": "Dirs", "type": "[]AlterReplicaLogDir", "versions": "0+", 
      "about": "The alterations to make for each directory.", "fields": [
      { "name": "Path", "type": "string", "versions": "0+", "mapKey": true,
        "about": "The absolute directory path." },
      { "name": "Topics", "type": "[]AlterReplicaLogDirTopic", "versions": "0+",
        "about": "The topics to add to the directory.",  "fields": [
        { "name": "Name", "type": "string", "versions": "0+", "mapKey": true, "entityType": "topicName",
          "about": "The topic name." },
        { "name": "Partitions", "type": "[]int32", "versions": "0+",
          "about": "The partition indexes." }
      ]}
    ]}
  ]
}

Response

AlterReplicaLogDirsResponse v2, response header v1, 25 bytes on the wire

byte layout (25 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

AlterReplicaLogDirsResponse                               message v2                                                    [0x0000, 25B]
+-- Frame                                                                                                               [0x0000, 4B]   length-delimited framing
|   +-- size                                              int32                                = 21                     [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
+-- AlterReplicaLogDirsResponse                           struct                                                        [0x0009, 16B]  message body, version 2
    +-- ThrottleTimeMs                                    int32                                = 0                      [0x0009, 4B]   Duration in milliseconds for which the request was throttled due to a quota...
    +-- Results                                           []AlterReplicaLogDirTopicResult      = 1 element              [0x000d, 11B]  The results for each topic.
    |   +-- length                                        uvarint                              = 2 (compact, n+1)       [0x000d, 1B]   one sample element follows
    |   +-- AlterReplicaLogDirTopicResult[0]              AlterReplicaLogDirTopicResult        = struct                 [0x000e, 10B]
    |       +-- TopicName                                 string                               = "" (compact, len+1=1)  [0x000e, 1B]   The name of the topic.
    |       +-- Partitions                                []AlterReplicaLogDirPartitionResult  = 1 element              [0x000f, 8B]   The results for each partition.
    |       |   +-- length                                uvarint                              = 2 (compact, n+1)       [0x000f, 1B]   one sample element follows
    |       |   +-- AlterReplicaLogDirPartitionResult[0]  AlterReplicaLogDirPartitionResult    = struct                 [0x0010, 7B]
    |       |       +-- PartitionIndex                    int32                                = 0                      [0x0010, 4B]   The partition index.
    |       |       +-- ErrorCode                         int16                                = 0                      [0x0014, 2B]   The error code, or 0 if there was no error.
    |       |       +-- 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
    +-- tagged_fields                                     uvarint                              = 0                      [0x0018, 1B]   number of tagged fields in this struct

kafka message schema (.json)

{
  "apiKey": 34,
  "type": "response",
  "name": "AlterReplicaLogDirsResponse",
  // 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 enables flexible versions.
  "validVersions": "1-2",
  "flexibleVersions": "2+",
  "fields": [
    { "name": "ThrottleTimeMs", "type": "int32", "versions": "0+",
      "about": "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": "Results", "type": "[]AlterReplicaLogDirTopicResult", "versions": "0+",
      "about": "The results for each topic.", "fields": [
      { "name": "TopicName", "type": "string", "versions": "0+", "entityType": "topicName",
        "about": "The name of the topic." },
      { "name": "Partitions", "type": "[]AlterReplicaLogDirPartitionResult", "versions": "0+",
        "about": "The results for each partition.", "fields": [
        { "name": "PartitionIndex", "type": "int32", "versions": "0+",
          "about": "The partition index."},
        { "name": "ErrorCode", "type": "int16", "versions": "0+",
          "about": "The error code, or 0 if there was no error." }
      ]}
    ]}
  ]
}