public final class UriCacheGenerator extends Object implements CacheGenerator<UriExtractionNamespace>
Constructor and Description |
---|
UriCacheGenerator(Map<String,SearchableVersionedDataFinder> pullers) |
Modifier and Type | Method and Description |
---|---|
CacheScheduler.VersionedCache |
generateCache(UriExtractionNamespace extractionNamespace,
CacheScheduler.EntryImpl<UriExtractionNamespace> entryId,
String lastVersion,
CacheScheduler scheduler)
If the lookup source, encapsulated by this
CacheGenerator , has data newer than identified
by the given lastVersion (which is null at the first run of this method, or the version from the previous
run), this method creates a new CacheScheduler.VersionedCache with CacheScheduler.createVersionedCache(io.druid.server.lookup.namespace.cache.CacheScheduler.EntryImpl<? extends io.druid.query.lookup.namespace.ExtractionNamespace>, java.lang.String) , called on the given scheduler , with the version string identifying
the current version of lookup source, populates the created VersionedCache and returns it. |
@Inject public UriCacheGenerator(Map<String,SearchableVersionedDataFinder> pullers)
@Nullable public CacheScheduler.VersionedCache generateCache(UriExtractionNamespace extractionNamespace, CacheScheduler.EntryImpl<UriExtractionNamespace> entryId, @Nullable String lastVersion, CacheScheduler scheduler) throws Exception
CacheGenerator
CacheGenerator
, has data newer than identified
by the given lastVersion
(which is null at the first run of this method, or the version from the previous
run), this method creates a new CacheScheduler.VersionedCache
with CacheScheduler.createVersionedCache(io.druid.server.lookup.namespace.cache.CacheScheduler.EntryImpl<? extends io.druid.query.lookup.namespace.ExtractionNamespace>, java.lang.String)
, called on the given scheduler
, with the version string identifying
the current version of lookup source, populates the created VersionedCache
and returns it. If the lookup
source is up-to-date, this methods returns null.generateCache
in interface CacheGenerator<UriExtractionNamespace>
extractionNamespace
- The ExtractionNamespace for which to generate cache.entryId
- An object uniquely corresponding to the CacheScheduler.Entry
, for which this generateCache()
method is called. Also it has the same toString() representation, that is useful for logginglastVersion
- The version which was last cachedscheduler
- Should be used only to call CacheScheduler.createVersionedCache(io.druid.server.lookup.namespace.cache.CacheScheduler.EntryImpl<? extends io.druid.query.lookup.namespace.ExtractionNamespace>, java.lang.String)
.Exception
Copyright © 2011–2018. All rights reserved.