You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@parquet.apache.org by "David Mollitor (Jira)" <ji...@apache.org> on 2020/10/13 15:50:00 UTC

[jira] [Updated] (PARQUET-1924) Do not Instantiate a New LongHashFunction

     [ https://issues.apache.org/jira/browse/PARQUET-1924?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Mollitor updated PARQUET-1924:
------------------------------------
    Description: 
{code:java|title=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);
  }
{code}

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

  was:
{code:java|title=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);|
| |}|


> Do not Instantiate a New LongHashFunction 
> ------------------------------------------
>
>                 Key: PARQUET-1924
>                 URL: https://issues.apache.org/jira/browse/PARQUET-1924
>             Project: Parquet
>          Issue Type: Improvement
>            Reporter: David Mollitor
>            Assignee: David Mollitor
>            Priority: Minor
>
> {code:java|title=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);
>   }
> {code}
> Since the seed is always zero, the {{static}} implementation provided by the library can be used here.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)