arrow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject [29/51] [partial] arrow-site git commit: Add Ray serialization blog post, update API docs
Date Mon, 16 Oct 2017 14:20:07 GMT
http://git-wip-us.apache.org/repos/asf/arrow-site/blob/7a2e5ece/docs/cpp/hash-util_8h_source.html
----------------------------------------------------------------------
diff --git a/docs/cpp/hash-util_8h_source.html b/docs/cpp/hash-util_8h_source.html
index bca4643..3f4335f 100644
--- a/docs/cpp/hash-util_8h_source.html
+++ b/docs/cpp/hash-util_8h_source.html
@@ -5,7 +5,7 @@
 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
 <meta name="generator" content="Doxygen 1.8.13"/>
 <meta name="viewport" content="width=device-width, initial-scale=1"/>
-<title>Apache Arrow (C++): /home/wesm/code/arrow/cpp/src/arrow/util/hash-util.h Source File</title>
+<title>Apache Arrow (C++): /apache-arrow/arrow/cpp/src/arrow/util/hash-util.h Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
 <script type="text/javascript" src="jquery.js"></script>
 <script type="text/javascript" src="dynsections.js"></script>
@@ -67,7 +67,7 @@ $(function() {
 <div class="title">hash-util.h</div>  </div>
 </div><!--header-->
 <div class="contents">
-<a href="hash-util_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">// Licensed to the Apache Software Foundation (ASF) under one</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">// or more contributor license agreements.  See the NOTICE file</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">// distributed with this work for additional information</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">// regarding copyright ownership.  The ASF licenses this file</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">// to you under the Apache License, Version 2.0 (the</span></div><div class="line"><a name="l00006"></a><span cla
 ss="lineno">    6</span>&#160;<span class="comment">// &quot;License&quot;); you may not use this file except in compliance</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">// with the License.  You may obtain a copy of the License at</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">//   http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">// Unless required by applicable law or agreed to in writing,</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">// software distributed
  under the License is distributed on an</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">// &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">// KIND, either express or implied.  See the License for the</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">// specific language governing permissions and limitations</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">// under the License.</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">// From Apache Impala (incubating) as of 2016-02-22</span></div><div class="line"><a name="l00019"></a>
 <span class="lineno">   19</span>&#160;</div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#ifndef ARROW_UTIL_HASH_UTIL_H</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#define ARROW_UTIL_HASH_UTIL_H</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#include &lt;cstdint&gt;</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="cpu-info_8h.html">arrow/util/cpu-info.h</a>&quot;</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="
 logging_8h.html">arrow/util/logging.h</a>&quot;</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="macros_8h.html">arrow/util/macros.h</a>&quot;</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="sse-util_8h.html">arrow/util/sse-util.h</a>&quot;</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacearrow.html">arrow</a> {</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div><div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html">   33</a></span>&#160;<span class="keyword">class </span><a class="code" hr
 ef="classarrow_1_1_hash_util.html">HashUtil</a> {</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#a319a992423d18679d77043c638b270f4">   42</a></span>&#160;  <span class="keyword">static</span> uint32_t <a class="code" href="classarrow_1_1_hash_util.html#a319a992423d18679d77043c638b270f4">CrcHash</a>(<span class="keyword">const</span> <span class="keywordtype">void</span>* data, int32_t bytes, uint32_t hash) {</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    <a class="code" href="logging_8h.html#ae17f8119c108cf3070bad3449c7e0006">DCHECK</a>(<a class="code" href="classarrow_1_1_cpu_info.html#ad111f08ae6a89fcc8c47b4fac7a32a3f">CpuInfo::IsSupported</a>(<a class="code" href="classarrow_1_1_cpu_info.html#abf5efa5c9768acadbb62a60872d7edb6">CpuInfo::SSE4_2</a>));</di
 v><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;    uint32_t words = <span class="keyword">static_cast&lt;</span>uint32_t<span class="keyword">&gt;</span>(bytes / <span class="keyword">sizeof</span>(uint32_t));</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;    bytes = <span class="keyword">static_cast&lt;</span>int32_t<span class="keyword">&gt;</span>(bytes % <span class="keyword">sizeof</span>(uint32_t));</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    <span class="keyword">const</span> uint32_t* p = <span class="keyword">reinterpret_cast&lt;</span><span class="keyword">const </span>uint32_t*<span class="keyword">&gt;</span>(data);</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    <span class="keywordflow">while</span> (words--) {</div><div class="line"><a 
 name="l00049"></a><span class="lineno">   49</span>&#160;      hash = SSE4_crc32_u32(hash, *p);</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;      ++p;</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    }</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    <span class="keyword">const</span> uint8_t* s = <span class="keyword">reinterpret_cast&lt;</span><span class="keyword">const </span>uint8_t*<span class="keyword">&gt;</span>(p);</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    <span class="keywordflow">while</span> (bytes--) {</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;      hash = SSE4_crc32_u8(hash, *s);</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;      ++s;</div><div class=
 "line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    }</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    <span class="comment">// The lower half of the CRC hash has has poor uniformity, so swap the halves</span></div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    <span class="comment">// for anyone who only uses the first several bits of the hash.</span></div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    hash = (hash &lt;&lt; 16) | (hash &gt;&gt; 16);</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    <span class="keywordflow">return</span> hash;</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;  }</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;</div><div class="line"><a n
 ame="l00066"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#ab4f3926a84438a5315961a9e8762a379">   66</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">inline</span> uint32_t <a class="code" href="classarrow_1_1_hash_util.html#ab4f3926a84438a5315961a9e8762a379">CrcHash1</a>(<span class="keyword">const</span> <span class="keywordtype">void</span>* v, uint32_t hash) {</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    <a class="code" href="logging_8h.html#ae17f8119c108cf3070bad3449c7e0006">DCHECK</a>(<a class="code" href="classarrow_1_1_cpu_info.html#ad111f08ae6a89fcc8c47b4fac7a32a3f">CpuInfo::IsSupported</a>(<a class="code" href="classarrow_1_1_cpu_info.html#abf5efa5c9768acadbb62a60872d7edb6">CpuInfo::SSE4_2</a>));</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    <span class="keyword">const</span> uint8_t* s = <span class="keyword">reinterpret_cast&lt;</spa
 n><span class="keyword">const </span>uint8_t*<span class="keyword">&gt;</span>(v);</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    hash = SSE4_crc32_u8(hash, *s);</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    hash = (hash &lt;&lt; 16) | (hash &gt;&gt; 16);</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    <span class="keywordflow">return</span> hash;</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;  }</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;</div><div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#a7088a69bfa1882c006afc702c8655369">   75</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">inline</span> uint32_t <a class="code" href="classarrow_1_1_hash_util.html#a7088a69bfa1882c006afc702c8655369">CrcHash2</a>
 (<span class="keyword">const</span> <span class="keywordtype">void</span>* v, uint32_t hash) {</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    <a class="code" href="logging_8h.html#ae17f8119c108cf3070bad3449c7e0006">DCHECK</a>(<a class="code" href="classarrow_1_1_cpu_info.html#ad111f08ae6a89fcc8c47b4fac7a32a3f">CpuInfo::IsSupported</a>(<a class="code" href="classarrow_1_1_cpu_info.html#abf5efa5c9768acadbb62a60872d7edb6">CpuInfo::SSE4_2</a>));</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    <span class="keyword">const</span> uint16_t* s = <span class="keyword">reinterpret_cast&lt;</span><span class="keyword">const </span>uint16_t*<span class="keyword">&gt;</span>(v);</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;    hash = SSE4_crc32_u16(hash, *s);</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    hash = (hash &lt;&lt; 16) | (hash &gt
 ;&gt; 16);</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    <span class="keywordflow">return</span> hash;</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;  }</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;</div><div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#aa1682043be864974463d84b30a07e830">   84</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">inline</span> uint32_t <a class="code" href="classarrow_1_1_hash_util.html#aa1682043be864974463d84b30a07e830">CrcHash4</a>(<span class="keyword">const</span> <span class="keywordtype">void</span>* v, uint32_t hash) {</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    <a class="code" href="logging_8h.html#ae17f8119c108cf3070bad3449c7e0006">DCHECK</a>(<a class="code" href="classarrow_1_1_cpu_info.html#ad111f08a
 e6a89fcc8c47b4fac7a32a3f">CpuInfo::IsSupported</a>(<a class="code" href="classarrow_1_1_cpu_info.html#abf5efa5c9768acadbb62a60872d7edb6">CpuInfo::SSE4_2</a>));</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    <span class="keyword">const</span> uint32_t* p = <span class="keyword">reinterpret_cast&lt;</span><span class="keyword">const </span>uint32_t*<span class="keyword">&gt;</span>(v);</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    hash = SSE4_crc32_u32(hash, *p);</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    hash = (hash &lt;&lt; 16) | (hash &gt;&gt; 16);</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    <span class="keywordflow">return</span> hash;</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;  }</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;</div><div c
 lass="line"><a name="l00093"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#ada776bf928502a9491dae4419c90d28d">   93</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">inline</span> uint32_t <a class="code" href="classarrow_1_1_hash_util.html#ada776bf928502a9491dae4419c90d28d">CrcHash8</a>(<span class="keyword">const</span> <span class="keywordtype">void</span>* v, uint32_t hash) {</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    <a class="code" href="logging_8h.html#ae17f8119c108cf3070bad3449c7e0006">DCHECK</a>(<a class="code" href="classarrow_1_1_cpu_info.html#ad111f08ae6a89fcc8c47b4fac7a32a3f">CpuInfo::IsSupported</a>(<a class="code" href="classarrow_1_1_cpu_info.html#abf5efa5c9768acadbb62a60872d7edb6">CpuInfo::SSE4_2</a>));</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    <span class="keyword">const</span> uint64_t* p = <span class="keyword">reinterp
 ret_cast&lt;</span><span class="keyword">const </span>uint64_t*<span class="keyword">&gt;</span>(v);</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    hash = SSE4_crc32_u64(hash, *p);</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    hash = (hash &lt;&lt; 16) | (hash &gt;&gt; 16);</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    <span class="keywordflow">return</span> hash;</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;  }</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;</div><div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#ae5deeed407254b0d0dfaac4ffc935b08">  102</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">inline</span> uint32_t <a class="code" href="classarrow_1_1_hash_util.html#ae5deeed407254b0d0dfaac4ffc9
 35b08">CrcHash12</a>(<span class="keyword">const</span> <span class="keywordtype">void</span>* v, uint32_t hash) {</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    <a class="code" href="logging_8h.html#ae17f8119c108cf3070bad3449c7e0006">DCHECK</a>(<a class="code" href="classarrow_1_1_cpu_info.html#ad111f08ae6a89fcc8c47b4fac7a32a3f">CpuInfo::IsSupported</a>(<a class="code" href="classarrow_1_1_cpu_info.html#abf5efa5c9768acadbb62a60872d7edb6">CpuInfo::SSE4_2</a>));</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    <span class="keyword">const</span> uint64_t* p = <span class="keyword">reinterpret_cast&lt;</span><span class="keyword">const </span>uint64_t*<span class="keyword">&gt;</span>(v);</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    hash = SSE4_crc32_u64(hash, *p);</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    ++p;</div><div cl
 ass="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    hash = SSE4_crc32_u32(hash, *reinterpret_cast&lt;const uint32_t*&gt;(p));</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    hash = (hash &lt;&lt; 16) | (hash &gt;&gt; 16);</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    <span class="keywordflow">return</span> hash;</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;  }</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;</div><div class="line"><a name="l00113"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#ab40a70130bf9f41f4244170b9f0308c1">  113</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">inline</span> uint32_t <a class="code" href="classarrow_1_1_hash_util.html#ab40a70130bf9f41f4244170b9f0308c1">CrcHash16</a>(<span class="keyword">const</span> <span class="key
 wordtype">void</span>* v, uint32_t hash) {</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;    <a class="code" href="logging_8h.html#ae17f8119c108cf3070bad3449c7e0006">DCHECK</a>(<a class="code" href="classarrow_1_1_cpu_info.html#ad111f08ae6a89fcc8c47b4fac7a32a3f">CpuInfo::IsSupported</a>(<a class="code" href="classarrow_1_1_cpu_info.html#abf5efa5c9768acadbb62a60872d7edb6">CpuInfo::SSE4_2</a>));</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    <span class="keyword">const</span> uint64_t* p = <span class="keyword">reinterpret_cast&lt;</span><span class="keyword">const </span>uint64_t*<span class="keyword">&gt;</span>(v);</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    hash = SSE4_crc32_u64(hash, *p);</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;    ++p;</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160; 
    hash = SSE4_crc32_u64(hash, *p);</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    hash = (hash &lt;&lt; 16) | (hash &gt;&gt; 16);</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;    <span class="keywordflow">return</span> hash;</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;  }</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;</div><div class="line"><a name="l00123"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#a23d3063447bbbc10f5116250e35cffe2">  123</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">const</span> uint64_t <a class="code" href="classarrow_1_1_hash_util.html#a23d3063447bbbc10f5116250e35cffe2">MURMUR_PRIME</a> = 0xc6a4a7935bd1e995;</div><div class="line"><a name="l00124"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#ab0f0a88f886fcd37a522b6
 e2c200bc67">  124</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="classarrow_1_1_hash_util.html#ab0f0a88f886fcd37a522b6e2c200bc67">MURMUR_R</a> = 47;</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;</div><div class="line"><a name="l00127"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#a2901d71d89109a041d5e9cee0414d224">  127</a></span>&#160;  <span class="keyword">static</span> uint64_t <a class="code" href="classarrow_1_1_hash_util.html#a2901d71d89109a041d5e9cee0414d224">MurmurHash2_64</a>(<span class="keyword">const</span> <span class="keywordtype">void</span>* input, <span class="keywordtype">int</span> len, uint64_t seed) {</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    uint64_t h = seed ^ (len * <a class="code" href="classarrow_1_1_hash_util.html#a23d3063447bbbc10f5116250e35cf
 fe2">MURMUR_PRIME</a>);</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    <span class="keyword">const</span> uint64_t* data = <span class="keyword">reinterpret_cast&lt;</span><span class="keyword">const </span>uint64_t*<span class="keyword">&gt;</span>(input);</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    <span class="keyword">const</span> uint64_t* end = data + (len / <span class="keyword">sizeof</span>(uint64_t));</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    <span class="keywordflow">while</span> (data != end) {</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;      uint64_t k = *data++;</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&
 #160;      k *= <a class="code" href="classarrow_1_1_hash_util.html#a23d3063447bbbc10f5116250e35cffe2">MURMUR_PRIME</a>;</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;      k ^= k &gt;&gt; <a class="code" href="classarrow_1_1_hash_util.html#ab0f0a88f886fcd37a522b6e2c200bc67">MURMUR_R</a>;</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;      k *= <a class="code" href="classarrow_1_1_hash_util.html#a23d3063447bbbc10f5116250e35cffe2">MURMUR_PRIME</a>;</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;      h ^= k;</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;      h *= <a class="code" href="classarrow_1_1_hash_util.html#a23d3063447bbbc10f5116250e35cffe2">MURMUR_PRIME</a>;</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;    }</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;</d
 iv><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    <span class="keyword">const</span> uint8_t* data2 = <span class="keyword">reinterpret_cast&lt;</span><span class="keyword">const </span>uint8_t*<span class="keyword">&gt;</span>(data);</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;    <span class="keywordflow">switch</span> (len &amp; 7) {</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;      <span class="keywordflow">case</span> 7:</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;        h ^= uint64_t(data2[6]) &lt;&lt; 48;</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;      <span class="keywordflow">case</span> 6:</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;        h ^= uint64_t(data2[5]) &lt;&lt; 40;</div><div class="line"><a name="l00148"></a><span class="lineno">  1
 48</span>&#160;      <span class="keywordflow">case</span> 5:</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;        h ^= uint64_t(data2[4]) &lt;&lt; 32;</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;      <span class="keywordflow">case</span> 4:</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;        h ^= uint64_t(data2[3]) &lt;&lt; 24;</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;      <span class="keywordflow">case</span> 3:</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;        h ^= uint64_t(data2[2]) &lt;&lt; 16;</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;      <span class="keywordflow">case</span> 2:</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;        h ^= uint64_t(data2[1]) &lt;&lt; 8;</div><div class="line"><a name="l0
 0156"></a><span class="lineno">  156</span>&#160;      <span class="keywordflow">case</span> 1:</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;        h ^= uint64_t(data2[0]);</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;        h *= <a class="code" href="classarrow_1_1_hash_util.html#a23d3063447bbbc10f5116250e35cffe2">MURMUR_PRIME</a>;</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;    }</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    h ^= h &gt;&gt; <a class="code" href="classarrow_1_1_hash_util.html#ab0f0a88f886fcd37a522b6e2c200bc67">MURMUR_R</a>;</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;    h *= <a class="code" href="classarrow_1_1_hash_util.html#a23d3063447bbbc10f5116250e35cffe2">MURMUR_PRIME</a>;</div><div 
 class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;    h ^= h &gt;&gt; <a class="code" href="classarrow_1_1_hash_util.html#ab0f0a88f886fcd37a522b6e2c200bc67">MURMUR_R</a>;</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;    <span class="keywordflow">return</span> h;</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;  }</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;</div><div class="line"><a name="l00168"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#acf9673f14a5e8980c688f6a5763a9158">  168</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">const</span> uint32_t <a class="code" href="classarrow_1_1_hash_util.html#acf9673f14a5e8980c688f6a5763a9158">FNV_PRIME</a> = 0x01000193;  <span class="comment">//   16777619</span></div><div class="line"><a name="l00169"></a><span class="lineno"><a class="line" href="
 classarrow_1_1_hash_util.html#a12e6c2bd6015f0c3a0cd47a7ecfdc5d9">  169</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">const</span> uint32_t <a class="code" href="classarrow_1_1_hash_util.html#a12e6c2bd6015f0c3a0cd47a7ecfdc5d9">FNV_SEED</a> = 0x811C9DC5;   <span class="comment">// 2166136261</span></div><div class="line"><a name="l00170"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#adc76586f132262061eb7881b8865b7ba">  170</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">const</span> uint64_t <a class="code" href="classarrow_1_1_hash_util.html#adc76586f132262061eb7881b8865b7ba">FNV64_PRIME</a> = 1099511628211UL;</div><div class="line"><a name="l00171"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#aedb189cc8d1f356ae5d907767babbf2c">  171</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">const</span> uint64_t <a class="code" href="classarrow_1_
 1_hash_util.html#aedb189cc8d1f356ae5d907767babbf2c">FNV64_SEED</a> = 14695981039346656037UL;</div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;</div><div class="line"><a name="l00182"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#ac4d6d601114af18f86efe3a5a6b01399">  182</a></span>&#160;  <span class="keyword">static</span> uint64_t <a class="code" href="classarrow_1_1_hash_util.html#ac4d6d601114af18f86efe3a5a6b01399">FnvHash64</a>(<span class="keyword">const</span> <span class="keywordtype">void</span>* data, int32_t bytes, uint64_t hash) {</div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;    <span class="keyword">const</span> uint8_t* ptr = <span class="keyword">reinterpret_cast&lt;</span><span class="keyword">const </span>uint8_t*<span class="keyword">&gt;</span>(data);</div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;    <span class="keywordflow">whi
 le</span> (bytes--) {</div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;      hash = (*ptr ^ hash) * FNV64_PRIME;</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;      ++ptr;</div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;    }</div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;    <span class="keywordflow">return</span> hash;</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;  }</div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;</div><div class="line"><a name="l00199"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#a72f78faa22e2c2e10ec6623678829bc7">  199</a></span>&#160;  <span class="keyword">static</span> uint32_t <a class="code" href="classarrow_1_1_hash_util.html#a72f78faa22e2c2e10ec6623678829bc7">FnvHash64to32</a>(<span class="keyword">const</span> 
 <span class="keywordtype">void</span>* data, int32_t bytes, uint32_t hash) {</div><div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;    <span class="comment">// IMPALA-2270: this function should never be used for zero-byte inputs.</span></div><div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;    <a class="code" href="logging_8h.html#ab4f56aa24c4c9cddc47a6abd2d747f9a">DCHECK_GT</a>(bytes, 0);</div><div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;    uint64_t hash_u64 = hash | ((uint64_t)hash &lt;&lt; 32);</div><div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;    hash_u64 = <a class="code" href="classarrow_1_1_hash_util.html#ac4d6d601114af18f86efe3a5a6b01399">FnvHash64</a>(data, bytes, hash_u64);</div><div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>uint32_t
 <span class="keyword">&gt;</span>((hash_u64 &gt;&gt; 32) ^ (hash_u64 &amp; 0xFFFFFFFF));</div><div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;  }</div><div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;</div><div class="line"><a name="l00211"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#a7379a70ec7f527773ee6bd034571ad15">  211</a></span>&#160;  <span class="keyword">static</span> uint32_t <a class="code" href="classarrow_1_1_hash_util.html#a7379a70ec7f527773ee6bd034571ad15">Hash</a>(<span class="keyword">const</span> <span class="keywordtype">void</span>* data, int32_t bytes, uint32_t seed) {</div><div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;<span class="preprocessor">#ifdef ARROW_USE_SSE</span></div><div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;    <span class="keywordflow">if</span> (LIKELY(<a class="code" href="classarrow_1_1_cp
 u_info.html#ad111f08ae6a89fcc8c47b4fac7a32a3f">CpuInfo::IsSupported</a>(<a class="code" href="classarrow_1_1_cpu_info.html#abf5efa5c9768acadbb62a60872d7edb6">CpuInfo::SSE4_2</a>))) {</div><div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;      <span class="keywordflow">return</span> <a class="code" href="classarrow_1_1_hash_util.html#a319a992423d18679d77043c638b270f4">CrcHash</a>(data, bytes, seed);</div><div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;    } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;      <span class="keywordflow">return</span> <a class="code" href="classarrow_1_1_hash_util.html#a2901d71d89109a041d5e9cee0414d224">MurmurHash2_64</a>(data, bytes, seed);</div><div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;    }</div><div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;<span clas
 s="preprocessor">#else</span></div><div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>uint32_t<span class="keyword">&gt;</span>(<a class="code" href="classarrow_1_1_hash_util.html#a2901d71d89109a041d5e9cee0414d224">MurmurHash2_64</a>(data, bytes, seed));</div><div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;  }</div><div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;</div><div class="line"><a name="l00224"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#af16452734d367cbf15820e269f869d74">  224</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">const</span> uint32_t <a class="code" href="classarrow_1_1_hash_util.html#af16452734d367cbf15820e2
 69f869d74">HASH_COMBINE_SEED</a> = 0x9e3779b9;</div><div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;</div><div class="line"><a name="l00230"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#a32de57b2811253511436a8d3edb2570b">  230</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">inline</span> uint32_t <a class="code" href="classarrow_1_1_hash_util.html#a32de57b2811253511436a8d3edb2570b">HashCombine32</a>(uint32_t value, uint32_t seed) {</div><div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;    <span class="keywordflow">return</span> seed ^ (HASH_COMBINE_SEED + value + (seed &lt;&lt; 6) + (seed &gt;&gt; 2));</div><div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;  }</div><div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;</div><div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;  <span class=
 "comment">// Get 32 more bits of randomness from a 32-bit hash:</span></div><div class="line"><a name="l00235"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#a2934b4e6ea31c827ec1f9dd114be6f96">  235</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">inline</span> uint32_t <a class="code" href="classarrow_1_1_hash_util.html#a2934b4e6ea31c827ec1f9dd114be6f96">Rehash32to32</a>(<span class="keyword">const</span> uint32_t hash) {</div><div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;    <span class="comment">// Constants generated by uuidgen(1) with the -r flag</span></div><div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;    <span class="keyword">static</span> <span class="keyword">const</span> uint64_t m = 0x7850f11ec6d14889ull, a = 0x6773610597ca4c63ull;</div><div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;    <span class="comment">// This is st
 rongly universal hashing following Dietzfelbinger&#39;s &quot;Universal hashing</span></div><div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;    <span class="comment">// and k-wise independent random variables via integer arithmetic without primes&quot;. As</span></div><div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;    <span class="comment">// such, for any two distinct uint32_t&#39;s hash1 and hash2, the probability (over the</span></div><div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;    <span class="comment">// randomness of the constants) that any subset of bit positions of</span></div><div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;    <span class="comment">// Rehash32to32(hash1) is equal to the same subset of bit positions</span></div><div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;    <span class="comment">// Rehash32to32(hash2)
  is minimal.</span></div><div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>uint32_t<span class="keyword">&gt;</span>((<span class="keyword">static_cast&lt;</span>uint64_t<span class="keyword">&gt;</span>(hash) * m + a) &gt;&gt; 32);</div><div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;  }</div><div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;</div><div class="line"><a name="l00247"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#ad1a9a41c06ed9a5570a501380e2991de">  247</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">inline</span> uint64_t <a class="code" href="classarrow_1_1_hash_util.html#ad1a9a41c06ed9a5570a501380e2991de">Rehash32to64</a>(<span class="keyword">const</span> uint32_t hash) {</div><div class="line"><a name="l00248"></a><span class="lineno"
 >  248</span>&#160;    <span class="keyword">static</span> <span class="keyword">const</span> uint64_t m1 = 0x47b6137a44974d91ull, m2 = 0x8824ad5ba2b7289cull,</div><div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;                          a1 = 0x705495c62df1424aull, a2 = 0x9efc49475c6bfb31ull;</div><div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;    <span class="keyword">const</span> uint64_t hash1 = (<span class="keyword">static_cast&lt;</span>uint64_t<span class="keyword">&gt;</span>(hash) * m1 + a1) &gt;&gt; 32;</div><div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;    <span class="keyword">const</span> uint64_t hash2 = (<span class="keyword">static_cast&lt;</span>uint64_t<span class="keyword">&gt;</span>(hash) * m2 + a2) &gt;&gt; 32;</div><div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;    <span class="keywordflow">return</span> hash1 | (hash2 &lt;&lt; 32);</div>
 <div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;  }</div><div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;};</div><div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;</div><div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;}  <span class="comment">// namespace arrow</span></div><div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;</div><div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;<span class="preprocessor">#endif  // ARROW_UTIL_HASH_UTIL_H</span></div><div class="ttc" id="classarrow_1_1_hash_util_html_ada776bf928502a9491dae4419c90d28d"><div class="ttname"><a href="classarrow_1_1_hash_util.html#ada776bf928502a9491dae4419c90d28d">arrow::HashUtil::CrcHash8</a></div><div class="ttdeci">static uint32_t CrcHash8(const void *v, uint32_t hash)</div><div class="ttdoc">CrcHash() specialized for 8-byte data. </div><div class="
 ttdef"><b>Definition:</b> hash-util.h:93</div></div>
