Class MetadataBasedServerBlobFinder

java.lang.Object
com.linkedin.venice.blobtransfer.MetadataBasedServerBlobFinder
All Implemented Interfaces:
BlobFinder, AutoCloseable

public class MetadataBasedServerBlobFinder extends Object implements BlobFinder
Discovers the Venice servers hosting a store partition so a Stateful CDC / Da Vinci client with no peer can fall back to fetching a blob from a server. Used only on the cold-start fallback path.

metadata/<store> is served by Venice servers, not the Router, so this finder uses D2 server-routing (like Fast Client's RequestBasedMetadata): it resolves the store's server D2 service, GETs metadata/<store> on a server, and reads the partition-to-replica map from MetadataResponseRecord.getRoutingInfo(), reusing the D2 client on the ClientConfig. The response is decoded against the writer schema the server advertises (via its schema id), so a server running a newer MetadataResponseRecord schema than the client is still readable. Any failure returns an empty/error response so the caller falls back to Version Topic replay -- it never returns a wrong host.

  • Constructor Details

    • MetadataBasedServerBlobFinder

      public MetadataBasedServerBlobFinder(ClientConfig clientConfig)
  • Method Details

    • discoverBlobPeers

      public BlobPeersDiscoveryResponse discoverBlobPeers(String storeName, int version, int partitionId)
      Return the server replicas hosting partitionId for the store's current serving version.
      Specified by:
      discoverBlobPeers in interface BlobFinder
    • close

      public void close()
      Release finder-owned resources after the blob transfer manager has stopped issuing discovery requests.
      Specified by:
      close in interface AutoCloseable