Example usage for org.apache.hadoop.mapred JobID getJtIdentifier

List of usage examples for org.apache.hadoop.mapred JobID getJtIdentifier

Introduction

In this page you can find the example usage for org.apache.hadoop.mapred JobID getJtIdentifier.

Prototype

public String getJtIdentifier() 

Source Link

Usage

From source file:com.liveramp.cascading_ext.flow.LoggingFlow.java

License:Apache License

private void logJobIDs() {
    boolean exceptions = false;
    try {//  w ww. jav  a  2s.c  o  m
        List<FlowStepStats> stepStats = getFlowStats().getFlowStepStats();
        List<String> jobIDs = new ArrayList<String>();
        for (FlowStepStats stat : stepStats) {

            try {
                JobID jobid = ((HadoopStepStats) stat).getRunningJob().getID();
                String jtID = jobid.getJtIdentifier();
                String jobID = Integer.toString(jobid.getId());
                jobIDs.add(jtID + "_" + jobID);
            } catch (Exception e) {
                exceptions = true;
            }
        }

        if (exceptions) {
            LOG.info("unable to retrieve jobid from all completed steps!");
            LOG.info("successfully retrieved job ids: " + StringUtils.join(jobIDs, ", "));
        } else {
            LOG.info("step job ids: " + StringUtils.join(jobIDs, ", "));
        }
    } catch (Exception e) {
        LOG.info("unable to retrieve any jobids from steps");
    }
}

From source file:com.mellanox.hadoop.mapred.UdaPluginSH.java

License:Apache License

static IndexRecordBridge getPathIndex(String jobIDStr, String mapId, int reduce) {
    String user = userRsrc.get(jobIDStr);

    ///////////////////////
    JobID jobID = JobID.forName(jobIDStr);
    ApplicationId appID = ApplicationId.newInstance(Long.parseLong(jobID.getJtIdentifier()), jobID.getId());
    final String base = ContainerLocalizer.USERCACHE + "/" + user + "/" + ContainerLocalizer.APPCACHE + "/"
            + ConverterUtils.toString(appID) + "/output" + "/" + mapId;
    if (LOG.isDebugEnabled()) {
        LOG.debug("DEBUG0 " + base);
    }//  w  ww.j  a va 2  s .com
    // Index file
    IndexRecordBridge data = null;
    try {
        Path indexFileName = lDirAlloc.getLocalPathToRead(base + "/file.out.index", mjobConf);
        // Map-output file
        Path mapOutputFileName = lDirAlloc.getLocalPathToRead(base + "/file.out", mjobConf);
        if (LOG.isDebugEnabled()) {
            LOG.debug("DEBUG1 " + base + " : " + mapOutputFileName + " : " + indexFileName);
        }

        ///////////////////////
        // TODO: is this correct ?? - why user and not runAsUserName like in hadoop-1 ?? 
        // on 2nd thought, this sounds correct, because probably we registered the runAsUser and not the "user"
        data = indexCache.getIndexInformationBridge(mapId, reduce, indexFileName, user);
        data.pathMOF = mapOutputFileName.toString();
    } catch (IOException e) {
        LOG.error("got an exception while retrieving the Index Info");
    }

    return data;

}

From source file:org.apache.tez.mapreduce.hadoop.IDConverter.java

License:Apache License

public static TezDAGID fromMRJobId(org.apache.hadoop.mapreduce.JobID jobId) {
    return TezDAGID.getInstance(ApplicationId.newInstance(Long.valueOf(jobId.getJtIdentifier()), jobId.getId()),
            1);//w w  w  .j  a  v a 2  s. c o  m
}