Interface StoreMetadata
- All Superinterfaces:
AutoCloseable,Closeable,SchemaReader
- All Known Implementing Classes:
AbstractStoreMetadata,RequestBasedMetadata
trackHealthBasedOnRequestToInstance(java.lang.String, int, int, java.util.concurrent.CompletableFuture<com.linkedin.venice.client.store.transport.TransportClientResponse>)
to decide the healthiness of each replica.-
Method Summary
Modifier and TypeMethodDescriptionintdefault CompressionStrategygetCompressionStrategy(int version) Returns theCompressionStrategyconfigured for the given storeversion.getCompressor(CompressionStrategy compressionStrategy, int version) intintgetPartitionId(int version, byte[] key) intgetPartitionId(int version, ByteBuffer key) getReplica(long requestId, int groupId, int version, int partitionId, Set<String> excludedInstances) This function is expected to return fully qualified URI, such as: "https://fake.host:8888".getReplicas(int version, int partitionId) default booleanisReady()default voidRegister a callback that fires when the metadata refresh loop observes a change to the store-level config snapshot (e.g.default voidRegister a callback that fires when the metadata refresh loop observes a change to the store's current serving version.<K> voidrouteRequest(RequestContext requestContext, RecordSerializer<K> keySerializer) voidstart()trackHealthBasedOnRequestToInstance(String instance, int version, int partitionId, CompletableFuture<TransportClientResponse> transportFuture) Methods inherited from interface com.linkedin.venice.schema.SchemaReader
getKeySchema, getLatestUpdateSchema, getLatestValueSchema, getLatestValueSchemaId, getLatestValueSchemaId, getUpdateSchema, getValueSchema, getValueSchemaId
-
Method Details
-
getClusterName
String getClusterName() -
getStoreName
String getStoreName() -
getCurrentStoreVersion
int getCurrentStoreVersion() -
getPartitionId
-
getPartitionId
int getPartitionId(int version, byte[] key) -
getReplicas
-
getReplica
String getReplica(long requestId, int groupId, int version, int partitionId, Set<String> excludedInstances) This function is expected to return fully qualified URI, such as: "https://fake.host:8888". -
trackHealthBasedOnRequestToInstance
ChainedCompletableFuture<Integer,Integer> trackHealthBasedOnRequestToInstance(String instance, int version, int partitionId, CompletableFuture<TransportClientResponse> transportFuture) -
getInstanceHealthMonitor
InstanceHealthMonitor getInstanceHealthMonitor() -
getCompressor
-
getCompressionStrategy
Returns theCompressionStrategyconfigured for the given storeversion.The strategy is delivered to this metadata instance via the per-version
versionPropertieson each metadata-refresh response. The Fast Client'sdecompressAndDeserializeseam uses this internally to resolve the per-version compressor when decoding out-of-band value bytes.External integration layers should not call this directly — use
AvroGenericStoreClient.decompressAndDeserialize(java.nio.ByteBuffer, int, Object)instead, which handles the version → strategy → compressor → schema id resolution behind a single call.Unknown-version contract. The canonical
AbstractStoreMetadata-derived implementation throwsVeniceClientExceptionon a version it has never observed (e.g. caller typo, or a version evicted from the active set on a prior refresh). The default implementation here returnsCompressionStrategy.NO_OPso that lightweight test fakes do not need to track per-version state — fake-based tests should not pass unknown versions to begin with. -
getBatchGetLimit
int getBatchGetLimit() -
start
void start() -
isReady
default boolean isReady() -
routeRequest
-
registerVersionSwitchListener
Register a callback that fires when the metadata refresh loop observes a change to the store's current serving version. The callback is invoked after the new version has been committed to the local cache. SeeStoreVersionSwitchListenerfor threading and exception semantics.Registration timing. Listeners must be registered before
start()to observe the initial transition committed by the first refresh. Listeners registered afterstart()returns observe only subsequent transitions.listenermust not benull. Default implementations ofStoreMetadata(e.g. test fakes) treat the registration itself as a no-op but still enforce the non-null contract so behavior is consistent with the canonicalAbstractStoreMetadataimplementation.- Throws:
IllegalArgumentException- iflistenerisnull
-
registerStoreConfigChangeListener
Register a callback that fires when the metadata refresh loop observes a change to the store-level config snapshot (e.g. operator-drivenExternalStorageReadModeflip). The callback is invoked after the new snapshot has been committed to the local cache. SeeStoreConfigChangeListenerfor threading and exception semantics.Registration timing. Same as
registerVersionSwitchListener(com.linkedin.venice.client.store.listeners.StoreVersionSwitchListener)— register beforestart()to observe the initial snapshot; post-start registration observes only subsequent changes.listenermust not benull. Default implementations ofStoreMetadata(e.g. test fakes) treat the registration itself as a no-op but still enforce the non-null contract so behavior is consistent with the canonicalAbstractStoreMetadataimplementation.- Throws:
IllegalArgumentException- iflistenerisnull
-