public class HadoopUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static int |
compareBytes(byte[] buf1,
int len1,
long ptr2,
int len2)
Internal comparison routine.
|
static HadoopDefaultJobInfo |
createJobInfo(Configuration cfg,
byte[] credentials)
Creates JobInfo from hadoop configuration.
|
static UserGroupInformation |
createUGI(String user,
byte[] credentialsBytes)
Create UserGroupInformation for specified user and credentials.
|
static void |
deserialize(Writable writable,
byte[] bytes)
Deserialization of Hadoop Writable object.
|
static void |
ensureNotSet(Configuration cfg,
String attr,
String msg)
Checks the attribute in configuration is not set.
|
static Path |
jobFile(Configuration conf,
String usr,
JobID jobId)
Gets job file.
|
static File |
jobLocalDir(String workDir,
UUID locNodeId,
HadoopJobId jobId)
Returns work directory for job execution.
|
static Configuration |
safeCreateConfiguration()
Creates
Configuration in a correct class loader context to avoid caching
of inappropriate class loader in the Configuration object. |
static Path |
stagingAreaDir(Configuration conf,
String usr)
Gets staging area directory.
|
static JobStatus |
status(HadoopJobStatus status,
Configuration conf)
Convert Ignite job status to Hadoop job status.
|
static File |
taskLocalDir(String workDir,
UUID locNodeId,
HadoopTaskInfo info)
Returns subdirectory of job working directory for task execution.
|
static IgniteCheckedException |
transformException(Throwable e)
Throws new
IgniteCheckedException with original exception is serialized into string. |
static Object |
unwrapSplit(HadoopSplitWrapper o)
Unwraps native split.
|
static HadoopSplitWrapper |
wrapSplit(int id,
Object split,
String[] hosts)
Wraps native split.
|
public static HadoopSplitWrapper wrapSplit(int id, Object split, String[] hosts) throws IOException
id - Split ID.split - Split.hosts - Hosts.IOException - If failed.public static Object unwrapSplit(HadoopSplitWrapper o)
o - Wrapper.public static JobStatus status(HadoopJobStatus status, Configuration conf)
status - Ignite job status.public static Path stagingAreaDir(Configuration conf, String usr)
conf - Configuration.usr - User.public static Path jobFile(Configuration conf, String usr, JobID jobId)
conf - Configuration.usr - User.jobId - Job ID.public static void ensureNotSet(Configuration cfg, String attr, String msg) throws IgniteCheckedException
attr - Attribute name.msg - Message for creation of exception.IgniteCheckedException - If attribute is set.public static HadoopDefaultJobInfo createJobInfo(Configuration cfg, byte[] credentials) throws IgniteCheckedException
cfg - Hadoop configuration.credentials - Credentials.IgniteCheckedException - If failed.public static IgniteCheckedException transformException(Throwable e)
IgniteCheckedException with original exception is serialized into string.
This is needed to transfer error outside the current class loader.e - Original exception.public static File jobLocalDir(String workDir, UUID locNodeId, HadoopJobId jobId) throws IgniteCheckedException
workDir - Work directory.locNodeId - Local node ID.jobId - Job ID.IgniteCheckedException - If Failed.public static File taskLocalDir(String workDir, UUID locNodeId, HadoopTaskInfo info) throws IgniteCheckedException
workDir - Work directory.locNodeId - Local node ID.info - Task info.IgniteCheckedException - If Failed.public static Configuration safeCreateConfiguration()
Configuration in a correct class loader context to avoid caching
of inappropriate class loader in the Configuration object.Configuration.public static int compareBytes(byte[] buf1,
int len1,
long ptr2,
int len2)
buf1 - Bytes 1.len1 - Length 1.ptr2 - Pointer 2.len2 - Length 2.public static void deserialize(Writable writable, byte[] bytes) throws IOException
writable - Writable object to deserialize to.bytes - byte array to deserialize.IOExceptionpublic static UserGroupInformation createUGI(String user, byte[] credentialsBytes) throws IOException
user - User.credentialsBytes - Credentials byte array.IOException
Follow @ApacheIgnite
Ignite Fabric : ver. 2.5.1-p166 Release Date : September 3 2019