Uploaded image for project: 'Parquet'
  1. Parquet
  2. PARQUET-1924

Do not Instantiate a New LongHashFunction

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 1.12.0
    • None
    • None

    Description

      XxHash.java
      /**
       * The implementation of HashFunction interface. The XxHash uses XXH64 version xxHash
       * with a seed of 0.
       */
      public class XxHash implements HashFunction {
        @Override
        public long hashBytes(byte[] input) {
          return LongHashFunction.xx(0).hashBytes(input);
        }
      
        @Override
        public long hashByteBuffer(ByteBuffer input) {
          return LongHashFunction.xx(0).hashBytes(input);
        }
      

      Since the seed is always zero, the static implementation provided by the library can be used here.

      Attachments

        Activity

          People

            belugabehr David Mollitor
            belugabehr David Mollitor
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: