aboutsummaryrefslogtreecommitdiff
path: root/common/sketch
diff options
context:
space:
mode:
authortedyu <yuzhihong@gmail.com>2016-01-25 18:23:47 -0800
committerCheng Lian <lian@databricks.com>2016-01-25 18:23:47 -0800
commitfdcc3512f7b45e5b067fc26cb05146f79c4a5177 (patch)
treec3d9650cdda958a6ec63c191a3f4673c89b26cca /common/sketch
parent109061f7ad27225669cbe609ec38756b31d4e1b9 (diff)
downloadspark-fdcc3512f7b45e5b067fc26cb05146f79c4a5177.tar.gz
spark-fdcc3512f7b45e5b067fc26cb05146f79c4a5177.tar.bz2
spark-fdcc3512f7b45e5b067fc26cb05146f79c4a5177.zip
[SPARK-12934] use try-with-resources for streams
liancheng please take a look Author: tedyu <yuzhihong@gmail.com> Closes #10906 from tedyu/master.
Diffstat (limited to 'common/sketch')
-rw-r--r--common/sketch/src/main/java/org/apache/spark/util/sketch/CountMinSketch.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/sketch/src/main/java/org/apache/spark/util/sketch/CountMinSketch.java b/common/sketch/src/main/java/org/apache/spark/util/sketch/CountMinSketch.java
index 67938644d9..9f4ff42403 100644
--- a/common/sketch/src/main/java/org/apache/spark/util/sketch/CountMinSketch.java
+++ b/common/sketch/src/main/java/org/apache/spark/util/sketch/CountMinSketch.java
@@ -128,11 +128,13 @@ abstract public class CountMinSketch {
/**
* Writes out this {@link CountMinSketch} to an output stream in binary format.
+ * It is the caller's responsibility to close the stream
*/
public abstract void writeTo(OutputStream out) throws IOException;
/**
* Reads in a {@link CountMinSketch} from an input stream.
+ * It is the caller's responsibility to close the stream
*/
public static CountMinSketch readFrom(InputStream in) throws IOException {
return CountMinSketchImpl.readFrom(in);