THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block | ||
---|---|---|
| ||
// ---- START: Proposed Admin API definitions ---- /** * Update the feature versions supported cluster-wide. You may * anticipate certain exceptions when calling get() on the futures * obtained from the returned UpdateFeaturesResult. * * @param updates set of feature updates, keyed by the * name of the feature * @return the result of the updateFeatures request */ UpdateFeaturesResult updateFeatures(Set<FeatureUpdate> updates); /** * Return the following: * 1. List of cluster-wide finalized feature versions. * 2. List of supported feature versions specific to the broker. * * You may anticipate certain exceptions when calling get() on the * futures obtained from the returned DescribeFeaturesResult. */ DescribeFeaturesResult describeFeatures(); // ---- END: Proposed Admin API definitions ---- interface FeatureBase { // The name of the feature. String getName(); } // Represents a cluster-wide finalized feature, with a feature version. interface FinalizedFeature extends FeatureBase { // The finalized value of the feature version. long getVersion(); } enum FeatureUpdateType { // Delete the feature. Useful to eliminate accidental junk, // or rarely eliminate a deprecated feature altogether. DELETE, // Either add the feature (if not present), or update it (if present). ADD_OR_UPDATE } interface FeatureUpdate { // Return the feature to be updated. // The version returned via 'getFeature().getVersion()' is: // - for the FeatureUpdateType.ADD_OR_UPDATE operation, this is the new value to-be-updated for FeatureUpdateType.ADD_OR_UPDATE. // - ignoredfor forthe FeatureUpdateType.DELETE operation, this is ignored. FinalizedFeature getFeature(); // Return the type of update to be made. FeatureUpdateType getUpdateType(); } // Represents a feature that is supported by a broker, with a specific // feature version range [minVersion, maxVersion]. interface SupportedFeature extends FeatureBase { // The minimum version (value >= 0) of the supported feature. long getMinVersion(); // The maximum version (value >=0 and value >= minVersion) of the supported feature. long getMaxVersion(); } interface FeatureMetadata { // The set of cluster-wide finalized features. Set<FinalizedFeature> finalizedFeatures; // The monotonically increasing metadata version for the finalized features. long getMetadataVersion(); // The set of features supported by a broker. Set<SupportedFeature> supportedFeatures; // The hostname of the broker. String host; // The port of the broker. int32 port; } interface UpdateFeaturesResult { /** * Returns a future which indicates success/failure. * 1. If the future has succeeded (i.e. no exceptions), * then the request was 100% successful, and no top level or * individual FeatureUpdate errors were seen. The data * returned in the future contains the latest entire set of * finalized cluster-wide features (after all updates were applied), * as well as the entire set of features supported by the controller *. serving this write request. * 2. If the future has failed, the top level error (if any) * or the error from the first failed FeatureUpdate * (if any) is raised to the caller. */ KafkaFuture<FeatureMetadata> all(); } interface DescribeFeaturesResult { /** * The data returned in the future contains the latest entire set of * finalized cluster-wide features, as well as the entire set of * features supported by the broker serving this read request. */ KafkaFuture<FeatureMetadata> all(); } |
...
Code Block |
---|
=== DESCRIBE FEATURES === # Get cluster-wide finalized features, and features supported by a specific broker. # - Use `--bootstrap-server` to provide a broker host:port to which queries should be issued. # - Optionally, provide `--controller` flag directing the tool to issue the query to the # controller (while discovering the controller via the bootstrap server). # This can be useful for debugging purposes. $> kafka-features.sh describe --bootstrap-server kafka-broker0.prn1:9071 [--controller] { "status": "OK", "supported_features": { "group_coordinator": { "minVersion": 1, "maxVersion": 2 }, "transaction_coordinator": { "minVersion": 0, "maxVersion": 5 }, "consumer_offsets_topic_schema": { "minVersion": 3, "maxVersion": 7 } }, "finalized_features": { "group_coordinator": { "version": 1 }, "transaction_coordinator": { "version": 4 }, "consumer_offsets_topic_schema": { "version": 7 } }, "host": "kafka-broker0.prn1", "port": 9071 } === ADD_OR_UPDATE FEATURES === # Add or update a list of cluster-wide finalized features. # - Use `--bootstrap-server` to provide a broker host:port to which MetadataRequest query should be issued. # The MetadataResponse will be used to discover the Controller, to which the actual ADD_OR_UPDATE request is issued. # - Use `--features` to provide a comma-separated list of features and their new finalized versions to ADD_OR_UPDATE. $> kafka-features.sh update --bootstrap-server kafka-broker0.prn1:9071 --features group_coordinator:2,transaction_coordinator:5 Please confirm before finalizing the upgrade of the following features: 1. group_coordinator from v1 (existing) to v2 (new) 2. transaction_coordinator from v4 (existing) to v5 (new) [Y/n]? Y { "status": "OK", "supported_features": { "group_coordinator": { "minVersion": 1, "maxVersion": 2 }, "transaction_coordinator": { "minVersion": 0, "maxVersion": 5 }, "consumer_offsets_topic_schema": { "minVersion": 3, "maxVersion": 7 } }, "finalized_features": { "group_coordinator": { "version": 2 }, "transaction_coordinator": { "version": 5 }, "consumer_offsets_topic_schema": { "version": 7 } }, "host": "kafka-broker0.prn1", "port": 9071 } === DELETE FEATURES === # Delete a list of cluster-wide finalized features. # - Use `--bootstrap-server` to provide a broker host:port to which MetadataRequest query should be issued. # The MetadataResponse will be used to discover the Controller, to which the actual delete request is issued. # - Use `--features` to provide a comma-separated list of features to be deleted. $> kafka-features.sh delete --bootstrap-server kafka-broker0.prn1:9071 --features group_coordinator,transaction_coordinator Please confirm deletion of the following features: 1. group_coordinator 2. transaction_coordinator [Y/n] Y { "status": "OK", "supported_features": { "group_coordinator": { "minVersion": 1, "maxVersion": 2 }, "transaction_coordinator": { "minVersion": 0, "maxVersion": 5 }, "consumer_offsets_topic_schema": { "minVersion": 3, "maxVersion": 7 } }, "finalized_features": { "consumer_offsets_topic_schema": { "version": 7 } }, "host": "kafka-broker0.prn1", "port": 9071 } |
...