public short offsetCommitValueVersion(boolean expireTimestampMs) {
        if (isLessThan(MetadataVersion.IBP_2_1_IV0) || expireTimestampMs) {
            return 1;
        } else if (isLessThan(MetadataVersion.IBP_2_1_IV1)) {
            return 2;
        } else {
            // Serialize with the highest supported non-flexible version
            // until a tagged field is introduced or the version is bumped.
            return  3;
        }
    }
An array containing all of the MetadataVersion entries.

This is essentially a cached copy of MetadataVersion.values. Unlike that function, it doesn't
allocate a new array each time.
server-common/src/main/java/org/apache/kafka/server/common/MetadataVersion.java