+<a href="hash-util_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">// Licensed to the Apache Software Foundation (ASF) under one</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">// or more contributor license agreements.  See the NOTICE file</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">// distributed with this work for additional information</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">// regarding copyright ownership.  The ASF licenses this file</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">// to you under the Apache License, Version 2.0 (the</span></div><div class="line"><a name="l00006"></a><span cla
 ss="lineno">    6</span>&#160;<span class="comment">// &quot;License&quot;); you may not use this file except in compliance</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">// with the License.  You may obtain a copy of the License at</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">//   http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">// Unless required by applicable law or agreed to in writing,</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">// software distributed
  under the License is distributed on an</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">// &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">// KIND, either express or implied.  See the License for the</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">// specific language governing permissions and limitations</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">// under the License.</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">// From Apache Impala (incubating) as of 2016-02-22</span></div><div class="line"><a name="l00019"></a>
 <span class="lineno">   19</span>&#160;</div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#ifndef ARROW_UTIL_HASH_UTIL_H</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#define ARROW_UTIL_HASH_UTIL_H</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#include &lt;cstdint&gt;</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="cpu-info_8h.html">arrow/util/cpu-info.h</a>&quot;</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="
 logging_8h.html">arrow/util/logging.h</a>&quot;</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="macros_8h.html">arrow/util/macros.h</a>&quot;</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="sse-util_8h.html">arrow/util/sse-util.h</a>&quot;</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacearrow.html">arrow</a> {</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div><div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html">   33</a></span>&#160;<span class="keyword">class </span><a class="code" hr
 ef="classarrow_1_1_hash_util.html">HashUtil</a> {</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#a319a992423d18679d77043c638b270f4">   42</a></span>&#160;  <span class="keyword">static</span> uint32_t <a class="code" href="classarrow_1_1_hash_util.html#a319a992423d18679d77043c638b270f4">CrcHash</a>(<span class="keyword">const</span> <span class="keywordtype">void</span>* data, int32_t bytes, uint32_t hash) {</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    <a class="code" href="logging_8h.html#ae17f8119c108cf3070bad3449c7e0006">DCHECK</a>(<a class="code" href="classarrow_1_1_cpu_info.html#ad111f08ae6a89fcc8c47b4fac7a32a3f">CpuInfo::IsSupported</a>(<a class="code" href="classarrow_1_1_cpu_info.html#abf5efa5c9768acadbb62a60872d7edb6">CpuInfo::SSE4_2</a>));</di
 v><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;    uint32_t words = <span class="keyword">static_cast&lt;</span>uint32_t<span class="keyword">&gt;</span>(bytes / <span class="keyword">sizeof</span>(uint32_t));</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;    bytes = <span class="keyword">static_cast&lt;</span>int32_t<span class="keyword">&gt;</span>(bytes % <span class="keyword">sizeof</span>(uint32_t));</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    <span class="keyword">const</span> uint32_t* p = <span class="keyword">reinterpret_cast&lt;</span><span class="keyword">const </span>uint32_t*<span class="keyword">&gt;</span>(data);</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    <span class="keywordflow">while</span> (words--) {</div><div class="line"><a 
 name="l00049"></a><span class="lineno">   49</span>&#160;      hash = SSE4_crc32_u32(hash, *p);</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;      ++p;</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    }</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    <span class="keyword">const</span> uint8_t* s = <span class="keyword">reinterpret_cast&lt;</span><span class="keyword">const </span>uint8_t*<span class="keyword">&gt;</span>(p);</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    <span class="keywordflow">while</span> (bytes--) {</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;      hash = SSE4_crc32_u8(hash, *s);</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;      ++s;</div><div class=
 "line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    }</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    <span class="comment">// The lower half of the CRC hash has has poor uniformity, so swap the halves</span></div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    <span class="comment">// for anyone who only uses the first several bits of the hash.</span></div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    hash = (hash &lt;&lt; 16) | (hash &gt;&gt; 16);</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    <span class="keywordflow">return</span> hash;</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;  }</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;</div><div class="line"><a n
 ame="l00066"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#ab4f3926a84438a5315961a9e8762a379">   66</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">inline</span> uint32_t <a class="code" href="classarrow_1_1_hash_util.html#ab4f3926a84438a5315961a9e8762a379">CrcHash1</a>(<span class="keyword">const</span> <span class="keywordtype">void</span>* v, uint32_t hash) {</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    <a class="code" href="logging_8h.html#ae17f8119c108cf3070bad3449c7e0006">DCHECK</a>(<a class="code" href="classarrow_1_1_cpu_info.html#ad111f08ae6a89fcc8c47b4fac7a32a3f">CpuInfo::IsSupported</a>(<a class="code" href="classarrow_1_1_cpu_info.html#abf5efa5c9768acadbb62a60872d7edb6">CpuInfo::SSE4_2</a>));</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    <span class="keyword">const</span> uint8_t* s = <span class="keyword">reinterpret_cast&lt;</spa
 n><span class="keyword">const </span>uint8_t*<span class="keyword">&gt;</span>(v);</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    hash = SSE4_crc32_u8(hash, *s);</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    hash = (hash &lt;&lt; 16) | (hash &gt;&gt; 16);</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    <span class="keywordflow">return</span> hash;</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;  }</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;</div><div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#a7088a69bfa1882c006afc702c8655369">   75</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">inline</span> uint32_t <a class="code" href="classarrow_1_1_hash_util.html#a7088a69bfa1882c006afc702c8655369">CrcHash2</a>
 (<span class="keyword">const</span> <span class="keywordtype">void</span>* v, uint32_t hash) {</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    <a class="code" href="logging_8h.html#ae17f8119c108cf3070bad3449c7e0006">DCHECK</a>(<a class="code" href="classarrow_1_1_cpu_info.html#ad111f08ae6a89fcc8c47b4fac7a32a3f">CpuInfo::IsSupported</a>(<a class="code" href="classarrow_1_1_cpu_info.html#abf5efa5c9768acadbb62a60872d7edb6">CpuInfo::SSE4_2</a>));</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    <span class="keyword">const</span> uint16_t* s = <span class="keyword">reinterpret_cast&lt;</span><span class="keyword">const </span>uint16_t*<span class="keyword">&gt;</span>(v);</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;    hash = SSE4_crc32_u16(hash, *s);</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    hash = (hash &lt;&lt; 16) | (hash &gt
 ;&gt; 16);</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    <span class="keywordflow">return</span> hash;</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;  }</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;</div><div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#aa1682043be864974463d84b30a07e830">   84</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">inline</span> uint32_t <a class="code" href="classarrow_1_1_hash_util.html#aa1682043be864974463d84b30a07e830">CrcHash4</a>(<span class="keyword">const</span> <span class="keywordtype">void</span>* v, uint32_t hash) {</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    <a class="code" href="logging_8h.html#ae17f8119c108cf3070bad3449c7e0006">DCHECK</a>(<a class="code" href="classarrow_1_1_cpu_info.html#ad111f08a
 e6a89fcc8c47b4fac7a32a3f">CpuInfo::IsSupported</a>(<a class="code" href="classarrow_1_1_cpu_info.html#abf5efa5c9768acadbb62a60872d7edb6">CpuInfo::SSE4_2</a>));</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    <span class="keyword">const</span> uint32_t* p = <span class="keyword">reinterpret_cast&lt;</span><span class="keyword">const </span>uint32_t*<span class="keyword">&gt;</span>(v);</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    hash = SSE4_crc32_u32(hash, *p);</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    hash = (hash &lt;&lt; 16) | (hash &gt;&gt; 16);</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    <span class="keywordflow">return</span> hash;</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;  }</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;</div><div c
 lass="line"><a name="l00093"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#ada776bf928502a9491dae4419c90d28d">   93</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">inline</span> uint32_t <a class="code" href="classarrow_1_1_hash_util.html#ada776bf928502a9491dae4419c90d28d">CrcHash8</a>(<span class="keyword">const</span> <span class="keywordtype">void</span>* v, uint32_t hash) {</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    <a class="code" href="logging_8h.html#ae17f8119c108cf3070bad3449c7e0006">DCHECK</a>(<a class="code" href="classarrow_1_1_cpu_info.html#ad111f08ae6a89fcc8c47b4fac7a32a3f">CpuInfo::IsSupported</a>(<a class="code" href="classarrow_1_1_cpu_info.html#abf5efa5c9768acadbb62a60872d7edb6">CpuInfo::SSE4_2</a>));</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    <span class="keyword">const</span> uint64_t* p = <span class="keyword">reinterp
 ret_cast&lt;</span><span class="keyword">const </span>uint64_t*<span class="keyword">&gt;</span>(v);</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    hash = SSE4_crc32_u64(hash, *p);</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    hash = (hash &lt;&lt; 16) | (hash &gt;&gt; 16);</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    <span class="keywordflow">return</span> hash;</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;  }</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;</div><div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#ae5deeed407254b0d0dfaac4ffc935b08">  102</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">inline</span> uint32_t <a class="code" href="classarrow_1_1_hash_util.html#ae5deeed407254b0d0dfaac4ffc9
 35b08">CrcHash12</a>(<span class="keyword">const</span> <span class="keywordtype">void</span>* v, uint32_t hash) {</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    <a class="code" href="logging_8h.html#ae17f8119c108cf3070bad3449c7e0006">DCHECK</a>(<a class="code" href="classarrow_1_1_cpu_info.html#ad111f08ae6a89fcc8c47b4fac7a32a3f">CpuInfo::IsSupported</a>(<a class="code" href="classarrow_1_1_cpu_info.html#abf5efa5c9768acadbb62a60872d7edb6">CpuInfo::SSE4_2</a>));</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    <span class="keyword">const</span> uint64_t* p = <span class="keyword">reinterpret_cast&lt;</span><span class="keyword">const </span>uint64_t*<span class="keyword">&gt;</span>(v);</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    hash = SSE4_crc32_u64(hash, *p);</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    ++p;</div><div cl
 ass="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    hash = SSE4_crc32_u32(hash, *reinterpret_cast&lt;const uint32_t*&gt;(p));</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    hash = (hash &lt;&lt; 16) | (hash &gt;&gt; 16);</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    <span class="keywordflow">return</span> hash;</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;  }</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;</div><div class="line"><a name="l00113"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#ab40a70130bf9f41f4244170b9f0308c1">  113</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">inline</span> uint32_t <a class="code" href="classarrow_1_1_hash_util.html#ab40a70130bf9f41f4244170b9f0308c1">CrcHash16</a>(<span class="keyword">const</span> <span class="key
 wordtype">void</span>* v, uint32_t hash) {</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;    <a class="code" href="logging_8h.html#ae17f8119c108cf3070bad3449c7e0006">DCHECK</a>(<a class="code" href="classarrow_1_1_cpu_info.html#ad111f08ae6a89fcc8c47b4fac7a32a3f">CpuInfo::IsSupported</a>(<a class="code" href="classarrow_1_1_cpu_info.html#abf5efa5c9768acadbb62a60872d7edb6">CpuInfo::SSE4_2</a>));</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    <span class="keyword">const</span> uint64_t* p = <span class="keyword">reinterpret_cast&lt;</span><span class="keyword">const </span>uint64_t*<span class="keyword">&gt;</span>(v);</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    hash = SSE4_crc32_u64(hash, *p);</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;    ++p;</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160; 
    hash = SSE4_crc32_u64(hash, *p);</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    hash = (hash &lt;&lt; 16) | (hash &gt;&gt; 16);</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;    <span class="keywordflow">return</span> hash;</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;  }</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;</div><div class="line"><a name="l00123"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#a23d3063447bbbc10f5116250e35cffe2">  123</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">const</span> uint64_t <a class="code" href="classarrow_1_1_hash_util.html#a23d3063447bbbc10f5116250e35cffe2">MURMUR_PRIME</a> = 0xc6a4a7935bd1e995;</div><div class="line"><a name="l00124"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#ab0f0a88f886fcd37a522b6
 e2c200bc67">  124</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="classarrow_1_1_hash_util.html#ab0f0a88f886fcd37a522b6e2c200bc67">MURMUR_R</a> = 47;</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;</div><div class="line"><a name="l00127"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#a2901d71d89109a041d5e9cee0414d224">  127</a></span>&#160;  <span class="keyword">static</span> uint64_t <a class="code" href="classarrow_1_1_hash_util.html#a2901d71d89109a041d5e9cee0414d224">MurmurHash2_64</a>(<span class="keyword">const</span> <span class="keywordtype">void</span>* input, <span class="keywordtype">int</span> len, uint64_t seed) {</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    uint64_t h = seed ^ (len * <a class="code" href="classarrow_1_1_hash_util.html#a23d3063447bbbc10f5116250e35cf
 fe2">MURMUR_PRIME</a>);</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    <span class="keyword">const</span> uint64_t* data = <span class="keyword">reinterpret_cast&lt;</span><span class="keyword">const </span>uint64_t*<span class="keyword">&gt;</span>(input);</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    <span class="keyword">const</span> uint64_t* end = data + (len / <span class="keyword">sizeof</span>(uint64_t));</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    <span class="keywordflow">while</span> (data != end) {</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;      uint64_t k = *data++;</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&
 #160;      k *= <a class="code" href="classarrow_1_1_hash_util.html#a23d3063447bbbc10f5116250e35cffe2">MURMUR_PRIME</a>;</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;      k ^= k &gt;&gt; <a class="code" href="classarrow_1_1_hash_util.html#ab0f0a88f886fcd37a522b6e2c200bc67">MURMUR_R</a>;</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;      k *= <a class="code" href="classarrow_1_1_hash_util.html#a23d3063447bbbc10f5116250e35cffe2">MURMUR_PRIME</a>;</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;      h ^= k;</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;      h *= <a class="code" href="classarrow_1_1_hash_util.html#a23d3063447bbbc10f5116250e35cffe2">MURMUR_PRIME</a>;</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;    }</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;</d
 iv><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    <span class="keyword">const</span> uint8_t* data2 = <span class="keyword">reinterpret_cast&lt;</span><span class="keyword">const </span>uint8_t*<span class="keyword">&gt;</span>(data);</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;    <span class="keywordflow">switch</span> (len &amp; 7) {</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;      <span class="keywordflow">case</span> 7:</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;        h ^= uint64_t(data2[6]) &lt;&lt; 48;</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;      <span class="keywordflow">case</span> 6:</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;        h ^= uint64_t(data2[5]) &lt;&lt; 40;</div><div class="line"><a name="l00148"></a><span class="lineno">  1
 48</span>&#160;      <span class="keywordflow">case</span> 5:</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;        h ^= uint64_t(data2[4]) &lt;&lt; 32;</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;      <span class="keywordflow">case</span> 4:</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;        h ^= uint64_t(data2[3]) &lt;&lt; 24;</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;      <span class="keywordflow">case</span> 3:</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;        h ^= uint64_t(data2[2]) &lt;&lt; 16;</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;      <span class="keywordflow">case</span> 2:</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;        h ^= uint64_t(data2[1]) &lt;&lt; 8;</div><div class="line"><a name="l0
 0156"></a><span class="lineno">  156</span>&#160;      <span class="keywordflow">case</span> 1:</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;        h ^= uint64_t(data2[0]);</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;        h *= <a class="code" href="classarrow_1_1_hash_util.html#a23d3063447bbbc10f5116250e35cffe2">MURMUR_PRIME</a>;</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;    }</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    h ^= h &gt;&gt; <a class="code" href="classarrow_1_1_hash_util.html#ab0f0a88f886fcd37a522b6e2c200bc67">MURMUR_R</a>;</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;    h *= <a class="code" href="classarrow_1_1_hash_util.html#a23d3063447bbbc10f5116250e35cffe2">MURMUR_PRIME</a>;</div><div 
 class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;    h ^= h &gt;&gt; <a class="code" href="classarrow_1_1_hash_util.html#ab0f0a88f886fcd37a522b6e2c200bc67">MURMUR_R</a>;</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;    <span class="keywordflow">return</span> h;</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;  }</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;</div><div class="line"><a name="l00168"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#acf9673f14a5e8980c688f6a5763a9158">  168</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">const</span> uint32_t <a class="code" href="classarrow_1_1_hash_util.html#acf9673f14a5e8980c688f6a5763a9158">FNV_PRIME</a> = 0x01000193;  <span class="comment">//   16777619</span></div><div class="line"><a name="l00169"></a><span class="lineno"><a class="line" href="
 classarrow_1_1_hash_util.html#a12e6c2bd6015f0c3a0cd47a7ecfdc5d9">  169</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">const</span> uint32_t <a class="code" href="classarrow_1_1_hash_util.html#a12e6c2bd6015f0c3a0cd47a7ecfdc5d9">FNV_SEED</a> = 0x811C9DC5;   <span class="comment">// 2166136261</span></div><div class="line"><a name="l00170"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#adc76586f132262061eb7881b8865b7ba">  170</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">const</span> uint64_t <a class="code" href="classarrow_1_1_hash_util.html#adc76586f132262061eb7881b8865b7ba">FNV64_PRIME</a> = 1099511628211UL;</div><div class="line"><a name="l00171"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#aedb189cc8d1f356ae5d907767babbf2c">  171</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">const</span> uint64_t <a class="code" href="classarrow_1_
 1_hash_util.html#aedb189cc8d1f356ae5d907767babbf2c">FNV64_SEED</a> = 14695981039346656037UL;</div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;</div><div class="line"><a name="l00182"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#ac4d6d601114af18f86efe3a5a6b01399">  182</a></span>&#160;  <span class="keyword">static</span> uint64_t <a class="code" href="classarrow_1_1_hash_util.html#ac4d6d601114af18f86efe3a5a6b01399">FnvHash64</a>(<span class="keyword">const</span> <span class="keywordtype">void</span>* data, int32_t bytes, uint64_t hash) {</div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;    <span class="keyword">const</span> uint8_t* ptr = <span class="keyword">reinterpret_cast&lt;</span><span class="keyword">const </span>uint8_t*<span class="keyword">&gt;</span>(data);</div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;    <span class="keywordflow">whi
 le</span> (bytes--) {</div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;      hash = (*ptr ^ hash) * FNV64_PRIME;</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;      ++ptr;</div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;    }</div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;    <span class="keywordflow">return</span> hash;</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;  }</div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;</div><div class="line"><a name="l00199"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#a72f78faa22e2c2e10ec6623678829bc7">  199</a></span>&#160;  <span class="keyword">static</span> uint32_t <a class="code" href="classarrow_1_1_hash_util.html#a72f78faa22e2c2e10ec6623678829bc7">FnvHash64to32</a>(<span class="keyword">const</span> 
 <span class="keywordtype">void</span>* data, int32_t bytes, uint32_t hash) {</div><div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;    <span class="comment">// IMPALA-2270: this function should never be used for zero-byte inputs.</span></div><div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;    <a class="code" href="logging_8h.html#ab4f56aa24c4c9cddc47a6abd2d747f9a">DCHECK_GT</a>(bytes, 0);</div><div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;    uint64_t hash_u64 = hash | (<span class="keyword">static_cast&lt;</span>uint64_t<span class="keyword">&gt;</span>(hash) &lt;&lt; 32);</div><div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;    hash_u64 = <a class="code" href="classarrow_1_1_hash_util.html#ac4d6d601114af18f86efe3a5a6b01399">FnvHash64</a>(data, bytes, hash_u64);</div><div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;    <span class="ke
 ywordflow">return</span> <span class="keyword">static_cast&lt;</span>uint32_t<span class="keyword">&gt;</span>((hash_u64 &gt;&gt; 32) ^ (hash_u64 &amp; 0xFFFFFFFF));</div><div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;  }</div><div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;</div><div class="line"><a name="l00211"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#a7379a70ec7f527773ee6bd034571ad15">  211</a></span>&#160;  <span class="keyword">static</span> uint32_t <a class="code" href="classarrow_1_1_hash_util.html#a7379a70ec7f527773ee6bd034571ad15">Hash</a>(<span class="keyword">const</span> <span class="keywordtype">void</span>* data, int32_t bytes, uint32_t seed) {</div><div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;<span class="preprocessor">#ifdef ARROW_USE_SSE</span></div><div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;    <span 
 class="keywordflow">if</span> (LIKELY(<a class="code" href="classarrow_1_1_cpu_info.html#ad111f08ae6a89fcc8c47b4fac7a32a3f">CpuInfo::IsSupported</a>(<a class="code" href="classarrow_1_1_cpu_info.html#abf5efa5c9768acadbb62a60872d7edb6">CpuInfo::SSE4_2</a>))) {</div><div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;      <span class="keywordflow">return</span> <a class="code" href="classarrow_1_1_hash_util.html#a319a992423d18679d77043c638b270f4">CrcHash</a>(data, bytes, seed);</div><div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;    } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;      <span class="keywordflow">return</span> <a class="code" href="classarrow_1_1_hash_util.html#a2901d71d89109a041d5e9cee0414d224">MurmurHash2_64</a>(data, bytes, seed);</div><div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;    }</div><div class=
 "line"><a name="l00218"></a><span class="lineno">  218</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>uint32_t<span class="keyword">&gt;</span>(<a class="code" href="classarrow_1_1_hash_util.html#a2901d71d89109a041d5e9cee0414d224">MurmurHash2_64</a>(data, bytes, seed));</div><div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;  }</div><div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;</div><div class="line"><a name="l00224"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#af16452734d367cbf15820e269f869d74">  224</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">const</span> uint32_t
  <a class="code" href="classarrow_1_1_hash_util.html#af16452734d367cbf15820e269f869d74">HASH_COMBINE_SEED</a> = 0x9e3779b9;</div><div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;</div><div class="line"><a name="l00230"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#a32de57b2811253511436a8d3edb2570b">  230</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">inline</span> uint32_t <a class="code" href="classarrow_1_1_hash_util.html#a32de57b2811253511436a8d3edb2570b">HashCombine32</a>(uint32_t value, uint32_t seed) {</div><div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;    <span class="keywordflow">return</span> seed ^ (HASH_COMBINE_SEED + value + (seed &lt;&lt; 6) + (seed &gt;&gt; 2));</div><div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;  }</div><div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;</div><div class="lin
 e"><a name="l00234"></a><span class="lineno">  234</span>&#160;  <span class="comment">// Get 32 more bits of randomness from a 32-bit hash:</span></div><div class="line"><a name="l00235"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#a2934b4e6ea31c827ec1f9dd114be6f96">  235</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">inline</span> uint32_t <a class="code" href="classarrow_1_1_hash_util.html#a2934b4e6ea31c827ec1f9dd114be6f96">Rehash32to32</a>(<span class="keyword">const</span> uint32_t hash) {</div><div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;    <span class="comment">// Constants generated by uuidgen(1) with the -r flag</span></div><div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;    <span class="keyword">static</span> <span class="keyword">const</span> uint64_t m = 0x7850f11ec6d14889ull, a = 0x6773610597ca4c63ull;</div><div class="line"><a name="l00238"></a><
 span class="lineno">  238</span>&#160;    <span class="comment">// This is strongly universal hashing following Dietzfelbinger&#39;s &quot;Universal hashing</span></div><div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;    <span class="comment">// and k-wise independent random variables via integer arithmetic without primes&quot;. As</span></div><div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;    <span class="comment">// such, for any two distinct uint32_t&#39;s hash1 and hash2, the probability (over the</span></div><div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;    <span class="comment">// randomness of the constants) that any subset of bit positions of</span></div><div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;    <span class="comment">// Rehash32to32(hash1) is equal to the same subset of bit positions</span></div><div class="line"><a name="l00243"></a><span clas
 s="lineno">  243</span>&#160;    <span class="comment">// Rehash32to32(hash2) is minimal.</span></div><div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>uint32_t<span class="keyword">&gt;</span>((<span class="keyword">static_cast&lt;</span>uint64_t<span class="keyword">&gt;</span>(hash) * m + a) &gt;&gt; 32);</div><div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;  }</div><div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;</div><div class="line"><a name="l00247"></a><span class="lineno"><a class="line" href="classarrow_1_1_hash_util.html#ad1a9a41c06ed9a5570a501380e2991de">  247</a></span>&#160;  <span class="keyword">static</span> <span class="keyword">inline</span> uint64_t <a class="code" href="classarrow_1_1_hash_util.html#ad1a9a41c06ed9a5570a501380e2991de">Rehash32to64</a>(<span class="keyword">const</span> uint
 32_t hash) {</div><div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;    <span class="keyword">static</span> <span class="keyword">const</span> uint64_t m1 = 0x47b6137a44974d91ull, m2 = 0x8824ad5ba2b7289cull,</div><div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;                          a1 = 0x705495c62df1424aull, a2 = 0x9efc49475c6bfb31ull;</div><div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;    <span class="keyword">const</span> uint64_t hash1 = (<span class="keyword">static_cast&lt;</span>uint64_t<span class="keyword">&gt;</span>(hash) * m1 + a1) &gt;&gt; 32;</div><div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;    <span class="keyword">const</span> uint64_t hash2 = (<span class="keyword">static_cast&lt;</span>uint64_t<span class="keyword">&gt;</span>(hash) * m2 + a2) &gt;&gt; 32;</div><div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160; 
    <span class="keywordflow">return</span> hash1 | (hash2 &lt;&lt; 32);</div><div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;  }</div><div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;};</div><div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;</div><div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;}  <span class="comment">// namespace arrow</span></div><div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;</div><div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;<span class="preprocessor">#endif  // ARROW_UTIL_HASH_UTIL_H</span></div><div class="ttc" id="classarrow_1_1_hash_util_html_ada776bf928502a9491dae4419c90d28d"><div class="ttname"><a href="classarrow_1_1_hash_util.html#ada776bf928502a9491dae4419c90d28d">arrow::HashUtil::CrcHash8</a></div><div class="ttdeci">static uint32_t CrcHash8(const void *v, uint32_t hash)</div
 ><div class="ttdoc">CrcHash() specialized for 8-byte data. </div><div class="ttdef"><b>Definition:</b> hash-util.h:93</div></div>
 <div class="ttc" id="classarrow_1_1_hash_util_html_acf9673f14a5e8980c688f6a5763a9158"><div class="ttname"><a href="classarrow_1_1_hash_util.html#acf9673f14a5e8980c688f6a5763a9158">arrow::HashUtil::FNV_PRIME</a></div><div class="ttdeci">static const uint32_t FNV_PRIME</div><div class="ttdoc">default values recommended by http://isthe.com/chongo/tech/comp/fnv/ </div><div class="ttdef"><b>Definition:</b> hash-util.h:168</div></div>
 <div class="ttc" id="classarrow_1_1_hash_util_html_ab40a70130bf9f41f4244170b9f0308c1"><div class="ttname"><a href="classarrow_1_1_hash_util.html#ab40a70130bf9f41f4244170b9f0308c1">arrow::HashUtil::CrcHash16</a></div><div class="ttdeci">static uint32_t CrcHash16(const void *v, uint32_t hash)</div><div class="ttdoc">CrcHash() specialized for 16-byte data. </div><div class="ttdef"><b>Definition:</b> hash-util.h:113</div></div>
 <div class="ttc" id="classarrow_1_1_hash_util_html_a23d3063447bbbc10f5116250e35cffe2"><div class="ttname"><a href="classarrow_1_1_hash_util.html#a23d3063447bbbc10f5116250e35cffe2">arrow::HashUtil::MURMUR_PRIME</a></div><div class="ttdeci">static const uint64_t MURMUR_PRIME</div><div class="ttdef"><b>Definition:</b> hash-util.h:123</div></div>

