Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
hash-util-ir.cc
Go to the documentation of this file.
1 // Copyright 2012 Cloudera Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #include "util/hash-util.h"
16 
17 // Define the hashing functions for llvm. They are not used by anything that is
18 // cross compiled and without this, would get stripped by the clang optimizer.
19 #ifdef IR_COMPILE
20 using namespace impala;
21 
22 extern "C"
23 uint32_t IrFnvHash(const void* data, int32_t bytes, uint32_t hash) {
24  return HashUtil::FnvHash64to32(data, bytes, hash);
25 }
26 
27 extern "C"
28 uint32_t IrMurmurHash(const void* data, int32_t bytes, uint32_t hash) {
29  return HashUtil::MurmurHash2_64(data, bytes, hash);
30 }
31 
32 extern "C"
33 uint32_t IrCrcHash(const void* data, int32_t bytes, uint32_t hash) {
34 #ifdef __SSE4_2__
35  return HashUtil::CrcHash(data, bytes, hash);
36 #else
37  return HashUtil::FnvHash64to32(data, bytes, hash);
38 #endif
39 }
40 #else
41 #error "This file should only be compiled by clang."
42 #endif
43 
const StringSearch UrlParser::hash_search & hash
Definition: url-parser.cc:41
static uint32_t CrcHash(const void *data, int32_t bytes, uint32_t hash)
Definition: hash-util.h:37
static uint32_t FnvHash64to32(const void *data, int32_t bytes, uint32_t hash)
Definition: hash-util.h:125
static uint64_t MurmurHash2_64(const void *input, int len, uint64_t seed)
Murmur2 hash implementation returning 64-bit hashes.
Definition: hash-util.h:64