Class HybridLocalStrategy
- java.lang.Object
-
- com.facebook.buck.rules.modern.builders.HybridLocalStrategy
-
- All Implemented Interfaces:
BuildRuleStrategy
,Closeable
,AutoCloseable
public class HybridLocalStrategy extends Object implements BuildRuleStrategy
This build strategy sends jobs to both a delegate build strategy and to the build engine to be run in the default way.It has a configurable limit for the number of active jobs to allow locally, and for the number to allow to the delegate. It prefers to send them locally if the limit there hasn't been reached. If both are at the limit, the jobs will be queued until space becomes available.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.facebook.buck.core.rules.build.strategy.BuildRuleStrategy
BuildRuleStrategy.StrategyBuildResult
-
-
Constructor Summary
Constructors Constructor Description HybridLocalStrategy(int numLocalJobs, int numLocalDelegateJobs, int numDelegateJobs, BuildRuleStrategy delegate, WorkerRequirementsProvider workerRequirementsProvider, Optional<com.facebook.buck.remoteexecution.proto.WorkerRequirements.WorkerSize> maxWorkerSizeToStealFrom, String auxiliaryBuildTag, BuckEventBus eventBus)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BuildRuleStrategy.StrategyBuildResult
build(BuildRule rule, BuildStrategyContext strategyContext)
Builds the rule.boolean
canBuild(BuildRule instance)
A rule will be built by the custom strategy only if canBuild() returns true.void
close()
-
-
-
Constructor Detail
-
HybridLocalStrategy
public HybridLocalStrategy(int numLocalJobs, int numLocalDelegateJobs, int numDelegateJobs, BuildRuleStrategy delegate, WorkerRequirementsProvider workerRequirementsProvider, Optional<com.facebook.buck.remoteexecution.proto.WorkerRequirements.WorkerSize> maxWorkerSizeToStealFrom, String auxiliaryBuildTag, BuckEventBus eventBus)
-
-
Method Detail
-
build
public BuildRuleStrategy.StrategyBuildResult build(BuildRule rule, BuildStrategyContext strategyContext)
Description copied from interface:BuildRuleStrategy
Builds the rule.- Specified by:
build
in interfaceBuildRuleStrategy
-
canBuild
public boolean canBuild(BuildRule instance)
Description copied from interface:BuildRuleStrategy
A rule will be built by the custom strategy only if canBuild() returns true.- Specified by:
canBuild
in interfaceBuildRuleStrategy
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceBuildRuleStrategy
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-