http://git-wip-us.apache.org/repos/asf/arrow-site/blob/7a2e5ece/docs/cpp/hdfs-internal_8h.html
----------------------------------------------------------------------
diff --git a/docs/cpp/hdfs-internal_8h.html b/docs/cpp/hdfs-internal_8h.html
index 1bd998e..5e69d88 100644
--- a/docs/cpp/hdfs-internal_8h.html
+++ b/docs/cpp/hdfs-internal_8h.html
@@ -5,7 +5,7 @@
 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
 <meta name="generator" content="Doxygen 1.8.13"/>
 <meta name="viewport" content="width=device-width, initial-scale=1"/>
-<title>Apache Arrow (C++): /home/wesm/code/arrow/cpp/src/arrow/io/hdfs-internal.h File Reference</title>
+<title>Apache Arrow (C++): /apache-arrow/arrow/cpp/src/arrow/io/hdfs-internal.h File Reference</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
 <script type="text/javascript" src="jquery.js"></script>
 <script type="text/javascript" src="dynsections.js"></script>

http://git-wip-us.apache.org/repos/asf/arrow-site/blob/7a2e5ece/docs/cpp/hdfs-internal_8h_source.html
----------------------------------------------------------------------
diff --git a/docs/cpp/hdfs-internal_8h_source.html b/docs/cpp/hdfs-internal_8h_source.html
index 320c987..b23136d 100644
--- a/docs/cpp/hdfs-internal_8h_source.html
+++ b/docs/cpp/hdfs-internal_8h_source.html
@@ -5,7 +5,7 @@
 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
 <meta name="generator" content="Doxygen 1.8.13"/>
 <meta name="viewport" content="width=device-width, initial-scale=1"/>
