Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titleAlterVirtualClusterRequest
{
  "apiKey": 92,
  "type": "request",
  "listeners": ["broker", "controller"],
  "name": "AlterVirtualClustersRequest",
  "validVersions": "0",
  "flexibleVersions": "0+",
  "fields": [
    { "name": "VirtualCluster", "type": "[]VirtualClusterData", "versions": "0+",
      "about": "The virtual clusters to Alter.", "fields": [
      { "name": "Name", "type": "string", "versions": "0+", "mapKey": true,
        "about": "The name of the virtual cluster." },
      { "name": "Resources", "type": "[]VirtualClusterResource", "versions": "0+",
        "about": "The updates for each resource.", "fields": [
        { "name": "ResourceType", "type": "int8", "versions": "0+", "mapKey": true,
          "about": "The resource type." },
        { "name": "ResourceName", "type": "string", "versions": "0+", "mapKey": true,
          "about": "The resource name." },
        { "name": "ResourceOperation", "type": "int8", "versions": "0+", "mapKey": true,
          "about": "The operation on the resource." }
      ]}
    ]},
    { "name": "timeoutMs", "type": "int32", "versions": "0+", "default": "60000",
      "about": "How long to wait in milliseconds before timing out the request." },
    { "name": "validateOnly", "type": "bool", "versions": "1+", "default": "false", "ignorable": false,
      "about": "If true, check that the virtual clusters can be created as specified, but don't create anything." }
  ]
}
  

DELETE_VIRTUAL_CLUSTER

Users who are allowed for DELETE_VIRTUAL_CLUSTER on CLUSTER resources, will be able to delete a virtual cluster. A virtual cluster can only be deleted when it’s empty and no users, clients and topics are associated with it.

LIST_VIRTUAL_CLUSTERS

Users who are allowed for LIST_VIRTUAL_CLUSTERS on CLUSTER resources, will be able to retrieve a list of virtual clusters in the Kafka cluster.

DESCRIBE_VIRTUAL_CLUSTER

...


Code Block
titleAlterVirtualClusterResponse
{
  "apiKey": 92,
  "type": "response",
  "name": "AlterVirtualClustersResponse",
  "validVersions": "0",
  "flexibleVersions": "0+",
  "fields": [
    { "name": "VirtualCluster", "type": "[]VirtualClusterData", "versions": "0+",
      "about": "The virtual clusters to Alter.", "fields": [
      { "name": "Name", "type": "string", "versions": "0+", "mapKey": true,
        "about": "The name of the virtual cluster." },
      { "name": "Resources", "type": "[]VirtualClusterResource", "versions": "0+",
        "about": "The updates for each resource.", "fields": [
        { "name": "ResourceType", "type": "int8", "versions": "0+", "mapKey": true,
          "about": "The resource type." },
        { "name": "ResourceName", "type": "string", "versions": "0+", "mapKey": true,
          "about": "The resource name." },
        { "name": "ResourceOperation", "type": "int8", "versions": "0+", "mapKey": true,
          "about": "The operation on the resource." },
        { "name": "ErrorCode", "type": "int16", "versions": "0+",
          "about": "The error code, or 0 if there was no error." },
        { "name": "ErrorMessage", "type": "string", "versions": "1+", "nullableVersions": "0+", "ignorable": true,
          "about": "The error message, or null if there was no error." }
      ]}
    ]}
  ]
}
   

DELETE_VIRTUAL_CLUSTER

Users who are allowed for DELETE_VIRTUAL_CLUSTER on CLUSTER resources, will be able to delete a virtual cluster. A virtual cluster can only be deleted when it’s empty and no users, clients and topics are associated with it.

