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
SimpleSingleTableQueryProcessor.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 SINGLE_TABLE_QP_H
20 #define SINGLE_TABLE_QP_H
21 
22 #include <memory>
23 #include "Handle.h"
24 
25 namespace pdb {
26 
28 typedef std::shared_ptr<SimpleSingleTableQueryProcessor> SimpleSingleTableQueryProcessorPtr;
29 
30 // this pure virtual class is spit out by a simple query class (like the Selection class)... it is
31 // then
32 // used by the system to process queries
33 //
35 
36 public:
37  // must be called before the query processor is asked to do anything
38  virtual void initialize() = 0;
39 
40  // loads up another input page to process
41  virtual void loadInputPage(void* pageToProcess) = 0;
42 
43  // load up another output page to process
44  virtual void loadOutputPage(void* pageToWriteTo, size_t numBytesInPage) = 0;
45 
46  virtual void loadInputObject(Handle<Object>& objectToProcess) {}
47 
48  // attempts to fill the next output page with data. Returns true if it can. If it
49  // cannot, returns false, and the next call to loadInputPage should be made
50  virtual bool fillNextOutputPage() = 0;
51 
52  // must be called after all of the input pages have been sent in
53  virtual void finalize() = 0;
54 
55  // must be called before free the data in output page
56  virtual void clearOutputPage() = 0;
57 
58  // must be called before free the data in input page
59  virtual void clearInputPage() = 0;
60 
61  // has to process input page or not
62  virtual bool needsProcessInput() {
63  return true;
64  }
65 };
66 }
67 
68 #endif
virtual void loadInputObject(Handle< Object > &objectToProcess)
std::shared_ptr< SimpleSingleTableQueryProcessor > SimpleSingleTableQueryProcessorPtr
virtual void loadInputPage(void *pageToProcess)=0
virtual void loadOutputPage(void *pageToWriteTo, size_t numBytesInPage)=0