Class RequestBasedMetadata
java.lang.Object
com.linkedin.venice.fastclient.meta.AbstractStoreMetadata
com.linkedin.venice.fastclient.meta.RequestBasedMetadata
- All Implemented Interfaces:
- StoreMetadata,- SchemaReader,- Closeable,- AutoCloseable
Store metadata class that uses the server's endpoint to fetch metadata and keep the local cache up to date.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final longstatic final longFields inherited from class com.linkedin.venice.fastclient.meta.AbstractStoreMetadataroutingStrategy, storeName
- 
Constructor SummaryConstructorsConstructorDescriptionRequestBasedMetadata(ClientConfig clientConfig, D2TransportClient d2TransportClient) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()intgetCompressor(CompressionStrategy compressionStrategy, int version) intorg.apache.avro.Schemaorg.apache.avro.SchemaGet the latest value schema id.intgetPartitionId(int version, ByteBuffer key) longgetReplicas(int version, int partitionId) org.apache.avro.SchemagetUpdateSchema(int valueSchemaId) org.apache.avro.SchemagetValueSchema(int id) intgetValueSchemaId(org.apache.avro.Schema schema) Return the schema ID of any schema that has the same parsing canonical form as the schema provided.static booleanisPartitionResourcesReady(String storeName, int version, int partitionCount, Map<Integer, List<String>> routingInfo) booleanisReady()voidsetD2ServiceDiscovery(D2ServiceDiscovery d2ServiceDiscovery) Used for test onlyvoidsetIsReadyLatch(CountDownLatch isReadyLatch) voidsetRefreshIntervalInSeconds(long refreshIntervalInSeconds) voidsetScheduler(ScheduledExecutorService scheduler) voidsetWarmUpInstancesFutures(Map<String, CompletableFuture> warmUpInstancesFutures) voidstart()static booleanwhetherToSwitchToFetchedCurrentVersion(String storeName, Set<Integer> activeVersions, AtomicInteger currentVersion, int fetchedCurrentVersion, int partitionCountForFetchedCurrentVersion, Map<Integer, List<String>> routingInfo) Methods inherited from class com.linkedin.venice.fastclient.meta.AbstractStoreMetadatagetCompressor, getInstanceHealthMonitor, getPartitionId, getReplica, getStoreName, routeRequest, setRoutingStrategy, setRoutingStrategy, trackHealthBasedOnRequestToInstanceMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.linkedin.venice.schema.SchemaReadergetLatestValueSchemaId
- 
Field Details- 
DEFAULT_REFRESH_INTERVAL_IN_SECONDSpublic static final long DEFAULT_REFRESH_INTERVAL_IN_SECONDS- See Also:
 
- 
DEFAULT_CONN_WARMUP_TIMEOUT_IN_SECONDS_DEFAULTpublic static final long DEFAULT_CONN_WARMUP_TIMEOUT_IN_SECONDS_DEFAULT- See Also:
 
 
- 
- 
Constructor Details- 
RequestBasedMetadata
 
- 
- 
Method Details- 
getClusterName
- 
getCurrentStoreVersionpublic int getCurrentStoreVersion()
- 
getPartitionId
- 
getReplicas
- 
startpublic void start()
- 
whetherToSwitchToFetchedCurrentVersion
- 
isPartitionResourcesReady
- 
close- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Overrides:
- closein class- AbstractStoreMetadata
- Throws:
- IOException
 
- 
getCompressor
- 
getKeySchemapublic org.apache.avro.Schema getKeySchema()
- 
getValueSchemapublic org.apache.avro.Schema getValueSchema(int id) 
- 
getValueSchemaIdpublic int getValueSchemaId(org.apache.avro.Schema schema) Description copied from interface:SchemaReaderReturn the schema ID of any schema that has the same parsing canonical form as the schema provided. If multiple schemas have the same parsing canonical form, return the one with the largest ID.- Parameters:
- schema- The schema for which the schema ID is needed
- Returns:
- The ID of the schema that has the same parsing canonical form as the schema provided
 
- 
getLatestValueSchemapublic org.apache.avro.Schema getLatestValueSchema()
- 
getLatestValueSchemaIdDescription copied from interface:SchemaReaderGet the latest value schema id. This may be different from the value schema with the largest id if the superset schema is not the value schema with the largest id
- 
getUpdateSchemapublic org.apache.avro.Schema getUpdateSchema(int valueSchemaId) 
- 
getLatestUpdateSchema
- 
isReadypublic boolean isReady()
- 
getBatchGetLimitpublic int getBatchGetLimit()- Specified by:
- getBatchGetLimitin interface- StoreMetadata
- Overrides:
- getBatchGetLimitin class- AbstractStoreMetadata
 
- 
setD2ServiceDiscoveryUsed for test only- Parameters:
- d2ServiceDiscovery-
 
- 
setScheduler
- 
getScheduler
- 
setIsReadyLatch
- 
getIsReadyLatch
- 
setRefreshIntervalInSecondspublic void setRefreshIntervalInSeconds(long refreshIntervalInSeconds) 
- 
getRefreshIntervalInSecondspublic long getRefreshIntervalInSeconds()
- 
getWarmUpInstancesFutures
- 
setWarmUpInstancesFutures
 
-