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
DistributedStorageManagerServer.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 OBJECTQUERYMODEL_DISTRIBUTEDSTORAGEMANAGERSERVER_H
19 #define OBJECTQUERYMODEL_DISTRIBUTEDSTORAGEMANAGERSERVER_H
20 
21 #include "PDBLogger.h"
22 
23 #include "BroadcastServer.h"
24 #include "SimpleRequestResult.h"
25 #include "StatisticsDB.h"
26 
27 namespace pdb {
28 
29 // This ServerFunctionality runs on the Manager server, and talks with
30 // the PangeaStorageServer deployed on each Worker server to serve
31 // storage-related requests. Include following:
32 // -- DistributedStorageAddDatabase: to add a database over the cluster
33 // -- DistributedStorageClearSet: to remove data (both in-memory or on-disk data) from a set
34 // -- DistributedStorageAddTempSet: to add a temp set (invisible to catalog) over the cluster
35 // -- DistributedStorageAddSet: to add a user set over the cluster
36 // -- DistributedStorageRemoveDatabase: to remove a database from the cluster
37 // -- DistributedStorageRemoveTempSet: to remove a temp set (invisible to catalog)
38 // from the cluster
39 // -- DistributedStorageRemoveSet: to remove a user set over the cluster
40 // -- DistributedStorageCleanup: to flush buffered data to disk for all storage nodes
41 // -- DistributedStorageExportSet: to export a set to user specified format
42 // -- SetScan: to scan all pages in a set from the client (One thread)
43 
44 
45 
47 
48 public:
50 
51 
52  DistributedStorageManagerServer(PDBLoggerPtr logger, std::shared_ptr<StatisticsDB> statisticsDB);
53 
55 
56  void registerHandlers(PDBServer& forMe) override;
57 
58 private:
59 
60  std::shared_ptr<StatisticsDB> statisticsDB;
61 
62  bool findNodesForDatabase(const std::string& databaseName,
63  std::vector<std::string>& nodesForDatabase,
64  std::string& errMsg);
65 
66  bool findNodesContainingDatabase(const std::string& databaseName,
67  std::vector<std::string>& nodesContainingDatabase,
68  std::string& errMsg);
69 
70  bool findNodesForSet(const std::string& databaseName,
71  const std::string& setName,
72  std::vector<std::string>& nodesContainingSet,
73  std::string& errMsg);
74 
75  bool findNodesContainingSet(const std::string& databaseName,
76  const std::string& setName,
77  std::vector<std::string>& nodesContainingSet,
78  std::string& errMsg);
79 
80  std::function<void(Handle<SimpleRequestResult>, std::string)> generateAckHandler(
81  std::vector<std::string>& success, std::vector<std::string>& failures, mutex& lock);
82 };
83 }
84 
85 
86 #endif // OBJECTQUERYMODEL_DISTRIBUTEDSTORAGEMANAGERSERVER_H
std::function< void(Handle< SimpleRequestResult >, std::string)> generateAckHandler(std::vector< std::string > &success, std::vector< std::string > &failures, mutex &lock)
bool findNodesContainingSet(const std::string &databaseName, const std::string &setName, std::vector< std::string > &nodesContainingSet, std::string &errMsg)
bool findNodesForDatabase(const std::string &databaseName, std::vector< std::string > &nodesForDatabase, std::string &errMsg)
bool findNodesContainingDatabase(const std::string &databaseName, std::vector< std::string > &nodesContainingDatabase, std::string &errMsg)
shared_ptr< Configuration > ConfigurationPtr
Definition: Configuration.h:89
DistributedStorageManagerServer(PDBLoggerPtr logger, ConfigurationPtr conf, std::shared_ptr< StatisticsDB > statisticsDB)
std::shared_ptr< PDBLogger > PDBLoggerPtr
Definition: PDBLogger.h:40
ConfigurationPtr conf
bool findNodesForSet(const std::string &databaseName, const std::string &setName, std::vector< std::string > &nodesContainingSet, std::string &errMsg)