Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix graph merge stats size calculation #1844

Merged
merged 9 commits into from
Aug 8, 2024
Prev Previous commit
Next Next commit
Add javadocs
Signed-off-by: Ryan Bogan <rbogan@amazon.com>
  • Loading branch information
ryanbogan committed Jul 18, 2024
commit 609301e9f5bb7f7498beeaf40f6399a8b062b81d
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ public static KNNCodecUtil.Pair getPair(final BinaryDocValues values, final Vect
);
}

/**
* This method provides a rough estimate of the number of bytes used for storing an array with the given parameters.
* @param numVectors number of vectors in the array
* @param vectorLength the length of each vector
* @param serializationMode serialization mode
* @return rough estimate of number of bytes used to store an array with the given parameters
*/
public static long calculateArraySize(int numVectors, int vectorLength, SerializationMode serializationMode) {
if (serializationMode == SerializationMode.ARRAY) {
ryanbogan marked this conversation as resolved.
Show resolved Hide resolved
int vectorSize = vectorLength * FLOAT_BYTE_SIZE + JAVA_ARRAY_HEADER_SIZE;
Expand Down
Loading