public class ClusterManagerImpl extends Object implements ClusterManager, SimpleRMI.ServerListener, ClusterPreferencesChangeListener, NodeTracker.NodeEventListener
| Modifier and Type | Method and Description |
|---|---|
void |
addContainersToAppMaster(JobInformation jobInfo,
List<ContainerDescriptor> containers)
Add descriptors of containers that are allocated to the application master.
|
void |
addListener(ClusterManagerListener listener) |
String |
allocateMaster(GUID jobGUID)
Allocates the master node for the given job
|
NodeAllocationPlan |
allocateWorkers(GUID jobGUID)
Allocates the worker nodes for the given job
|
void |
checkStatus() |
void |
clearClasspathCache()
Clears the shared classpath cache
|
void |
deregisterAppMaster(JobInformation jobInfo)
Deregister an external application master.
|
void |
destroy()
Called upon server shutdown.
|
void |
ensureRegistered(NodeDescriptor node)
Adds a node to the cluster registry.
|
void |
failJob(GUID jobGUID)
Manually force job fail
|
List<MasterDescriptor> |
getActiveAppMasters()
Get a list of active (external) application masters.
|
List<JobInformation> |
getAllocatedJobs() |
InetSocketAddress |
getClusterAddress() |
ClusterPreferences |
getConfiguration()
Get the global cluster configuration (not for a specific node).
|
ClusterPreferences |
getConfiguration(String node)
Requests the configuration for the given node.
|
List<ContainerDescriptor> |
getContainers(MasterDescriptor masterDescriptor)
Get the list of containers allocated to an application master.
|
ExecutorOptions |
getDefaultOptions()
Gets the default options configured for remote fragment
execution.
|
protected Integer |
getJobServiceStatus(GUID jobGUID,
WorkerRole role) |
Integer |
getJobStatus(GUID jobGUID)
Get the general run status of the job
-1 - job in progress
0 - job completed normally
1+ - job has errors
|
NodeDescriptor |
getNodeDescriptor(String name)
Gets the node descriptor for the specified node
|
NodeMapping |
getNodes(boolean refresh)
Gets node info for all nodes in the cluster
|
List<MasterDescriptor> |
getPendingAppMasters()
Get a list of pending (external) application masters.
|
List<NodeAllocationRequest> |
getPendingJobs() |
String |
getStatus()
Gets a description of the current status of the node
|
String |
getVersion()
Returns the version number of this ClusterManager instance
|
void |
init(GenericTCPServer.ServerContext context)
Called upon server start to inform the handler of context information
such as the listening address.
|
String |
initializeNodeAllocation(SerializationBridge<NodeAllocationRequest> request) |
void |
jobFinished(JobStatistics statistics)
Called by command server upon exit to report final statistics
|
void |
killJob(GUID jobGUID)
Administrative job kill
|
void |
nodeStarted(NodeDescriptor node) |
InputStream |
openClusterLogFile(LogFileOptions options)
Opens the log file for cluster manager for reading
|
void |
preferencesChanged(ClusterPreferenceChangeEvent e)
Event fired to indicate change of cluster preferences
|
void |
registerAppMaster(MasterDescriptor masterDescriptor)
Register an application master started outside of the context of the cluster manager.
|
void |
removeListener(ClusterManagerListener listener) |
void |
rotateClusterLog()
Rotates the cluster manager log
|
void |
rotateNodeLogs()
Rotates all of the node manager logs
|
void |
shutdown()
Requests a shutdown of the cluster.
|
void |
shutdownNode(String name)
Shuts down the given node.
|
static ClusterManagerImpl |
start(ClusterPreferencesProvider prefProvider,
int port,
boolean daemon,
String ipaddress) |
public void checkStatus()
public InetSocketAddress getClusterAddress()
public ExecutorOptions getDefaultOptions()
ClusterManagergetDefaultOptions in interface ClusterManagerpublic void nodeStarted(NodeDescriptor node)
nodeStarted in interface NodeTracker.NodeEventListenerpublic NodeMapping getNodes(boolean refresh)
ClusterManagergetNodes in interface ClusterManagerrefresh - if true, pings each node to ensure that it only returns live nodespublic void ensureRegistered(NodeDescriptor node)
ClusterManagerensureRegistered in interface ClusterManagernode - the node informationpublic NodeDescriptor getNodeDescriptor(String name)
ClusterManagergetNodeDescriptor in interface ClusterManagername - the name of the node requestedpublic ClusterPreferences getConfiguration() throws RMIException
ClusterManagergetConfiguration in interface ClusterManagerRMIException - thrown for communication errorspublic void registerAppMaster(MasterDescriptor masterDescriptor) throws RMIException
ClusterManagerregisterAppMaster in interface ClusterManagermasterDescriptor - descriptor of the application masterRMIException - thrown for communication errorspublic void deregisterAppMaster(JobInformation jobInfo) throws RMIException
ClusterManagerderegisterAppMaster in interface ClusterManagerRMIException - thrown for communication errorspublic List<MasterDescriptor> getPendingAppMasters() throws RMIException
ClusterManagergetPendingAppMasters in interface ClusterManagerRMIException - throw for communication errorspublic List<MasterDescriptor> getActiveAppMasters() throws RMIException
ClusterManagergetActiveAppMasters in interface ClusterManagerRMIException - throw for communication errorspublic void addContainersToAppMaster(JobInformation jobInfo, List<ContainerDescriptor> containers) throws RMIException
ClusterManageraddContainersToAppMaster in interface ClusterManagercontainers - containers allocated to the application masterRMIException - thrown for communication errorspublic List<ContainerDescriptor> getContainers(MasterDescriptor masterDescriptor) throws RMIException
ClusterManagergetContainers in interface ClusterManagermasterDescriptor - application masterRMIException - throws for communication errorspublic void shutdown()
ClusterManagershutdown in interface ClusterManagerpublic void addListener(ClusterManagerListener listener)
public void removeListener(ClusterManagerListener listener)
public static ClusterManagerImpl start(ClusterPreferencesProvider prefProvider, int port, boolean daemon, String ipaddress)
public String getStatus()
ClusterManagergetStatus in interface ClusterManagerpublic void init(GenericTCPServer.ServerContext context)
SimpleRMI.ServerListenerinit in interface SimpleRMI.ServerListenercontext - the server contextpublic void destroy()
SimpleRMI.ServerListenerdestroy in interface SimpleRMI.ServerListenerpublic ClusterPreferences getConfiguration(String node)
ClusterManagergetConfiguration in interface ClusterManagernode - the node requesting the configurationpublic void preferencesChanged(ClusterPreferenceChangeEvent e)
ClusterPreferencesChangeListenerpreferencesChanged in interface ClusterPreferencesChangeListenere - the change eventpublic void jobFinished(JobStatistics statistics)
JobHistoryServicejobFinished in interface JobHistoryServicestatistics - the final statisticspublic InputStream openClusterLogFile(LogFileOptions options) throws IOException
ClusterManageropenClusterLogFile in interface ClusterManagerIOExceptionpublic void killJob(GUID jobGUID)
ClusterManagerkillJob in interface ClusterManagerpublic void failJob(GUID jobGUID)
ClusterManagerfailJob in interface ClusterManagerpublic Integer getJobStatus(GUID jobGUID)
ClusterManagergetJobStatus in interface ClusterManagerprotected Integer getJobServiceStatus(GUID jobGUID, WorkerRole role)
public void clearClasspathCache()
throws RMIException,
IOException
ClusterManagerclearClasspathCache in interface ClusterManagerIOException - if unable to delete (would typically happen if job is running). Generally we don't care so much about
cleanup failures, but here we need to let the user know because otherwise case may still be dirty.RMIExceptionpublic String getVersion()
ClusterManagergetVersion in interface ClusterManagerpublic void shutdownNode(String name) throws RMIException
ClusterManagershutdownNode in interface ClusterManagername - the entry to removeRMIExceptionpublic void rotateClusterLog()
throws RMIException
ClusterManagerrotateClusterLog in interface ClusterManagerRMIExceptionpublic void rotateNodeLogs()
throws RMIException,
IOException
ClusterManagerrotateNodeLogs in interface ClusterManagerRMIExceptionIOException - if unable to rotatepublic String initializeNodeAllocation(SerializationBridge<NodeAllocationRequest> request)
initializeNodeAllocation in interface ClusterManagerpublic String allocateMaster(GUID jobGUID)
ClusterManagerallocateMaster in interface ClusterManagerpublic NodeAllocationPlan allocateWorkers(GUID jobGUID)
ClusterManagerallocateWorkers in interface ClusterManagerpublic List<JobInformation> getAllocatedJobs()
getAllocatedJobs in interface ClusterManagerpublic List<NodeAllocationRequest> getPendingJobs()
getPendingJobs in interface ClusterManagerCopyright © 2015 Actian Corporation. All Rights Reserved.