Spring for Apache Hadoop

org.springframework.yarn.support
Class YarnUtils

java.lang.Object
  extended by org.springframework.yarn.support.YarnUtils

public class YarnUtils
extends java.lang.Object

Different utilities.

Author:
Janne Valkealahti

Constructor Summary
YarnUtils()
           
 
Method Summary
static org.springframework.dao.DataAccessException convertYarnAccessException(java.io.IOException e)
          Converts IOException to a Spring dao exception.
static org.springframework.dao.DataAccessException convertYarnAccessException(org.apache.hadoop.ipc.RemoteException e)
          Converts RemoteException to a Spring dao exception.
static org.springframework.dao.DataAccessException convertYarnAccessException(org.apache.hadoop.yarn.exceptions.YarnException e)
          Converts YarnException to a Spring dao exception.
static org.springframework.dao.DataAccessException convertYarnAccessException(org.apache.hadoop.yarn.exceptions.YarnRuntimeException e)
          Converts YarnRuntimeException to a Spring dao exception.
static java.net.InetSocketAddress getAddress(org.apache.hadoop.conf.Configuration conf)
          Gets the address.
static org.apache.hadoop.yarn.api.records.ApplicationAttemptId getApplicationAttemptId(java.util.Map<java.lang.String,java.lang.String> environment)
          Gets ApplicationAttemptId from environment variables.
static java.lang.String getPrincipal(org.apache.hadoop.conf.Configuration conf)
          Gets the principal.
static java.lang.String getUserName(org.apache.hadoop.conf.Configuration conf)
          Gets the user name.
static org.apache.hadoop.conf.Configuration merge(org.apache.hadoop.conf.Configuration base, org.apache.hadoop.conf.Configuration merge)
          Merge configurations together.
static java.lang.String toString(org.apache.hadoop.conf.Configuration conf)
          Better toString() for hadoop Configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

YarnUtils

public YarnUtils()
Method Detail

convertYarnAccessException

public static org.springframework.dao.DataAccessException convertYarnAccessException(org.apache.hadoop.yarn.exceptions.YarnRuntimeException e)
Converts YarnRuntimeException to a Spring dao exception.

Parameters:
e - the YarnRuntimeException
Returns:
a wrapped native exception into DataAccessException

convertYarnAccessException

public static org.springframework.dao.DataAccessException convertYarnAccessException(java.io.IOException e)
Converts IOException to a Spring dao exception.

Parameters:
e - the IOException
Returns:
a wrapped native exception into DataAccessException

convertYarnAccessException

public static org.springframework.dao.DataAccessException convertYarnAccessException(org.apache.hadoop.ipc.RemoteException e)
Converts RemoteException to a Spring dao exception.

Parameters:
e - the RemoteException
Returns:
a wrapped native exception into DataAccessException

convertYarnAccessException

public static org.springframework.dao.DataAccessException convertYarnAccessException(org.apache.hadoop.yarn.exceptions.YarnException e)
Converts YarnException to a Spring dao exception.

Parameters:
e - the YarnException
Returns:
a wrapped native exception into DataAccessException

getApplicationAttemptId

public static org.apache.hadoop.yarn.api.records.ApplicationAttemptId getApplicationAttemptId(java.util.Map<java.lang.String,java.lang.String> environment)
Gets ApplicationAttemptId from environment variables.

Parameters:
environment - Map of environment variables
Returns:
the ApplicationAttemptId

getPrincipal

public static java.lang.String getPrincipal(org.apache.hadoop.conf.Configuration conf)
                                     throws java.io.IOException
Gets the principal.

Parameters:
conf - the conf
Returns:
the principal
Throws:
java.io.IOException - Signals that an I/O exception has occurred.

getUserName

public static java.lang.String getUserName(org.apache.hadoop.conf.Configuration conf)
Gets the user name.

Parameters:
conf - the Yarn configuration
Returns:
the user name

getAddress

public static java.net.InetSocketAddress getAddress(org.apache.hadoop.conf.Configuration conf)
Gets the address.

Parameters:
conf - the Yarn configuration
Returns:
the address

merge

public static org.apache.hadoop.conf.Configuration merge(org.apache.hadoop.conf.Configuration base,
                                                         org.apache.hadoop.conf.Configuration merge)
Merge configurations together.

Parameters:
base - the configuration to merge to
merge - the configuration to merge
Returns:
the merged configuration

toString

public static java.lang.String toString(org.apache.hadoop.conf.Configuration conf)
Better toString() for hadoop Configuration.

Parameters:
conf - the configuration
Returns:
the string representation of a configuration

Spring for Apache Hadoop