You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by rv...@apache.org on 2014/11/12 17:13:16 UTC
jena git commit: Clean up and comment code
Repository: jena
Updated Branches:
refs/heads/hadoop-rdf 6a35e6765 -> c7f8c89aa
Clean up and comment code
Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/c7f8c89a
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/c7f8c89a
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/c7f8c89a
Branch: refs/heads/hadoop-rdf
Commit: c7f8c89aa9ac0cb47ab2b83370ef0290cd640966
Parents: 6a35e67
Author: Rob Vesse <rv...@apache.org>
Authored: Wed Nov 12 16:12:18 2014 +0000
Committer: Rob Vesse <rv...@apache.org>
Committed: Wed Nov 12 16:12:18 2014 +0000
----------------------------------------------------------------------
.../hadoop/rdf/io/output/AbstractNodeTupleOutputFormat.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jena/blob/c7f8c89a/jena-hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/AbstractNodeTupleOutputFormat.java
----------------------------------------------------------------------
diff --git a/jena-hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/AbstractNodeTupleOutputFormat.java b/jena-hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/AbstractNodeTupleOutputFormat.java
index 3a5438e..c4a34f5 100644
--- a/jena-hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/AbstractNodeTupleOutputFormat.java
+++ b/jena-hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/AbstractNodeTupleOutputFormat.java
@@ -59,21 +59,24 @@ public abstract class AbstractNodeTupleOutputFormat<TKey, TValue, T extends Abst
Configuration config = context.getConfiguration();
boolean isCompressed = getCompressOutput(context);
CompressionCodec codec = null;
+
+ // Build the output file path
String extension = this.getFileExtension();
if (isCompressed) {
+ // Add compression extension if applicable
Class<? extends CompressionCodec> codecClass = getOutputCompressorClass(context, GzipCodec.class);
codec = (CompressionCodec) ReflectionUtils.newInstance(codecClass, config);
extension += codec.getDefaultExtension();
}
Path file = getDefaultWorkFile(context, extension);
LOG.info("Writing output to file " + file);
+
+ // Open the file appropriately and create a record writer for it
FileSystem fs = file.getFileSystem(config);
if (!isCompressed) {
FSDataOutputStream fileOut = fs.create(file, false);
return this.getRecordWriter(new OutputStreamWriter(fileOut), config, file);
} else {
- // TODO Do we need to append the relevant extension to the path
- // here?
FSDataOutputStream fileOut = fs.create(file, false);
return this.getRecordWriter(new OutputStreamWriter(codec.createOutputStream(fileOut)), config, file);
}