gortiz commented on code in PR #13303: URL: https://github.com/apache/pinot/pull/13303#discussion_r1750400466
########## pinot-common/src/main/java/org/apache/pinot/common/datablock/DataBlockUtils.java: ########## @@ -18,20 +18,48 @@ */ package org.apache.pinot.common.datablock; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Preconditions; import java.io.IOException; import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.util.ArrayList; import java.util.Collections; +import java.util.EnumMap; +import java.util.List; import java.util.Map; +import java.util.function.LongConsumer; +import java.util.stream.Collectors; +import javax.annotation.Nullable; import org.apache.pinot.common.exception.QueryException; import org.apache.pinot.common.response.ProcessingException; import org.apache.pinot.common.utils.DataSchema; import org.apache.pinot.common.utils.DataSchema.ColumnDataType; +import org.apache.pinot.segment.spi.memory.CompoundDataBuffer; +import org.apache.pinot.segment.spi.memory.DataBuffer; +import org.apache.pinot.segment.spi.memory.PinotByteBuffer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public final class DataBlockUtils { private static final Logger LOGGER = LoggerFactory.getLogger(DataBlockUtils.class); + private static final EnumMap<DataBlockSerde.Version, DataBlockSerde> SERDES; + + static { + SERDES = new EnumMap<>(DataBlockSerde.Version.class); + SERDES.put(DataBlockSerde.Version.V1_V2, new ZeroCopyDataBlockSerde()); Review Comment: In case we end up having more serdes we will probably add more entries to the map and/or open the ability to change them using configurations. For example, we could end up implementing a better implementation of V1_V2. Then we could have both Serdes and change from one to the other using configuration. In case we create new protocol versions (like a V3) we would be able to add it here, although we would need a way to decide which version should be used (as explained in some doc, probably just setting the version used as a config meanwhile we have a heterogeneous cluster). -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org