Code Block
titleDeleteVirtualClusterRequest
{
  "apiKey": 93,
  "type": "request",
  "listeners": ["broker", "controller"],
  "name": "DeleteVirtualClustersRequest",
  "validVersions": "0",
  "flexibleVersions": "0+",
  "fields": [
    { "name": "VirtualClusters", "type": "[]DeletableVirtualCluster", "versions": "0+",
      "about": "The virtual clusters to create.", "fields": [
      { "name": "Name", "type": "string", "versions": "0+", "mapKey": true,
        "about": "The name of the virtual cluster." }
    ]},
    { "name": "timeoutMs", "type": "int32", "versions": "0+", "default": "60000",
      "about": "How long to wait in milliseconds before timing out the request." },
    { "name": "validateOnly", "type": "bool", "versions": "1+", "default": "false", "ignorable": false,
      "about": "If true, check that the virtual clusters can be deleted as specified, but don't delete anything." }
  ]
}
   


Code Block
titleDeleteVirtualClusterResponse
{
  "apiKey": 93,
  "type": "response",
  "name": "DeleteVirtualClustersResponse",
  "validVersions": "0",
  "flexibleVersions": "0+",
  "fields": [
    { "name": "ThrottleTimeMs", "type": "int32", "versions": "1+", "ignorable": true,
      "about": "The 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": "Responses", "type": "[]DeletableVirtualClusterResult", "versions": "0+",
      "about": "The results for each virtual cluster we tried to delete.", "fields": [
      { "name": "Name", "type": "string", "versions": "0+", "mapKey": true,
        "about": "The name of the virtual cluster." },
      { "name": "ErrorCode", "type": "int16", "versions": "0+",
        "about": "The deletion error, or 0 if the deletion succeeded." },
      { "name": "ErrorMessage", "type": "string", "versions": "0+", "nullableVersions": "0+", "ignorable": true, "default": "null",
        "about": "The error message, or null if there was no error." }
    ]}
  ]
}    

LIST_VIRTUAL_CLUSTERS

Users who are allowed for LIST_VIRTUAL_CLUSTERS on CLUSTER resources, will be able to retrieve a list of virtual clusters in the Kafka cluster.

Code Block
titleListVirtualClusterRequest
{
  "apiKey": 94,
  "type": "request",
  "listeners": ["zkBroker", "broker"],
  "name": "ListVirtualClustersRequest",
  "validVersions": "0",
  "flexibleVersions": "0+",
  "fields": [
  ]
}   


Code Block
titleListVirtualClusterResponse
{
  "apiKey": 94,
  "type": "response",
  "name": "ListVirtualClustersResponse",
  "validVersions": "0",
  "flexibleVersions": "0+",
  "fields": [
    { "name": "ThrottleTimeMs", "type": "int32", "versions": "1+", "ignorable": true,
      "about": "The 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": "ErrorCode", "type": "int16", "versions": "0+",
      "about": "The error code, or 0 if there was no error." },
    { "name": "VirtualClusters", "type": "[]ListedVirtualCluster", "versions": "0+",
      "about": "Each virtual cluster in the response.", "fields": [
      { "name": "Name", "type": "string", "versions": "0+", "mapKey": true,
        "about": "The name of the virtual cluster." }
    ]}
  ]
}

DESCRIBE_VIRTUAL_CLUSTER

Users who are allowed for DESCRIBE_VIRTUAL_CLUSTER on CLUSTER resources, will be able to describe a virtual cluster. The listing would include the topics, users, clients, groups and transactions assigned to that virtual cluster.

Code Block
titleDescribeVirtualClusterRequest
{
  "apiKey": 95,
  "type": "request",
  "listeners": ["broker", "controller"],
  "name": "DescribeVirtualClustersRequest",
  "validVersions": "0",
  "flexibleVersions": "0+",
  "fields": [
    { "name": "VirtualClusters", "type": "[]VirtualClusterData", "versions": "0+",
      "about": "The virtual clusters to describe.", "fields": [
      { "name": "Name", "type": "string", "versions": "0+", "mapKey": true,
        "about": "The name of the virtual cluster." }
    ]}
  ]
}


