public class RuleKeyCacheRecycler<V> extends Object
RuleKeyCache
between builds.Modifier and Type | Class and Description |
---|---|
static class |
RuleKeyCacheRecycler.SettingsAffectingCache
Any external settings which, if changed, will cause the entire cache to be invalidated.
|
Modifier and Type | Method and Description |
---|---|
static <V> RuleKeyCacheRecycler<V> |
create(TrackableRuleKeyCache<V> ruleKeyCache) |
static <V> RuleKeyCacheRecycler<V> |
createAndRegister(com.google.common.eventbus.EventBus eventBus,
TrackableRuleKeyCache<V> ruleKeyCache,
com.google.common.collect.ImmutableSet<ProjectFilesystem> watchedFilesystems) |
com.google.common.collect.ImmutableList<Map.Entry<BuildRule,V>> |
getCachedBuildRules() |
void |
invalidatePath(ProjectFilesystem filesystem,
Path path) |
void |
onFilesystemChange(WatchmanOverflowEvent event) |
void |
onFilesystemChange(WatchmanPathEvent event) |
RuleKeyCacheScope<V> |
withRecycledCache(BuckEventBus buckEventBus,
RuleKeyCacheRecycler.SettingsAffectingCache currentSettings)
Provides access to a
RuleKeyCache via a RuleKeyCacheScope . |
public static <V> RuleKeyCacheRecycler<V> createAndRegister(com.google.common.eventbus.EventBus eventBus, TrackableRuleKeyCache<V> ruleKeyCache, com.google.common.collect.ImmutableSet<ProjectFilesystem> watchedFilesystems)
eventBus
- EventBus
which delivers watchman events.watchedFilesystems
- all ProjectFilesystem
s which use watchman to receive events
when files are changed.RuleKeyCacheRecycler
.public static <V> RuleKeyCacheRecycler<V> create(TrackableRuleKeyCache<V> ruleKeyCache)
public void onFilesystemChange(WatchmanPathEvent event)
public void invalidatePath(ProjectFilesystem filesystem, Path path)
public void onFilesystemChange(WatchmanOverflowEvent event)
public RuleKeyCacheScope<V> withRecycledCache(BuckEventBus buckEventBus, RuleKeyCacheRecycler.SettingsAffectingCache currentSettings)
RuleKeyCache
via a RuleKeyCacheScope
. The RuleKeyCacheScope
must be used with a try-resource block and does logging and cache
invalidation both before and after being used.RuleKeyCacheScope
managing access to enclosed RuleKeyCache
.