diff options
author | Lee Dongjin <dongjin@apache.org> | 2017-02-09 11:18:02 +0000 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2017-02-09 11:18:02 +0000 |
commit | 1a09cd634610329e85ff212c71cf67c697da5f84 (patch) | |
tree | b72e40e524a06d94a47af9a54212db2bc6b27ef6 | |
parent | 9d9d67c7957f7cbbdbe889bdbc073568b2bfbb16 (diff) | |
download | spark-1a09cd634610329e85ff212c71cf67c697da5f84.tar.gz spark-1a09cd634610329e85ff212c71cf67c697da5f84.tar.bz2 spark-1a09cd634610329e85ff212c71cf67c697da5f84.zip |
[MINOR][CORE] Fix incorrect documentation of WritableConverter
## What changes were proposed in this pull request?
`WritableConverter` and `WritableFactory` work in opposite directions. But both of them are documented with same description:
> A class encapsulating how to convert some type T to Writable. It stores both the Writable class corresponding to T (e.g. IntWritable for Int) and a function for doing the conversion.
This error is a result of commit 2604939. As a note, `WritableFactory` was added from commit d37978d, which resolves [SPARK-4795](https://issues.apache.org/jira/browse/SPARK-4795) with the correct description.
This PR fix the documentation of `WritableConverter`, along with some improvements on type description.
## How was this patch tested?
`build/mvn clean checkstyle:checkstyle`
Author: Lee Dongjin <dongjin@apache.org>
Closes #16830 from dongjinleekr/feature/fix-writableconverter-doc.
-rw-r--r-- | core/src/main/scala/org/apache/spark/SparkContext.scala | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/core/src/main/scala/org/apache/spark/SparkContext.scala b/core/src/main/scala/org/apache/spark/SparkContext.scala index 869c5d7094..40189a2256 100644 --- a/core/src/main/scala/org/apache/spark/SparkContext.scala +++ b/core/src/main/scala/org/apache/spark/SparkContext.scala @@ -2745,11 +2745,12 @@ private object SparkMasterRegex { } /** - * A class encapsulating how to convert some type T to Writable. It stores both the Writable class - * corresponding to T (e.g. IntWritable for Int) and a function for doing the conversion. - * The getter for the writable class takes a ClassTag[T] in case this is a generic object - * that doesn't know the type of T when it is created. This sounds strange but is necessary to - * support converting subclasses of Writable to themselves (writableWritableConverter). + * A class encapsulating how to convert some type `T` from `Writable`. It stores both the `Writable` + * class corresponding to `T` (e.g. `IntWritable` for `Int`) and a function for doing the + * conversion. + * The getter for the writable class takes a `ClassTag[T]` in case this is a generic object + * that doesn't know the type of `T` when it is created. This sounds strange but is necessary to + * support converting subclasses of `Writable` to themselves (`writableWritableConverter()`). */ private[spark] class WritableConverter[T]( val writableClass: ClassTag[T] => Class[_ <: Writable], @@ -2800,9 +2801,10 @@ object WritableConverter { } /** - * A class encapsulating how to convert some type T to Writable. It stores both the Writable class - * corresponding to T (e.g. IntWritable for Int) and a function for doing the conversion. - * The Writable class will be used in `SequenceFileRDDFunctions`. + * A class encapsulating how to convert some type `T` to `Writable`. It stores both the `Writable` + * class corresponding to `T` (e.g. `IntWritable` for `Int`) and a function for doing the + * conversion. + * The `Writable` class will be used in `SequenceFileRDDFunctions`. */ private[spark] class WritableFactory[T]( val writableClass: ClassTag[T] => Class[_ <: Writable], |