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
BlockQueryProcessor.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 
19 #ifndef BLOCK_QUERY_PROCESSOR_H
20 #define BLOCK_QUERY_PROCESSOR_H
21 
22 #include <memory>
23 #include "GenericBlock.h"
24 #include "PipelineContext.h"
25 
26 namespace pdb {
27 
29 typedef std::shared_ptr<BlockQueryProcessor> BlockQueryProcessorPtr;
30 
31 // this pure virtual class is spit out by a simple query class (like the Selection class)... it is
32 // then
33 // used by the system to process queries
34 //
36 
37 public:
38  // must be called before the query processor is asked to do anything
39  virtual void initialize() = 0;
40 
41  // loads up another input block to read input data
42  virtual void loadInputBlock(Handle<GenericBlock> block) = 0;
43 
44  // load up another output block to write output data
46 
47  // attempts to fill the next output block with data. Returns true if it can. If it
48  // cannot, returns false, and the next call to loadInputBlock should be made
49  virtual bool fillNextOutputBlock() = 0;
50 
51  // must be called after all of the input pages have been sent in
52  virtual void finalize() = 0;
53 
54  // must be called before free the data in output page
55  virtual void clearOutputBlock() = 0;
56 
57  // must be called before free the data in input page
58  virtual void clearInputBlock() = 0;
59 
60  // set pipeline context
62  this->context = context;
63  }
64 
65  // get pipeline context
67  return this->context;
68  }
69 
70 protected:
72 };
73 }
74 
75 #endif
PipelineContextPtr getContext()
virtual void finalize()=0
virtual void clearOutputBlock()=0
virtual Handle< GenericBlock > & loadOutputBlock()=0
PipelineContextPtr context
virtual void loadInputBlock(Handle< GenericBlock > block)=0
std::shared_ptr< PipelineContext > PipelineContextPtr
std::shared_ptr< BlockQueryProcessor > BlockQueryProcessorPtr
virtual void initialize()=0
virtual void clearInputBlock()=0
virtual void setContext(PipelineContextPtr context)
virtual bool fillNextOutputBlock()=0