private static int log2(int val) {
    return INTEGER_SIZE_MINUS_ONE - Integer.numberOfLeadingZeros(val);
  }
Calculates the log2 value of a given integer.

@param val The value to calculate the log2 for.
@return The log2 value of the given integer.
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/binaryallocator/utils/SizeClasses.java