public class LocalWorkpoolImpl extends UnicastRemoteObject implements LocalWorkpoolServer
LoadDistributor or LoadDistributorV2. The workpool is also responsible for interfacing
with the ValidationService to validate tasks and committing valid tasks.| Modifier and Type | Field and Description |
|---|---|
Integer |
abortOnStartCounter |
static Integer |
BARRIER_FINISHED |
static Integer |
BARRIER_PENDING |
Config |
configParams |
static long |
GAP_TIME |
static int |
INIT |
static int |
INIT_PENDING |
static int |
JOB_FINISHED |
static int |
JOB_STARTED |
static String |
LOAD_DISTRIBUTOR_VERSION |
ConcurrentHashMap<String,LoadInfo> |
loadInfoTable |
StatContainer |
localDepStats |
StringBuffer |
logBuffer |
String |
modelType |
String |
myHost |
Vector<String> |
peerList |
static String |
RPC_MECHANISM |
static long |
SLEEP_TIME |
static long |
STS_DELAY |
ValidationService |
validationService |
ConcurrentHashMap<String,LocalWorkpoolServer> |
wpoolHandles |
ref| Constructor and Description |
|---|
LocalWorkpoolImpl(String validationHostDetail,
int workerCount,
int[] partitionedGraphHostNodesTable) |
| Modifier and Type | Method and Description |
|---|---|
void |
addTask(Task t)
Adds the given task into the workpool depending on its affinity and targetLocation.
|
void |
addTask(Vector<Task> taskVector)
Adds several tasks to the workpool
|
void |
barrierJoin(String remoteHost)
A means workpool servers to synchronize using a barrier.
|
void |
broadcast(Task t)
Broadcasts a task to all of its peers
|
boolean |
checkTermination()
A means to check if there are no tasks left in either workpool, if so, the system is in the termination phase.
|
void |
depositTask(Task t)
An API for remote deposits of a task.
|
LoadInfo |
depositTasks(Vector<Task> taskList) |
LoadInfo |
getLoadInfo() |
int |
getMyAggregatedLoad()
Called only by
getMyLoad() |
int |
getMyLoad() |
String |
getNewTID() |
ProgressStatus |
getProgressStatus()
Not used
|
String |
getStats() |
int |
getStatus()
Not used: Only called from
proceedToClustering() |
long |
getSTS()
Synchronizes the local stable timestamp with that of the global timestamp
|
WorkStatus |
getTask()
Attempts to fetch a task from the ready-workpool.
|
LoadInfo |
getTerminationStatus(int oldts,
int newts)
Only called by
checkTermination(). |
void |
lookupPeers(Vector<String> hostList)
Connects to each
WorkpoolServer whose hostname is given |
void |
printProgress() |
void |
proceedToClustering()
Not used: Only called in the while-loop from
PageRankTest to enter clustering |
void |
removeTask(Task t)
Removes a task from the active workpool.
|
void |
reportAbortOnStart()
A means to report that the execution of a task must be aborted before the execution starts
|
void |
reportCompletion(Task t,
HashSet<Task> tasksCreated)
A means to report the completion of the execution of a task.
|
void |
reportInitialization() |
void |
reportJobCompletion()
A means to notify each worker that a job has completed.
|
void |
reportStartup()
Not used
|
void |
reportTransactionCompletion(long commitTS)
Allows a task to report the completion of a transaction phase.
|
void |
setStatusInit()
Not used: Only called from
reportInitialization() |
void |
updateLoadInfo(Vector<LoadInfo> loadVector)
Each workpool caches the
LoadInfo of its peers. |
void |
updateSTS(long sts)
Updates the local stable timestamp of the system.
|
ValidateResponse |
validate(Task t,
RWSetInfo rwSetInfo)
Validates the completed task
|
clone, exportObject, exportObject, exportObject, unexportObjectgetClientHost, getLog, setLogpublic ValidationService validationService
public ConcurrentHashMap<String,LocalWorkpoolServer> wpoolHandles
public ConcurrentHashMap<String,LoadInfo> loadInfoTable
public StatContainer localDepStats
public StringBuffer logBuffer
public Config configParams
public static final int INIT_PENDING
public static final int INIT
public static final int JOB_STARTED
public static final int JOB_FINISHED
public static final Integer BARRIER_PENDING
public static final Integer BARRIER_FINISHED
public static long SLEEP_TIME
public static long GAP_TIME
public static long STS_DELAY
public static String LOAD_DISTRIBUTOR_VERSION
public String modelType
public String myHost
public Integer abortOnStartCounter
public static String RPC_MECHANISM
public LocalWorkpoolImpl(String validationHostDetail, int workerCount, int[] partitionedGraphHostNodesTable) throws IOException
validationHostDetail - The hostname of the server running the ValidationServiceworkerCount - The number of Workers pulling from this workpoolpartitionedGraphHostNodesTable - IOException - Thrown if the Validator could not be contactedpublic LoadInfo depositTasks(Vector<Task> taskList) throws RemoteException
depositTasks in interface LocalWorkpoolServertaskList - The tasks to deposit into the workpoolLoadInfo after the tasks have been depositedRemoteExceptionpublic void depositTask(Task t)
t - The task to be depositedpublic void reportJobCompletion()
throws RemoteException
reportJobCompletion in interface LocalWorkpoolServerRemoteExceptionpublic void reportAbortOnStart()
public LoadInfo getLoadInfo() throws RemoteException
getLoadInfo in interface LocalWorkpoolServerRemoteExceptionpublic LoadInfo getTerminationStatus(int oldts, int newts) throws RemoteException
checkTermination(). Get's the current state of the system to see if it is in
termination.getTerminationStatus in interface LocalWorkpoolServeroldts - The last timestamp that termination was checkednewts - The current timestamp that termination is being checkedLoadInfo describing whether or not the system is in termination.RemoteExceptionpublic void barrierJoin(String remoteHost)
barrierJoin in interface LocalWorkpoolServerremoteHost - The hostname of the server that is joining the barrier.public ProgressStatus getProgressStatus()
public void lookupPeers(Vector<String> hostList)
WorkpoolServer whose hostname is givenhostList - A list of hostnames to connect topublic void reportInitialization()
throws RemoteException
reportInitialization in interface LocalWorkpoolServerRemoteExceptionpublic void reportStartup()
throws RemoteException
RemoteExceptionpublic int getStatus()
proceedToClustering()public void setStatusInit()
reportInitialization()public void proceedToClustering()
PageRankTest to enter clusteringpublic void broadcast(Task t) throws RemoteException
t - The task to broadcastRemoteException - Thrown if the task could not be added to its own workpoollookupPeers(Vector),
addTask(Task)public void addTask(Task t) throws RemoteException
t - The task to be added to the workpoolRemoteExceptionpublic void addTask(Vector<Task> taskVector) throws RemoteException
RemoteExceptionaddTask(Task)public WorkStatus getTask() throws RemoteException
WorkStatus containing either:
StatusType.WORK_TERMINATED status if the job was completedRemoteExceptionreportJobCompletion()public String getNewTID()
public ValidateResponse validate(Task t, RWSetInfo rwSetInfo) throws RemoteException
t - The task that is to be validatedrwSetInfo - The set of Nodes that the task read and updatedRemoteExceptionpublic long getSTS()
throws RemoteException
RemoteException - Thrown if the ValidationService could not be contactedpublic void updateSTS(long sts)
sts is earlier than the current local stable
timestamp, then nothing happens.sts - The proposed timestamp to update to.public void updateLoadInfo(Vector<LoadInfo> loadVector)
LoadInfo of its peers. This is a means for this workpool to refresh its
cache.loadVector - The new loads of each workpool.public void removeTask(Task t)
t - The task that is to be removed.public void reportTransactionCompletion(long commitTS)
reportCompletion(Task, HashSet) also calls this method,
but it also removes the task from the workpoolcommitTS - The timestamp at which this transaction was reportedpublic void reportCompletion(Task t, HashSet<Task> tasksCreated) throws RemoteException
t - The task that is to reported for completiontasksCreated - Any tasks created by the completed taskRemoteException - Thrown if the created tasks could not be distributedpublic void printProgress()
public String getStats()
public int getMyLoad()
LoadDistributorV2.getPendingTaskCount(),
Configpublic int getMyAggregatedLoad()
getMyLoad()public boolean checkTermination()
throws RemoteException
RemoteException