Hazelcast C++ Client
Hazelcast C++ Client Library
hazelcast::client::hazelcast_client Class Reference

Public Member Functions

const std::string & get_name () const
 Returns the name of this client instance. More...
 
template<typename T >
boost::shared_future< std::shared_ptr< T > > get_distributed_object (const std::string &name)
 
boost::shared_future< std::shared_ptr< imap > > get_map (const std::string &name)
 Returns the distributed map instance with the specified name. More...
 
boost::shared_future< std::shared_ptr< multi_map > > get_multi_map (const std::string &name)
 Returns the distributed multimap instance with the specified name. More...
 
boost::shared_future< std::shared_ptr< replicated_map > > get_replicated_map (const std::string &name)
 
boost::shared_future< std::shared_ptr< iqueue > > get_queue (const std::string &name)
 Returns the distributed queue instance with the specified name. More...
 
boost::shared_future< std::shared_ptr< iset > > get_set (const std::string &name)
 Returns the distributed set instance with the specified name. More...
 
boost::shared_future< std::shared_ptr< ilist > > get_list (const std::string &name)
 Returns the distributed list instance with the specified name. More...
 
boost::shared_future< std::shared_ptr< itopic > > get_topic (const std::string &name)
 Returns the distributed topic instance with the specified name. More...
 
boost::shared_future< std::shared_ptr< reliable_topic > > get_reliable_topic (const std::string &name)
 Returns the distributed topic instance with the specified name. More...
 
boost::shared_future< std::shared_ptr< flake_id_generator > > get_flake_id_generator (const std::string &name)
 Returns a generator that creates a cluster-wide unique IDs. More...
 
boost::shared_future< std::shared_ptr< pn_counter > > get_pn_counter (const std::string &name)
 Obtain a pn_counter with the given name. More...
 
boost::shared_future< std::shared_ptr< ringbuffer > > get_ringbuffer (const std::string &name)
 Returns the distributed ringbuffer instance with the specified name. More...
 
boost::shared_future< std::shared_ptr< iexecutor_service > > get_executor_service (const std::string &name)
 Creates or returns the distributed executor service for the given name. More...
 
client_configget_client_config ()
 
transaction_context new_transaction_context ()
 Creates a new transaction_context associated with the current thread using default options. More...
 
transaction_context new_transaction_context (const transaction_options &options)
 Creates a new transaction_context associated with the current thread with given options. More...
 
clusterget_cluster ()
 Returns the Cluster that connected Hazelcast instance is a part of. More...
 
local_endpoint get_local_endpoint () const
 Returns the local endpoint which this HazelcastInstance belongs to. More...
 
boost::uuids::uuid add_lifecycle_listener (lifecycle_listener &&lifecycle_listener)
 Add listener to listen lifecycle events. More...
 
bool remove_lifecycle_listener (const boost::uuids::uuid &registration_id)
 Remove lifecycle listener. More...
 
boost::future< void > shutdown ()
 Shuts down this hazelcast_client.
 
spi::lifecycle_service & get_lifecycle_service ()
 Returns the lifecycle service for this instance. More...
 
cp::cp_subsystemget_cp_subsystem ()
 

Friends

class spi::ClientContext
 
boost::future< hazelcast_clienthazelcast::new_client ()
 
boost::future< hazelcast_clienthazelcast::new_client (hazelcast::client::client_config config)
 

Detailed Description

Definition at line 62 of file hazelcast_client.h.

Member Function Documentation

◆ add_lifecycle_listener()

boost::uuids::uuid hazelcast::client::hazelcast_client::add_lifecycle_listener ( lifecycle_listener &&  lifecycle_listener)

Add listener to listen lifecycle events.

Warning 1: If listener should do a time consuming operation, off-load the operation to another thread. otherwise it will slow down the system.

Warning 2: Do not make a call to hazelcast. It can cause deadlock.

Parameters
lifecycleListenerListener object

Definition at line 100 of file client_impl.cpp.

100  {
101  return client_impl_->add_lifecycle_listener(std::move(lifecycle_listener));
102  }

◆ get_client_config()

client_config & hazelcast::client::hazelcast_client::get_client_config ( )
Returns
configuration of this Hazelcast client.

Definition at line 84 of file client_impl.cpp.

84  {
85  return client_impl_->get_client_config();
86  }

◆ get_cluster()

cluster & hazelcast::client::hazelcast_client::get_cluster ( )

Returns the Cluster that connected Hazelcast instance is a part of.

