public final class NodeManagerImpl extends Object implements NodeManager, SimpleRMI.ServerListener, WorkerServerHandle.Listener
Modifier and Type | Method and Description |
---|---|
OutputStream |
addToCache(CacheScope scope,
ClasspathKey key) |
boolean |
anyJobsRunning() |
void |
cleanup(GUID jobGUID,
WorkerRole role,
CleanupLevel level)
Cleans up files created for the job
|
void |
clearClasspathCache()
Clears the shared classpath cache
|
WorkerService |
createCommandExecutor(SerializationBridge<ClientWorkerServerArguments> arguments) |
void |
deleteJobLog(GUID jobId,
WorkerRole role)
Deletes the log file for the given job.
|
void |
destroy()
Called upon server shutdown.
|
Map<String,String> |
getAllJobs()
Gets the id of every job log mapped to it's name that is managed by this node.
|
Integer |
getCommandServiceStatus(GUID guid,
WorkerRole role)
Get the current status of the command service associated with the job and role
null - command service does not exist or has been terminated
-1 - command service still executing
0 - command service execution completed normally
1+ - command service execution completed with error
|
NodeConfiguration |
getConfiguration()
Gets the current configuration settings for the node.
|
String |
getJobName(GUID jobId)
Gets the name of the job with the provided id.
|
long |
getNodeLogAge(GUID jobId,
WorkerRole role)
Gets the age of the log files for the given job based on the last
modification date.
|
Map<String,Long> |
getNodeLogAge(WorkerRole role)
Gets the age of all log files based on the last modification
date mapped to job id.
|
JobLogInfo.LogInfo |
getNodeLogInfo(GUID jobId,
WorkerRole role)
Get the log info for a job.
|
Map<String,JobLogInfo.LogInfo> |
getNodeLogInfo(WorkerRole role)
Gets a map of all job ids linked with the node's log info.
|
List<NodeStatistics> |
getStatistics()
Fetches statistics from each of the live processes launched by this node manager
|
String |
getStatus()
Gets a description of the current status of the node
|
String |
getVersion()
Returns the version number of this NodeManager instance
|
void |
init(GenericTCPServer.ServerContext context)
Called upon server start to inform the handler of context information
such as the listening address.
|
NodeStatistics |
killJob(GUID guid,
WorkerRole role)
Admin kill.
|
void |
notifyNodePreferencesChanged(ClusterPreferences nodeScopedPreferences)
Notifies the node manager that their preferences (may) have changed
|
Set<ClasspathKey> |
notInNodeCache(Set<ClasspathKey> elements) |
InputStream |
openJobLogFile(GUID jobId,
WorkerRole role,
LogFileOptions options)
Opens the log file for the given job.
|
InputStream |
openNodeLogFile(LogFileOptions options)
Opens the log file for the node manager.
|
void |
processTerminated(com.pervasive.datarush.cluster.WorkerServerHandle handle) |
void |
rotateNodeLog()
Rotates the node manager log
|
void |
shutdown()
Terminates the node manager.
|
static void |
start(DataRushCluster cluster,
String name,
boolean daemon,
String host) |
public void notifyNodePreferencesChanged(ClusterPreferences nodeScopedPreferences)
NodeManager
notifyNodePreferencesChanged
in interface NodeManager
nodeScopedPreferences
- the new preferencespublic NodeConfiguration getConfiguration()
NodeManager
getConfiguration
in interface NodeManager
public WorkerService createCommandExecutor(SerializationBridge<ClientWorkerServerArguments> arguments)
createCommandExecutor
in interface NodeManager
public String getStatus()
NodeManager
getStatus
in interface NodeManager
public void shutdown()
NodeManager
shutdown
in interface NodeManager
public static void start(DataRushCluster cluster, String name, boolean daemon, String host)
public void init(GenericTCPServer.ServerContext context)
SimpleRMI.ServerListener
init
in interface SimpleRMI.ServerListener
context
- the server contextpublic void destroy()
SimpleRMI.ServerListener
destroy
in interface SimpleRMI.ServerListener
public List<NodeStatistics> getStatistics()
NodeManager
getStatistics
in interface NodeManager
public void processTerminated(com.pervasive.datarush.cluster.WorkerServerHandle handle)
processTerminated
in interface WorkerServerHandle.Listener
public Integer getCommandServiceStatus(GUID guid, WorkerRole role)
NodeManager
getCommandServiceStatus
in interface NodeManager
guid
- the job guidrole
- the role of the workerpublic NodeStatistics killJob(GUID guid, WorkerRole role)
NodeManager
killJob
in interface NodeManager
role
- the role of the worker to killClusterManager#killJob(GUID)}
public Map<String,String> getAllJobs()
NodeManager
getAllJobs
in interface NodeManager
public String getJobName(GUID jobId)
NodeManager
getJobName
in interface NodeManager
public Map<String,Long> getNodeLogAge(WorkerRole role)
NodeManager
getNodeLogAge
in interface NodeManager
role
- whether we want the log for the job master or the jobpublic long getNodeLogAge(GUID jobId, WorkerRole role)
NodeManager
getNodeLogAge
in interface NodeManager
jobId
- information used to determine the name of the log filerole
- whether we want the log for the job master or the jobpublic Map<String,JobLogInfo.LogInfo> getNodeLogInfo(WorkerRole role)
NodeManager
getNodeLogInfo
in interface NodeManager
public JobLogInfo.LogInfo getNodeLogInfo(GUID jobId, WorkerRole role)
NodeManager
getNodeLogInfo
in interface NodeManager
jobId
- information used to determine the name of the log filerole
- whether we want the log for the job master or the jobpublic InputStream openJobLogFile(GUID jobId, WorkerRole role, LogFileOptions options) throws IOException
NodeManager
openJobLogFile
in interface NodeManager
jobId
- information used to determine the name of the log filerole
- whether we want the log for the job master or the jobIOException
- if a failure happens reading the filepublic void deleteJobLog(GUID jobId, WorkerRole role)
NodeManager
deleteJobLog
in interface NodeManager
jobId
- information used to determine the name of the log filerole
- whether we want the log for the job master or the jobpublic InputStream openNodeLogFile(LogFileOptions options) throws IOException
NodeManager
openNodeLogFile
in interface NodeManager
IOException
public void cleanup(GUID jobGUID, WorkerRole role, CleanupLevel level)
NodeManager
cleanup
in interface NodeManager
jobGUID
- the job guidlevel
- the cleanup level.public Set<ClasspathKey> notInNodeCache(Set<ClasspathKey> elements)
notInNodeCache
in interface ClasspathCacheManager
public OutputStream addToCache(CacheScope scope, ClasspathKey key) throws IOException
addToCache
in interface ClasspathCacheManager
IOException
public void clearClasspathCache() throws IOException
NodeManager
clearClasspathCache
in interface NodeManager
IOException
- if unable to delete (would typically happen if job is running)public String getVersion()
NodeManager
getVersion
in interface NodeManager
public boolean anyJobsRunning() throws RMIException
anyJobsRunning
in interface NodeManager
RMIException
public void rotateNodeLog() throws RMIException
NodeManager
rotateNodeLog
in interface NodeManager
RMIException
Copyright © 2016 Actian Corporation. All Rights Reserved.