Package com.facebook.buck.rules.keys
Class DefaultRuleKeyCache<V>
- java.lang.Object
-
- com.facebook.buck.rules.keys.DefaultRuleKeyCache<V>
-
- Type Parameters:
V
- The rule key type.
- All Implemented Interfaces:
TrackableRuleKeyCache<V>
public class DefaultRuleKeyCache<V> extends Object implements TrackableRuleKeyCache<V>
ARuleKey
cache used by aRuleKeyFactory
. Inputs and dependencies of cached rule keys are tracked to allow for invalidations based on changed inputs. As such, this cache is usable between multiple build runs.
-
-
Constructor Summary
Constructors Constructor Description DefaultRuleKeyCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description V
get(BuildEngineAction action, CacheStatsTracker statsTracker)
V
get(BuildEngineAction action, java.util.function.Function<? super BuildEngineAction,RuleKeyResult<V>> create, CacheStatsTracker statsTracker)
V
get(AddsToRuleKey appendable, java.util.function.Function<? super AddsToRuleKey,RuleKeyResult<V>> create, CacheStatsTracker statsTracker)
com.google.common.collect.ImmutableList<Map.Entry<BuildRule,V>>
getCachedBuildRules()
void
invalidateAll(CacheStatsTracker statsTracker)
Invalidate everything in the cache.void
invalidateAllExceptFilesystems(com.google.common.collect.ImmutableSet<ProjectFilesystem> filesystems, CacheStatsTracker statsTracker)
Invalidate all inputs *not* from the givenProjectFilesystem
s and their transitive dependents.void
invalidateFilesystem(ProjectFilesystem filesystem, CacheStatsTracker statsTracker)
Invalidate all inputs from a givenProjectFilesystem
and their transitive dependents.void
invalidateInputs(Iterable<com.facebook.buck.rules.keys.RuleKeyInput> inputs, CacheStatsTracker statsTracker)
Invalidate the given inputs and all their transitive dependents.
-
-
-
Method Detail
-
get
@Nullable public V get(BuildEngineAction action, CacheStatsTracker statsTracker)
- Specified by:
get
in interfaceTrackableRuleKeyCache<V>
-
get
public V get(BuildEngineAction action, java.util.function.Function<? super BuildEngineAction,RuleKeyResult<V>> create, CacheStatsTracker statsTracker)
- Specified by:
get
in interfaceTrackableRuleKeyCache<V>
-
get
public V get(AddsToRuleKey appendable, java.util.function.Function<? super AddsToRuleKey,RuleKeyResult<V>> create, CacheStatsTracker statsTracker)
- Specified by:
get
in interfaceTrackableRuleKeyCache<V>
-
invalidateInputs
public void invalidateInputs(Iterable<com.facebook.buck.rules.keys.RuleKeyInput> inputs, CacheStatsTracker statsTracker)
Invalidate the given inputs and all their transitive dependents.- Specified by:
invalidateInputs
in interfaceTrackableRuleKeyCache<V>
-
invalidateAllExceptFilesystems
public void invalidateAllExceptFilesystems(com.google.common.collect.ImmutableSet<ProjectFilesystem> filesystems, CacheStatsTracker statsTracker)
Invalidate all inputs *not* from the givenProjectFilesystem
s and their transitive dependents.- Specified by:
invalidateAllExceptFilesystems
in interfaceTrackableRuleKeyCache<V>
-
invalidateFilesystem
public void invalidateFilesystem(ProjectFilesystem filesystem, CacheStatsTracker statsTracker)
Invalidate all inputs from a givenProjectFilesystem
and their transitive dependents.- Specified by:
invalidateFilesystem
in interfaceTrackableRuleKeyCache<V>
-
invalidateAll
public void invalidateAll(CacheStatsTracker statsTracker)
Invalidate everything in the cache.- Specified by:
invalidateAll
in interfaceTrackableRuleKeyCache<V>
-
getCachedBuildRules
public com.google.common.collect.ImmutableList<Map.Entry<BuildRule,V>> getCachedBuildRules()
- Specified by:
getCachedBuildRules
in interfaceTrackableRuleKeyCache<V>
-
-