A platform for high-performance distributed tool and library development written in C++. It can be deployed in two different cluster modes: standalone or distributed. API for v0.5.0, released on June 13, 2018.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
AdvancedPhysicalJoinSidePipe.cc
Go to the documentation of this file.
1 /*****************************************************************************
2  * *
3  * Copyright 2018 Rice University *
4  * *
5  * Licensed under the Apache License, Version 2.0 (the "License"); *
6  * you may not use this file except in compliance with the License. *
7  * You may obtain a copy of the License at *
8  * *
9  * http://www.apache.org/licenses/LICENSE-2.0 *
10  * *
11  * Unless required by applicable law or agreed to in writing, software *
12  * distributed under the License is distributed on an "AS IS" BASIS, *
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
14  * See the License for the specific language governing permissions and *
15  * limitations under the License. *
16  * *
17  *****************************************************************************/
18 
25 
26 namespace pdb {
27 
29  Handle<ComputePlan> &computePlan,
30  LogicalPlanPtr &logicalPlan,
31  ConfigurationPtr &conf,
32  vector<AtomicComputationPtr> &pipeComputations,
33  size_t id) : AdvancedPhysicalAbstractPipe(jobId,
34  computePlan,
35  logicalPlan,
36  conf,
37  pipeComputations,
38  id) {}
39 
41 
42  // a join side is never an output
43  static_assert(true, "this is not supposed to happen");
44 
45  // return a dummy
47 }
48 
49 vector<AdvancedPhysicalAbstractAlgorithmPtr> AdvancedPhysicalJoinSidePipe::getPossibleAlgorithms(const StatisticsPtr &stats) {
50 
51  // all the algorithms that we can use
52  vector<AdvancedPhysicalAbstractAlgorithmPtr> algorithms;
53 
54  // check if we can use a broadcast algorithm
56  algorithms.push_back(std::make_shared<AdvancedPhysicalJoinBroadcastedHashsetAlgorithm>(getAdvancedPhysicalNodeHandle(),
57  jobId,
58  isJoining(),
59  consumers.empty(),
63  conf));
64  }
65 
66  // we can always do a shuffle algorithm and then build a hash set
67  algorithms.push_back(std::make_shared<AdvancedPhysicalShuffledHashsetPipelineAlgorithm>(getAdvancedPhysicalNodeHandle(),
68  jobId,
69  isJoining(),
70  consumers.empty(),
74  conf));
75 
76  // we can always do a hash shuffle partitioning
77  algorithms.push_back(std::make_shared<AdvancedPhysicalShuffleSetAlgorithm>(getAdvancedPhysicalNodeHandle(),
78  jobId,
79  isJoining(),
80  consumers.empty(),
84  conf));
85 
86  // we can always do a pipeline algorithm on this single pipe
87  algorithms.push_back(std::make_shared<AdvancedPhysicalPipelineAlgorithm>(getAdvancedPhysicalNodeHandle(),
88  jobId,
89  isJoining(),
90  consumers.empty(),
94  conf));
95 
96  return algorithms;
97 }
98 
100  return JOIN_SIDE;
101 }
102 
104  return hashSet;
105 }
106 
108  return !hashSet.empty();
109 }
110 
111 void AdvancedPhysicalJoinSidePipe::setHashSet(const string &hashSet) {
112  this->hashSet = hashSet;
113 }
114 
115 }
Handle< ComputePlan > computePlan
std::shared_ptr< Statistics > StatisticsPtr
Definition: Statistics.h:27
AdvancedPhysicalPipelineTypeID getType() override
AdvancedPhysicalPipelineNodePtr getAdvancedPhysicalNodeHandle()
std::shared_ptr< LogicalPlan > LogicalPlanPtr
Definition: ComputePlan.h:36
double getCost(const StatisticsPtr &stats) override
shared_ptr< Configuration > ConfigurationPtr
Definition: Configuration.h:89
std::list< AbstractPhysicalNodePtr > consumers
AdvancedPhysicalJoinSidePipe(string &jobId, Handle< ComputePlan > &computePlan, LogicalPlanPtr &logicalPlan, ConfigurationPtr &conf, vector< AtomicComputationPtr > &pipeComputations, size_t id)
AdvancedPhysicalAbstractAlgorithmPtr selectOutputAlgorithm() override
vector< AdvancedPhysicalAbstractAlgorithmPtr > getPossibleAlgorithms(const StatisticsPtr &stats) override
std::shared_ptr< AdvancedPhysicalAbstractAlgorithm > AdvancedPhysicalAbstractAlgorithmPtr