18 #ifndef OBJECTQUERYMODEL_DISPATCHERCLIENTTEMPLATE_CC
19 #define OBJECTQUERYMODEL_DISPATCHERCLIENTTEMPLATE_CC
29 template <
class DataType>
32 std::string& errMsg) {
33 return simpleSendDataRequest<DispatcherAddData, Handle<DataType>,
SimpleRequestResult,
bool>(
40 if (result !=
nullptr) {
41 if (!result->getRes().first) {
42 errMsg =
"Error dispatching data: " + result->getRes().second;
43 logger->error(errMsg);
49 setAndDatabase.second,
51 getTypeName<DataType>());
55 template <
class DataType>
59 std::string& errMsg) {
60 #ifdef ENABLE_COMPRESSION
61 char* compressedBytes =
new char[snappy::MaxCompressedLength(numBytes)];
62 size_t compressedSize;
63 snappy::RawCompress((
char*)bytes, numBytes, compressedBytes, &compressedSize);
64 std::cout <<
"size before compression is " << numBytes <<
" and size after compression is "
65 << compressedSize << std::endl;
66 return simpleSendBytesRequest<DispatcherAddData, SimpleRequestResult, bool>(
73 if (result !=
nullptr)
74 if (!result->getRes().first) {
75 logger->error(
"Error sending data: " + result->getRes().second);
76 errMsg =
"Error sending data: " + result->getRes().second;
82 setAndDatabase.second,
84 getTypeName<DataType>(),
87 return simpleSendBytesRequest<DispatcherAddData, SimpleRequestResult, bool>(
94 if (result !=
nullptr)
95 if (!result->getRes().first) {
96 logger->error(
"Error sending data: " + result->getRes().second);
97 errMsg =
"Error sending data: " + result->getRes().second;
103 setAndDatabase.second,
104 setAndDatabase.first,
105 getTypeName<DataType>());
bool sendBytes(std::pair< std::string, std::string > setAndDatabase, char *bytes, size_t numBytes, std::string &errMsg)
bool sendData(std::pair< std::string, std::string > setAndDatabase, Handle< Vector< Handle< DataType >>> dataToSend, std::string &errMsg)