liyafan82 commented on a change in pull request #8214:
URL: https://github.com/apache/arrow/pull/8214#discussion_r494713164
##########
File path: java/vector/src/main/java/org/apache/arrow/vector/BitVector.java
##########
@@ -119,13 +119,16 @@ public void setInitialCapacity(int valueCount) {
lastValueCapacity = valueCount;
}
- /**
- * Get the current value capacity for the vector.
- *
- * @return number of elements that vector can hold.
- */
@Override
- public int getValueCapacity() {
+ protected void refreshValueCapacity() {
+ actualValueCapacity = Math.min(getValueBufferValueCapacity(),
getValidityBufferValueCapacity());
+ }
+
+ private int getValueBufferValueCapacity() {
+ return capAtMaxInt(valueBuffer.capacity() * 8);
+ }
+
+ private int getValidityBufferValueCapacity() {
Review comment:
This one is identical to the one in the super class, so it can be
removed?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]