1 #ifndef ISPN_HOTROD_REMOTECACHE_H 2 #define ISPN_HOTROD_REMOTECACHE_H 64 template<
class K,
class V>
class RemoteCache:
private RemoteCacheBase
67 #ifndef SWIG // Let SWIG ignore this method 68 template<
typename Function>
69 inline std::future<typename std::result_of<Function()>::type> goAsync(Function&& f,
70 std::function<
typename std::result_of<Function()>::type(
typename std::result_of<Function()>::type)> success,
71 std::function<
typename std::result_of<Function()>::type(std::exception&)> fail)
75 {
return success==0 ? f() : success(f());}
76 catch (std::exception& ex)
82 return std::async(fq);
85 template<
typename Function>
86 inline std::future<void> goAsync(Function&& f, std::function<
void()> success,
87 std::function<
void(std::exception&)> fail)
91 {
if (success==0) f();
93 catch (std::exception& ex)
99 return std::async(fq);
113 return std::string(base_getName());
145 return (V *) base_get(&key);
155 std::map<std::shared_ptr<K>, std::shared_ptr<V> >
getAll(
const std::set<K>&
keySet)
157 std::set<std::vector<char> > keySetMarshalled;
158 for (
auto item = keySet.begin(); item != keySet.end(); item++)
161 this->keyMarshaller->marshall(*item, v);
162 keySetMarshalled.insert(v);
164 auto marshalledResult = base_getAll(keySetMarshalled);
165 std::map<std::shared_ptr<K>, std::shared_ptr<V> > result;
166 for (
auto item : marshalledResult)
168 std::shared_ptr<K> rk(this->keyMarshaller->unmarshall(item.first));
169 std::shared_ptr<V> rv(this->keyMarshaller->unmarshall(item.second));
185 std::future<V*>
getAsync(
const K& key, std::function<V* (V*)> success =
nullptr,
186 std::function<V* (std::exception&)> fail =
nullptr)
190 {
return this->
get(*pKey);};
191 return goAsync(f, success, fail);
213 V*
put(
const K& key,
const V& val, uint64_t lifespan = 0, uint64_t maxIdle = 0)
236 V*
put(
const K& key,
const V& val, uint64_t lifespan,
TimeUnit lifespanUnit)
238 return put(key, val, lifespan, lifespanUnit, 0,
SECONDS);
262 V*
put(
const K& key,
const V& val, uint64_t lifespan,
TimeUnit lifespanUnit, uint64_t maxIdle,
TimeUnit maxIdleUnit)
264 return (V *) base_put(&key, &val, toSeconds(lifespan, lifespanUnit), toSeconds(maxIdle, maxIdleUnit));
278 std::future<V*>
putAsync(
const K& key,
const V& val, uint64_t lifespan = 0, uint64_t maxIdle = 0,
279 std::function<V* (V*)> success =
nullptr, std::function<V* (std::exception&)> fail =
nullptr)
281 auto pKey = &key, pVal = &val;
283 {
return this->
put(*pKey,*pVal,lifespan,maxIdle);};
284 return goAsync(f, success, fail);
298 std::future<V*>
putAsync(
const K& key,
const V& val, uint64_t lifespan,
TimeUnit lifespanUnit,
299 std::function<V* (V*)> success =
nullptr, std::function<V* (std::exception&)> fail =
nullptr)
301 auto pKey = &key, pVal = &val;
303 {
return this->
put(*pKey,*pVal,lifespan,lifespanUnit);};
304 return goAsync(f, success, fail);
320 std::future<V*>
putAsync(
const K& key,
const V& val, uint64_t lifespan,
TimeUnit lifespanUnit, uint64_t maxIdle,
321 TimeUnit maxIdleUnit, std::function<V* (V*)> success =
nullptr, std::function<V* (std::exception&)> fail =
324 auto pKey = &key, pVal = &val;
326 {
return this->
put(*pKey,*pVal,lifespan, lifespanUnit,maxIdle,maxIdleUnit);};
327 return goAsync(f, success, fail);
340 V*
putIfAbsent(
const K& key,
const V& val, uint64_t lifespan = 0, uint64_t maxIdle = 0)
373 return (V *) base_putIfAbsent(&key, &val, toSeconds(lifespan, lifespanUnit), toSeconds(maxIdle, maxIdleUnit));
386 std::future<V*>
putIfAbsentAsync(
const K& key,
const V& val, uint64_t lifespan = 0, uint64_t maxIdle = 0,
387 std::function<V* (V*)> success =
nullptr, std::function<V* (std::exception&)> fail =
nullptr)
389 auto pKey = &key, pVal = &val;
391 {
return this->
putIfAbsent(*pKey,*pVal, lifespan, maxIdle);};
392 return goAsync(f, success, fail);
406 std::function<V* (V*)> success =
nullptr, std::function<V* (std::exception&)> fail =
nullptr)
408 auto pKey = &key, pVal = &val;
411 return goAsync(f, success, fail);
427 uint64_t maxIdle,
TimeUnit maxIdleUnit, std::function<V* (V*)> success =
nullptr,
428 std::function<V* (std::exception&)> fail =
nullptr)
430 auto pKey = &key, pVal = &val;
432 {
return this->
putIfAbsent(*pKey,*pVal, lifespan, lifespanUnit, maxIdle, maxIdleUnit);};
433 return goAsync(f, success, fail);
445 void putAll(
const std::map<K, V>& map, uint64_t lifespan = 0, uint64_t maxIdle = 0)
477 void putAll(
const std::map<K, V>& map, uint64_t lifespan,
TimeUnit lifespanUnit, uint64_t maxIdle,
480 uint64_t lifespanMillis = toSeconds(lifespan, lifespanUnit);
481 uint64_t maxIdleMillis = toSeconds(maxIdle, maxIdleUnit);
483 for (
typename std::map<K, V>::const_iterator it = map.begin(); it != map.end(); ++it)
485 put(it->first, it->second, lifespanMillis, maxIdleMillis);
500 std::future<void>
putAllAsync(
const std::map<K, V>& map, uint64_t lifespan = 0, uint64_t maxIdle = 0,
501 std::function<
void()> success =
nullptr, std::function<
void(std::exception&)> fail =
nullptr)
505 {
return this->
putAll(pMap, lifespan, maxIdle);};
506 return goAsync(f, success, fail);
521 std::function<
void(
void)> success =
nullptr, std::function<
void(std::exception&)> fail =
nullptr)
525 { this->
putAll(pMap, lifespan, lifespanUnit);};
526 return goAsync(f, success, fail);
542 std::future<void>
putAllAsync(
const std::map<K, V>& map, uint64_t lifespan,
TimeUnit lifespanUnit, uint64_t maxIdle,
543 TimeUnit maxIdleUnit, std::function<
void(
void)> success =
nullptr,
544 std::function<
void(std::exception&)> fail =
nullptr)
548 { this->
putAll(*pMap,lifespan, lifespanUnit, maxIdle, maxIdleUnit);};
549 return goAsync(f, success, fail);
562 V*
replace(
const K& key,
const V& val, uint64_t lifespan = 0, uint64_t maxIdle = 0)
593 V*
replace(
const K& key,
const V& val, uint64_t lifespan,
TimeUnit lifespanUnit, uint64_t maxIdle,
596 return (V *) base_replace(&key, &val, toSeconds(lifespan, lifespanUnit), toSeconds(maxIdle, maxIdleUnit));
609 V*
replace(
const K& key,
const V& oldVal,
const V& val, uint64_t lifespan = 0, uint64_t maxIdle = 0)
624 V*
replace(
const K& key,
const V& oldVal,
const V& val, uint64_t lifespan,
TimeUnit lifespanUnit)
626 return replace(key, oldVal, val, lifespan, lifespanUnit, 0,
SECONDS);
640 V*
replace(
const K& key,
const V& oldVal,
const V& val, uint64_t lifespan,
TimeUnit lifespanUnit, uint64_t maxIdle,
657 std::future<V*>
replaceAsync(
const K& key,
const V& val, uint64_t lifespan = 0, uint64_t maxIdle = 0,
658 std::function<V* (V*)> success =
nullptr, std::function<V* (std::exception&)> fail =
nullptr)
660 auto pKey = &key, pVal = &val;
663 return goAsync(f, success, fail);
678 std::function<V* (V*)> success =
nullptr, std::function<V* (std::exception&)> fail =
nullptr)
680 auto pKey = &key, pVal = &val;
682 {
return this->
replace(*pKey, *pVal, lifespan, lifespanUnit, 0,
SECONDS);};
683 return goAsync(f, success, fail);
699 std::future<V*>
replaceAsync(
const K& key,
const V& val, uint64_t lifespan,
TimeUnit lifespanUnit, uint64_t maxIdle,
700 TimeUnit maxIdleUnit, std::function<V* (V*)> success =
nullptr, std::function<V* (std::exception&)> fail =
703 auto pKey = &key, pVal = &val;
705 {
return this->
replace(*pKey, *pVal, lifespan, lifespanUnit, maxIdle, maxIdleUnit);};
706 return goAsync(f, success, fail);
722 std::future<V*>
replaceAsync(
const K& key,
const V& oldVal,
const V& val, uint64_t lifespan = 0, uint64_t maxIdle =
723 0, std::function<V* (V*)> success =
nullptr, std::function<V* (std::exception&)> fail =
nullptr)
727 return goAsync(f, success, fail);
743 std::future<V*>
replaceAsync(
const K& key,
const V& oldVal,
const V& val, uint64_t lifespan,
TimeUnit lifespanUnit,
744 std::function<V* (V*)> success =
nullptr, std::function<V* (std::exception&)> fail =
nullptr)
747 {
return this->
replace(key, oldVal, val, lifespan, lifespanUnit, 0,
SECONDS);};
748 return goAsync(f, success, fail);
758 V*
remove(
const K& key)
760 return (V *) base_remove(&key);
772 std::future<V*>
removeAsync(
const K& key, std::function<V* (V*)> success =
nullptr,
773 std::function<V* (std::exception&)> fail =
nullptr)
776 {
return this->
remove(key);};
777 return goAsync(f, success, fail);
788 return base_containsKey(&key);
813 bool replaceWithVersion(
const K& key,
const V& val, uint64_t version, uint64_t lifespan = 0, uint64_t maxIdle = 0)
815 return base_replaceWithVersion(&key, &val, version, lifespan, maxIdle);
832 uint64_t maxIdle, std::function<
bool(
bool)> success =
nullptr, std::function<
bool(std::exception&)> fail =
837 return goAsync(f, success, fail);
860 return base_removeWithVersion(&key, version);
873 std::function<
bool(
bool)> success =
nullptr, std::function<
bool(std::exception&)> fail =
nullptr)
877 return goAsync(f, success, fail);
893 void *value = base_getWithVersion(&key, &version);
894 return std::make_pair(std::shared_ptr<V>((V *) value), version);
909 void *value = base_getWithMetadata(&key, &metadata);
910 return std::make_pair(std::shared_ptr<V>((V *) value), metadata);
916 std::map<std::shared_ptr<K>, std::shared_ptr<V> >
getBulk()
924 std::map<std::shared_ptr<K>, std::shared_ptr<V> >
getBulk(
int nrOfEntries)
926 std::map<void*, void*> mbuf;
927 std::map<std::shared_ptr<K>, std::shared_ptr<V> > result;
928 base_getBulk(nrOfEntries, mbuf);
929 for (
auto it = mbuf.begin(); it != mbuf.end(); ++it)
931 result[std::shared_ptr<K>((K*) it->first)] = std::shared_ptr<V>((V*) it->second);
941 std::vector<unsigned char>
execute(
const std::string& name,
const std::map<std::string, std::string>& args)
943 return base_execute(name, args);
952 std::vector<unsigned char>
execute(
const std::string& name,
const std::map<std::vector<char>, std::vector<char> >& args)
954 return base_execute(name,args);
964 return base_query(qr);
973 std::vector<unsigned char>
query(std::vector<unsigned char> qr,
size_t size)
975 return base_query_char(qr, size);
995 std::vector<void*> p;
998 std::set<std::shared_ptr<K> > result;
999 for (
size_t i = 0; i < p.size(); ++i)
1001 result.insert(std::shared_ptr<K>((K*) p.data()[i]));
1037 std::map<std::string, std::string>
stats()
1039 std::map<std::string, std::string> statistics;
1040 base_stats(statistics);
1061 std::future<void>
clearAsync(std::function<
void(
void)> success =
nullptr,
1062 std::function<
void(std::exception&)> fail =
nullptr)
1066 return goAsync(f, success, fail);
1090 std::vector<std::vector<char> > converterFactoryParams,
const std::function<
void()> &recoveryCallback =
1093 base_addClientListener(clientListener, filterFactoryParams, converterFactoryParams, recoveryCallback);
1105 base_removeClientListener(clientListener);
1108 #if !defined(SWIG) && !defined(SWIGCSHARP) 1116 base_addContinuousQueryListener(cql);
1118 template<
typename ... Params>
1126 base_addContinuousQueryListener(cql);
1134 template<
typename ... Params>
1137 base_removeClientListener(cql.cl);
1143 return base_getCacheTopologyInfo();
1153 base_withFlags(flags);
1163 template <
class M = JBossMarshaller>
1170 RemoteCacheBase(other), keyMarshaller(other.keyMarshaller), valueMarshaller(other.valueMarshaller)
1172 setMarshallers(
this, &keyMarshall, &valueMarshall, &keyUnmarshall, &valueUnmarshall);
1177 RemoteCacheBase::operator=(other);
1178 keyMarshaller = other.keyMarshaller;
1179 valueMarshaller = other.valueMarshaller;
1180 setMarshallers(
this, &keyMarshall, &valueMarshall, &keyUnmarshall, &valueUnmarshall);
1187 setMarshallers(
this, &keyMarshall, &valueMarshall, &keyUnmarshall, &valueUnmarshall);
1191 uint64_t toSeconds(uint64_t time,
TimeUnit unit)
1197 result = (uint64_t) ceil(time / 1000000000.0);
1200 result = (uint64_t) ceil(time / 1000000.0);
1203 result = (uint64_t) ceil(time / 1000.0);
1212 result = time * 3600;
1215 result = time * 86400;
1218 std::stringstream ss;
1219 ss <<
"Unhandled TimeUnit specified: " << unit <<
".";
1220 throw std::invalid_argument(ss.str());
1226 static void keyMarshall(
void *thisp,
const void* key, std::vector<char> &buf)
1230 static void valueMarshall(
void* thisp,
const void* val, std::vector<char> &buf)
1232 ((
RemoteCache<K, V> *) thisp)->valueMarshaller->marshall(*(
const V *) val, buf);
1234 static void* keyUnmarshall(
void *thisp,
const std::vector<char> &buf)
1238 static void* valueUnmarshall(
void* thisp,
const std::vector<char> &buf)
1243 std::shared_ptr<Marshaller<K> > keyMarshaller;
1244 std::shared_ptr<Marshaller<V> > valueMarshaller;
void putAll(const std::map< K, V > &map, uint64_t lifespan, TimeUnit lifespanUnit, uint64_t maxIdle, TimeUnit maxIdleUnit)
Definition: RemoteCache.h:477
std::future< V * > putAsync(const K &key, const V &val, uint64_t lifespan, TimeUnit lifespanUnit, std::function< V *(V *)> success=nullptr, std::function< V *(std::exception &)> fail=nullptr)
Definition: RemoteCache.h:298
std::map< std::shared_ptr< K >, std::shared_ptr< V > > getBulk(int nrOfEntries)
Definition: RemoteCache.h:924
std::future< bool > replaceWithVersionAsync(const K &key, const V &val, uint64_t version, uint64_t lifespan, uint64_t maxIdle, std::function< bool(bool)> success=nullptr, std::function< bool(std::exception &)> fail=nullptr)
Definition: RemoteCache.h:831
V * putIfAbsent(const K &key, const V &val, uint64_t lifespan, TimeUnit lifespanUnit)
Definition: RemoteCache.h:354
std::future< void > putAllAsync(const std::map< K, V > &map, uint64_t lifespan=0, uint64_t maxIdle=0, std::function< void()> success=nullptr, std::function< void(std::exception &)> fail=nullptr)
Definition: RemoteCache.h:500
std::future< V * > putIfAbsentAsync(const K &key, const V &val, uint64_t lifespan=0, uint64_t maxIdle=0, std::function< V *(V *)> success=nullptr, std::function< V *(std::exception &)> fail=nullptr)
Definition: RemoteCache.h:386
std::vector< unsigned char > query(std::vector< unsigned char > qr, size_t size)
Definition: RemoteCache.h:973
V * put(const K &key, const V &val, uint64_t lifespan, TimeUnit lifespanUnit, uint64_t maxIdle, TimeUnit maxIdleUnit)
Definition: RemoteCache.h:262
std::string getName()
Definition: RemoteCache.h:111
std::pair< std::shared_ptr< V >, VersionedValue > getWithVersion(const K &key)
Definition: RemoteCache.h:890
std::set< std::pair< K, V > > entrySet()
Definition: RemoteCache.h:982
static const char * getProtocolVersionCString()
Definition: Version.h:32
std::map< std::shared_ptr< K >, std::shared_ptr< V > > getAll(const std::set< K > &keySet)
Definition: RemoteCache.h:155
bool containsKey(const K &key)
Definition: RemoteCache.h:786
std::future< V * > replaceAsync(const K &key, const V &val, uint64_t lifespan, TimeUnit lifespanUnit, uint64_t maxIdle, TimeUnit maxIdleUnit, std::function< V *(V *)> success=nullptr, std::function< V *(std::exception &)> fail=nullptr)
Definition: RemoteCache.h:699
std::map< std::string, std::string > stats()
Definition: RemoteCache.h:1037
std::future< V * > putIfAbsentAsync(const K &key, const V &val, uint64_t lifespan, TimeUnit lifespanUnit, uint64_t maxIdle, TimeUnit maxIdleUnit, std::function< V *(V *)> success=nullptr, std::function< V *(std::exception &)> fail=nullptr)
Definition: RemoteCache.h:426
V * replace(const K &key, const V &oldVal, const V &val, uint64_t lifespan=0, uint64_t maxIdle=0)
Definition: RemoteCache.h:609
std::set< std::shared_ptr< K > > keySet()
Definition: RemoteCache.h:993
void putAll(const std::map< K, V > &map, uint64_t lifespan=0, uint64_t maxIdle=0)
Definition: RemoteCache.h:445
RemoteExecution< M > getRemoteExecution()
Definition: RemoteCache.h:1164
RemoteCache< K, V > & operator=(const RemoteCache &other)
Definition: RemoteCache.h:1175
std::future< void > putAllAsync(const std::map< K, V > &map, uint64_t lifespan, TimeUnit lifespanUnit, std::function< void(void)> success=nullptr, std::function< void(std::exception &)> fail=nullptr)
Definition: RemoteCache.h:520
std::vector< V > values()
Definition: RemoteCache.h:1027
void addContinuousQueryListener(ContinuousQueryListener< K, V > &cql)
Definition: RemoteCache.h:1114
V * putIfAbsent(const K &key, const V &val, uint64_t lifespan, TimeUnit lifespanUnit, uint64_t maxIdle, TimeUnit maxIdleUnit)
Definition: RemoteCache.h:370
std::map< std::shared_ptr< K >, std::shared_ptr< V > > getBulk()
Definition: RemoteCache.h:916
std::future< bool > removeWithVersionAsync(const K &key, uint64_t version, std::function< bool(bool)> success=nullptr, std::function< bool(std::exception &)> fail=nullptr)
Definition: RemoteCache.h:872
Definition: CacheClientListener.h:28
Definition: TimeUnit.h:14
Definition: TimeUnit.h:18
V * putIfAbsent(const K &key, const V &val, uint64_t lifespan=0, uint64_t maxIdle=0)
Definition: RemoteCache.h:340
Definition: TimeUnit.h:15
std::future< V * > putAsync(const K &key, const V &val, uint64_t lifespan=0, uint64_t maxIdle=0, std::function< V *(V *)> success=nullptr, std::function< V *(std::exception &)> fail=nullptr)
Definition: RemoteCache.h:278
Definition: AuthenticationConfiguration.h:10
V * replace(const K &key, const V &oldVal, const V &val, uint64_t lifespan, TimeUnit lifespanUnit)
Definition: RemoteCache.h:624
std::future< V * > putIfAbsentAsync(const K &key, const V &val, uint64_t lifespan, TimeUnit lifespanUnit, std::function< V *(V *)> success=nullptr, std::function< V *(std::exception &)> fail=nullptr)
Definition: RemoteCache.h:405
uint64_t size()
Definition: RemoteCache.h:1010
std::future< V * > getAsync(const K &key, std::function< V *(V *)> success=nullptr, std::function< V *(std::exception &)> fail=nullptr)
Definition: RemoteCache.h:185
void removeClientListener(ClientListener &clientListener)
Definition: RemoteCache.h:1103
std::future< V * > replaceAsync(const K &key, const V &oldVal, const V &val, uint64_t lifespan=0, uint64_t maxIdle=0, std::function< V *(V *)> success=nullptr, std::function< V *(std::exception &)> fail=nullptr)
Definition: RemoteCache.h:722
RemoteCache()
Definition: RemoteCache.h:1184
void addClientListener(ClientListener &clientListener, std::vector< std::vector< char > > filterFactoryParams, std::vector< std::vector< char > > converterFactoryParams, const std::function< void()> &recoveryCallback=nullptr)
Definition: RemoteCache.h:1089
std::vector< unsigned char > execute(const std::string &name, const std::map< std::string, std::string > &args)
Definition: RemoteCache.h:941
std::future< V * > replaceAsync(const K &key, const V &oldVal, const V &val, uint64_t lifespan, TimeUnit lifespanUnit, std::function< V *(V *)> success=nullptr, std::function< V *(std::exception &)> fail=nullptr)
Definition: RemoteCache.h:743
CacheTopologyInfo getCacheTopologyInfo()
Definition: RemoteCache.h:1141
void clear()
Definition: RemoteCache.h:1048
bool isEmpty()
Definition: RemoteCache.h:1019
std::future< void > clearAsync(std::function< void(void)> success=nullptr, std::function< void(std::exception &)> fail=nullptr)
Definition: RemoteCache.h:1061
std::future< V * > replaceAsync(const K &key, const V &val, uint64_t lifespan=0, uint64_t maxIdle=0, std::function< V *(V *)> success=nullptr, std::function< V *(std::exception &)> fail=nullptr)
Definition: RemoteCache.h:657
V * put(const K &key, const V &val, uint64_t lifespan, TimeUnit lifespanUnit)
Definition: RemoteCache.h:236
RemoteCache< K, V > & withFlags(Flag flags)
Definition: RemoteCache.h:1151
RemoteCache(const RemoteCache &other)
Definition: RemoteCache.h:1169
bool replaceWithVersion(const K &key, const V &val, uint64_t version, uint64_t lifespan=0, uint64_t maxIdle=0)
Definition: RemoteCache.h:813
std::string getVersion()
Definition: RemoteCache.h:121
Definition: RemoteCacheManager.h:38
Definition: TimeUnit.h:17
std::string getProtocolVersion()
Definition: RemoteCache.h:131
std::future< void > putAllAsync(const std::map< K, V > &map, uint64_t lifespan, TimeUnit lifespanUnit, uint64_t maxIdle, TimeUnit maxIdleUnit, std::function< void(void)> success=nullptr, std::function< void(std::exception &)> fail=nullptr)
Definition: RemoteCache.h:542
std::future< V * > removeAsync(const K &key, std::function< V *(V *)> success=nullptr, std::function< V *(std::exception &)> fail=nullptr)
Definition: RemoteCache.h:772
V * replace(const K &key, const V &oldVal, const V &val, uint64_t lifespan, TimeUnit lifespanUnit, uint64_t maxIdle, TimeUnit maxIdleUnit)
Definition: RemoteCache.h:640
Definition: ClientListener.h:35
void removeContinuousQueryListener(ContinuousQueryListener< Params... > &cql)
Definition: RemoteCache.h:1135
V * replace(const K &key, const V &val, uint64_t lifespan, TimeUnit lifespanUnit, uint64_t maxIdle, TimeUnit maxIdleUnit)
Definition: RemoteCache.h:593
void ping()
Definition: RemoteCache.h:1074
Definition: exceptions.h:117
std::future< V * > putAsync(const K &key, const V &val, uint64_t lifespan, TimeUnit lifespanUnit, uint64_t maxIdle, TimeUnit maxIdleUnit, std::function< V *(V *)> success=nullptr, std::function< V *(std::exception &)> fail=nullptr)
Definition: RemoteCache.h:320
QueryResponse query(const QueryRequest &qr)
Definition: RemoteCache.h:962
Definition: ContinuousQueryListener.h:34
static const char * getVersionCString()
Definition: Version.h:41
TimeUnit
Definition: TimeUnit.h:13
bool containsValue(const V &val)
Definition: RemoteCache.h:795
V * replace(const K &key, const V &val, uint64_t lifespan, TimeUnit lifespanUnit)
Definition: RemoteCache.h:577
Definition: TimeUnit.h:16
Definition: TimeUnit.h:19
Definition: TimeUnit.h:20
V * replace(const K &key, const V &val, uint64_t lifespan=0, uint64_t maxIdle=0)
Definition: RemoteCache.h:562
std::vector< unsigned char > execute(const std::string &name, const std::map< std::vector< char >, std::vector< char > > &args)
Definition: RemoteCache.h:952
std::pair< std::shared_ptr< V >, MetadataValue > getWithMetadata(const K &key)
Definition: RemoteCache.h:906
std::future< V * > replaceAsync(const K &key, const V &val, uint64_t lifespan, TimeUnit lifespanUnit, std::function< V *(V *)> success=nullptr, std::function< V *(std::exception &)> fail=nullptr)
Definition: RemoteCache.h:677
Definition: RemoteExecution.h:29
Definition: VersionedValue.h:9
V * put(const K &key, const V &val, uint64_t lifespan=0, uint64_t maxIdle=0)
Definition: RemoteCache.h:213
void addContinuousQueryListener(ContinuousQueryListener< K, V, Params... > &cql)
Definition: RemoteCache.h:1124
void putAll(const std::map< K, V > &map, uint64_t lifespan, TimeUnit lifespanUnit)
Definition: RemoteCache.h:460
bool removeWithVersion(const K &key, uint64_t version)
Definition: RemoteCache.h:858