Class DefaultLsrcLookupService

java.lang.Object
io.confluent.kafka.odyssey.DefaultLsrcLookupService
All Implemented Interfaces:
LsrcLookupService

public class DefaultLsrcLookupService extends Object implements 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 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

      public CompletableFuture<Optional<String>> getSchemaRegistryEndpoint(String lkcId)
      Description copied from interface: LsrcLookupService
      Get 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:
      getSchemaRegistryEndpoint in interface LsrcLookupService
      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.