|
@@ -0,0 +1,73 @@
|
|
|
+package sarama
|
|
|
+
|
|
|
+
|
|
|
+type DescribeLogDirsRequest struct {
|
|
|
+
|
|
|
+
|
|
|
+ Version int16
|
|
|
+
|
|
|
+
|
|
|
+ DescribeTopics []DescribeLogDirsRequestTopic
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+type DescribeLogDirsRequestTopic struct {
|
|
|
+ Topic string
|
|
|
+ PartitionIDs []int32
|
|
|
+}
|
|
|
+
|
|
|
+func (r *DescribeLogDirsRequest) encode(pe packetEncoder) error {
|
|
|
+ if err := pe.putArrayLength(len(r.DescribeTopics)); err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, d := range r.DescribeTopics {
|
|
|
+ if err := pe.putString(d.Topic); err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+
|
|
|
+ if err := pe.putInt32Array(d.PartitionIDs); err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return nil
|
|
|
+}
|
|
|
+
|
|
|
+func (r *DescribeLogDirsRequest) decode(pd packetDecoder, version int16) error {
|
|
|
+ n, err := pd.getArrayLength()
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+
|
|
|
+ topics := make([]DescribeLogDirsRequestTopic, n)
|
|
|
+ for i := 0; i < n; i++ {
|
|
|
+ topics[i] = DescribeLogDirsRequestTopic{}
|
|
|
+
|
|
|
+ topic, err := pd.getString()
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ topics[i].Topic = topic
|
|
|
+
|
|
|
+ pIDs, err := pd.getInt32Array()
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ topics[i].PartitionIDs = pIDs
|
|
|
+ }
|
|
|
+
|
|
|
+ return nil
|
|
|
+}
|
|
|
+
|
|
|
+func (r *DescribeLogDirsRequest) key() int16 {
|
|
|
+ return 35
|
|
|
+}
|
|
|
+
|
|
|
+func (r *DescribeLogDirsRequest) version() int16 {
|
|
|
+ return r.Version
|
|
|
+}
|
|
|
+
|
|
|
+func (r *DescribeLogDirsRequest) requiredVersion() KafkaVersion {
|
|
|
+ return V1_0_0_0
|
|
|
+}
|