Example usage for org.apache.hadoop.mapred MapTask MAP_OUTPUT_INDEX_RECORD_LENGTH

List of usage examples for org.apache.hadoop.mapred MapTask MAP_OUTPUT_INDEX_RECORD_LENGTH

Introduction

In this page you can find the example usage for org.apache.hadoop.mapred MapTask MAP_OUTPUT_INDEX_RECORD_LENGTH.

Prototype

int MAP_OUTPUT_INDEX_RECORD_LENGTH

To view the source code for org.apache.hadoop.mapred MapTask MAP_OUTPUT_INDEX_RECORD_LENGTH.

Click Source Link

Document

The size of each record in the index file for the map-outputs.

Usage

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

License:Apache License

private static void createIndexFile(File indexFile, Configuration conf) throws IOException {
    if (indexFile.exists()) {
        System.out.println("Deleting existing file");
        indexFile.delete();/*from  ww w  .  j  av  a2s  . com*/
    }
    indexFile.createNewFile();
    FSDataOutputStream output = FileSystem.getLocal(conf).getRaw()
            .append(new Path(indexFile.getAbsolutePath()));
    Checksum crc = new PureJavaCrc32();
    crc.reset();
    CheckedOutputStream chk = new CheckedOutputStream(output, crc);
    String msg = "Writing new index file. This file will be used only " + "for the testing.";
    chk.write(Arrays.copyOf(msg.getBytes(), MapTask.MAP_OUTPUT_INDEX_RECORD_LENGTH));
    output.writeLong(chk.getChecksum().getValue());
    output.close();
}