text
stringlengths 0
2.2M
|
---|
AMEFEncoder encoder;
|
AMEFDecoder decoder;
|
AMEFObject* object = new AMEFObject;
|
object->addPacket("remove mapentry "+cacheKey+" "+key);
|
lock.lock();
|
client->sendData(encoder.encodeB(object));
|
std::string resp = client->getBinaryData(4, false);
|
lock.unlock();
|
delete object;
|
object = decoder.decodeB(resp, true);
|
std::vector<std::string> ignoreErrors;readValueOrThrowExp(object, ignoreErrors);
|
}
|
std::string DistoCacheClientUtils::getMapEntryValue(const std::string& cacheKey, const std::string& key) {
|
AMEFEncoder encoder;
|
AMEFDecoder decoder;
|
AMEFObject* object = new AMEFObject;
|
object->addPacket("get mapentry "+cacheKey+" "+key);
|
lock.lock();
|
client->sendData(encoder.encodeB(object));
|
std::string resp = client->getBinaryData(4, false);
|
lock.unlock();
|
delete object;
|
object = decoder.decodeB(resp, true);
|
std::vector<std::string> ignoreErrors;resp = readValueOrThrowExp(object, ignoreErrors);
|
return resp;
|
}
|
std::string DistoCacheClientUtils::getMapEntryValueByPosition(const std::string& cacheKey, const int& position) {
|
AMEFEncoder encoder;
|
AMEFDecoder decoder;
|
AMEFObject* object = new AMEFObject;
|
object->addPacket("getbypos mapentry "+cacheKey+" "+CastUtil::fromNumber(position));
|
lock.lock();
|
client->sendData(encoder.encodeB(object));
|
std::string resp = client->getBinaryData(4, false);
|
lock.unlock();
|
delete object;
|
object = decoder.decodeB(resp, true);
|
std::vector<std::string> ignoreErrors;resp = readValueOrThrowExp(object, ignoreErrors);
|
return resp;
|
}
|
void DistoCacheClientUtils::setMapEntryValueByPosition(const std::string& cacheKey, const int& position, const std::string& value) {
|
AMEFEncoder encoder;
|
AMEFDecoder decoder;
|
AMEFObject* object = new AMEFObject;
|
object->addPacket("set mapentry "+cacheKey + " " + CastUtil::fromNumber(position));
|
object->addPacket(value);
|
lock.lock();
|
client->sendData(encoder.encodeB(object));
|
std::string resp = client->getBinaryData(4, false);
|
lock.unlock();
|
delete object;
|
object = decoder.decodeB(resp, true);
|
std::vector<std::string> ignoreErrors;readValueOrThrowExp(object, ignoreErrors);
|
}
|
void DistoCacheClientUtils::setCollectionEntryAt(const std::string& cacheKey, const int& position, const std::string& value) {
|
AMEFEncoder encoder;
|
AMEFDecoder decoder;
|
AMEFObject* object = new AMEFObject;
|
object->addPacket("set collentry "+cacheKey + " " + CastUtil::fromNumber(position));
|
object->addPacket(value);
|
lock.lock();
|
client->sendData(encoder.encodeB(object));
|
std::string resp = client->getBinaryData(4, false);
|
lock.unlock();
|
delete object;
|
object = decoder.decodeB(resp, true);
|
std::vector<std::string> ignoreErrors;readValueOrThrowExp(object, ignoreErrors);
|
}
|
void DistoCacheClientUtils::addCollectionEntry(const std::string& cacheKey, const std::string& value) {
|
AMEFEncoder encoder;
|
AMEFDecoder decoder;
|
AMEFObject* object = new AMEFObject;
|
object->addPacket("add collentry "+cacheKey);
|
object->addPacket(value);
|
lock.lock();
|
client->sendData(encoder.encodeB(object));
|
std::string resp = client->getBinaryData(4, false);
|
lock.unlock();
|
delete object;
|
object = decoder.decodeB(resp, true);
|
std::vector<std::string> ignoreErrors;readValueOrThrowExp(object, ignoreErrors);
|
}
|
void DistoCacheClientUtils::removeCollectionEntryAt(const std::string& cacheKey, const int& position) {
|
AMEFEncoder encoder;
|
AMEFDecoder decoder;
|
AMEFObject* object = new AMEFObject;
|
object->addPacket("remove collentry "+cacheKey+" "+CastUtil::fromNumber(position));
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.