public class CachingBuildEngine extends Object implements BuildEngine, Closeable
BuildRule which also caches the results. If the current
 RuleKey of the build rules matches the one on disk, it does not do any work. It also
 tries to fetch its output from an ArtifactCache to avoid doing any computation.| Modifier and Type | Class and Description | 
|---|---|
static class  | 
CachingBuildEngine.DefaultBuildRuleBuilderDelegate  | 
BuildEngine.BuildEngineResult| Modifier and Type | Field and Description | 
|---|---|
static ResourceAmounts | 
CACHE_CHECK_RESOURCE_AMOUNTS  | 
static ResourceAmounts | 
RULE_KEY_COMPUTATION_RESOURCE_AMOUNTS  | 
static ResourceAmounts | 
SCHEDULING_MORE_WORK_RESOURCE_AMOUNTS  | 
| Constructor and Description | 
|---|
CachingBuildEngine(CachingBuildEngineDelegate cachingBuildEngineDelegate,
                  Optional<BuildRuleStrategy> customBuildRuleStrategy,
                  WeightedListeningExecutorService service,
                  BuildType buildMode,
                  DepFiles depFiles,
                  long maxDepFileCacheEntries,
                  Optional<Long> artifactCacheSizeLimit,
                  BuildRuleResolver resolver,
                  BuildEngineActionToBuildRuleResolver actionToBuildRuleResolver,
                  TargetConfigurationSerializer targetConfigurationSerializer,
                  BuildInfoStoreManager buildInfoStoreManager,
                  ResourceAwareSchedulingInfo resourceAwareSchedulingInfo,
                  boolean consoleLogBuildFailuresInline,
                  RuleKeyFactories ruleKeyFactories)  | 
| Modifier and Type | Method and Description | 
|---|---|
BuildEngine.BuildEngineResult | 
build(BuildEngineBuildContext buildContext,
     ExecutionContext executionContext,
     BuildRule rule)
Build the given build rule and return a future to the build rule success. 
 | 
void | 
close()  | 
BuildResult | 
getBuildRuleResult(BuildTarget buildTarget)
Returns the build result of the build rule associated with the given build target. 
 | 
int | 
getNumRulesToBuild(Iterable<BuildRule> rules)
Calculate the total number of transitive build rules processed from the given roots. 
 | 
ParallelRuleKeyCalculator<RuleKey> | 
getRuleKeyCalculator()  | 
boolean | 
isRuleBuilt(BuildTarget buildTarget)
Returns whether the build rule associated with the build target has been successfully built. 
 | 
void | 
terminateBuildWithFailure(Throwable failure)
Marks build as failed with the given Throwable. 
 | 
com.google.common.util.concurrent.ListenableFuture<?> | 
walkRule(BuildRule rule,
        Set<BuildRule> seen)  | 
public static final ResourceAmounts CACHE_CHECK_RESOURCE_AMOUNTS
public static final ResourceAmounts RULE_KEY_COMPUTATION_RESOURCE_AMOUNTS
public static final ResourceAmounts SCHEDULING_MORE_WORK_RESOURCE_AMOUNTS
public CachingBuildEngine(CachingBuildEngineDelegate cachingBuildEngineDelegate, Optional<BuildRuleStrategy> customBuildRuleStrategy, WeightedListeningExecutorService service, BuildType buildMode, DepFiles depFiles, long maxDepFileCacheEntries, Optional<Long> artifactCacheSizeLimit, BuildRuleResolver resolver, BuildEngineActionToBuildRuleResolver actionToBuildRuleResolver, TargetConfigurationSerializer targetConfigurationSerializer, BuildInfoStoreManager buildInfoStoreManager, ResourceAwareSchedulingInfo resourceAwareSchedulingInfo, boolean consoleLogBuildFailuresInline, RuleKeyFactories ruleKeyFactories)
public void close()
close in interface Closeableclose in interface AutoCloseablepublic ParallelRuleKeyCalculator<RuleKey> getRuleKeyCalculator()
public boolean isRuleBuilt(BuildTarget buildTarget) throws InterruptedException
BuildEngineisRuleBuilt in interface BuildEngineInterruptedExceptionpublic void terminateBuildWithFailure(Throwable failure)
BuildEngineterminateBuildWithFailure in interface BuildEnginepublic com.google.common.util.concurrent.ListenableFuture<?> walkRule(BuildRule rule, Set<BuildRule> seen)
public int getNumRulesToBuild(Iterable<BuildRule> rules)
BuildEnginegetNumRulesToBuild in interface BuildEnginepublic BuildEngine.BuildEngineResult build(BuildEngineBuildContext buildContext, ExecutionContext executionContext, BuildRule rule)
BuildEnginebuild in interface BuildEngine@Nullable public BuildResult getBuildRuleResult(BuildTarget buildTarget) throws ExecutionException, InterruptedException
BuildEnginenull if the build rule has not yet been built.getBuildRuleResult in interface BuildEngineExecutionExceptionInterruptedException