From 9fbc14e5cb624b01b638ba31758a4ee9ac929995 Mon Sep 17 00:00:00 2001 From: mroeder Date: Fri, 20 May 2016 17:05:15 +0200 Subject: [PATCH 1/2] Reduced the disk space used for debugging by using a GZipped output stream for printing out annotator results in debug mode. --- .../java/org/aksw/gerbil/execute/AnnotatorOutputWriter.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/aksw/gerbil/execute/AnnotatorOutputWriter.java b/src/main/java/org/aksw/gerbil/execute/AnnotatorOutputWriter.java index 18a57dd0e..1ce9f5377 100644 --- a/src/main/java/org/aksw/gerbil/execute/AnnotatorOutputWriter.java +++ b/src/main/java/org/aksw/gerbil/execute/AnnotatorOutputWriter.java @@ -20,6 +20,7 @@ import java.io.FileOutputStream; import java.util.ArrayList; import java.util.List; +import java.util.zip.GZIPOutputStream; import org.aksw.gerbil.datatypes.ExperimentTaskConfiguration; import org.aksw.gerbil.io.nif.NIFWriter; @@ -52,15 +53,18 @@ public void storeAnnotatorOutput(ExperimentTaskConfiguration List> results, List documents) { if (outputShouldBeStored(configuration)) { FileOutputStream fout = null; + GZIPOutputStream gout = null; try { File file = generateOutputFile(configuration); List resultDocuments = generateResultDocuments(results, documents); fout = new FileOutputStream(file); + gout = new GZIPOutputStream(fout); NIFWriter writer = new TurtleNIFWriter(); - writer.writeNIF(resultDocuments, fout); + writer.writeNIF(resultDocuments, gout); } catch (Exception e) { LOGGER.error("Couldn't write annotator result to file.", e); } finally { + IOUtils.closeQuietly(gout); IOUtils.closeQuietly(fout); } } From aa911717ca3ba9ba0b4fc7a65805e710ece24b75 Mon Sep 17 00:00:00 2001 From: mroeder Date: Fri, 20 May 2016 17:06:04 +0200 Subject: [PATCH 2/2] Added missing .gz ending. --- .../java/org/aksw/gerbil/execute/AnnotatorOutputWriter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/aksw/gerbil/execute/AnnotatorOutputWriter.java b/src/main/java/org/aksw/gerbil/execute/AnnotatorOutputWriter.java index 1ce9f5377..4542cfd54 100644 --- a/src/main/java/org/aksw/gerbil/execute/AnnotatorOutputWriter.java +++ b/src/main/java/org/aksw/gerbil/execute/AnnotatorOutputWriter.java @@ -88,7 +88,7 @@ private File generateOutputFile(ExperimentTaskConfiguration configuration) { fileBuilder.append("-s-"); } appendCleanedString(fileBuilder, configuration.type.name()); - fileBuilder.append(".ttl"); + fileBuilder.append(".ttl.gz"); return new File(fileBuilder.toString()); }