Class DefaultLsrcLookupService
java.lang.Object
io.confluent.kafka.odyssey.DefaultLsrcLookupService
- All Implemented Interfaces:
LsrcLookupService
Implementation of LsrcLookupService using Resource Manager's RRI (Resource Relation Index).
This service queries the rri/v1/LKCToLSRC resource using the typed RRI client.
Features:
- Direct Get API: Uses LKC ID as primary key for O(1) lookup
- Async operations: Non-blocking operations using CompletableFuture
- Built-in retry: Uses RRI client's retry mechanism
- Observability: Integrated with OpenTelemetry via RRI client
Thread Safety:
This class is thread-safe. Multiple threads can call methods concurrently.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultLsrcLookupService(io.confluent.resourcemanager.api.client.Client rmClient) LsrcLookupService from a Resource Manager client.DefaultLsrcLookupService(io.confluent.rri.client.RRIClient rriClient) LsrcLookupService using an existing RRIClient. -
Method Summary
Modifier and TypeMethodDescriptiongetSchemaRegistryEndpoint(String lkcId) Get the Schema Registry public endpoint for a given Logical Kafka Cluster.
-
Constructor Details
-
DefaultLsrcLookupService
public DefaultLsrcLookupService(io.confluent.rri.client.RRIClient rriClient) LsrcLookupService using an existing RRIClient.- Parameters:
rriClient- the RRI client for querying LKCToLSRC resources
-
DefaultLsrcLookupService
public DefaultLsrcLookupService(io.confluent.resourcemanager.api.client.Client rmClient) LsrcLookupService from a Resource Manager client.This constructor wraps the RM client in an RRIClient for type-safe access to RRI resources.
- Parameters:
rmClient- the Resource Manager client
-
-
Method Details
-
getSchemaRegistryEndpoint
Description copied from interface:LsrcLookupServiceGet the Schema Registry public endpoint for a given Logical Kafka Cluster.This method queries the Resource Manager's RRI LKCToLSRC resource to find the mapping from LKC to LSRC and extracts the public endpoint URL.
- Specified by:
getSchemaRegistryEndpointin interfaceLsrcLookupService- Parameters:
lkcId- the Logical Kafka Cluster ID (e.g., "lkc-abc123"), must not be null- Returns:
- a CompletableFuture containing Optional with the Schema Registry public endpoint URL, or empty Optional if no mapping exists. Never returns null.
-