libfoedus-core
FOEDUS Core Library
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Jenkins (x86_64 Fedora)
Jenkins (x86_64 Ubuntu)
Jenkins (aarch64 Ubuntu)
Github
Wiki
File List
File Members
hash_combo.cpp
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2014-2015, Hewlett-Packard Development Company, LP.
3
* This program is free software; you can redistribute it and/or modify it
4
* under the terms of the GNU General Public License as published by the Free
5
* Software Foundation; either version 2 of the License, or (at your option)
6
* any later version.
7
*
8
* This program is distributed in the hope that it will be useful, but WITHOUT
9
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11
* more details. You should have received a copy of the GNU General Public
12
* License along with this program; if not, write to the Free Software
13
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
14
*
15
* HP designates this particular file as subject to the "Classpath" exception
16
* as provided by HP in the LICENSE.txt file that accompanied this code.
17
*/
18
#include "
foedus/storage/hash/hash_combo.hpp
"
19
20
#include <ostream>
21
#include <string>
22
23
#include "
foedus/assorted/assorted_func.hpp
"
24
#include "
foedus/storage/hash/hash_metadata.hpp
"
25
26
namespace
foedus
{
27
namespace
storage {
28
namespace
hash {
29
HashCombo::HashCombo
(
const
void
* key, uint16_t key_length,
const
HashMetadata
& meta) {
30
uint8_t bin_shifts = meta.
get_bin_shifts
();
31
hash_
=
hashinate
(key, key_length);
32
bin_
=
hash_
>> bin_shifts;
33
fingerprint_
=
DataPageBloomFilter::extract_fingerprint
(
hash_
);
34
route_
=
IntermediateRoute::construct
(
bin_
);
35
}
36
37
std::ostream&
operator<<
(std::ostream& o,
const
HashCombo
& v) {
38
o <<
"<HashCombo>"
39
<<
"<hash>"
<<
assorted::Hex
(v.
hash_
, 16) <<
"</hash>"
40
<<
"<bin>"
<< v.
bin_
<<
"</bin>"
41
<< v.
fingerprint_
42
<< v.
route_
43
<<
"</HashCombo>"
;
44
return
o;
45
}
46
47
}
// namespace hash
48
}
// namespace storage
49
}
// namespace foedus
assorted_func.hpp
foedus::storage::hash::HashCombo::route_
IntermediateRoute route_
Definition:
hash_combo.hpp:52
foedus
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
Definition:
assert_nd.hpp:44
foedus::storage::hash::HashMetadata::get_bin_shifts
uint8_t get_bin_shifts() const
Definition:
hash_metadata.hpp:64
hash_combo.hpp
foedus::storage::hash::HashCombo::HashCombo
HashCombo(const void *key, uint16_t key_length, const HashMetadata &meta)
Definition:
hash_combo.cpp:29
foedus::storage::hash::hashinate
HashValue hashinate(const void *key, uint16_t key_length)
Calculates hash value for general input.
Definition:
hash_hashinate.cpp:31
foedus::storage::hash::operator<<
std::ostream & operator<<(std::ostream &o, const HashCombo &v)
Definition:
hash_combo.cpp:37
foedus::storage::hash::HashCombo
A set of information that are used in many places, extracted from the given key.
Definition:
hash_combo.hpp:48
foedus::storage::hash::HashCombo::hash_
HashValue hash_
Definition:
hash_combo.hpp:49
foedus::storage::hash::HashCombo::fingerprint_
BloomFilterFingerprint fingerprint_
Definition:
hash_combo.hpp:51
foedus::storage::hash::DataPageBloomFilter::extract_fingerprint
static BloomFilterFingerprint extract_fingerprint(HashValue fullhash)
Definition:
hash_hashinate.hpp:175
hash_metadata.hpp
foedus::storage::hash::HashMetadata
Metadata of an hash storage.
Definition:
hash_metadata.hpp:40
foedus::assorted::Hex
Convenient way of writing hex integers to stream.
Definition:
assorted_func.hpp:124
foedus::storage::hash::IntermediateRoute::construct
static IntermediateRoute construct(HashBin bin)
Calculates the rout for the given hash bin.
Definition:
hash_hashinate.hpp:233
foedus::storage::hash::HashCombo::bin_
HashBin bin_
Definition:
hash_combo.hpp:50
foedus-core
src
foedus
storage
hash
hash_combo.cpp
Generated by
1.8.10