|
| 1 | +// Licensed to the Apache Software Foundation (ASF) under one or more |
| 2 | +// contributor license agreements. See the NOTICE file distributed with |
| 3 | +// this work for additional information regarding copyright ownership. |
| 4 | +// The ASF licenses this file to You under the Apache License, Version 2.0 |
| 5 | +// (the "License"); you may not use this file except in compliance with |
| 6 | +// the License. You may obtain a copy of the License at |
| 7 | +// |
| 8 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +// |
| 10 | +// Unless required by applicable law or agreed to in writing, software |
| 11 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +// See the License for the specific language governing permissions and |
| 14 | +// limitations under the License. |
| 15 | + |
| 16 | +{ |
| 17 | + "type": "data", |
| 18 | + "name": "ConsumerProtocolSubscription", |
| 19 | + // Subscription part of the Consumer Protocol. |
| 20 | + // |
| 21 | + // The current implementation assumes that future versions will not break compatibility. When |
| 22 | + // it encounters a newer version, it parses it using the current format. This basically means |
| 23 | + // that new versions cannot remove or reorder any of the existing fields. |
| 24 | + |
| 25 | + // Version 1 added the "OwnedPartitions" field to allow assigner know what partitions each member owned |
| 26 | + // Version 2 added a new field "GenerationId" to indicate if the member has out-of-date ownedPartitions. |
| 27 | + // Version 3 adds rack id to enable rack-aware assignment. |
| 28 | + "validVersions": "0-3", |
| 29 | + "flexibleVersions": "none", |
| 30 | + "fields": [ |
| 31 | + { "name": "Topics", "type": "[]string", "versions": "0+", |
| 32 | + "about": "The topics that the member wants to consume."}, |
| 33 | + { "name": "UserData", "type": "bytes", "versions": "0+", "nullableVersions": "0+", |
| 34 | + "default": "null", "zeroCopy": true, |
| 35 | + "about": "User data that will be passed back to the consumer."}, |
| 36 | + { "name": "OwnedPartitions", "type": "[]TopicPartition", "versions": "1+", "ignorable": true, |
| 37 | + "about": "The partitions that the member owns.", "fields": [ |
| 38 | + { "name": "Topic", "type": "string", "mapKey": true, "versions": "1+", "entityType": "topicName", |
| 39 | + "about": "The topic name."}, |
| 40 | + { "name": "Partitions", "type": "[]int32", "versions": "1+", |
| 41 | + "about": "The partition ids."} |
| 42 | + ] |
| 43 | + }, |
| 44 | + { "name": "GenerationId", "type": "int32", "versions": "2+", "default": "-1", "ignorable": true, |
| 45 | + "about": "The generation id of the member."}, |
| 46 | + { "name": "RackId", "type": "string", "versions": "3+", "nullableVersions": "3+", "default": "null", "ignorable": true, |
| 47 | + "about": "The rack id of the member."} |
| 48 | + ] |
| 49 | +} |
0 commit comments