Code Block
titledescribeVirtualClusterResponse
{
  "apiKey": 95,
  "type": "response",
  "name": "DescribeVirtualClustersResponse",
  "validVersions": "0",
  "flexibleVersions": "0+",
  "fields": [
    { "name": "ThrottleTimeMs", "type": "int32", "versions": "0+", "ignorable": true,
      "about": "The 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": "VirtualClusters", "type": "[]VirtualClusterResults", "versions": "0+",
      "about": "The virtual clusters to describe.", "fields": [
      { "name": "Name", "type": "string", "versions": "0+", "mapKey": true,
        "about": "The name of the virtual cluster." },
      { "name": "ErrorCode", "type": "int16", "versions": "0+",
        "about": "The topic error, or 0 if there was no error." },
      { "name":  "TopicLinks", "type": "[]TopicLink", "versions": "0+",
        "about": "The topic links for the virtual cluster.", "fields": [
        { "name": "LinkName", "type": "string", "versions": "0+", "entityType": "topicName",
          "about": "The name of the topic link." },
        { "name": "PhysicalName", "type": "string", "versions": "0+", "entityType": "topicName",
          "about": "The topic name on the physical cluster." }
      ]},
      { "name": "Users", "type": "[]string", "versions": "0+", "about": "The users of the virtual cluster." },
      { "name": "ClientIds", "type": "[]string", "versions": "0+", "about": "The client ids of the virtual cluster." },
      { "name": "TransactionalIds", "type": "[]string", "versions": "0+", "entityType": "transactionalId", "about": "The transactional ids associated with the virtual cluster." },
      { "name": "ConsumerGroups", "type": "[]string", "versions": "0+", "entityType": "groupId", "about": "The consumer group ids associated with the virtual cluster." }
    ]}
  ]
}

Interface Changes

We’ll list the anticipated interface changes below.

Admin APIs

Create Virtual Clusters

Code Block
languagejava
titleCreateVirtualClustersResult
@InterfaceStability.Evolving
public class CreateVirtualClustersResult {

    private final Map<String, KafkaFuture<CreateVirtualClustersResponseData.CreatableVirtualClustersResult>> futures;

    public CreateVirtualClustersResult(Map<String, KafkaFuture<CreateVirtualClustersResponseData.CreatableVirtualClustersResult>> futures) {
        this.futures = futures;
    }

    public Map<String, KafkaFuture<Void>> values() {
        return futures.entrySet().stream()
                .collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().thenApply(v -> null)));
    }

    public KafkaFuture<Void> all() {
        return KafkaFuture.allOf(futures.values().toArray(new KafkaFuture[0]));
    }
}


Code Block
languagejava
titleNewVirtualCluster
@InterfaceStability.Evolving
public class NewVirtualCluster {

    private final String name;

    public NewVirtualCluster(String name) {
        this.name = name;
    }

    public String name() {
        return name;
    }
}


Code Block
languagejava
titleCreateVirtualClustersOptions
@InterfaceStability.Evolving
public class CreateVirtualClustersOptions extends AbstractOptions<CreateVirtualClustersOptions> {

    private boolean validateOnly = false;
    private boolean retryOnQuotaViolation = true;

    public CreateVirtualClustersOptions timeoutMs(Integer timeoutMs) {
        this.timeoutMs = timeoutMs;
        return this;
    }

    public CreateVirtualClustersOptions validateOnly(boolean validateOnly) {
        this.validateOnly = validateOnly;
        return this;
    }

    public boolean shouldValidateOnly() {
        return validateOnly;
    }

    public CreateVirtualClustersOptions retryOnQuotaViolation(boolean retryOnQuotaViolation) {
        this.retryOnQuotaViolation = retryOnQuotaViolation;
        return this;
    }

    public boolean shouldRetryOnQuotaViolation() {
        return retryOnQuotaViolation;
    }
}

Public Interfaces

Briefly list any new interfaces that will be introduced as part of this proposal or any existing interfaces that will be removed or changed. The purpose of this section is to concisely call out the public contract that will come along with this feature.

...