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
CatalogClient.cc
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 CATALOG_CLIENT_CC
20 #define CATALOG_CLIENT_CC
21 
22 #include <ctime>
23 #include <fcntl.h>
24 #include <fstream>
25 #include <iostream>
26 #include <sys/stat.h>
27 #include <sys/types.h>
28 #include <unistd.h>
29 
31 #include "CatAddNodeToSetRequest.h"
33 #include "CatCreateSetRequest.h"
35 #include "CatDeleteSetRequest.h"
36 #include "CatRegisterType.h"
41 #include "CatTypeNameSearch.h"
43 #include "CatTypeSearchResult.h"
44 #include "CatalogClient.h"
45 #include "PDBDebug.h"
46 #include "ShutDown.h"
47 #include "SimpleRequest.h"
48 #include "SimpleRequestResult.h"
49 #include "SimpleSendDataRequest.h"
50 
51 namespace pdb {
52 
53 // Constructor
54 CatalogClient::CatalogClient(int portIn, std::string addressIn,
55  PDBLoggerPtr myLoggerIn,
56  bool pointsToCatalogManagerIn) {
57  pointsToCatalogManager = pointsToCatalogManagerIn;
58  CatalogClient(portIn, addressIn, myLoggerIn);
59 }
60 
61 // default constructor
63 
64 // Constructor
65 CatalogClient::CatalogClient(int portIn, std::string addressIn,
66  PDBLoggerPtr myLoggerIn) {
67 
68  // get the communicator information
69  port = portIn;
70  address = addressIn;
71 
72  myLogger = myLoggerIn;
73 
74  // and let the v-table map know this information
75  if (!theVTable->getCatalogClient()) {
77  }
78 
79  // set up the mutex
80  pthread_mutex_init(&workingMutex, nullptr);
81 }
82 
83 // destructor
85  // Clean up the VTable catalog ptr if it is using this CatalogClient
86  if (theVTable->getCatalogClient() == this) {
87  theVTable->setCatalogClient(nullptr);
88  }
89 
90  pthread_mutex_destroy(&workingMutex);
91 }
92 
93 /* no handlers for a catalog client!! */
95 
96 // sends a request to a Catalog Server to register a Data Type defined in a
97 // Shared Library
98 bool CatalogClient::registerType(std::string fileContainingSharedLib,
99  std::string &errMsg) {
100 
101  const LockGuard guard{workingMutex};
102 
103  // first, load up the shared library file
104  std::ifstream in(fileContainingSharedLib,
105  std::ifstream::ate | std::ifstream::binary);
106  if (in.fail()) {
107  errMsg = "The file " + fileContainingSharedLib +
108  " doesn't exist or cannot be opened.\n";
109  return false;
110  }
111 
112  size_t fileLen = in.tellg();
113 
114  PDB_COUT << "file " << fileContainingSharedLib << endl;
115  PDB_COUT << "size " << fileLen << endl;
116  PDB_COUT << "Registering type " << fileContainingSharedLib << std::endl;
117 
118  const UseTemporaryAllocationBlock tempBlock{fileLen + 1024};
119  bool res = false;
120  {
121  Handle<Vector<char>> putResultHere =
122  makeObject<Vector<char>>(fileLen, fileLen);
123 
124  // reads the bytes from the Shared Library
125  int filedesc = open(fileContainingSharedLib.c_str(), O_RDONLY);
126  read(filedesc, putResultHere->c_ptr(), fileLen);
127  close(filedesc);
128 
130  bool>(
131  myLogger, port, address, false, 1024,
132  [&](Handle<SimpleRequestResult> result) {
133  if (result != nullptr) {
134  if (!result->getRes().first) {
135  errMsg = "Error registering type: " + result->getRes().second;
136  myLogger->error("Error registering type: " +
137  result->getRes().second);
138  return false;
139  }
140  return true;
141  } else {
142  errMsg =
143  "Error registering type: got null pointer on return message.\n";
144  myLogger->error("Error registering type: got null pointer on "
145  "return message.\n");
146  return false;
147  }
148  },
149  putResultHere);
150  }
151  return res;
152 }
153 
154 // makes a request to shut down a PDB server
155 bool CatalogClient::shutDownServer(std::string &errMsg) {
156 
157  return simpleRequest<ShutDown, SimpleRequestResult, bool>(
158  myLogger, port, address, false, 1024,
159  [&](Handle<SimpleRequestResult> result) {
160  if (result != nullptr) {
161  if (!result->getRes().first) {
162  errMsg = "Error shutting down server: " + result->getRes().second;
163  myLogger->error("Error shutting down server: " +
164  result->getRes().second);
165  return false;
166  }
167  return true;
168  }
169  errMsg = "Error getting type name: got nothing back from catalog";
170  return false;
171  });
172 }
173 
174 // returns true if this Catalog Client points to the Manager Catalog (false
175 // otherwise)
177  return pointsToCatalogManager;
178 }
179 
180 // sets if this Catalog Client points to the Manager Catalog (true), or not
181 // (false)
182 void CatalogClient::setPointsToManagerCatalog(bool pointsToManager) {
183  pointsToCatalogManager = pointsToManager;
184 }
185 
186 // searches for a User-Defined Type give its name and returns it's TypeID
187 int16_t CatalogClient::searchForObjectTypeName(std::string objectTypeName) {
188  PDB_COUT << "searchForObjectTypeName for " << objectTypeName << std::endl;
189  return simpleRequest<CatTypeNameSearch, CatTypeSearchResult, int16_t>(
190  myLogger, port, address, -1, 1024 * 1024,
191  [&](Handle<CatTypeSearchResult> result) {
192  if (result != nullptr) {
193  PDB_COUT << "searchForObjectTypeName: getTypeId="
194  << result->getTypeID() << std::endl;
195  return result->getTypeID();
196  } else {
197  PDB_COUT << "searchForObjectTypeName: error in getting typeId"
198  << std::endl;
199  return (int16_t)-1;
200  }
201  },
202  objectTypeName);
203 }
204 
205 // retrieves the content of a Shared Library given it's Type Id
206 bool CatalogClient::getSharedLibrary(int16_t identifier,
207  std::string sharedLibraryFileName) {
208 
209  const UseTemporaryAllocationBlock tempBlock{1024 * 1024 * 124};
210  PDB_COUT << "CatalogClient: getSharedLibrary for id=" << identifier
211  << std::endl;
212  Handle<CatalogUserTypeMetadata> tempMetadataObject =
213  makeObject<CatalogUserTypeMetadata>();
214  string sharedLibraryBytes;
215  string errMsg;
216 
217  // using an empty Name b/c it's being searched by typeId
218  string typeNameToSearch = "";
219 
220  bool res = getSharedLibraryByTypeName(
221  identifier, typeNameToSearch, sharedLibraryFileName, tempMetadataObject,
222  sharedLibraryBytes, errMsg);
223 
224  PDB_COUT << "CatalogClient: deleted putResultHere" << std::endl;
225  return res;
226 }
227 
228 // retrieves a Shared Library given it's typeName
230  int16_t identifier, std::string &typeNameToSearch,
231  std::string sharedLibraryFileName,
232  Handle<CatalogUserTypeMetadata> &typeMetadata, string &sharedLibraryBytes,
233  std::string &errMsg) {
234 
235  PDB_COUT << "inside CatalogClient getSharedLibraryByTypeName for type="
236  << typeNameToSearch << " and id=" << identifier << std::endl;
237 
239  bool>(
240  myLogger, port, address, false, 1024 * 1024 * 4,
241  [&](Handle<CatalogUserTypeMetadata> result) {
242 
243  PDB_COUT << "In CatalogClient- Handling CatSharedLibraryByNameRequest "
244  "received from "
245  "CatalogServer..."
246  << std::endl;
247  if (result == nullptr) {
248  std::cout << "FATAL ERROR: can't connect to remote server to fetch "
249  "shared library "
250  "for typeId="
251  << identifier << std::endl;
252  exit(-1);
253  }
254 
255  // gets the typeId returned by the Manager Catalog
256  int16_t returnedTypeId = std::atoi((result->getObjectID()).c_str());
257  PDB_COUT << "Cat Client - Object Id returned " << returnedTypeId
258  << endl;
259 
260  if (returnedTypeId == -1) {
261  errMsg = "Error getting shared library: type not found in Manager "
262  "Catalog.\n";
263  PDB_COUT << "Error getting shared library: type not found in Manager "
264  "Catalog.\n"
265  << endl;
266  return false;
267  }
268 
269  PDB_COUT << "Cat Client - Finally bytes returned "
270  << result->getLibraryBytes().size() << endl;
271 
272  if (result->getLibraryBytes().size() == 0) {
273  errMsg = "Error getting shared library, no data returned.\n";
274  PDB_COUT << "Error getting shared library, no data returned.\n"
275  << endl;
276  return false;
277  }
278 
279  // gets metadata and bytes of the registered type
280  typeNameToSearch = std::string((*result).getItemName());
281  sharedLibraryBytes = string(result->getLibraryBytes().c_str(),
282  result->getLibraryBytes().size());
283 
284  PDB_COUT << " Metadata in Catalog Client " << (*result).getObjectID()
285  << " | " << (*result).getItemKey() << " | "
286  << (*result).getItemName() << endl;
287 
288  PDB_COUT << "copying bytes received in CatClient # bytes "
289  << sharedLibraryBytes.size() << endl;
290 
291  // just write the shared library to the file
292  int filedesc = open(sharedLibraryFileName.c_str(), O_CREAT | O_WRONLY,
293  S_IRUSR | S_IWUSR);
294  PDB_COUT << "Writing file " << sharedLibraryFileName.c_str() << "\n";
295  write(filedesc, sharedLibraryBytes.c_str(), sharedLibraryBytes.size());
296  close(filedesc);
297 
298  PDB_COUT << "objectFile is written by CatalogClient" << std::endl;
299  return true;
300  },
301  identifier, typeNameToSearch);
302 }
303 
304 // sends a request to obtain the TypeId of a Type, given a database and set
305 std::string CatalogClient::getObjectType(std::string databaseName,
306  std::string setName,
307  std::string &errMsg) {
308 
310  std::string>(
311  myLogger, port, address, "", 1024,
312  [&](Handle<CatTypeNameSearchResult> result) {
313  if (result != nullptr) {
314  auto success = result->wasSuccessful();
315  if (!success.first) {
316  errMsg = "Error getting type name: " + success.second;
317  myLogger->error("Error getting type name: " + success.second);
318  } else
319  return result->getTypeName();
320  }
321  errMsg = "Error getting type name: got nothing back from catalog";
322  return std::string("");
323  },
324  databaseName, setName);
325 }
326 
327 // sends a request to the Catalog Server to create Metadata for a new Set
328 bool CatalogClient::createSet(int16_t typeID, std::string databaseName,
329  std::string setName, std::string &errMsg) {
330  PDB_COUT << "CatalogClient: to create set..." << std::endl;
331  return simpleRequest<CatCreateSetRequest, SimpleRequestResult, bool>(
332  myLogger, port, address, false, 1024,
333  [&](Handle<SimpleRequestResult> result) {
334  PDB_COUT << "CatalogClient: received response for creating set"
335  << std::endl;
336  if (result != nullptr) {
337  if (!result->getRes().first) {
338  errMsg = "Error creating set: " + result->getRes().second;
339  std::cout << "errMsg" << std::endl;
340  myLogger->error("Error creating set: " + result->getRes().second);
341  return false;
342  }
343  PDB_COUT << "CatalogClient: created set" << std::endl;
344  return true;
345  }
346  errMsg = "Error getting type name: got nothing back from catalog";
347  std::cout << errMsg << std::endl;
348  return false;
349  },
350  databaseName, setName, typeID);
351 }
352 
353 // sends a request to the Catalog Server to create Metadata for a new Database
354 bool CatalogClient::createDatabase(std::string databaseName,
355  std::string &errMsg) {
356 
357  return simpleRequest<CatCreateDatabaseRequest, SimpleRequestResult, bool>(
358  myLogger, port, address, false, 1024,
359  [&](Handle<SimpleRequestResult> result) {
360  if (result != nullptr) {
361  if (!result->getRes().first) {
362  errMsg = "Error creating database: " + result->getRes().second;
363  myLogger->error("Error creating database: " +
364  result->getRes().second);
365  return false;
366  }
367  return true;
368  }
369  errMsg = "Error getting type name: got nothing back from catalog";
370  return false;
371  },
372  databaseName);
373 }
374 
375 // sends a request to the Catalog Server to remove Metadata for a Set that is
376 // deleted
377 bool CatalogClient::deleteSet(std::string databaseName, std::string setName,
378  std::string &errMsg) {
379 
380  return simpleRequest<CatDeleteSetRequest, SimpleRequestResult, bool>(
381  myLogger, port, address, false, 1024,
382  [&](Handle<SimpleRequestResult> result) {
383  if (result != nullptr) {
384  if (!result->getRes().first) {
385  errMsg = "Error deleting set: " + result->getRes().second;
386  myLogger->error("Error deleting set: " + result->getRes().second);
387  return false;
388  }
389  return true;
390  }
391  errMsg = "Error getting type name: got nothing back from catalog";
392  return false;
393  },
394  databaseName, setName);
395 }
396 
397 // sends a request to the Catalog Server to remove Metadata for a Database that
398 // has been deleted
399 bool CatalogClient::deleteDatabase(std::string databaseName,
400  std::string &errMsg) {
401 
402  return simpleRequest<CatDeleteDatabaseRequest, SimpleRequestResult, bool>(
403  myLogger, port, address, false, 1024,
404  [&](Handle<SimpleRequestResult> result) {
405  if (result != nullptr) {
406  if (!result->getRes().first) {
407  errMsg = "Error deleting database: " + result->getRes().second;
408  myLogger->error("Error deleting database: " +
409  result->getRes().second);
410  return false;
411  }
412  return true;
413  }
414  errMsg = "Error getting type name: got nothing back from catalog";
415  return false;
416  },
417  databaseName);
418 }
419 
420 // sends a request to the Catalog Server to add Information about a Node to a
421 // Set
422 bool CatalogClient::addNodeToSet(std::string nodeIP, std::string databaseName,
423  std::string setName, std::string &errMsg) {
424 
425  return simpleRequest<CatAddNodeToSetRequest, SimpleRequestResult, bool>(
426  myLogger, port, address, false, 1024,
427  [&](Handle<SimpleRequestResult> result) {
428  if (result != nullptr) {
429  if (!result->getRes().first) {
430  errMsg = "Error creating set: " + result->getRes().second;
431  myLogger->error("Error creating set: " + result->getRes().second);
432  return false;
433  }
434  return true;
435  }
436  errMsg = "Error getting type name: got nothing back from catalog";
437  return false;
438  },
439  databaseName, setName, nodeIP);
440 }
441 
442 // sends a request to the Catalog Server to add Information about a Node to a
443 // Database
444 bool CatalogClient::addNodeToDB(std::string nodeIP, std::string databaseName,
445  std::string &errMsg) {
446 
447  return simpleRequest<CatAddNodeToDatabaseRequest, SimpleRequestResult, bool>(
448  myLogger, port, address, false, 1024,
449  [&](Handle<SimpleRequestResult> result) {
450  if (result != nullptr) {
451  if (!result->getRes().first) {
452  errMsg = "Error creating database: " + result->getRes().second;
453  myLogger->error("Error creating database: " +
454  result->getRes().second);
455  return false;
456  }
457  return true;
458  }
459  errMsg = "Error getting type name: got nothing back from catalog";
460  return false;
461  },
462  databaseName, nodeIP);
463 }
464 
465 // sends a request to the Catalog Server to remove Information about a Node from
466 // a Set
467 bool CatalogClient::removeNodeFromSet(std::string nodeIP,
468  std::string databaseName,
469  std::string setName,
470  std::string &errMsg) {
471 
472  return simpleRequest<CatRemoveNodeFromSetRequest, SimpleRequestResult, bool>(
473  myLogger, port, address, false, 1024,
474  [&](Handle<SimpleRequestResult> result) {
475  if (result != nullptr) {
476  if (!result->getRes().first) {
477  errMsg = "Error deleting set: " + result->getRes().second;
478  myLogger->error("Error deleting set: " + result->getRes().second);
479  return false;
480  }
481  return true;
482  }
483  errMsg = "Error getting type name: got nothing back from catalog";
484  return false;
485  },
486  databaseName, setName, nodeIP);
487 }
488 
489 // sends a request to the Catalog Server to remove Information about a Node from
490 // a Database
491 bool CatalogClient::removeNodeFromDB(std::string nodeIP,
492  std::string databaseName,
493  std::string &errMsg) {
494 
496  bool>(
497  myLogger, port, address, false, 1024,
498  [&](Handle<SimpleRequestResult> result) {
499  if (result != nullptr) {
500  if (!result->getRes().first) {
501  errMsg = "Error deleting database: " + result->getRes().second;
502  myLogger->error("Error deleting database: " +
503  result->getRes().second);
504  return false;
505  }
506  return true;
507  }
508  errMsg = "Error getting type name: got nothing back from catalog";
509  return false;
510  },
511  databaseName, nodeIP);
512 }
513 
514 // sends a request to the Catalog Server to add metadata about a Database
515 bool CatalogClient::registerDatabaseMetadata(std::string itemToSearch,
516  std::string &errMsg) {
517  PDB_COUT << "inside registerDatabaseMetadata" << endl;
518 
519  return simpleRequest<CatalogDatabaseMetadata, SimpleRequestResult, bool>(
520  myLogger, port, address, false, 1024,
521  [&](Handle<SimpleRequestResult> result) {
522  if (result != nullptr) {
523  if (!result->getRes().first) {
524  errMsg = "Error registering database metadata: " +
525  result->getRes().second;
526  myLogger->error("Error registering database metadata: " +
527  result->getRes().second);
528  return false;
529  }
530  return true;
531  }
532  errMsg = "Error getting type name: got nothing back from catalog";
533  return false;
534  });
535 }
536 
537 // sends a request to the Catalog Server to add metadata about a Node
539  pdb::Handle<pdb::CatalogNodeMetadata> nodeData, std::string &errMsg) {
540 
541  PDB_COUT << "registerNodeMetadata for item: " << (*nodeData) << endl;
542 
543  return simpleRequest<CatalogNodeMetadata, SimpleRequestResult, bool>(
544  myLogger, port, address, false, 1024,
545  [&](Handle<SimpleRequestResult> result) {
546  if (result != nullptr) {
547  if (!result->getRes().first) {
548  errMsg =
549  "Error registering node metadata: " + result->getRes().second;
550  myLogger->error("Error registering node metadata: " +
551  result->getRes().second);
552  return false;
553  }
554  return true;
555  }
556  errMsg = "Error registering node metadata in the catalog";
557  return false;
558  },
559  nodeData);
560 }
561 
562 // sends a request to the Catalog Server to print all metadata newer than a
563 // given timestamp
565  pdb::Handle<pdb::CatalogPrintMetadata> itemToSearch, std::string &errMsg) {
566 
567  PDB_COUT << "itemToSearch " << itemToSearch->getItemName().c_str() << endl;
568  PDB_COUT << "from TimeStamp " << itemToSearch->getTimeStamp().c_str() << endl;
569 
570  return simpleRequest<pdb::CatalogPrintMetadata, CatalogPrintMetadata, string>(
571  myLogger, port, address, "", 1024,
572  [&](Handle<CatalogPrintMetadata> result) {
573  if (result != nullptr) {
574  string res = result->getMetadataToPrint();
575  return res;
576  }
577  errMsg = "Error printing catalog metadata.";
578  return errMsg;
579  },
580  itemToSearch);
581 }
582 
583 // sends a request to the Catalog Server to print all metadata for a given
584 // category
585 string CatalogClient::printCatalogMetadata(std::string &categoryToPrint,
586  std::string &errMsg) {
587 
589  pdb::makeObject<CatalogPrintMetadata>("", "0", categoryToPrint);
590 
591  return simpleRequest<pdb::CatalogPrintMetadata, CatalogPrintMetadata, string>(
592  myLogger, port, address, "", 1024,
593  [&](Handle<CatalogPrintMetadata> result) {
594  if (result != nullptr) {
595  string resultToPrint = result->getMetadataToPrint();
596  return resultToPrint;
597  }
598  errMsg = "Error printing catalog metadata.";
599  return errMsg;
600  },
601  itemToPrint);
602 }
603 
604 string CatalogClient::listRegisteredDatabases(std::string &errMsg) {
605 
606  string category = "databases";
607  return printCatalogMetadata(category, errMsg);
608 }
609 
610 string CatalogClient::listRegisteredSetsForADatabase(std::string databaseName,
611  std::string &errMsg) {
612 
613  string category = "sets";
614  return printCatalogMetadata(category, errMsg);
615 }
616 
617 string CatalogClient::listNodesInCluster(std::string &errMsg) {
618 
619  string category = "nodes";
620  return printCatalogMetadata(category, errMsg);
621 }
622 
623 string CatalogClient::listUserDefinedTypes(std::string &errMsg) {
624 
625  string category = "udts";
626  return printCatalogMetadata(category, errMsg);
627 }
628 
629 string CatalogClient::listAllRegisteredMetadata(std::string &errMsg) {
630 
631  string category = "all";
632  return printCatalogMetadata(category, errMsg);
633 }
634 
635 // sends a request to the Catalog Serve to close the SQLite handler
636 bool CatalogClient::closeCatalogSQLite(std::string &errMsg) {
637  return simpleRequest<CatalogCloseSQLiteDBHandler, SimpleRequestResult, bool>(
638  myLogger, port, address, false, 1024,
639  [&](Handle<SimpleRequestResult> result) {
640  if (result != nullptr) {
641  if (!result->getRes().first) {
642  errMsg =
643  "Error printing catalog metadata: " + result->getRes().second;
644  myLogger->error("Error printing catalog metadata: " +
645  result->getRes().second);
646  return false;
647  }
648  return true;
649  }
650  errMsg = "Error printing catalog metadata.";
651  return false;
652  });
653 }
654 
655 // templated method to send a request to the Catalog Server to register Metadata
656 // about an Item in the Catalog
657 template <class Type>
659  std::string &errMsg) {
660 
661  return simpleRequest<Type, SimpleRequestResult, bool>(
662  myLogger, port, address, false, 1024 * 1024,
663  [&](Handle<SimpleRequestResult> result) {
664  if (result != nullptr) {
665  if (!result->getRes().first) {
666  errMsg =
667  "Error registering node metadata: " + result->getRes().second;
668  myLogger->error("Error registering node metadata: " +
669  result->getRes().second);
670  return false;
671  }
672  return true;
673  }
674  errMsg = "Error registering node metadata in the catalog";
675  return false;
676  },
677  metadataItem);
678 }
679 
680 // templated method to send a request to the Catalog Server to delete Metadata
681 // about an Item in the Catalog
682 template <class Type>
684  std::string &errMsg) {
685 
686  return simpleRequest<Type, SimpleRequestResult, bool>(
687  myLogger, port, address, false, 1024 * 1024,
688  [&](Handle<SimpleRequestResult> result) {
689  if (result != nullptr) {
690  if (!result->getRes().first) {
691  errMsg = "Error removing node metadata: " + result->getRes().second;
692  myLogger->error("Error removing node metadata: " +
693  result->getRes().second);
694  return false;
695  }
696  return true;
697  }
698  errMsg = "Error removing node metadata in the catalog";
699  return false;
700  },
701  metadataItem);
702 }
703 
704 /* Explicit instantiation to register various types of Metadata */
705 template bool
707  Handle<CatalogNodeMetadata> metadataItem,
708  string &errMsg);
709 
710 template bool
712  Handle<CatalogDatabaseMetadata> metadataItem,
713  string &errMsg);
714 
715 template bool
717  Handle<CatalogSetMetadata> metadataItem,
718  string &errMsg);
719 
720 /* Explicit instantiation to delete various types of Metadata */
721 template bool
724  string &errMsg);
725 
726 template bool
728  Handle<CatDeleteSetRequest> metadataItem,
729  string &errMsg);
730 }
731 #endif
bool registerType(std::string fileContainingSharedLib, std::string &errMsg)
string listNodesInCluster(std::string &errMsg)
string listRegisteredSetsForADatabase(std::string databaseName, std::string &errMsg)
string listAllRegisteredMetadata(std::string &errMsg)
bool registerDatabaseMetadata(std::string databaseName, std::string &errMsg)
void setPointsToManagerCatalog(bool pointsToManager)
bool deleteSet(std::string databaseName, std::string setName, std::string &errMsg)
virtual void registerHandlers(PDBServer &forMe) override
bool removeNodeFromSet(std::string nodeIP, std::string databaseName, std::string setName, std::string &errMsg)
bool deleteGenericMetadata(pdb::Handle< Type > metadataItem, std::string &errMsg)
std::string getObjectType(std::string databaseName, std::string setName, std::string &errMsg)
int16_t searchForObjectTypeName(std::string objectTypeName)
PDBLoggerPtr myLogger
bool addNodeToSet(std::string nodeIP, std::string databaseName, std::string setName, std::string &errMsg)
bool getSharedLibraryByTypeName(int16_t identifier, std::string &typeName, std::string sharedLibraryFileName, Handle< CatalogUserTypeMetadata > &typeMetadata, string &sharedLibraryBytes, std::string &errMsg)
bool shutDownServer(std::string &errMsg)
bool deleteDatabase(std::string databaseName, std::string &errMsg)
static CatalogClient * getCatalogClient()
Definition: VTableMap.cc:193
#define PDB_COUT
Definition: PDBDebug.h:31
string listUserDefinedTypes(std::string &errMsg)
bool getPointsToManagerCatalog()
bool createSet(std::string databaseName, std::string setName, std::string &errMsg)
bool addNodeToDB(std::string nodeIP, std::string databaseName, std::string &errMsg)
pthread_mutex_t workingMutex
static void setCatalogClient(CatalogClient *catalog)
Definition: VTableMap.cc:180
bool registerNodeMetadata(pdb::Handle< pdb::CatalogNodeMetadata > nodeData, std::string &errMsg)
std::shared_ptr< PDBLogger > PDBLoggerPtr
Definition: PDBLogger.h:40
bool closeCatalogSQLite(std::string &errMsg)
VTableMap * theVTable
bool registerGenericMetadata(pdb::Handle< Type > metadataItem, std::string &errMsg)
std::string address
bool createDatabase(std::string databaseName, std::string &errMsg)
ReturnType simpleSendDataRequest(PDBLoggerPtr myLogger, int port, std::string address, ReturnType onErr, size_t bytesForRequest, function< ReturnType(Handle< ResponseType >)> processResponse, Handle< Vector< DataType >> dataToSend, RequestTypeParams &&...args)
string listRegisteredDatabases(std::string &errMsg)
string printCatalogMetadata(pdb::Handle< pdb::CatalogPrintMetadata > itemToSearch, std::string &errMsg)
ReturnType simpleRequest(PDBLoggerPtr myLogger, int port, std::string address, ReturnType onErr, size_t bytesForRequest, function< ReturnType(Handle< ResponseType >)> processResponse, RequestTypeParams &&...args)
bool removeNodeFromDB(std::string nodeIP, std::string databaseName, std::string &errMsg)
bool getSharedLibrary(int16_t identifier, std::string sharedLibraryFileName)