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
PDBScanWork.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 SRC_CPP_MAIN_STORAGE_HEADERS_PDBSCANWORK_H_
20 #define SRC_CPP_MAIN_STORAGE_HEADERS_PDBSCANWORK_H_
21 
22 #include "PDBBuzzer.h"
24 #include "PDBCommunicator.h"
25 #include "PangeaStorageServer.h"
26 #include <memory>
27 using namespace std;
29 typedef shared_ptr<PDBScanWork> PDBScanWorkPtr;
30 
36 class PDBScanWork : public pdb::PDBWork {
37 public:
38  PDBScanWork(PageIteratorPtr iter, pdb::PangeaStorageServer* storage, int& counter);
39  ~PDBScanWork();
40  bool sendPagePinned(pdb::PDBCommunicatorPtr myCommunicator,
41  bool morePagesToPin,
42  NodeID nodeId,
43  DatabaseID dbId,
44  UserTypeID typeId,
45  SetID setId,
46  PageID pageId,
47  size_t pageSize,
48  size_t offset);
49 
50  bool acceptPagePinnedAck(pdb::PDBCommunicatorPtr myCommunicator,
51  bool& wasError,
52  string& info,
53  string& errMsg);
54 
55  // do the actual work
56  void execute(PDBBuzzerPtr callerBuzzer) override;
57 
58 private:
61  int& counter;
62  pthread_mutex_t connection_mutex;
63 };
64 
65 
66 #endif /* SRC_CPP_MAIN_STORAGE_HEADERS_PDBSCANWORK_H_ */
pdb::PangeaStorageServer * storage
Definition: PDBScanWork.h:60
unsigned int SetID
Definition: DataTypes.h:31
pthread_mutex_t connection_mutex
Definition: PDBScanWork.h:62
shared_ptr< PageIteratorInterface > PageIteratorPtr
Definition: PageIterator.h:33
shared_ptr< PDBScanWork > PDBScanWorkPtr
Definition: PDBScanWork.h:28
unsigned int NodeID
Definition: DataTypes.h:27
PageIteratorPtr iter
Definition: PDBScanWork.h:59
unsigned int DatabaseID
Definition: DataTypes.h:29
std::shared_ptr< PDBCommunicator > PDBCommunicatorPtr
unsigned int PageID
Definition: DataTypes.h:26
int & counter
Definition: PDBScanWork.h:61
shared_ptr< PDBBuzzer > PDBBuzzerPtr
Definition: PDBBuzzer.h:32
unsigned int UserTypeID
Definition: DataTypes.h:25