This is an automated email from the ASF dual-hosted git repository. jackie pushed a commit to branch bytes_on_heap in repository https://gitbox.apache.org/repos/asf/pinot.git
commit 5fa45750fbddcd18e914858685ca6d6b3cbf88f2 Author: Xiaotian (Jackie) Jiang <[email protected]> AuthorDate: Thu Jun 16 11:32:33 2022 -0700 Add comment on not reusing bytes --- pinot-spi/src/main/java/org/apache/pinot/spi/utils/ByteArray.java | 1 + 1 file changed, 1 insertion(+) diff --git a/pinot-spi/src/main/java/org/apache/pinot/spi/utils/ByteArray.java b/pinot-spi/src/main/java/org/apache/pinot/spi/utils/ByteArray.java index 6eefcadeae..53c7357fd0 100644 --- a/pinot-spi/src/main/java/org/apache/pinot/spi/utils/ByteArray.java +++ b/pinot-spi/src/main/java/org/apache/pinot/spi/utils/ByteArray.java @@ -34,6 +34,7 @@ import org.slf4j.LoggerFactory; * <li>Implements equals() and hashCode(), so it can be used as key for HashMap/Set</li> * <li>Caches the hash code of the byte[]</li> * </ul> + * NOTE: DO NOT reuse the bytes when hash is needed because hash is only calculated once and cached. */ public class ByteArray implements Comparable<ByteArray>, Serializable { private static final Logger LOGGER = LoggerFactory.getLogger(ByteArray.class); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
