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
SimplePhysicalNode.h
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 #ifndef PDB_SIMPLEPHYSICALNODE_H
19 #define PDB_SIMPLEPHYSICALNODE_H
20 
24 #include "AggregationJobStage.h"
25 #include "TupleSetJobStage.h"
26 #include "AbstractPhysicalNode.h"
27 
28 namespace pdb {
29 
31 typedef std::shared_ptr<SimplePhysicalNode> SimplePhysicalNodePtr;
32 
34 
35 public:
36 
42 
48  PhysicalOptimizerResultPtr analyze(const StatisticsPtr &stats, int nextStageID) override;
49 
61  SimplePhysicalNodePtr &prevNode,
62  const StatisticsPtr &stats,
63  int nextStageID);
64 
69  const AtomicComputationPtr &getNode() const;
70 
76  void addConsumer(const AbstractPhysicalNodePtr &consumer) override;
77 
82  bool hasConsumers() override;
83 
84  bool isConsuming(Handle<SetIdentifier> &set) override;
85 
91  double getCost(const StatisticsPtr &stats) override;
92 
98 
99 protected:
100 
114  SimplePhysicalNodePtr &prevNode,
115  const StatisticsPtr &stats,
116  int nextStageID);
117 
131  SimplePhysicalNodePtr &prevNode,
132  const StatisticsPtr &stats,
133  int nextStageID);
134 
149  SimplePhysicalNodePtr &prevNode,
150  const StatisticsPtr &stats,
151  int nextStageID);
152 
157  std::string getNodeIdentifier() override;
158 
159  protected:
160 
168  double getCost(Handle<SetIdentifier> source, const StatisticsPtr &stats);
169 
175 
179  std::list<SimplePhysicalNodePtr> activeConsumers;
180 
185 
190 
191 };
192 
193 }
194 
195 #endif //PDB_SIMPLEPHYSICALNODE_H
virtual PhysicalOptimizerResultPtr analyzeOutput(TupleSetJobStageBuilderPtr &tupleStageBuilder, SimplePhysicalNodePtr &prevNode, const StatisticsPtr &stats, int nextStageID)
SimplePhysicalNode(string jobId, AtomicComputationPtr node, const Handle< ComputePlan > &computePlan, LogicalPlanPtr logicalPlan, ConfigurationPtr conf)
const AtomicComputationPtr & getNode() const
Handle< ComputePlan > computePlan
std::shared_ptr< Statistics > StatisticsPtr
Definition: Statistics.h:27
PhysicalOptimizerResultPtr analyze(const StatisticsPtr &stats, int nextStageID) override
void addConsumer(const AbstractPhysicalNodePtr &consumer) override
double getCost(const StatisticsPtr &stats) override
bool isConsuming(Handle< SetIdentifier > &set) override
std::shared_ptr< LogicalPlan > LogicalPlanPtr
Definition: ComputePlan.h:36
std::string getNodeIdentifier() override
virtual PhysicalOptimizerResultPtr analyzeMultipleConsumers(TupleSetJobStageBuilderPtr &ptr, SimplePhysicalNodePtr &prevNode, const StatisticsPtr &stats, int nextStageID)
const Handle< SetIdentifier > & getSourceSetIdentifier() const
shared_ptr< Configuration > ConfigurationPtr
Definition: Configuration.h:89
std::shared_ptr< struct AtomicComputation > AtomicComputationPtr
std::shared_ptr< SimplePhysicalNode > SimplePhysicalNodePtr
virtual PhysicalOptimizerResultPtr analyzeSingleConsumer(TupleSetJobStageBuilderPtr &tupleStageBuilder, SimplePhysicalNodePtr &prevNode, const StatisticsPtr &stats, int nextStageID)
std::shared_ptr< AbstractPhysicalNode > AbstractPhysicalNodePtr
SimplePhysicalNodePtr getSimpleNodeHandle()
AtomicComputationPtr node
Handle< SetIdentifier > sourceSetIdentifier
std::list< SimplePhysicalNodePtr > activeConsumers
std::shared_ptr< TupleSetJobStageBuilder > TupleSetJobStageBuilderPtr
std::shared_ptr< PhysicalOptimizerResult > PhysicalOptimizerResultPtr