|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
public interface GuaguaService
GuaguaService is a common service interface of both master and worker service implementations.
TODO Define GuaguaServiceListener: 'onInit(Properties), onStart(), onStop()' to make three hooks for
GuaguaMasterService and GuaguaWorkerService to scale. GuaguaServiceListener is a list can be configurated by using
one parameter. And, we should also add setServiceListeners to set listeners on GuaguaService, which will be invoked
at the end of init, start and stop. Example: Master as a RPC server, workers as RPC client, start and stop them here,
which can be used to update progress or counter.
| 方法摘要 | |
|---|---|
void |
init(Properties props)
Service initialization. |
void |
run(Progressable progress)
Real logic implementation, for example, master and worker iteration logic. |
void |
setAppId(String appId)
App id for whole application. |
void |
setContainerId(String containerId)
Set the unique container id for master or worker. |
void |
setSplits(List<GuaguaFileSplit> splits)
Assign splits to each worker to make them load that data. |
void |
start()
Start point for the service. |
void |
stop()
Stop service, resources cleaning should be added in this function. |
| 方法详细信息 |
|---|
void init(Properties props)
The caller should make sure init(Properties) is called before start(),
run(Progressable), stop() functions.
props - which contains different properties for master and workers to use.void start()
void run(Progressable progress)
If progress is not null, it will be invoked by once per iteration.
void stop()
void setSplits(List<GuaguaFileSplit> splits)
void setAppId(String appId)
void setContainerId(String containerId)
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||