kafka-client-engine 0.0.1

Execution and driver-integration layer for the native Kafka client
Documentation
//! Closed ownership aggregate for the native engine host.

use std::sync::Arc;

use crate::{
    admin::{
        AbortPartitionTransactionShardOwner, AddRaftVoterShardOwner,
        AdminDescribeProducersShardOwner, AdminDescribeTopicPartitionsShardOwner,
        AdminDescribeTransactionsShardOwner, AdminFenceProducersShardOwner,
        AdminListOffsetsShardOwner, AdminListTransactionsShardOwner, AlterClientQuotasShardOwner,
        AlterConsumerGroupOffsetsShardOwner, AlterPartitionReassignmentsShardOwner,
        AlterReplicaLogDirsShardOwner, AlterUserScramCredentialsShardOwner, CreateAclsShardOwner,
        CreateDelegationTokenShardOwner, CreatePartitionsShardOwner, CreateTopicsShardOwner,
        DeleteAclsShardOwner, DeleteConsumerGroupOffsetsShardOwner, DeleteConsumerGroupsShardOwner,
        DeleteRecordsShardOwner, DeleteTopicsShardOwner, DescribeAclsShardOwner,
        DescribeClientQuotasShardOwner, DescribeClusterShardOwner, DescribeConfigsShardOwner,
        DescribeConsumerGroupsShardOwner, DescribeDelegationTokensShardOwner,
        DescribeFeaturesShardOwner, DescribeLogDirsShardOwner, DescribeMetadataQuorumShardOwner,
        DescribeReplicaLogDirsShardOwner, DescribeTopicsShardOwner,
        DescribeUserScramCredentialsShardOwner, ElectLeadersShardOwner,
        ExpireDelegationTokenShardOwner, IncrementalAlterConfigsShardOwner,
        LegacyAlterConfigsShardOwner, ListConsumerGroupOffsetsShardOwner,
        ListConsumerGroupsShardOwner, ListPartitionReassignmentsShardOwner,
        RemoveConsumerGroupMembersShardOwner, RemoveRaftVoterShardOwner,
        RenewDelegationTokenShardOwner,
        alter_share_group_offsets::AlterShareGroupOffsetsShardOwner,
        delete_share_group_offsets::DeleteShareGroupOffsetsShardOwner,
        describe_share_group::DescribeShareGroupShardOwner,
        describe_streams_group::DescribeStreamsGroupShardOwner,
        list_client_metrics_resources::internal_api::ListClientMetricsResourcesShardOwner,
        list_config_resources::ListConfigResourcesShardOwner,
        list_share_group_offsets::ListShareGroupOffsetsShardOwner,
        unregister_broker::UnregisterBrokerShardOwner, update_features::UpdateFeaturesShardOwner,
    },
    clock::MonotonicClock,
    driver::{
        DescribeClusterCalls, DescribeConfigsCalls, DescribeTopicsCalls, DriverOwner,
        IncrementalAlterConfigsCalls, TrackedCreatePartitionsCalls, TrackedCreateTopicsCalls,
        TrackedDeleteTopicsCalls, TrackedProduceCalls, TrackedProducerIdentityCalls,
    },
    producer::{host_turn::ProducerTurnBudget, ingress::ProducerShardOwner},
    transaction::TransactionInitializationShardOwner,
};

use super::super::EngineHostControl;

