You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@quickstep.apache.org by zu...@apache.org on 2016/05/27 03:23:33 UTC
[42/50] [abbrv] incubator-quickstep git commit: Removed changes from
other merged branches.
Removed changes from other merged branches.
Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/61266e3b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/61266e3b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/61266e3b
Branch: refs/heads/partition_aware_hashjoin_with_optimizer_support
Commit: 61266e3bbf245a1a743349c650228644f5fe2da9
Parents: 75285a0
Author: Adalbert Gerald Soosai Raj <ge...@cs.wisc.edu>
Authored: Tue May 24 17:07:06 2016 -0500
Committer: Adalbert Gerald Soosai Raj <ge...@cs.wisc.edu>
Committed: Tue May 24 17:07:06 2016 -0500
----------------------------------------------------------------------
relational_operators/BuildHashOperator.hpp | 2 +-
relational_operators/DestroyHashOperator.hpp | 4 ++--
relational_operators/HashJoinOperator.cpp | 27 +++++++++++++----------
relational_operators/HashJoinOperator.hpp | 2 +-
storage/CMakeLists.txt | 4 ++++
storage/InsertDestination.cpp | 3 ++-
storage/StorageManager.cpp | 6 +----
storage/StorageManager.hpp | 1 -
8 files changed, 26 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/61266e3b/relational_operators/BuildHashOperator.hpp
----------------------------------------------------------------------
diff --git a/relational_operators/BuildHashOperator.hpp b/relational_operators/BuildHashOperator.hpp
index ba631cd..78bf7bb 100644
--- a/relational_operators/BuildHashOperator.hpp
+++ b/relational_operators/BuildHashOperator.hpp
@@ -81,7 +81,7 @@ class BuildHashOperator : public RelationalOperator {
const std::vector<attribute_id> &join_key_attributes,
const bool any_join_key_attributes_nullable,
const QueryContext::join_hash_table_group_id hash_table_group_index,
- bool is_numa_aware_join)
+ bool is_numa_aware_join = false)
: input_relation_(input_relation),
input_relation_is_stored_(input_relation_is_stored),
join_key_attributes_(join_key_attributes),
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/61266e3b/relational_operators/DestroyHashOperator.hpp
----------------------------------------------------------------------
diff --git a/relational_operators/DestroyHashOperator.hpp b/relational_operators/DestroyHashOperator.hpp
index c69b857..1c51b1a 100644
--- a/relational_operators/DestroyHashOperator.hpp
+++ b/relational_operators/DestroyHashOperator.hpp
@@ -63,7 +63,7 @@ class DestroyHashOperator : public RelationalOperator {
**/
explicit DestroyHashOperator(const CatalogRelation &input_relation,
const QueryContext::join_hash_table_group_id hash_table_group_index,
- bool is_numa_aware_join)
+ bool is_numa_aware_join = false)
: input_relation_(input_relation),
hash_table_group_index_(hash_table_group_index),
is_numa_aware_join_(is_numa_aware_join),
@@ -100,7 +100,7 @@ class DestroyHashWorkOrder : public WorkOrder {
DestroyHashWorkOrder(const CatalogRelation &input_relation,
const QueryContext::join_hash_table_group_id hash_table_group_index,
QueryContext *query_context,
- bool is_numa_aware_join,
+ bool is_numa_aware_join = false,
const numa_node_id numa_node = -1)
: input_relation_(input_relation),
hash_table_group_index_(hash_table_group_index),
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/61266e3b/relational_operators/HashJoinOperator.cpp
----------------------------------------------------------------------
diff --git a/relational_operators/HashJoinOperator.cpp b/relational_operators/HashJoinOperator.cpp
index f130c89..ce57b9c 100644
--- a/relational_operators/HashJoinOperator.cpp
+++ b/relational_operators/HashJoinOperator.cpp
@@ -314,18 +314,21 @@ void HashJoinOperator::addWorkOrdersUsingPartitionedInput(WorkOrdersContainer *c
}
} else {
for (std::size_t part_id = 0; part_id < num_partitions; ++part_id) {
- while (num_workorders_generated_in_partition_[part_id] < probe_relation_block_ids_in_partition_[part_id].size()) {
- container->addNormalWorkOrder(new JoinWorkOrderClass(build_relation_,
- probe_relation_,
- join_key_attributes_,
- any_join_key_attributes_nullable_,
- probe_relation_block_ids_in_partition_[part_id][num_workorders_generated_in_partition_[part_id]],
- residual_predicate,
- selection,
- hash_table,
- output_destination,
- storage_manager),
- op_index_);
+ while (num_workorders_generated_in_partition_[part_id] <
+ probe_relation_block_ids_in_partition_[part_id].size()) {
+ container->addNormalWorkOrder(
+ new JoinWorkOrderClass(
+ build_relation_,
+ probe_relation_,
+ join_key_attributes_,
+ any_join_key_attributes_nullable_,
+ probe_relation_block_ids_in_partition_[part_id][num_workorders_generated_in_partition_[part_id]],
+ residual_predicate,
+ selection,
+ hash_table,
+ output_destination,
+ storage_manager),
+ op_index_);
++num_workorders_generated_in_partition_[part_id];
} // end while
}
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/61266e3b/relational_operators/HashJoinOperator.hpp
----------------------------------------------------------------------
diff --git a/relational_operators/HashJoinOperator.hpp b/relational_operators/HashJoinOperator.hpp
index 3e50eef..81b5b35 100644
--- a/relational_operators/HashJoinOperator.hpp
+++ b/relational_operators/HashJoinOperator.hpp
@@ -129,7 +129,7 @@ class HashJoinOperator : public RelationalOperator {
const QueryContext::join_hash_table_group_id hash_table_group_index,
const QueryContext::predicate_id residual_predicate_index,
const QueryContext::scalar_group_id selection_index,
- bool is_numa_aware_join,
+ bool is_numa_aware_join = false,
const std::vector<bool> *is_selection_on_build = nullptr,
const JoinType join_type = JoinType::kInnerJoin)
: build_relation_(build_relation),
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/61266e3b/storage/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/storage/CMakeLists.txt b/storage/CMakeLists.txt
index 0bb2318..c39811b 100644
--- a/storage/CMakeLists.txt
+++ b/storage/CMakeLists.txt
@@ -696,6 +696,10 @@ target_link_libraries(quickstep_storage_InsertDestination
quickstep_types_containers_Tuple
quickstep_utility_Macros
tmb)
+if (QUICKSTEP_HAVE_LIBNUMA)
+ target_link_libraries(quickstep_storage_InsertDestination
+ quickstep_catalog_NUMAPlacementScheme)
+endif()
target_link_libraries(quickstep_storage_InsertDestinationInterface
quickstep_catalog_CatalogTypedefs
quickstep_types_containers_Tuple)
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/61266e3b/storage/InsertDestination.cpp
----------------------------------------------------------------------
diff --git a/storage/InsertDestination.cpp b/storage/InsertDestination.cpp
index 489414f..06c69cc 100644
--- a/storage/InsertDestination.cpp
+++ b/storage/InsertDestination.cpp
@@ -421,7 +421,8 @@ MutableBlockReference PartitionAwareInsertDestination::createNewBlockInPartition
// Create a new block.
// TODO(gerald): PASS THE CORRECT NUMA NODE INSTEAD OF ZERO FROM THE OPERATOR!
- const block_id new_id = storage_manager_->createBlock(relation_, *layout_, placement_scheme_, 0);
+ const int numa_node = placement_scheme_->getNUMANodeForPartition(part_id);
+ const block_id new_id = storage_manager_->createBlock(relation_, *layout_, numa_node);
// Notify Foreman to add the newly created block id in the master Catalog.
serialization::CatalogRelationNewBlockMessage proto;
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/61266e3b/storage/StorageManager.cpp
----------------------------------------------------------------------
diff --git a/storage/StorageManager.cpp b/storage/StorageManager.cpp
index 6632a59..e6a2756 100644
--- a/storage/StorageManager.cpp
+++ b/storage/StorageManager.cpp
@@ -186,6 +186,7 @@ StorageManager::~StorageManager() {
if (it->second.block->isDirty()) {
LOG(WARNING) << "Block with ID " << BlockIdUtil::ToString(it->first)
<< " is dirty during StorageManager shutdown";
+
}
delete it->second.block;
deallocateSlots(it->second.block_memory, it->second.block_memory_size);
@@ -194,7 +195,6 @@ StorageManager::~StorageManager() {
block_id StorageManager::createBlock(const CatalogRelationSchema &relation,
const StorageBlockLayout &layout,
- NUMAPlacementScheme *placement_scheme,
const int numa_node) {
const size_t num_slots = layout.getDescription().num_slots();
@@ -223,10 +223,6 @@ block_id StorageManager::createBlock(const CatalogRelationSchema &relation,
// Make '*eviction_policy_' aware of the new block's existence.
eviction_policy_->blockCreated(new_block_id);
- if (placement_scheme != nullptr) {
- placement_scheme->addBlockToNUMANodeMap(new_block_id, numa_node);
- }
-
return new_block_id;
}
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/61266e3b/storage/StorageManager.hpp
----------------------------------------------------------------------
diff --git a/storage/StorageManager.hpp b/storage/StorageManager.hpp
index 9580fed..1754085 100644
--- a/storage/StorageManager.hpp
+++ b/storage/StorageManager.hpp
@@ -199,7 +199,6 @@ class StorageManager {
**/
block_id createBlock(const CatalogRelationSchema &relation,
const StorageBlockLayout &layout,
- NUMAPlacementScheme *placement_scheme = nullptr,
const int numa_node = -1);
/**