/** Write and flush the file header. */ void writeFileHeader() throws IOException { if (useNewMagic) { out.writeBoolean(isCompressed()); } else { Text.writeString(out, KeyBuffer.class.getName()); Text.writeString(out, ValueBuffer.class.getName()); out.writeBoolean(isCompressed()); out.writeBoolean(false); } if (isCompressed()) { Text.writeString(out, (codec.getClass()).getName()); } metadata.write(out); }
/** Write and flush the file header. */ void writeFileHeader() throws IOException { if (useNewMagic) { out.writeBoolean(isCompressed()); } else { Text.writeString(out, KeyBuffer.class.getName()); Text.writeString(out, ValueBuffer.class.getName()); out.writeBoolean(isCompressed()); out.writeBoolean(false); } if (isCompressed()) { Text.writeString(out, (codec.getClass()).getName()); } metadata.write(out); }
/** Write and flush the file header. */ private void writeFileHeader() throws IOException { out.write(VERSION); Text.writeString(out, keyClass.getName()); Text.writeString(out, valClass.getName()); out.writeBoolean(this.isCompressed()); out.writeBoolean(this.isBlockCompressed()); if (this.isCompressed()) { Text.writeString(out, (codec.getClass()).getName()); } this.metadata.write(out); out.write(sync); // write the sync bytes out.flush(); // flush header }
/** Write and flush the file header. */ void writeFileHeader() throws IOException { if (useNewMagic) { out.writeBoolean(isCompressed()); } else { Text.writeString(out, KeyBuffer.class.getName()); Text.writeString(out, ValueBuffer.class.getName()); out.writeBoolean(isCompressed()); out.writeBoolean(false); } if (isCompressed()) { Text.writeString(out, (codec.getClass()).getName()); } metadata.write(out); }
/** Write and flush the file header. */ void writeFileHeader() throws IOException { Text.writeString(out, KeyBuffer.class.getName()); Text.writeString(out, ValueBuffer.class.getName()); out.writeBoolean(isCompressed()); out.writeBoolean(false); if (isCompressed()) { Text.writeString(out, (codec.getClass()).getName()); } metadata.write(out); }
/** Write and flush the file header. */ void writeFileHeader() throws IOException { if (useNewMagic) { out.writeBoolean(isCompressed()); } else { Text.writeString(out, KeyBuffer.class.getName()); Text.writeString(out, ValueBuffer.class.getName()); out.writeBoolean(isCompressed()); out.writeBoolean(false); } if (isCompressed()) { Text.writeString(out, (codec.getClass()).getName()); } metadata.write(out); }
/** Write and flush the file header. */ void writeFileHeader() throws IOException { if (useNewMagic) { out.writeBoolean(isCompressed()); } else { Text.writeString(out, KeyBuffer.class.getName()); Text.writeString(out, ValueBuffer.class.getName()); out.writeBoolean(isCompressed()); out.writeBoolean(false); } if (isCompressed()) { Text.writeString(out, (codec.getClass()).getName()); } metadata.write(out); }
/** Write and flush the file header. */ void writeFileHeader() throws IOException { Text.writeString(out, keyClass.getName()); Text.writeString(out, valClass.getName()); out.writeBoolean(this.isCompressed()); out.writeBoolean(this.isBlockCompressed()); if (this.isCompressed()) { Text.writeString(out, (codec.getClass()).getName()); } this.metadata.write(out); }
/** Write and flush the file header. */ void writeFileHeader() throws IOException { Text.writeString(out, keyClass.getName()); Text.writeString(out, valClass.getName()); out.writeBoolean(this.isCompressed()); out.writeBoolean(this.isBlockCompressed()); if (this.isCompressed()) { Text.writeString(out, (codec.getClass()).getName()); } this.metadata.write(out); }
/** Write and flush the file header. */ private void writeFileHeader() throws IOException { out.write(VERSION); Text.writeString(out, keyClass.getName()); Text.writeString(out, valClass.getName()); out.writeBoolean(this.isCompressed()); out.writeBoolean(this.isBlockCompressed()); if (this.isCompressed()) { Text.writeString(out, (codec.getClass()).getName()); } this.metadata.write(out); out.write(sync); // write the sync bytes out.flush(); // flush header }
/** * Write and flush the file header. */ void writeFileHeader() throws IOException { if (useNewMagic) { out.writeBoolean(isCompressed()); } else { Text.writeString(out, "org.apache.hadoop.hive.ql.io.RCFile$KeyBuffer"); Text.writeString(out, "org.apache.hadoop.hive.ql.io.RCFile$ValueBuffer"); out.writeBoolean(isCompressed()); out.writeBoolean(false); } if (isCompressed()) { Text.writeString(out, (codec.getClass()).getName()); } metadata.write(out); }
/** Write and flush the file header. */ private void writeFileHeader() throws IOException { out.write(VERSION); Text.writeString(out, keyClass.getName()); Text.writeString(out, valClass.getName()); out.writeBoolean(this.isCompressed()); out.writeBoolean(this.isBlockCompressed()); if (this.isCompressed()) { Text.writeString(out, (codec.getClass()).getName()); } this.metadata.write(out); out.write(sync); // write the sync bytes out.flush(); // flush header }
/** * Write and flush the file header. */ void writeFileHeader() throws IOException { if (useNewMagic) { out.writeBoolean(isCompressed()); } else { Text.writeString(out, "org.apache.hadoop.hive.ql.io.RCFile$KeyBuffer"); Text.writeString(out, "org.apache.hadoop.hive.ql.io.RCFile$ValueBuffer"); out.writeBoolean(isCompressed()); out.writeBoolean(false); } if (isCompressed()) { Text.writeString(out, (codec.getClass()).getName()); } metadata.write(out); }
/** Write and flush the file header. */ private void writeFileHeader() throws IOException { out.write(VERSION); Text.writeString(out, keyClass.getName()); Text.writeString(out, valClass.getName()); out.writeBoolean(this.isCompressed()); out.writeBoolean(this.isBlockCompressed()); if (this.isCompressed()) { Text.writeString(out, (codec.getClass()).getName()); } this.metadata.write(out); out.write(sync); // write the sync bytes out.flush(); // flush header }
/** * Write and flush the file header. */ void writeFileHeader() throws IOException { if (useNewMagic) { out.writeBoolean(isCompressed()); } else { Text.writeString(out, "org.apache.hadoop.hive.ql.io.RCFile$KeyBuffer"); Text.writeString(out, "org.apache.hadoop.hive.ql.io.RCFile$ValueBuffer"); out.writeBoolean(isCompressed()); out.writeBoolean(false); } if (isCompressed()) { Text.writeString(out, (codec.getClass()).getName()); } metadata.write(out); }
/** Write and flush the file header. */ private void writeFileHeader() throws IOException { out.write(VERSION); Text.writeString(out, keyClass.getName()); Text.writeString(out, valClass.getName()); out.writeBoolean(this.isCompressed()); out.writeBoolean(this.isBlockCompressed()); if (this.isCompressed()) { Text.writeString(out, (codec.getClass()).getName()); } this.metadata.write(out); out.write(sync); // write the sync bytes out.flush(); // flush header }
/** Write and flush the file header. */ private void writeFileHeader() throws IOException { out.write(VERSION); Text.writeString(out, keyClass.getName()); Text.writeString(out, valClass.getName()); out.writeBoolean(this.isCompressed()); out.writeBoolean(this.isBlockCompressed()); if (this.isCompressed()) { Text.writeString(out, (codec.getClass()).getName()); } this.metadata.write(out); out.write(sync); // write the sync bytes out.flush(); // flush header }
/** Write and flush the file header. */ private void writeFileHeader() throws IOException { out.write(VERSION); Text.writeString(out, keyClass.getName()); Text.writeString(out, valClass.getName()); out.writeBoolean(this.isCompressed()); out.writeBoolean(this.isBlockCompressed()); if (this.isCompressed()) { Text.writeString(out, (codec.getClass()).getName()); } this.metadata.write(out); out.write(sync); // write the sync bytes out.flush(); // flush header }
public void serialize(Path output, Configuration conf) throws IOException { FileSystem fs = output.getFileSystem(conf); FSDataOutputStream out = fs.create(new Path(output, "naiveBayesModel.bin")); try { out.writeFloat(alphaI); out.writeBoolean(isComplementary); VectorWritable.writeVector(out, weightsPerFeature); VectorWritable.writeVector(out, weightsPerLabel); if (isComplementary){ VectorWritable.writeVector(out, perlabelThetaNormalizer); } for (int row = 0; row < weightsPerLabelAndFeature.numRows(); row++) { VectorWritable.writeVector(out, weightsPerLabelAndFeature.viewRow(row)); } } finally { Closeables.close(out, false); } }
public void serialize(Path output, Configuration conf) throws IOException { FileSystem fs = output.getFileSystem(conf); try (FSDataOutputStream out = fs.create(new Path(output, "naiveBayesModel.bin"))) { out.writeFloat(alphaI); out.writeBoolean(isComplementary); VectorWritable.writeVector(out, weightsPerFeature); VectorWritable.writeVector(out, weightsPerLabel); if (isComplementary){ VectorWritable.writeVector(out, perlabelThetaNormalizer); } for (int row = 0; row < weightsPerLabelAndFeature.numRows(); row++) { VectorWritable.writeVector(out, weightsPerLabelAndFeature.viewRow(row)); } } }