diff options
author | Tejas Patil <tejasp@fb.com> | 2017-03-08 09:38:05 -0800 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2017-03-08 09:38:05 -0800 |
commit | e420fd4592615d91cdcbca674ac58bcca6ab2ff3 (patch) | |
tree | ed84a27c91b6bd412fcbf4c4d3ba489857dbf8c0 | |
parent | 9a6ac7226fd09d570cae08d0daea82d9bca189a0 (diff) | |
download | spark-e420fd4592615d91cdcbca674ac58bcca6ab2ff3.tar.gz spark-e420fd4592615d91cdcbca674ac58bcca6ab2ff3.tar.bz2 spark-e420fd4592615d91cdcbca674ac58bcca6ab2ff3.zip |
[SPARK-19843][SQL][FOLLOWUP] Classdoc for `IntWrapper` and `LongWrapper`
## What changes were proposed in this pull request?
This is as per suggestion by rxin at : https://github.com/apache/spark/pull/17184#discussion_r104841735
## How was this patch tested?
NA as this is a documentation change
Author: Tejas Patil <tejasp@fb.com>
Closes #17205 from tejasapatil/SPARK-19843_followup.
-rw-r--r-- | common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java b/common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java index 7abe0fa80a..4c28075bd9 100644 --- a/common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java +++ b/common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java @@ -850,11 +850,26 @@ public final class UTF8String implements Comparable<UTF8String>, Externalizable, return fromString(sb.toString()); } + /** + * Wrapper over `long` to allow result of parsing long from string to be accessed via reference. + * This is done solely for better performance and is not expected to be used by end users. + */ public static class LongWrapper { public long value = 0; } /** + * Wrapper over `int` to allow result of parsing integer from string to be accessed via reference. + * This is done solely for better performance and is not expected to be used by end users. + * + * {@link LongWrapper} could have been used here but using `int` directly save the extra cost of + * conversion from `long` -> `int` + */ + public static class IntWrapper { + public int value = 0; + } + + /** * Parses this UTF8String to long. * * Note that, in this method we accumulate the result in negative format, and convert it to @@ -942,10 +957,6 @@ public final class UTF8String implements Comparable<UTF8String>, Externalizable, return true; } - public static class IntWrapper { - public int value = 0; - } - /** * Parses this UTF8String to int. * |