Cluster interface allows you to add listener for membership events and learn more about the cluster.

Returns
cluster

Definition at line 96 of file client_impl.cpp.

96  {
97  return client_impl_->get_cluster();
98  }

◆ get_cp_subsystem()

cp::cp_subsystem & hazelcast::client::hazelcast_client::get_cp_subsystem ( )
Returns
the CP subsystem that offers a set of in-memory linearizable data structures

Definition at line 122 of file client_impl.cpp.

122  {
123  return client_impl_->get_cp_subsystem();
124  }

◆ get_distributed_object()

template<typename T >
boost::shared_future<std::shared_ptr<T> > hazelcast::client::hazelcast_client::get_distributed_object ( const std::string &  name)
inline
Template Parameters
Ttype of the distributed object
Parameters
namename of the distributed object.
Returns
distributed object

Definition at line 86 of file hazelcast_client.h.

86  {
87  return client_impl_->get_distributed_object<T>(name);
88  }

◆ get_executor_service()

boost::shared_future<std::shared_ptr<iexecutor_service> > hazelcast::client::hazelcast_client::get_executor_service ( const std::string &  name)
inline

Creates or returns the distributed executor service for the given name.

Executor service enables you to run your Runnables and Callables on the Hazelcast cluster.

Note: Note that it doesn't support

invokeAll/Any

and doesn't have standard shutdown behavior

Parameters
namename of the executor service
Returns
the distributed executor service for the given name

Definition at line 226 of file hazelcast_client.h.

226  {
227  return client_impl_->get_distributed_object<iexecutor_service>(name);
228  }

◆ get_flake_id_generator()

boost::shared_future<std::shared_ptr<flake_id_generator> > hazelcast::client::hazelcast_client::get_flake_id_generator ( const std::string &  name)
inline

Returns a generator that creates a cluster-wide unique IDs.

Generated IDs are

long

primitive values and are k-ordered (roughly ordered). IDs are in the range from

0

to

Long.MAX_VALUE

.

The IDs contain timestamp component and a node ID component, which is assigned when the member joins the cluster. This allows the IDs to be ordered and unique without any coordination between members, which makes the generator safe even in split-brain scenario (for caveats, see here).

For more details and caveats, see class documentation for flake_id_generator.

Parameters
namename of the flake_id_generator
Returns
flake_id_generator for the given name

Definition at line 185 of file hazelcast_client.h.

185  {
186  return client_impl_->get_distributed_object<flake_id_generator>(name);
187  }

◆ get_lifecycle_service()

spi::lifecycle_service & hazelcast::client::hazelcast_client::get_lifecycle_service ( )

Returns the lifecycle service for this instance.

LifecycleService allows you to shutdown this HazelcastInstance and listen for the lifecycle events.

Returns
the lifecycle service for this instance

Definition at line 112 of file client_impl.cpp.

112  {
113  return client_impl_->get_lifecycle_service();
114  }

◆ get_list()

boost::shared_future<std::shared_ptr<ilist> > hazelcast::client::hazelcast_client::get_list ( const std::string &  name)
inline

Returns the distributed list instance with the specified name.

List is ordered set of entries. similar to std::vector

Parameters
namename of the distributed list
Returns
distributed list instance with the specified name

Definition at line 145 of file hazelcast_client.h.

145  {
146  return client_impl_->get_distributed_object<ilist>(name);
147  }

◆ get_local_endpoint()

local_endpoint hazelcast::client::hazelcast_client::get_local_endpoint ( ) const

Returns the local endpoint which this HazelcastInstance belongs to.

Returns
the local enpoint which this client belongs to
See also
Client

Definition at line 116 of file client_impl.cpp.

116  {
117  return client_impl_->get_local_endpoint();
118  }

◆ get_map()

boost::shared_future<std::shared_ptr<imap> > hazelcast::client::hazelcast_client::get_map ( const std::string &  name)
inline

Returns the distributed map instance with the specified name.

Template Parameters
Kkey type
Vvalue type
Parameters
namename of the distributed map
Returns
distributed map instance with the specified name

Definition at line 99 of file hazelcast_client.h.

99  {
100  return client_impl_->get_distributed_object<imap>(name);
101  }

◆ get_multi_map()

boost::shared_future<std::shared_ptr<multi_map> > hazelcast::client::hazelcast_client::get_multi_map ( const std::string &  name)
inline

Returns the distributed multimap instance with the specified name.

