List of usage examples for org.apache.hadoop.io ArrayPrimitiveWritable ArrayPrimitiveWritable
public ArrayPrimitiveWritable(Object value)
From source file:org.apache.kylin.engine.mr.steps.UHCDictionaryReducer.java
License:Apache License
private void outputDict(TblColRef col, Dictionary<String> dict) throws IOException, InterruptedException { // output written to baseDir/colName/colName.rldict-r-00000 (etc) String dictFileName = col.getIdentity() + "/" + col.getName() + DICT_FILE_POSTFIX; try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream outputStream = new DataOutputStream(baos);) { outputStream.writeUTF(dict.getClass().getName()); dict.write(outputStream);//from w w w . j ava2 s . co m mos.write(BatchConstants.CFG_OUTPUT_DICT, NullWritable.get(), new ArrayPrimitiveWritable(baos.toByteArray()), dictFileName); } mos.close(); }