-<title>Apache Arrow (C++): /home/wesm/code/arrow/cpp/src/arrow/io/hdfs-internal.h Source File</title>
+<title>Apache Arrow (C++): /apache-arrow/arrow/cpp/src/arrow/io/hdfs-internal.h Source File</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
 <script type="text/javascript" src="jquery.js"></script>
 <script type="text/javascript" src="dynsections.js"></script>

http://git-wip-us.apache.org/repos/asf/arrow-site/blob/7a2e5ece/docs/cpp/hdfs_8h.html
----------------------------------------------------------------------
diff --git a/docs/cpp/hdfs_8h.html b/docs/cpp/hdfs_8h.html
index eb5bd90..334aac3 100644
--- a/docs/cpp/hdfs_8h.html
+++ b/docs/cpp/hdfs_8h.html
@@ -5,7 +5,7 @@
 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
 <meta name="generator" content="Doxygen 1.8.13"/>
 <meta name="viewport" content="width=device-width, initial-scale=1"/>
-<title>Apache Arrow (C++): /home/wesm/code/arrow/cpp/src/arrow/io/hdfs.h File Reference</title>
+<title>Apache Arrow (C++): /apache-arrow/arrow/cpp/src/arrow/io/hdfs.h File Reference</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
 <script type="text/javascript" src="jquery.js"></script>
 <script type="text/javascript" src="dynsections.js"></script>


Mime
View raw message