Parameters
namename of the distributed multimap
Returns
distributed multimap instance with the specified name

Definition at line 109 of file hazelcast_client.h.

109  {
110  return client_impl_->get_distributed_object<multi_map>(name);
111  }

◆ get_name()

const std::string & hazelcast::client::hazelcast_client::get_name ( ) const

Returns the name of this client instance.

Returns
name of this client instance

Definition at line 80 of file client_impl.cpp.

80  {
81  return client_impl_->get_name();
82  }

◆ get_pn_counter()

boost::shared_future<std::shared_ptr<pn_counter> > hazelcast::client::hazelcast_client::get_pn_counter ( const std::string &  name)
inline

Obtain a pn_counter with the given name.

The PN counter can be used as a counter with strong eventual consistency guarantees - if operations to the counters stop, the counter values of all replicas that can communicate with each other should eventually converge to the same value.

Parameters
namethe name of the PN counter
Returns
a pn_counter

Definition at line 201 of file hazelcast_client.h.

201  {
202  return client_impl_->get_distributed_object<pn_counter>(name);
203  }

◆ get_queue()

boost::shared_future<std::shared_ptr<iqueue> > hazelcast::client::hazelcast_client::get_queue ( const std::string &  name)
inline

Returns the distributed queue instance with the specified name.

Parameters
namename of the distributed queue
Returns
distributed queue instance with the specified name

Definition at line 123 of file hazelcast_client.h.

123  {
124  return client_impl_->get_distributed_object<iqueue>(name);
125  }

◆ get_reliable_topic()

boost::shared_future<std::shared_ptr<reliable_topic> > hazelcast::client::hazelcast_client::get_reliable_topic ( const std::string &  name)
inline

Returns the distributed topic instance with the specified name.

Parameters
namename of the distributed topic
Returns
distributed topic instance with the specified name

Definition at line 165 of file hazelcast_client.h.

165  {
166  return client_impl_->get_distributed_object<reliable_topic>(name);
167  }

◆ get_ringbuffer()

boost::shared_future<std::shared_ptr<ringbuffer> > hazelcast::client::hazelcast_client::get_ringbuffer ( const std::string &  name)
inline

Returns the distributed ringbuffer instance with the specified name.

Parameters
namename of the distributed ringbuffer
Returns
distributed ringbuffer instance with the specified name

Definition at line 211 of file hazelcast_client.h.

211  {
212  return client_impl_->get_distributed_object<ringbuffer>(name);
213  }

◆ get_set()

boost::shared_future<std::shared_ptr<iset> > hazelcast::client::hazelcast_client::get_set ( const std::string &  name)
inline

Returns the distributed set instance with the specified name.

Set is ordered unique set of entries. similar to std::unordered_set

Parameters
namename of the distributed set
Returns
distributed set instance with the specified name

Definition at line 134 of file hazelcast_client.h.

134  {
135  return client_impl_->get_distributed_object<iset>(name);
136  }

◆ get_topic()

boost::shared_future<std::shared_ptr<itopic> > hazelcast::client::hazelcast_client::get_topic ( const std::string &  name)
inline

Returns the distributed topic instance with the specified name.

Parameters
namename of the distributed topic
Returns
distributed topic instance with the specified name

Definition at line 155 of file hazelcast_client.h.

155  {
156  return client_impl_->get_distributed_object<itopic>(name);
157  };

◆ new_transaction_context() [1/2]

transaction_context hazelcast::client::hazelcast_client::new_transaction_context ( )

Creates a new transaction_context associated with the current thread using default options.

Returns
new transaction_context

Definition at line 88 of file client_impl.cpp.

88  {
89  return client_impl_->new_transaction_context();
90  }

◆ new_transaction_context() [2/2]

transaction_context hazelcast::client::hazelcast_client::new_transaction_context ( const transaction_options options)

Creates a new transaction_context associated with the current thread with given options.

Parameters
optionsoptions for this transaction
Returns
new transaction_context

Definition at line 92 of file client_impl.cpp.

92  {
93  return client_impl_->new_transaction_context(options);
94  }

◆ remove_lifecycle_listener()

bool hazelcast::client::hazelcast_client::remove_lifecycle_listener ( const boost::uuids::uuid &  registration_id)

Remove lifecycle listener.

Parameters
lifecycleListener
Returns
true if removed successfully

Definition at line 104 of file client_impl.cpp.

104  {
105  return client_impl_->remove_lifecycle_listener(registration_id);
106  }

The documentation for this class was generated from the following files: