public class GuaguaYarnTask<MASTER_RESULT extends Bytable,WORKER_RESULT extends Bytable> extends Object
GuaguaYarnTask is a entry point to run both master and workers.
partition should be passed as the last parameter in main. And it should be not be changed if we try another
task.
Input split are now storing in guagua-conf.xml. We read data from there and check whether this task is master or worker.
| Modifier and Type | Class and Description |
|---|---|
static class |
GuaguaYarnTask.ClientHandler
ClientHandeler used to update progress to RPC server (AppMaster).
|
| Constructor and Description |
|---|
GuaguaYarnTask(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId,
org.apache.hadoop.yarn.api.records.ContainerId containerId,
int partition,
String rpcHostName,
String rpcPort,
org.apache.hadoop.conf.Configuration conf)
Constructor with yarn task related parameters.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
cleanup()
Clean up resources used
|
org.apache.hadoop.yarn.api.records.ApplicationAttemptId |
getAppAttemptId() |
org.apache.hadoop.yarn.api.records.ApplicationId |
getAppId() |
org.apache.hadoop.yarn.api.records.ContainerId |
getContainerId() |
GuaguaService |
getGuaguaService() |
GuaguaInputSplit |
getInputSplit() |
int |
getPartition() |
org.apache.hadoop.conf.Configuration |
getYarnConf() |
boolean |
isMaster() |
static void |
main(String[] args) |
void |
run()
Run master or worker service.
|
void |
setAppAttemptId(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId) |
void |
setAppId(org.apache.hadoop.yarn.api.records.ApplicationId appId) |
void |
setContainerId(org.apache.hadoop.yarn.api.records.ContainerId containerId) |
void |
setGuaguaService(GuaguaService guaguaService) |
void |
setInputSplit(GuaguaInputSplit inputSplit) |
void |
setMaster(boolean isMaster) |
void |
setPartition(int partition) |
protected void |
setup()
Set up guagua service
|
void |
setYarnConf(org.apache.hadoop.yarn.conf.YarnConfiguration yarnConf) |
public GuaguaYarnTask(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId,
org.apache.hadoop.yarn.api.records.ContainerId containerId,
int partition,
String rpcHostName,
String rpcPort,
org.apache.hadoop.conf.Configuration conf)
protected void setup()
public void run()
protected void cleanup()
public GuaguaService getGuaguaService()
public void setGuaguaService(GuaguaService guaguaService)
public int getPartition()
public void setPartition(int partition)
public org.apache.hadoop.yarn.api.records.ApplicationAttemptId getAppAttemptId()
public void setAppAttemptId(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId)
public org.apache.hadoop.yarn.api.records.ContainerId getContainerId()
public void setContainerId(org.apache.hadoop.yarn.api.records.ContainerId containerId)
public boolean isMaster()
public void setMaster(boolean isMaster)
public org.apache.hadoop.conf.Configuration getYarnConf()
public void setYarnConf(org.apache.hadoop.yarn.conf.YarnConfiguration yarnConf)
public org.apache.hadoop.yarn.api.records.ApplicationId getAppId()
public void setAppId(org.apache.hadoop.yarn.api.records.ApplicationId appId)
public GuaguaInputSplit getInputSplit()
public void setInputSplit(GuaguaInputSplit inputSplit)
public static void main(String[] args)
Copyright © 2018. All Rights Reserved.