public class JavaScriptWorkerSelectStrategy extends Object implements WorkerSelectStrategy
Modifier and Type | Class and Description |
---|---|
static interface |
JavaScriptWorkerSelectStrategy.SelectorFunction |
Constructor and Description |
---|
JavaScriptWorkerSelectStrategy(String fn) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
com.google.common.base.Optional<ImmutableZkWorker> |
findWorkerForTask(RemoteTaskRunnerConfig config,
com.google.common.collect.ImmutableMap<String,ImmutableZkWorker> zkWorkers,
Task task)
Customizable logic for selecting a worker to run a task.
|
String |
getFunction() |
int |
hashCode() |
String |
toString() |
public JavaScriptWorkerSelectStrategy(String fn)
public com.google.common.base.Optional<ImmutableZkWorker> findWorkerForTask(RemoteTaskRunnerConfig config, com.google.common.collect.ImmutableMap<String,ImmutableZkWorker> zkWorkers, Task task)
WorkerSelectStrategy
findWorkerForTask
in interface WorkerSelectStrategy
config
- A config for running remote taskszkWorkers
- An immutable map of workers to choose from.task
- The task to assign.ImmutableZkWorker
to run the task if one is available.public String getFunction()
Copyright © 2011–2015. All rights reserved.