goiri commented on a change in pull request #3411:
URL: https://github.com/apache/hadoop/pull/3411#discussion_r705553685



##########
File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/Text.java
##########
@@ -34,7 +34,6 @@
 import java.util.Arrays;
 
 import org.apache.avro.reflect.Stringable;
-

Review comment:
       Avoid this change.

##########
File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/Text.java
##########
@@ -302,7 +300,10 @@ public void clear() {
    */
   private boolean ensureCapacity(final int capacity) {
     if (bytes.length < capacity) {
-      bytes = new byte[capacity];
+      // Try to expand  the backing array by the factor of 1.5x  
+      // (by taking the current size + diving it by half)

Review comment:
       "Try to expand the backing array by a factor of 1.5x
   (by taking the current size + dividing it by half)"
   Fix the warning too.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to