Example usage for org.apache.hadoop.mapred JobConf get

List of usage examples for org.apache.hadoop.mapred JobConf get

Introduction

In this page you can find the example usage for org.apache.hadoop.mapred JobConf get.

Prototype

public String get(String name) 

Source Link

Document

Get the value of the name property, null if no such property exists.

Usage

From source file:com.ibm.bi.dml.runtime.matrix.mapred.MRJobConfiguration.java

License:Open Source License

public static String getResultMergeStagingDir(JobConf job) {
    return job.get(RESULTMERGE_STAGING_DIR_CONFIG) + job.get("mapred.tip.id");
}

From source file:com.ibm.bi.dml.runtime.matrix.mapred.MRJobConfiguration.java

License:Open Source License

public static long[] getResultMergeMatrixCharacteristics(JobConf job) {
    long[] ret = new long[4];
    ret[0] = Long.parseLong(job.get(RESULTMERGE_MATRIX_NUM_ROW_CONFIG));
    ret[1] = Long.parseLong(job.get(RESULTMERGE_MATRIX_NUM_COLUMN_CONFIG));
    ret[2] = Long.parseLong(job.get(RESULTMERGE_BLOCK_NUM_ROW_CONFIG));
    ret[3] = Long.parseLong(job.get(RESULTMERGE_BLOCK_NUM_COLUMN_CONFIG));

    return ret;//from w  w w  .  j ava2  s . co  m
}

From source file:com.ibm.bi.dml.runtime.matrix.mapred.MRJobConfiguration.java

License:Open Source License

public static byte[] getInputIndexesInMapper(JobConf job) {
    String[] istrs = job.get(MAPFUNC_INPUT_MATRICIES_INDEXES_CONFIG).split(Instruction.INSTRUCTION_DELIM);
    return stringArrayToByteArray(istrs);
}

From source file:com.ibm.bi.dml.runtime.matrix.mapred.MRJobConfiguration.java

License:Open Source License

public static byte[] getOutputIndexesInMapper(JobConf job) {
    String[] istrs = job.get(OUTPUT_INDEXES_IN_MAPPER_CONFIG).split(Instruction.INSTRUCTION_DELIM);
    return stringArrayToByteArray(istrs);
}

From source file:com.ibm.bi.dml.runtime.matrix.mapred.MRJobConfiguration.java

License:Open Source License

public static ArrayList<Byte> getInputMatrixIndexesInMapper(JobConf job) throws IOException {
    String[] matrices = job.getStrings(INPUT_MATRICIES_DIRS_CONFIG);
    String str = job.get(MAPFUNC_INPUT_MATRICIES_INDEXES_CONFIG);
    byte[] indexes;
    if (str == null || str.isEmpty()) {
        indexes = new byte[matrices.length];
        for (int i = 0; i < indexes.length; i++)
            indexes[i] = (byte) i;
    } else {/* w  w w .j  av a2 s .  co  m*/
        String[] strs = str.split(Instruction.INSTRUCTION_DELIM);
        indexes = new byte[strs.length];
        for (int i = 0; i < strs.length; i++)
            indexes[i] = Byte.parseByte(strs[i]);
    }

    int numMatrices = matrices.length;
    if (numMatrices > Byte.MAX_VALUE)
        throw new RuntimeException("number of matrices is too large > " + Byte.MAX_VALUE);
    for (int i = 0; i < matrices.length; i++)
        matrices[i] = new Path(matrices[i]).toString();

    FileSystem fs = FileSystem.get(job);
    Path thisFile = new Path(job.get("map.input.file")).makeQualified(fs);

    //Path p=new Path(thisFileName);

    Path thisDir = thisFile.getParent().makeQualified(fs);
    ArrayList<Byte> representativeMatrixes = new ArrayList<Byte>();
    for (int i = 0; i < matrices.length; i++) {
        Path p = new Path(matrices[i]).makeQualified(fs);
        if (thisFile.toUri().compareTo(p.toUri()) == 0 || thisDir.toUri().compareTo(p.toUri()) == 0)
            representativeMatrixes.add(indexes[i]);
    }
    return representativeMatrixes;
}

From source file:com.ibm.bi.dml.runtime.matrix.mapred.MRJobConfiguration.java

License:Open Source License

public static DataGenMRInstruction[] getDataGenInstructions(JobConf job)
        throws DMLUnsupportedOperationException, DMLRuntimeException {
    String str = job.get(RAND_INSTRUCTIONS_CONFIG);
    return MRInstructionParser.parseDataGenInstructions(str);
}

From source file:com.ibm.bi.dml.runtime.matrix.mapred.MRJobConfiguration.java

License:Open Source License

public static AggregateBinaryInstruction[] getAggregateBinaryInstructions(JobConf job)
        throws DMLUnsupportedOperationException, DMLRuntimeException {
    String str = job.get(AGGREGATE_BINARY_INSTRUCTIONS_CONFIG);
    return MRInstructionParser.parseAggregateBinaryInstructions(str);
}

From source file:com.ibm.bi.dml.runtime.matrix.mapred.MRJobConfiguration.java

License:Open Source License

public static CM_N_COVInstruction[] getCM_N_COVInstructions(JobConf job)
        throws DMLUnsupportedOperationException, DMLRuntimeException {
    String str = job.get(CM_N_COV_INSTRUCTIONS_CONFIG);
    return MRInstructionParser.parseCM_N_COVInstructions(str);
}

From source file:com.ibm.bi.dml.runtime.matrix.mapred.MRJobConfiguration.java

License:Open Source License

public static GroupedAggregateInstruction[] getGroupedAggregateInstructions(JobConf job)
        throws DMLUnsupportedOperationException, DMLRuntimeException {
    String str = job.get(GROUPEDAGG_INSTRUCTIONS_CONFIG);
    return MRInstructionParser.parseGroupedAggInstructions(str);
}

From source file:com.ibm.bi.dml.runtime.matrix.mapred.MRJobConfiguration.java

License:Open Source License

public static byte[] getResultIndexes(JobConf job) {
    String[] istrs = job.get(RESULT_INDEXES_CONFIG).split(Instruction.INSTRUCTION_DELIM);
    return stringArrayToByteArray(istrs);
}