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 the of cluster-wide finalized feature versions. * 2. List of supported cluster-wide (via ApiVersions API) 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 FeatureFeatureBase { // The name of the feature to be updated. String getName(); } // The newRepresents a cluster-wide finalized feature, with a feature version. interface FinalizedFeature extends FeatureBase { // The finalized value of the feature version. Longlong 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. FeatureFinalizedFeature 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 FinalizedFeatureMetadataFeatureBase { // 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 cluster-wide finalized features features supported by a broker. Set<Feature>Set<SupportedFeature> featuressupportedFeatures; // The hostname of the broker. String host; // The monotonicallyport increasingof metadatathe versionbroker. int32 port; Long getMetadataVersion(); } 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<FinalizedFeatureMetadata>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<FinalizedFeatureMetadata>KafkaFuture<FeatureMetadata> all(); } |
Tooling support examples
...
Code Block |
---|
=== DESCRIBE FEATURES === # Describe features supported cluster-wide. # - Optionally, provide a broker host:port to which the `ApiVersions` query should be issued. # If this is not provided, a random broker in the cluster will be picked to serve this request. # - Optionally, provide --controller flag directing the tool to issue the query only to the controller. # 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 } === UPDATE FEATURES === # Update a list of cluster-wide finalized features. # - Provide the type of update, ex: ADD_OR_UPDATE, DELETE. # - Provide a comma-separated list of features and their new finalized versions to update. $> kafka-features.sh update --update-type ADD_OR_UPDATE --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. # - Provide the type of update, ex: DELETE. # - Provide a comma-separated list of features to be deleted. $> kafka-features.sh update --update-type DELETE --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 } |
...