List of usage examples for org.apache.hadoop.mapred MapTask MAP_OUTPUT_INDEX_RECORD_LENGTH
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
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(); }