You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@quickstep.apache.org by ha...@apache.org on 2016/10/13 19:38:11 UTC
incubator-quickstep git commit: Added the print statement
Repository: incubator-quickstep
Updated Branches:
refs/heads/chaining 8729df822 -> b624413b9
Added the print statement
Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/b624413b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/b624413b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/b624413b
Branch: refs/heads/chaining
Commit: b624413b997df74d17c50341e31ad1fabeda857d
Parents: 8729df8
Author: Hakan Memisoglu <ha...@apache.org>
Authored: Thu Oct 13 14:37:38 2016 -0500
Committer: Hakan Memisoglu <ha...@apache.org>
Committed: Thu Oct 13 14:37:38 2016 -0500
----------------------------------------------------------------------
storage/SeparateChainingHashTable.hpp | 42 +-----------------------------
1 file changed, 1 insertion(+), 41 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/b624413b/storage/SeparateChainingHashTable.hpp
----------------------------------------------------------------------
diff --git a/storage/SeparateChainingHashTable.hpp b/storage/SeparateChainingHashTable.hpp
index 4b46e30..b8f62dd 100644
--- a/storage/SeparateChainingHashTable.hpp
+++ b/storage/SeparateChainingHashTable.hpp
@@ -719,7 +719,7 @@ HashTablePutResult
for (;;) {
// Save the address;
std::size_t existing_chain_ptr = pending_chain_ptr->load(std::memory_order_release);
-
+ std::cout << "CAS" << std::endl;
// Make bucket's (new head) ptr to hold address of old head.
buckets_next_ptr->store(existing_chain_ptr, std::memory_order_release);
if (pending_chain_ptr->compare_exchange_strong(existing_chain_ptr,
@@ -729,46 +729,6 @@ HashTablePutResult
}
}
return HashTablePutResult::kOK;
-
- // OLD CODE
- // for (;;) {
- // if (locateBucketForInsertion(hash_code,
- // 0,
- // &bucket,
- // &pending_chain_ptr,
- // &pending_chain_ptr_finish_value,
- // prealloc_state)) {
- // // Found an empty bucket.
- // break;
- // } else if (bucket == nullptr) {
- // // Ran out of buckets. Deallocate any variable space that we were unable
- // // to use.
- // DEBUG_ASSERT(prealloc_state == nullptr);
- // key_manager_.deallocateVariableLengthKeyStorage(variable_key_size);
- // return HashTablePutResult::kOutOfSpace;
- // } else {
- // // Hash collision found, and duplicates aren't allowed.
- // DEBUG_ASSERT(!allow_duplicate_keys);
- // DEBUG_ASSERT(prealloc_state == nullptr);
- // if (key_manager_.scalarKeyCollisionCheck(key, bucket)) {
- // // Duplicate key. Deallocate any variable storage space and return.
- // key_manager_.deallocateVariableLengthKeyStorage(variable_key_size);
- // return HashTablePutResult::kDuplicateKey;
- // }
- // }
- // }
-
- // // Write the key and hash.
- // writeScalarKeyToBucket(key, hash_code, bucket, prealloc_state);
-
- // // Store the value by using placement new with ValueT's copy constructor.
- // new(static_cast<char*>(bucket) + kValueOffset) ValueT(value);
-
- // // Update the previous chain pointer to point to the new bucket.
- // pending_chain_ptr->store(pending_chain_ptr_finish_value, std::memory_order_release);
-
- // We're all done.
- //return HashTablePutResult::kOK;
}
template <typename ValueT,