Spring for Apache Hadoop

org.springframework.yarn.launch
Class SimpleJvmExitCodeMapper

java.lang.Object
  extended by org.springframework.yarn.launch.SimpleJvmExitCodeMapper
All Implemented Interfaces:
ExitCodeMapper

public class SimpleJvmExitCodeMapper
extends java.lang.Object
implements ExitCodeMapper

An implementation of ExitCodeMapper that can be configured through a map from batch exit codes (String) to integer results. Some default entries are set up to recognise common cases. Any that are injected are added to these.

Author:
Janne Valkealahti

Field Summary
protected static org.apache.commons.logging.Log log
           
 
Fields inherited from interface org.springframework.yarn.launch.ExitCodeMapper
JVM_EXITCODE_COMPLETED, JVM_EXITCODE_FORCE_KILLED, JVM_EXITCODE_GENERIC_ERROR, JVM_EXITCODE_INVALID_CONFIG_FILE, JVM_EXITCODE_INVALID_CONTAINER_EXEC_PERMISSIONS, JVM_EXITCODE_INVALID_CONTAINER_PID, JVM_EXITCODE_INVALID_USER_NAME, JVM_EXITCODE_TERMINATED, JVM_EXITCODE_UNABLE_TO_EXECUTE_CONTAINER_SCRIPT, JVM_EXITCODE_WRITE_CGROUP_FAILED
 
Constructor Summary
SimpleJvmExitCodeMapper()
           
 
Method Summary
 java.util.Map<java.lang.String,java.lang.Integer> getMapping()
           
 int intValue(java.lang.String exitCode)
          Get the operating system exit status that matches a certain Batch Framework Exitcode
 void setMapping(java.util.Map<java.lang.String,java.lang.Integer> exitCodeMap)
          Supply the ExitCodeMappings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.commons.logging.Log log
Constructor Detail

SimpleJvmExitCodeMapper

public SimpleJvmExitCodeMapper()
Method Detail

getMapping

public java.util.Map<java.lang.String,java.lang.Integer> getMapping()

setMapping

public void setMapping(java.util.Map<java.lang.String,java.lang.Integer> exitCodeMap)
Supply the ExitCodeMappings

Parameters:
exitCodeMap - A set of mappings between environment specific exit codes and batch framework internal exit codes

intValue

public int intValue(java.lang.String exitCode)
Get the operating system exit status that matches a certain Batch Framework Exitcode

Specified by:
intValue in interface ExitCodeMapper
Parameters:
exitCode - The exitcode of the Batch Job as known by the Batch Framework
Returns:
The exitCode of the Batch Job as known by the JVM

Spring for Apache Hadoop