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
DispatcherClient.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 OBJECTQUERYMODEL_DISPATCHERCLIENT_H
20 #define OBJECTQUERYMODEL_DISPATCHERCLIENT_H
21 
22 #include "ServerFunctionality.h"
23 #include "Handle.h"
24 #include "PDBVector.h"
25 #include "PDBObject.h"
26 #include "PartitionPolicy.h"
27 #include "CatalogClient.h"
28 
29 namespace pdb {
30 
31 // this class serves as a dispatcher client to talk with the DispatcherServer
32 // to send Vector<Objects> from clients to the distributed storage server.
33 
34 
36 
37 public:
39  DispatcherClient(int portIn, std::string addressIn, PDBLoggerPtr myLoggerIn);
41 
46  void registerHandlers(PDBServer& forMe) override; // no-op
47 
53  bool registerSet(std::pair<std::string, std::string> setAndDatabase,
55  std::string& errMsg);
56 
62  template <class DataType>
63  bool sendData(std::pair<std::string, std::string> setAndDatabase,
64  Handle<Vector<Handle<DataType>>> dataToSend,
65  std::string& errMsg);
66 
67  template <class DataType>
68  bool sendBytes(std::pair<std::string, std::string> setAndDatabase,
69  char* bytes,
70  size_t numBytes,
71  std::string& errMsg);
72 
73 private:
75  int port;
76  std::string address;
78 };
79 }
80 
82 
83 #endif // OBJECTQUERYMODEL_DISPATCHERCLIENT_H
bool sendBytes(std::pair< std::string, std::string > setAndDatabase, char *bytes, size_t numBytes, std::string &errMsg)
bool registerSet(std::pair< std::string, std::string > setAndDatabase, PartitionPolicy::Policy policy, std::string &errMsg)
std::shared_ptr< PDBLogger > PDBLoggerPtr
Definition: PDBLogger.h:40
void registerHandlers(PDBServer &forMe) override
bool sendData(std::pair< std::string, std::string > setAndDatabase, Handle< Vector< Handle< DataType >>> dataToSend, std::string &errMsg)