VMware VMware GemFire Native C++ Reference 10.4.3
Loading...
Searching...
No Matches
Region.hpp
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. 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#pragma once
19
20#ifndef GEODE_REGION_H_
21#define GEODE_REGION_H_
22
23#include <chrono>
24#include <iosfwd>
25#include <memory>
26
27#include "AttributesMutator.hpp"
28#include "CacheListener.hpp"
29#include "CacheLoader.hpp"
30#include "CacheStatistics.hpp"
31#include "CacheWriter.hpp"
32#include "CacheableBuiltins.hpp"
33#include "CacheableKey.hpp"
34#include "CacheableString.hpp"
35#include "ExceptionTypes.hpp"
36#include "PartitionResolver.hpp"
37#include "Query.hpp"
38#include "RegionAttributes.hpp"
40#include "RegionEntry.hpp"
41#include "Serializable.hpp"
42#include "internal/geode_globals.hpp"
43
44namespace apache {
45namespace geode {
46namespace client {
47
48class Pool;
49class AttributesMutator;
50class Cache;
51class CacheStatistics;
52class CacheableKey;
53class RegionAttributes;
54class RegionEntry;
55class RegionService;
56class SelectResults;
57class Serializable;
58
59static constexpr std::chrono::milliseconds DEFAULT_RESPONSE_TIMEOUT =
60 std::chrono::seconds(15);
61
95class APACHE_GEODE_EXPORT Region : public std::enable_shared_from_this<Region> {
98 public:
100 virtual const std::string& getName() const = 0;
101 // virtual uint64_t getUpdateReceived() const { return 0; };
102
106 virtual const std::string& getFullPath() const = 0;
107
111 virtual std::shared_ptr<Region> getParentRegion() const = 0;
112
115 virtual const RegionAttributes& getAttributes() const = 0;
116
121 virtual std::shared_ptr<AttributesMutator> getAttributesMutator() const = 0;
122
123 // virtual void updateAccessOrModifiedTime() = 0;
124
125 virtual std::shared_ptr<CacheStatistics> getStatistics() const = 0;
126
143 virtual void invalidateRegion(
144 const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
145
166 const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
167
204 virtual void destroyRegion(
205 const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
213 virtual void clear(
214 const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
222 virtual void localClear(
223 const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
224
244 virtual void localDestroyRegion(
245 const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
246
249 virtual std::shared_ptr<Region> getSubregion(const std::string& path) = 0;
250
252 virtual std::shared_ptr<Region> createSubregion(
253 const std::string& subregionName, RegionAttributes aRegionAttributes) = 0;
254
261 virtual std::vector<std::shared_ptr<Region>> subregions(
262 const bool recursive) = 0;
263
267 virtual std::shared_ptr<RegionEntry> getEntry(
268 const std::shared_ptr<CacheableKey>& key) = 0;
269
271 template <class KEYTYPE>
272 inline std::shared_ptr<RegionEntry> getEntry(const KEYTYPE& key) {
273 return getEntry(CacheableKey::create(key));
274 }
275
317 virtual std::shared_ptr<Cacheable> get(
318 const std::shared_ptr<CacheableKey>& key,
319 const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
320
322 template <class KEYTYPE>
323 inline std::shared_ptr<Cacheable> get(
324 const KEYTYPE& key,
325 const std::shared_ptr<Serializable>& callbackArg = nullptr) {
326 return get(CacheableKey::create(key), callbackArg);
327 }
328
374 virtual void put(
375 const std::shared_ptr<CacheableKey>& key,
376 const std::shared_ptr<Cacheable>& value,
377 const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
378
380 template <class KEYTYPE, class VALUETYPE>
381 inline void put(const KEYTYPE& key, const VALUETYPE& value,
382 const std::shared_ptr<Serializable>& arg = nullptr) {
383 put(CacheableKey::create(key), Serializable::create(value), arg);
384 }
385
387 template <class KEYTYPE>
388 inline void put(const KEYTYPE& key, const std::shared_ptr<Cacheable>& value,
389 const std::shared_ptr<Serializable>& arg = nullptr) {
390 put(CacheableKey::create(key), value, arg);
391 }
392
394 template <class VALUETYPE>
395 inline void put(const std::shared_ptr<CacheableKey>& key,
396 const VALUETYPE& value,
397 const std::shared_ptr<Serializable>& arg = nullptr) {
398 put(key, Serializable::create(value), arg);
399 }
400
419 virtual void putAll(
420 const HashMapOfCacheable& map,
421 std::chrono::milliseconds timeout = DEFAULT_RESPONSE_TIMEOUT,
422 const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
423
448 virtual void localPut(
449 const std::shared_ptr<CacheableKey>& key,
450 const std::shared_ptr<Cacheable>& value,
451 const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
452
454 template <class KEYTYPE, class VALUETYPE>
455 inline void localPut(const KEYTYPE& key, const VALUETYPE& value,
456 const std::shared_ptr<Serializable>& arg = nullptr) {
457 localPut(CacheableKey::create(key), Serializable::create(value), arg);
458 }
459
461 template <class KEYTYPE>
462 inline void localPut(const KEYTYPE& key,
463 const std::shared_ptr<Cacheable>& value,
464 const std::shared_ptr<Serializable>& arg = nullptr) {
465 localPut(CacheableKey::create(key), value, arg);
466 }
467
469 template <class VALUETYPE>
470 inline void localPut(const std::shared_ptr<CacheableKey>& key,
471 const VALUETYPE& value,
472 const std::shared_ptr<Serializable>& arg = nullptr) {
473 localPut(key, Serializable::create(value), arg);
474 }
475
522 virtual void create(
523 const std::shared_ptr<CacheableKey>& key,
524 const std::shared_ptr<Cacheable>& value,
525 const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
526
528 template <class KEYTYPE, class VALUETYPE>
529 inline void create(const KEYTYPE& key, const VALUETYPE& value,
530 const std::shared_ptr<Serializable>& arg = nullptr) {
531 create(CacheableKey::create(key), Serializable::create(value), arg);
532 }
533
535 template <class KEYTYPE>
536 inline void create(const KEYTYPE& key,
537 const std::shared_ptr<Cacheable>& value,
538 const std::shared_ptr<Serializable>& arg = nullptr) {
539 create(CacheableKey::create(key), value, arg);
540 }
541
543 template <class VALUETYPE>
544 inline void create(const std::shared_ptr<CacheableKey>& key,
545 const VALUETYPE& value,
546 const std::shared_ptr<Serializable>& arg = nullptr) {
547 create(key, Serializable::create(value), arg);
548 }
549
575 virtual void localCreate(
576 const std::shared_ptr<CacheableKey>& key,
577 const std::shared_ptr<Cacheable>& value,
578 const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
579
581 template <class KEYTYPE, class VALUETYPE>
582 inline void localCreate(const KEYTYPE& key, const VALUETYPE& value,
583 const std::shared_ptr<Serializable>& arg = nullptr) {
584 localCreate(CacheableKey::create(key), Serializable::create(value), arg);
585 }
586
588 template <class KEYTYPE>
589 inline void localCreate(const KEYTYPE& key,
590 const std::shared_ptr<Cacheable>& value,
591 const std::shared_ptr<Serializable>& arg = nullptr) {
592 localCreate(CacheableKey::create(key), value, arg);
593 }
594
596 template <class VALUETYPE>
597 inline void localCreate(const std::shared_ptr<CacheableKey>& key,
598 const VALUETYPE& value,
599 const std::shared_ptr<Serializable>& arg = nullptr) {
600 localCreate(key, Serializable::create(value), arg);
601 }
602
625 virtual void invalidate(
626 const std::shared_ptr<CacheableKey>& key,
627 const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
628
630 template <class KEYTYPE>
631 inline void invalidate(const KEYTYPE& key,
632 const std::shared_ptr<Serializable>& arg = nullptr) {
633 invalidate(CacheableKey::create(key), arg);
634 }
635
656 virtual void localInvalidate(
657 const std::shared_ptr<CacheableKey>& key,
658 const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
659
661 template <class KEYTYPE>
662 inline void localInvalidate(
663 const KEYTYPE& key, const std::shared_ptr<Serializable>& arg = nullptr) {
664 localInvalidate(CacheableKey::create(key), arg);
665 }
666
711 virtual void destroy(
712 const std::shared_ptr<CacheableKey>& key,
713 const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
714
716 template <class KEYTYPE>
717 inline void destroy(const KEYTYPE& key,
718 const std::shared_ptr<Serializable>& arg = nullptr) {
719 destroy(CacheableKey::create(key), arg);
720 }
721
746 virtual void localDestroy(
747 const std::shared_ptr<CacheableKey>& key,
748 const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
749
751 template <class KEYTYPE>
752 inline void localDestroy(const KEYTYPE& key,
753 const std::shared_ptr<Serializable>& arg = nullptr) {
754 localDestroy(CacheableKey::create(key), arg);
755 }
756
805 virtual bool remove(
806 const std::shared_ptr<CacheableKey>& key,
807 const std::shared_ptr<Cacheable>& value,
808 const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
809
811 template <class KEYTYPE, class VALUETYPE>
812 inline bool remove(const KEYTYPE& key, const VALUETYPE& value,
813 const std::shared_ptr<Serializable>& arg = nullptr) {
814 return remove(CacheableKey::create(key), Serializable::create(value), arg);
815 }
816
818 template <class KEYTYPE>
819 inline bool remove(const KEYTYPE& key,
820 const std::shared_ptr<Cacheable>& value,
821 const std::shared_ptr<Serializable>& arg = nullptr) {
822 return remove(CacheableKey::create(key), value, arg);
823 }
824
826 template <class VALUETYPE>
827 inline bool remove(const std::shared_ptr<CacheableKey>& key,
828 const VALUETYPE& value,
829 const std::shared_ptr<Serializable>& arg = nullptr) {
830 return remove(key, Serializable::create(value), arg);
831 }
832
833 bool remove(const std::shared_ptr<CacheableKey>& key) {
834 return removeEx(key);
835 }
836
838 template <class KEYTYPE>
839 inline bool remove(const KEYTYPE& key) {
840 return remove(CacheableKey::create(key));
841 }
842
889 virtual bool removeEx(
890 const std::shared_ptr<CacheableKey>& key,
891 const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
892
894 template <class KEYTYPE>
895 inline bool removeEx(const KEYTYPE& key,
896 const std::shared_ptr<Serializable>& arg = nullptr) {
897 return removeEx(CacheableKey::create(key), arg);
898 }
899
927 virtual bool localRemove(
928 const std::shared_ptr<CacheableKey>& key,
929 const std::shared_ptr<Cacheable>& value,
930 const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
931
933 template <class KEYTYPE, class VALUETYPE>
934 inline bool localRemove(const KEYTYPE& key, const VALUETYPE& value,
935 const std::shared_ptr<Serializable>& arg = nullptr) {
936 return localRemove(CacheableKey::create(key), Serializable::create(value),
937 arg);
938 }
939
941 template <class KEYTYPE>
942 inline bool localRemove(const KEYTYPE& key,
943 const std::shared_ptr<Cacheable>& value,
944 const std::shared_ptr<Serializable>& arg = nullptr) {
945 return localRemove(CacheableKey::create(key), value, arg);
946 }
947
949 template <class VALUETYPE>
950 inline bool localRemove(const std::shared_ptr<CacheableKey>& key,
951 const VALUETYPE& value,
952 const std::shared_ptr<Serializable>& arg = nullptr) {
953 return localRemove(key, Serializable::create(value), arg);
954 }
955
982 virtual bool localRemoveEx(
983 const std::shared_ptr<CacheableKey>& key,
984 const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
985
987 template <class KEYTYPE>
988 inline bool localRemoveEx(
989 const KEYTYPE& key, const std::shared_ptr<Serializable>& arg = nullptr) {
990 return localRemoveEx(CacheableKey::create(key), arg);
991 }
992
997 virtual std::vector<std::shared_ptr<CacheableKey>> keys() = 0;
998
1024 virtual std::vector<std::shared_ptr<CacheableKey>> serverKeys() = 0;
1025
1030 virtual std::vector<std::shared_ptr<Cacheable>> values() = 0;
1031
1032 virtual std::vector<std::shared_ptr<RegionEntry>> entries(bool recursive) = 0;
1033
1038 virtual RegionService& getRegionService() const = 0;
1039
1040 virtual bool isDestroyed() const = 0;
1041
1048 const std::shared_ptr<CacheableKey>& keyPtr) const = 0;
1049
1056 template <class KEYTYPE>
1057 inline bool containsValueForKey(const KEYTYPE& key) const {
1058 return containsValueForKey(CacheableKey::create(key));
1059 }
1060
1066 virtual bool containsKey(
1067 const std::shared_ptr<CacheableKey>& keyPtr) const = 0;
1075 const std::shared_ptr<CacheableKey>& keyPtr) const = 0;
1082 virtual std::vector<std::shared_ptr<CacheableKey>> getInterestList()
1083 const = 0;
1090 virtual std::vector<std::shared_ptr<CacheableString>> getInterestListRegex()
1091 const = 0;
1098 template <class KEYTYPE>
1099 inline bool containsKey(const KEYTYPE& key) const {
1100 return containsKey(CacheableKey::create(key));
1101 }
1102
1135 virtual void registerKeys(
1136 const std::vector<std::shared_ptr<CacheableKey>>& keys,
1137 bool isDurable = false, bool getInitialValues = false,
1138 bool receiveValues = true) = 0;
1139
1162 virtual void unregisterKeys(
1163 const std::vector<std::shared_ptr<CacheableKey>>& keys) = 0;
1164
1194 virtual void registerAllKeys(bool isDurable = false,
1195 bool getInitialValues = false,
1196 bool receiveValues = true) = 0;
1197
1217 virtual void unregisterAllKeys() = 0;
1218
1256 virtual void registerRegex(const std::string& regex, bool isDurable = false,
1257 bool getInitialValues = false,
1258 bool receiveValues = true) = 0;
1259
1284 virtual void unregisterRegex(const std::string& regex) = 0;
1285
1328 virtual HashMapOfCacheable getAll(
1329 const std::vector<std::shared_ptr<CacheableKey>>& keys,
1330 const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
1331
1358 virtual std::shared_ptr<SelectResults> query(
1359 const std::string& predicate,
1360 std::chrono::milliseconds timeout = DEFAULT_QUERY_RESPONSE_TIMEOUT) = 0;
1361
1382 virtual bool existsValue(
1383 const std::string& predicate,
1384 std::chrono::milliseconds timeout = DEFAULT_QUERY_RESPONSE_TIMEOUT) = 0;
1385
1408 virtual std::shared_ptr<Serializable> selectValue(
1409 const std::string& predicate,
1410 std::chrono::milliseconds timeout = DEFAULT_QUERY_RESPONSE_TIMEOUT) = 0;
1411
1439 virtual void removeAll(
1440 const std::vector<std::shared_ptr<CacheableKey>>& keys,
1441 const std::shared_ptr<Serializable>& aCallbackArgument = nullptr) = 0;
1442
1447 virtual uint32_t size() = 0;
1448
1449 virtual const std::shared_ptr<Pool>& getPool() const = 0;
1450
1451 Cache& getCache();
1452
1453 Region(const Region&) = delete;
1454 Region& operator=(const Region&) = delete;
1455
1456 protected:
1457 explicit Region(CacheImpl* cacheImpl);
1458 virtual ~Region() noexcept;
1459
1460 CacheImpl* m_cacheImpl;
1461};
1462
1463} // namespace client
1464} // namespace geode
1465} // namespace apache
1466
1467#endif // GEODE_REGION_H_
Contains generic template definitions for Cacheable types and instantiations for built-in types.
Caches are obtained from the create method on the CacheFactory#create class.
Definition Cache.hpp:65
This class manages subregions and cached data.
Definition Region.hpp:95
virtual std::shared_ptr< SelectResults > query(const std::string &predicate, std::chrono::milliseconds timeout=DEFAULT_QUERY_RESPONSE_TIMEOUT)=0
Executes the query on the server based on the predicate.
virtual std::vector< std::shared_ptr< CacheableKey > > keys()=0
Return all the keys in the local process for this region.
virtual void destroyRegion(const std::shared_ptr< Serializable > &aCallbackArgument=nullptr)=0
Destroys the whole region and provides a user-defined parameter object to any CacheWriter invoked in ...
virtual bool containsKeyOnServer(const std::shared_ptr< CacheableKey > &keyPtr) const =0
The cache of the server, to which it is connected with, is searched for the key to see if the key is ...
virtual std::vector< std::shared_ptr< CacheableString > > getInterestListRegex() const =0
Returns the list of regular expresssions on which this client is interested and will be notified of c...
void localCreate(const KEYTYPE &key, const VALUETYPE &value, const std::shared_ptr< Serializable > &arg=nullptr)
Convenience method allowing both key and value to be a const char*.
Definition Region.hpp:582
virtual void destroy(const std::shared_ptr< CacheableKey > &key, const std::shared_ptr< Serializable > &aCallbackArgument=nullptr)=0
Destroys the entry with the specified key, and provides a user-defined parameter object to any CacheW...
virtual const RegionAttributes & getAttributes() const =0
Return the RegionAttributes for this region.
void localInvalidate(const KEYTYPE &key, const std::shared_ptr< Serializable > &arg=nullptr)
Convenience method allowing key to be a const char*.
Definition Region.hpp:662
virtual RegionService & getRegionService() const =0
Returns the cache associated with this region.
virtual std::shared_ptr< RegionEntry > getEntry(const std::shared_ptr< CacheableKey > &key)=0
Return the meta-object RegionEntry for key.
void destroy(const KEYTYPE &key, const std::shared_ptr< Serializable > &arg=nullptr)
Convenience method allowing key to be a const char*.
Definition Region.hpp:717
virtual void unregisterAllKeys()=0
Registers to get updates for all keys from the server.
virtual const std::string & getName() const =0
Public Methods.
virtual bool existsValue(const std::string &predicate, std::chrono::milliseconds timeout=DEFAULT_QUERY_RESPONSE_TIMEOUT)=0
Executes the query on the server based on the predicate and returns whether any result exists.
virtual void localClear(const std::shared_ptr< Serializable > &aCallbackArgument=nullptr)=0
Removes all entries from this region and provides a user-defined parameter object to any CacheWriter ...
virtual void clear(const std::shared_ptr< Serializable > &aCallbackArgument=nullptr)=0
Removes all entries from this region and provides a user-defined parameter object to any CacheWriter ...
virtual const std::string & getFullPath() const =0
return the full path of the region as can be used to lookup the region from Cache::getRegion.
void localDestroy(const KEYTYPE &key, const std::shared_ptr< Serializable > &arg=nullptr)
Convenience method allowing key to be a const char*.
Definition Region.hpp:752
virtual void localPut(const std::shared_ptr< CacheableKey > &key, const std::shared_ptr< Cacheable > &value, const std::shared_ptr< Serializable > &aCallbackArgument=nullptr)=0
Places a new value into an entry in this region with the specified key in the local cache only,...
std::shared_ptr< Cacheable > get(const KEYTYPE &key, const std::shared_ptr< Serializable > &callbackArg=nullptr)
Convenience method allowing key to be a const char*.
Definition Region.hpp:323
bool localRemoveEx(const KEYTYPE &key, const std::shared_ptr< Serializable > &arg=nullptr)
Convenience method allowing key to be a const char*.
Definition Region.hpp:988
bool remove(const std::shared_ptr< CacheableKey > &key, const VALUETYPE &value, const std::shared_ptr< Serializable > &arg=nullptr)
Convenience method allowing value to be a const char*.
Definition Region.hpp:827
virtual bool localRemove(const std::shared_ptr< CacheableKey > &key, const std::shared_ptr< Cacheable > &value, const std::shared_ptr< Serializable > &aCallbackArgument=nullptr)=0
Removes the entry with the specified key and value in the local cache only, and provides a user-defin...
bool localRemove(const KEYTYPE &key, const VALUETYPE &value, const std::shared_ptr< Serializable > &arg=nullptr)
Convenience method allowing both key and value to be a const char*.
Definition Region.hpp:934
bool containsKey(const KEYTYPE &key) const
Convenience method allowing key to be a const char* This operations checks for the key in the local c...
Definition Region.hpp:1099
void create(const KEYTYPE &key, const VALUETYPE &value, const std::shared_ptr< Serializable > &arg=nullptr)
Convenience method allowing both key and value to be a const char*.
Definition Region.hpp:529
virtual std::shared_ptr< Serializable > selectValue(const std::string &predicate, std::chrono::milliseconds timeout=DEFAULT_QUERY_RESPONSE_TIMEOUT)=0
Executes the query on the server based on the predicate and returns a single result value.
bool containsValueForKey(const KEYTYPE &key) const
Convenience method allowing key to be a const char* This operations checks for the value in the local...
Definition Region.hpp:1057
void localCreate(const std::shared_ptr< CacheableKey > &key, const VALUETYPE &value, const std::shared_ptr< Serializable > &arg=nullptr)
Convenience method allowing value to be a const char*.
Definition Region.hpp:597
virtual void removeAll(const std::vector< std::shared_ptr< CacheableKey > > &keys, const std::shared_ptr< Serializable > &aCallbackArgument=nullptr)=0
Removes all of the entries for the specified keys from this region.
void localPut(const std::shared_ptr< CacheableKey > &key, const VALUETYPE &value, const std::shared_ptr< Serializable > &arg=nullptr)
Convenience method allowing value to be a const char*.
Definition Region.hpp:470
void put(const std::shared_ptr< CacheableKey > &key, const VALUETYPE &value, const std::shared_ptr< Serializable > &arg=nullptr)
Convenience method allowing value to be a const char*.
Definition Region.hpp:395
virtual void put(const std::shared_ptr< CacheableKey > &key, const std::shared_ptr< Cacheable > &value, const std::shared_ptr< Serializable > &aCallbackArgument=nullptr)=0
Places a new value into an entry in this region with the specified key, providing a user-defined para...
void create(const std::shared_ptr< CacheableKey > &key, const VALUETYPE &value, const std::shared_ptr< Serializable > &arg=nullptr)
Convenience method allowing value to be a const char*.
Definition Region.hpp:544
virtual bool containsKey(const std::shared_ptr< CacheableKey > &keyPtr) const =0
Only the client's cache is searched for the key.
bool removeEx(const KEYTYPE &key, const std::shared_ptr< Serializable > &arg=nullptr)
Convenience method allowing key to be a const char*.
Definition Region.hpp:895
virtual void localDestroyRegion(const std::shared_ptr< Serializable > &aCallbackArgument=nullptr)=0
Destroys the whole region and provides a user-defined parameter object to any CacheWriter invoked in ...
void localPut(const KEYTYPE &key, const VALUETYPE &value, const std::shared_ptr< Serializable > &arg=nullptr)
Convenience method allowing both key and value to be a const char*.
Definition Region.hpp:455
virtual void invalidateRegion(const std::shared_ptr< Serializable > &aCallbackArgument=nullptr)=0
Invalidates this region.
virtual void unregisterKeys(const std::vector< std::shared_ptr< CacheableKey > > &keys)=0
Unregisters an array of keys to stop getting updates for them.
void put(const KEYTYPE &key, const VALUETYPE &value, const std::shared_ptr< Serializable > &arg=nullptr)
Convenience method allowing both key and value to be a const char*.
Definition Region.hpp:381
void localPut(const KEYTYPE &key, const std::shared_ptr< Cacheable > &value, const std::shared_ptr< Serializable > &arg=nullptr)
Convenience method allowing key to be a const char*.
Definition Region.hpp:462
void localCreate(const KEYTYPE &key, const std::shared_ptr< Cacheable > &value, const std::shared_ptr< Serializable > &arg=nullptr)
Convenience method allowing key to be a const char*.
Definition Region.hpp:589
virtual bool localRemoveEx(const std::shared_ptr< CacheableKey > &key, const std::shared_ptr< Serializable > &aCallbackArgument=nullptr)=0
Removes the entry with the specified key in the local cache only, and provides a user-defined paramet...
bool remove(const KEYTYPE &key)
Convenience method allowing both key and value to be a const char*.
Definition Region.hpp:839
virtual void registerAllKeys(bool isDurable=false, bool getInitialValues=false, bool receiveValues=true)=0
Registers to get updates for all keys from the server.
virtual std::vector< std::shared_ptr< CacheableKey > > serverKeys()=0
Return the set of keys defined in the server process associated to this client and region.
virtual void registerKeys(const std::vector< std::shared_ptr< CacheableKey > > &keys, bool isDurable=false, bool getInitialValues=false, bool receiveValues=true)=0
Registers an array of keys for getting updates from the server.
virtual void create(const std::shared_ptr< CacheableKey > &key, const std::shared_ptr< Cacheable > &value, const std::shared_ptr< Serializable > &aCallbackArgument=nullptr)=0
Creates a new entry in this region with the specified key and value, providing a user-defined paramet...
virtual void localInvalidateRegion(const std::shared_ptr< Serializable > &aCallbackArgument=nullptr)=0
Invalidates this region.
void invalidate(const KEYTYPE &key, const std::shared_ptr< Serializable > &arg=nullptr)
Convenience method allowing key to be a const char*.
Definition Region.hpp:631
virtual bool removeEx(const std::shared_ptr< CacheableKey > &key, const std::shared_ptr< Serializable > &aCallbackArgument=nullptr)=0
Removes the entry with the specified key and provides a user-defined parameter object to any CacheWri...
virtual bool remove(const std::shared_ptr< CacheableKey > &key, const std::shared_ptr< Cacheable > &value, const std::shared_ptr< Serializable > &aCallbackArgument=nullptr)=0
Removes the entry with the specified key, value and provides a user-defined parameter object to any C...
virtual std::vector< std::shared_ptr< Cacheable > > values()=0
Return all values in the local process for this region.
virtual uint32_t size()=0
Get the size of region.
virtual std::shared_ptr< Region > getSubregion(const std::string &path)=0
Returns the subregion identified by the path, nullptr if no such subregion.
virtual void invalidate(const std::shared_ptr< CacheableKey > &key, const std::shared_ptr< Serializable > &aCallbackArgument=nullptr)=0
Invalidates the entry with the specified key, and provides a user-defined argument to the CacheListen...
virtual std::shared_ptr< Cacheable > get(const std::shared_ptr< CacheableKey > &key, const std::shared_ptr< Serializable > &aCallbackArgument=nullptr)=0
Returns the value associated with the specified key, passing the callback argument to any cache loade...
bool localRemove(const KEYTYPE &key, const std::shared_ptr< Cacheable > &value, const std::shared_ptr< Serializable > &arg=nullptr)
Convenience method allowing key to be a const char*.
Definition Region.hpp:942
virtual void localCreate(const std::shared_ptr< CacheableKey > &key, const std::shared_ptr< Cacheable > &value, const std::shared_ptr< Serializable > &aCallbackArgument=nullptr)=0
Creates a new entry in this region with the specified key and value in the local cache only,...
virtual std::shared_ptr< Region > createSubregion(const std::string &subregionName, RegionAttributes aRegionAttributes)=0
Creates a subregion with the specified attributes.
virtual HashMapOfCacheable getAll(const std::vector< std::shared_ptr< CacheableKey > > &keys, const std::shared_ptr< Serializable > &aCallbackArgument=nullptr)=0
Gets values for an array of keys from the local cache or server.
virtual void registerRegex(const std::string &regex, bool isDurable=false, bool getInitialValues=false, bool receiveValues=true)=0
Registers a regular expression to match with keys to get updates from the server.
bool remove(const KEYTYPE &key, const VALUETYPE &value, const std::shared_ptr< Serializable > &arg=nullptr)
Convenience method allowing both key and value to be a const char*.
Definition Region.hpp:812
virtual std::vector< std::shared_ptr< Region > > subregions(const bool recursive)=0
Populates the passed in std::vector<std::shared_ptr<Region>> with subregions of the current region.
virtual void putAll(const HashMapOfCacheable &map, std::chrono::milliseconds timeout=DEFAULT_RESPONSE_TIMEOUT, const std::shared_ptr< Serializable > &aCallbackArgument=nullptr)=0
Places a set of new values in this region with the specified keys given as a map of key/value pairs.
virtual std::vector< std::shared_ptr< CacheableKey > > getInterestList() const =0
Returns the list of keys on which this client is interested and will be notified of changes.
void create(const KEYTYPE &key, const std::shared_ptr< Cacheable > &value, const std::shared_ptr< Serializable > &arg=nullptr)
Convenience method allowing key to be a const char*.
Definition Region.hpp:536
virtual std::shared_ptr< Region > getParentRegion() const =0
Returns the parent region, or nullptr if a root region.
std::shared_ptr< RegionEntry > getEntry(const KEYTYPE &key)
Convenience method allowing key to be a const char*.
Definition Region.hpp:272
bool remove(const KEYTYPE &key, const std::shared_ptr< Cacheable > &value, const std::shared_ptr< Serializable > &arg=nullptr)
Convenience method allowing key to be a const char*.
Definition Region.hpp:819
virtual void localDestroy(const std::shared_ptr< CacheableKey > &key, const std::shared_ptr< Serializable > &aCallbackArgument=nullptr)=0
Destroys the entry with the specified key in the local cache only, and provides a user-defined parame...
virtual std::shared_ptr< AttributesMutator > getAttributesMutator() const =0
Return the a mutator object for changing a subset of the region attributes.
virtual void unregisterRegex(const std::string &regex)=0
Unregisters a regular expression to stop getting updates for keys from the server.
virtual void localInvalidate(const std::shared_ptr< CacheableKey > &key, const std::shared_ptr< Serializable > &aCallbackArgument=nullptr)=0
Invalidates the entry with the specified key in the local cache only, and provides a user-defined arg...
void put(const KEYTYPE &key, const std::shared_ptr< Cacheable > &value, const std::shared_ptr< Serializable > &arg=nullptr)
Convenience method allowing key to be a const char*.
Definition Region.hpp:388
virtual bool containsValueForKey(const std::shared_ptr< CacheableKey > &keyPtr) const =0
This operations checks for the value in the local cache .
bool localRemove(const std::shared_ptr< CacheableKey > &key, const VALUETYPE &value, const std::shared_ptr< Serializable > &arg=nullptr)
Convenience method allowing value to be a const char*.
Definition Region.hpp:950
Defines attributes for configuring a region.
Definition RegionAttributes.hpp:77
A RegionService provides access to existing regions that exist in a Geode cache.
Definition RegionService.hpp:58

Apache Geode C++ Cache API Documentation