Package com.linkedin.venice.router.api
Class DictionaryRetrievalService
java.lang.Object
com.linkedin.venice.service.AbstractVeniceService
com.linkedin.venice.router.api.DictionaryRetrievalService
- All Implemented Interfaces:
Closeable
,AutoCloseable
DictionaryRetrievalService runs in a producer-consumer pattern. A thread is created which waits for items to be put
in a shared BlockingQueue.
There are 2 producers for the store versions to download dictionaries for.
1) Store metadata changed ZK listener.
2) Each failed dictionary fetch request is retried infinitely (till the version is retired).
At Router startup, the dictionaries are pre-fetched for currently active versions that require a dictionary. This
process is fail-fast and will prevent router start up if any dictionary fetch request fails.
When a dictionary is downloaded for a version, it's corresponding version specific compressor is initialized and is
maintained by CompressorFactory.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.linkedin.venice.service.AbstractVeniceService
AbstractVeniceService.ServiceState
-
Field Summary
Fields inherited from class com.linkedin.venice.service.AbstractVeniceService
logger, serviceState
-
Constructor Summary
ConstructorDescriptionDictionaryRetrievalService
(OnlineInstanceFinder onlineInstanceFinder, VeniceRouterConfig routerConfig, Optional<SSLFactory> sslFactory, ReadOnlyStoreRepository metadataRepository, StorageNodeClient storageNodeClient, CompressorFactory compressorFactory) -
Method Summary
-
Constructor Details
-
DictionaryRetrievalService
public DictionaryRetrievalService(OnlineInstanceFinder onlineInstanceFinder, VeniceRouterConfig routerConfig, Optional<SSLFactory> sslFactory, ReadOnlyStoreRepository metadataRepository, StorageNodeClient storageNodeClient, CompressorFactory compressorFactory) - Parameters:
onlineInstanceFinder
- OnlineInstanceFinder used to identify which storage node needs to be queriedrouterConfig
- common router configurationsslFactory
- if provided, the request will attempt to use ssl when fetching dictionary from the storage nodes
-
-
Method Details
-
startInner
public boolean startInner()- Specified by:
startInner
in classAbstractVeniceService
- Returns:
- true if the service is completely started,
false if it is still starting asynchronously (in this case, it is the implementer's
responsibility to set
AbstractVeniceService.serviceState
toAbstractVeniceService.ServiceState.STARTED
upon completion of the async work).
-
stopInner
- Specified by:
stopInner
in classAbstractVeniceService
- Throws:
IOException
-