From e420fd4592615d91cdcbca674ac58bcca6ab2ff3 Mon Sep 17 00:00:00 2001 From: Tejas Patil Date: Wed, 8 Mar 2017 09:38:05 -0800 Subject: [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 Closes #17205 from tejasapatil/SPARK-19843_followup. --- .../org/apache/spark/unsafe/types/UTF8String.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'common') 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,10 +850,25 @@ public final class UTF8String implements Comparable, 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. * @@ -942,10 +957,6 @@ public final class UTF8String implements Comparable, Externalizable, return true; } - public static class IntWrapper { - public int value = 0; - } - /** * Parses this UTF8String to int. * -- cgit v1.2.3