Example usage for org.apache.hadoop.mapreduce JobID JOBID_REGEX

List of usage examples for org.apache.hadoop.mapreduce JobID JOBID_REGEX

Introduction

In this page you can find the example usage for org.apache.hadoop.mapreduce JobID JOBID_REGEX.

Prototype

String JOBID_REGEX

To view the source code for org.apache.hadoop.mapreduce JobID JOBID_REGEX.

Click Source Link

Usage

From source file:org.apache.tez.auxservices.ShuffleHandler.java

License:Apache License

private void recoverState(Configuration conf) throws IOException {
    Path recoveryRoot = getRecoveryPath();
    if (recoveryRoot != null) {
        startStore(recoveryRoot);//from   w  ww.  java  2  s  .c o  m
        Pattern jobPattern = Pattern.compile(JobID.JOBID_REGEX);
        LeveldbIterator iter = null;
        try {
            iter = new LeveldbIterator(stateDb);
            iter.seek(bytes(JobID.JOB));
            while (iter.hasNext()) {
                Map.Entry<byte[], byte[]> entry = iter.next();
                String key = asString(entry.getKey());
                if (!jobPattern.matcher(key).matches()) {
                    break;
                }
                recoverJobShuffleInfo(key, entry.getValue());
            }
        } catch (DBException e) {
            throw new IOException("Database error during recovery", e);
        } finally {
            if (iter != null) {
                iter.close();
            }
        }
    }
}