Class OdysseyIntegrationManager
- All Implemented Interfaces:
OdysseyManager, OdysseyReadManager, AutoCloseable
This class owns and manages the lifecycle of all internal components. Call close()
to release resources.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for OdysseyIntegrationManager.Nested classes/interfaces inherited from interface OdysseyManager
OdysseyManager.LargeAssociationPayloads -
Constructor Summary
ConstructorsConstructorDescriptionOdysseyIntegrationManager(OdysseyRequestManager odysseyRequestManager, TopicIdLookup topicIdLookup, String clusterId, org.apache.kafka.common.utils.internals.LogContext logContext, org.apache.kafka.common.utils.Time time, LsrcLookupService lsrcLookupService, org.apache.kafka.common.config.BrokerType brokerType, String schemaRegistryUrl) Test-only constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this manager and releases all resources.CompletableFuture<org.apache.kafka.common.message.CreateTopicsResponseData> handleCreateTopicsWithOdyssey(org.apache.kafka.common.requests.CreateTopicsRequest request, BiFunction<org.apache.kafka.common.message.CreateTopicsRequestData, Set<String>, CompletableFuture<org.apache.kafka.common.message.CreateTopicsResponseData>> topicCreator, org.apache.kafka.common.security.auth.KafkaPrincipal principal) Handles CreateTopics requests with Odyssey integration for K1.handleDeleteTopicsWithOdyssey(Map<String, org.apache.kafka.common.Uuid> nameToId, Set<String> topicsWithAssociations, org.apache.kafka.common.security.auth.KafkaPrincipal principal) Handles DeleteTopics requests with Odyssey integration for K1.handleDescribeConfigsWithOdyssey(org.apache.kafka.common.message.DescribeConfigsResponseData kafkaResponse, List<String> topicNames, org.apache.kafka.common.security.auth.KafkaPrincipal principal, org.apache.kafka.common.ConfluentAssociationFetchMode fetchMode, boolean isClusterLink) Handles DescribeConfigs requests with Odyssey integration for K1.handleIncrementalAlterConfigsWithOdyssey(Map<org.apache.kafka.common.config.ConfigResource, Map<String, Map.Entry<org.apache.kafka.clients.admin.AlterConfigOp.OpType, String>>> configChanges, Map<org.apache.kafka.common.config.ConfigResource, OdysseyManager.LargeAssociationPayloads> largePayloads, org.apache.kafka.common.security.auth.KafkaPrincipal principal, boolean validateOnly, ControllerConfigUpdater controllerConfigUpdater, Consumer<Map<org.apache.kafka.common.config.ConfigResource, org.apache.kafka.common.requests.ApiError>> responseDataUpdater, ExternalSchemaUpdater externalSchemaUpdater) Handles IncrementalAlterConfigs requests with Odyssey integration for K1.voidnotifyDeleteTopicsResult(Set<org.apache.kafka.common.Uuid> associationDeletedTopicIds, Map<org.apache.kafka.common.Uuid, org.apache.kafka.common.requests.ApiError> idToError) Reports per-topic results from the post-Odyssey Kafka delete so SR-committed-but-Kafka-failed topics — the orphan-event boundary — can be observed.
-
Constructor Details
-
OdysseyIntegrationManager
public OdysseyIntegrationManager(OdysseyRequestManager odysseyRequestManager, TopicIdLookup topicIdLookup, String clusterId, org.apache.kafka.common.utils.internals.LogContext logContext, org.apache.kafka.common.utils.Time time, LsrcLookupService lsrcLookupService, org.apache.kafka.common.config.BrokerType brokerType, String schemaRegistryUrl) Test-only constructor. Production code should useOdysseyIntegrationManager.Builder, which constructsodysseyRequestManagerandlsrcLookupServiceitself.
-
-
Method Details
-
handleCreateTopicsWithOdyssey
public CompletableFuture<org.apache.kafka.common.message.CreateTopicsResponseData> handleCreateTopicsWithOdyssey(org.apache.kafka.common.requests.CreateTopicsRequest request, BiFunction<org.apache.kafka.common.message.CreateTopicsRequestData, Set<String>, CompletableFuture<org.apache.kafka.common.message.CreateTopicsResponseData>> topicCreator, org.apache.kafka.common.security.auth.KafkaPrincipal principal) Handles CreateTopics requests with Odyssey integration for K1.Schema Registry validation completes before any topic is created, and associations are created only after creation succeeds; a topic that fails validation is never created.
- Specified by:
handleCreateTopicsWithOdysseyin interfaceOdysseyManager- Parameters:
request- the CreateTopics request, holding only authorized topicstopicCreator- creates the given topics; its second argument names the subset whose external-schema type the same create operation must set to MAYBEprincipal- the request principal for namespace extraction and token acquisition- Returns:
- CompletableFuture with the complete response
-
handleDescribeConfigsWithOdyssey
public CompletableFuture<DescribeConfigsOdysseyResult> handleDescribeConfigsWithOdyssey(org.apache.kafka.common.message.DescribeConfigsResponseData kafkaResponse, List<String> topicNames, org.apache.kafka.common.security.auth.KafkaPrincipal principal, org.apache.kafka.common.ConfluentAssociationFetchMode fetchMode, boolean isClusterLink) Handles DescribeConfigs requests with Odyssey integration for K1.Flow:
- Resolve Schema Registry endpoint (via RM)
- Fetch schema associations from SR for all requested TOPIC resources
- Inject association data as config entries into the Kafka response
Kafka configs are always returned regardless of SR errors. On SR failure, the relevant SR error code and error message are embedded in the Kafka error message.
- Specified by:
handleDescribeConfigsWithOdysseyin interfaceOdysseyReadManager- Parameters:
kafkaResponse- The standard Kafka DescribeConfigs response to enrichtopicNames- Topic names to fetch associations for (must be TOPIC resources only)principal- The Kafka principal for the requestfetchMode- the requested association fetch mode (from the DescribeConfigs tagged field);DEFAULTmeans no associations are returned, for every caller — a caller that wants associations back must requestASSOCIATIONS_WITHOUT_SCHEMAexplicitlyisClusterLink- whether the request originated from a cluster link (present cluster-link id header). No longer affects the result — retained on the signature for compatibility with existing callers- Returns:
- CompletableFuture with the enriched result; never completes exceptionally —
SR errors are captured per-topic as failed
OdysseyResultinstances
-
handleDeleteTopicsWithOdyssey
public CompletableFuture<List<DeleteResult>> handleDeleteTopicsWithOdyssey(Map<String, org.apache.kafka.common.Uuid> nameToId, Set<String> topicsWithAssociations, org.apache.kafka.common.security.auth.KafkaPrincipal principal) Description copied from interface:OdysseyManagerHandles DeleteTopics requests with Odyssey integration for K1. The caller has already authorized each topic and resolved its UUID.topicsWithAssociationsis the caller's classification of which topics may carry a Schema Registry association; this method does not classify. A superset is safe — those topics just pay a no-op SR call — but a subset orphans associations, since the topic is deleted right afterwards.Returns one
DeleteResultper input topic, innameToIditeration order.- Specified by:
handleDeleteTopicsWithOdysseyin interfaceOdysseyManager
-
notifyDeleteTopicsResult
public void notifyDeleteTopicsResult(Set<org.apache.kafka.common.Uuid> associationDeletedTopicIds, Map<org.apache.kafka.common.Uuid, org.apache.kafka.common.requests.ApiError> idToError) Description copied from interface:OdysseyManagerReports per-topic results from the post-Odyssey Kafka delete so SR-committed-but-Kafka-failed topics — the orphan-event boundary — can be observed.- Specified by:
notifyDeleteTopicsResultin interfaceOdysseyManager- Parameters:
associationDeletedTopicIds- topics whose SR association was actually removed this request; the only orphan candidates. Callers must exclude bypass-SR (no-association) topics.idToError- per-topic Kafka delete outcomes
-
handleIncrementalAlterConfigsWithOdyssey
public CompletableFuture<Void> handleIncrementalAlterConfigsWithOdyssey(Map<org.apache.kafka.common.config.ConfigResource, Map<String, Map.Entry<org.apache.kafka.clients.admin.AlterConfigOp.OpType, String>>> configChanges, Map<org.apache.kafka.common.config.ConfigResource, OdysseyManager.LargeAssociationPayloads> largePayloads, org.apache.kafka.common.security.auth.KafkaPrincipal principal, boolean validateOnly, ControllerConfigUpdater controllerConfigUpdater, Consumer<Map<org.apache.kafka.common.config.ConfigResource, org.apache.kafka.common.requests.ApiError>> responseDataUpdater, ExternalSchemaUpdater externalSchemaUpdater) Description copied from interface:OdysseyManagerHandles IncrementalAlterConfigs requests with Odyssey integration for K1.SET ops upsert associations to SR; DELETE ops disassociate them. Non-Odyssey resources bypass the SR flow and go directly to the controller. Every per-resource result — illegal rejection, validation failure, SR-resolution failure, controller result, SR-upsert result — is delivered through
responseDataUpdater, which is the sole channel for response writes and handles any caller-side translation (e.g. cluster link name mapping).When
validateOnlyistrue, SR dry-run validation still runs, the controller call still runs (passed-throughvalidateOnlyby the caller's lambda), but the real SR upsert (updateAssociations) is skipped — no schema-association state changes in SR. Mirrors the CreateTopics-with-Odyssey behavior.- Specified by:
handleIncrementalAlterConfigsWithOdysseyin interfaceOdysseyManager- Parameters:
configChanges- preprocessed config changes per resource, keyed by op typelargePayloads- association payloads the request delivered as tagged bytes, per resource; resolved intoconfigChangesbefore classificationprincipal- the request principal for namespace extraction and token acquisitionvalidateOnly- if true, skip real SR upsert (dry-run validation still runs)controllerConfigUpdater- callback to apply config changes via the controller (Odyssey configs stripped); receivesvalidateOnlyexplicitly so the controller call honours the same flagresponseDataUpdater- consumer that receives each per-resource result (resource → ApiError) and writes it into the caller's response with any required translationexternalSchemaUpdater-ExternalSchemaUpdater, invoked between the controller alter and the SR upsert- Returns:
- CompletableFuture that completes after the final
responseDataUpdaterinvocation; on failure, completes exceptionally with the error
-
close
public void close()Closes this manager and releases all resources.This method closes:
- OdysseyRequestManager (closes executor, metrics, and Token Platform client)
- LsrcLookupService (closes metrics and RM client)
- Specified by:
closein interfaceAutoCloseable
-