pub(crate) struct EngineHostResources {
    pub(in super::super) driver: Option<DriverOwner>,
    pub(in super::super) producer: ProducerShardOwner,
    pub(in super::super) admin_notifier: crate::admin::AdminCompletionNotifier,
    pub(in super::super) assigned_consumer_notifier:
        crate::consumer::AssignedConsumerCompletionNotifier,
    pub(in super::super) abort_partition_transaction: AbortPartitionTransactionShardOwner,
    pub(in super::super) add_raft_voter: AddRaftVoterShardOwner,
    pub(in super::super) remove_raft_voter: RemoveRaftVoterShardOwner,
    pub(in super::super) create_topics: CreateTopicsShardOwner,
    pub(in super::super) create_acls: CreateAclsShardOwner,
    pub(in super::super) create_delegation_token: CreateDelegationTokenShardOwner,
    pub(in super::super) describe_delegation_tokens: DescribeDelegationTokensShardOwner,
    pub(in super::super) renew_delegation_token: RenewDelegationTokenShardOwner,
    pub(in super::super) expire_delegation_token: ExpireDelegationTokenShardOwner,
    pub(in super::super) delete_acls: DeleteAclsShardOwner,
    pub(in super::super) delete_topics: DeleteTopicsShardOwner,
    pub(in super::super) delete_consumer_groups: DeleteConsumerGroupsShardOwner,
    pub(in super::super) delete_records: DeleteRecordsShardOwner,
    pub(in super::super) describe_acls: DescribeAclsShardOwner,
    pub(in super::super) describe_client_quotas: DescribeClientQuotasShardOwner,
    pub(in super::super) alter_client_quotas: AlterClientQuotasShardOwner,
    pub(in super::super) alter_user_scram_credentials: AlterUserScramCredentialsShardOwner,
    pub(in super::super) update_features: UpdateFeaturesShardOwner,
    pub(in super::super) unregister_broker: UnregisterBrokerShardOwner,
    pub(in super::super) describe_user_scram_credentials: DescribeUserScramCredentialsShardOwner,
    pub(in super::super) describe_metadata_quorum: DescribeMetadataQuorumShardOwner,
    pub(in super::super) describe_producers: AdminDescribeProducersShardOwner,
    pub(in super::super) describe_topic_partitions: AdminDescribeTopicPartitionsShardOwner,
    pub(in super::super) describe_transactions: AdminDescribeTransactionsShardOwner,
    pub(in super::super) fence_producers: AdminFenceProducersShardOwner,
    pub(in super::super) list_transactions: AdminListTransactionsShardOwner,
    pub(in super::super) list_client_metrics_resources: ListClientMetricsResourcesShardOwner,
    pub(in super::super) list_config_resources: ListConfigResourcesShardOwner,
    pub(in super::super) describe_cluster: DescribeClusterShardOwner,
    pub(in super::super) describe_consumer_groups: DescribeConsumerGroupsShardOwner,
    pub(in super::super) describe_features: DescribeFeaturesShardOwner,
    pub(in super::super) describe_log_dirs: DescribeLogDirsShardOwner,
    pub(in super::super) describe_replica_log_dirs: DescribeReplicaLogDirsShardOwner,
    pub(in super::super) alter_replica_log_dirs: AlterReplicaLogDirsShardOwner,
    pub(in super::super) create_partitions: CreatePartitionsShardOwner,
    pub(in super::super) describe_topics: DescribeTopicsShardOwner,
    pub(in super::super) describe_configs: DescribeConfigsShardOwner,
    pub(in super::super) incremental_alter_configs: IncrementalAlterConfigsShardOwner,
    pub(in super::super) legacy_alter_configs: LegacyAlterConfigsShardOwner,
    pub(in super::super) list_consumer_group_offsets: ListConsumerGroupOffsetsShardOwner,
    pub(in super::super) list_consumer_groups: ListConsumerGroupsShardOwner,
    pub(in super::super) delete_consumer_group_offsets: DeleteConsumerGroupOffsetsShardOwner,
    pub(in super::super) delete_share_group_offsets: DeleteShareGroupOffsetsShardOwner,
    pub(in super::super) list_share_group_offsets: ListShareGroupOffsetsShardOwner,
    pub(in super::super) alter_share_group_offsets: AlterShareGroupOffsetsShardOwner,
    pub(in super::super) describe_share_group: DescribeShareGroupShardOwner,
    pub(in super::super) describe_streams_group: DescribeStreamsGroupShardOwner,
    pub(in super::super) alter_consumer_group_offsets: AlterConsumerGroupOffsetsShardOwner,
    pub(in super::super) list_offsets: AdminListOffsetsShardOwner,
    pub(in super::super) list_partition_reassignments: ListPartitionReassignmentsShardOwner,
    pub(in super::super) alter_partition_reassignments: AlterPartitionReassignmentsShardOwner,
    pub(in super::super) elect_leaders: ElectLeadersShardOwner,
    pub(in super::super) remove_consumer_group_members: RemoveConsumerGroupMembersShardOwner,
    pub(in super::super) assigned_consumer: crate::consumer::AssignedConsumerShardOwner,
    pub(in super::super) group_consumers: crate::consumer::GroupConsumerShardOwner,
    pub(in super::super) transaction_initialization: TransactionInitializationShardOwner,
    pub(in super::super) clock: Arc<MonotonicClock>,
    pub(in super::super) control: Arc<EngineHostControl>,
    pub(in super::super) budget: ProducerTurnBudget,
    pub(in super::super) produce_calls: TrackedProduceCalls,
    pub(in super::super) producer_identity_calls: TrackedProducerIdentityCalls,
    pub(in super::super) producer_partitioning_call:
        Option<super::super::produce::ProducerPartitioningCall>,
    pub(in super::super) create_topics_calls: TrackedCreateTopicsCalls,
    pub(in super::super) delete_topics_calls: TrackedDeleteTopicsCalls,
    pub(in super::super) describe_cluster_calls: DescribeClusterCalls,
    pub(in super::super) create_partitions_calls: TrackedCreatePartitionsCalls,
    pub(in super::super) describe_topics_calls: DescribeTopicsCalls,
    pub(in super::super) describe_configs_calls: DescribeConfigsCalls,
    pub(in super::super) incremental_alter_configs_calls: IncrementalAlterConfigsCalls,
}

impl Drop for EngineHostResources {
    fn drop(&mut self) {
        super::super::admission_close::close_all(self);
    }
}