#include <gridclientprojection.hpp>
Public Member Functions | |
| GridClientProjectionImpl (TGridClientSharedDataPtr pData, GridClientProjectionListener &prjLsnr, TGridClientNodePredicatePtr pFilter=TGridClientNodePredicatePtr((TGridClientNodePredicate *) 0)) | |
| virtual | ~GridClientProjectionImpl () |
| void | withReconnectHandling (ClientProjectionClosure &c) const |
| void | withReconnectHandling (ClientProjectionClosure &c, const std::string &cacheName, const GridClientHasheableObject &affKey) |
Protected Member Functions | |
| TGridClientNodePtr | affinityNode (const std::string &cacheName, const GridClientHasheableObject &affKey) |
| TGridClientNodePtr | balancedNode () const |
| void | subProjectionNodes (TNodesSet &nodes, const TGridClientNodePredicate &dynamicFilter=GridClientAllPassFilter()) const |
| std::string | clientUniqueId () const |
| GridClientUuid & | clientUniqueUuid () |
| TNodesSet | topologyNodes () const |
| TGridClientNodePtr | node (const GridClientUuid &uuid) const |
| std::shared_ptr < GridClientCommandExecutorPrivate > | executor () const |
| virtual TGridClientLoadBalancerPtr | loadBalancer () const |
| GridClientProtocol | protocol () const |
Protected Attributes | |
| const TGridClientSharedDataPtr | sharedData |
| GridClientProjectionListener & | prjLsnr |
| TGridClientNodePredicatePtr | filter |
| std::map< std::string, std::shared_ptr < GridClientDataAffinity > > | affinityMap |
| std::shared_ptr < GridClientDataAffinity > | dfltAffinity |
| TGridClientLoadBalancerPtr | loadBalancer_ |
Implementation of client projection.
| GridClientProjectionImpl::GridClientProjectionImpl | ( | TGridClientSharedDataPtr | pData, | |
| GridClientProjectionListener & | prjLsnr, | |||
| TGridClientNodePredicatePtr | pFilter = TGridClientNodePredicatePtr((TGridClientNodePredicate*) 0) | |||
| ) |
Constructor of client projection.
| pData | Pointer to shared data. | |
| prjLsnr | Projection listener. | |
| pFilter | Pointer to a node predicate. |
| virtual GridClientProjectionImpl::~GridClientProjectionImpl | ( | ) | [inline, virtual] |
Public destructor.
| TGridClientNodePtr GridClientProjectionImpl::affinityNode | ( | const std::string & | cacheName, | |
| const GridClientHasheableObject & | affKey | |||
| ) | [protected] |
Gets the primary node for the given cache and the affinity key
| TGridClientNodePtr GridClientProjectionImpl::balancedNode | ( | ) | const [protected] |
Gets the current node to be used for processing.
| std::string GridClientProjectionImpl::clientUniqueId | ( | ) | const [inline, protected] |
Returns the unique ID of the client.
| GridClientUuid& GridClientProjectionImpl::clientUniqueUuid | ( | ) | [inline, protected] |
Returns the unique ID of the client.
| std::shared_ptr<GridClientCommandExecutorPrivate> GridClientProjectionImpl::executor | ( | ) | const [inline, protected] |
Returns the current executor.
| virtual TGridClientLoadBalancerPtr GridClientProjectionImpl::loadBalancer | ( | ) | const [inline, protected, virtual] |
Returns the active version of the load balancer for the given projection.
| TGridClientNodePtr GridClientProjectionImpl::node | ( | const GridClientUuid & | uuid | ) | const [inline, protected] |
Returns the definition of the node by the given uuid.
Reimplemented in GridClientComputeProjectionImpl.
| GridClientProtocol GridClientProjectionImpl::protocol | ( | ) | const [inline, protected] |
Returns the current protocol used by the client.
| void GridClientProjectionImpl::subProjectionNodes | ( | TNodesSet & | subPrjNodes, | |
| const TGridClientNodePredicate & | dynamicFilter = GridClientAllPassFilter() | |||
| ) | const [protected] |
Gets nodes for the given sub-projection.
Get the list of the sub-projection nodes.
| subPrjNodes | TNodesSet - The list of sub-Projection nodes. |
| TNodesSet GridClientProjectionImpl::topologyNodes | ( | ) | const [inline, protected] |
Returns the actual list of the nodes in the current topology.
| void GridClientProjectionImpl::withReconnectHandling | ( | ClientProjectionClosure & | c | ) | const |
This method executes request to a communication layer and handles connection error, if it occurs. In case of communication exception client instance is notified and new instance of client is created. If none of the grid servers can be reached, an exception is thrown.
| c | Closure to be executed. |
| GridServerUnreachableException | If either none of the server can be reached or each attempt of communication within RETRY_CNT attempts resulted in GridClientConnectionResetException. | |
| GridClientException | In case of problems. |
This method executes request to a communication layer and handles connection error, if it occurs. In case of communication exception client instance is notified and new instance of client is created. If none of the grid servers can be reached, an exception is thrown.
| c | Closure to be executed. |
| GridServerUnreachableException | If either none of the server can be reached or each attempt of communication within RETRY_CNT attempts resulted in GridClientConnectionResetException. |
| void GridClientProjectionImpl::withReconnectHandling | ( | ClientProjectionClosure & | c, | |
| const std::string & | cacheName, | |||
| const GridClientHasheableObject & | affKey | |||
| ) |
This method executes request to a communication layer and handles connection error, if it occurs. Server is picked up according to the projection affinity and key given. Connection will be made with the node on which key is cached. In case of communication exception client instance is notified and new instance of client is created. If none of servers can be reached, an exception is thrown.
| c | Closure to be executed. | |
| cacheName | Cache name for which mapped node will be calculated. | |
| affKey | Affinity key. |
| GridClientException | In case of problems. |
This method executes request to a communication layer and handles connection error, if it occurs. Server is picked up according to the projection affinity and key given. Connection will be made with the node on which key is cached. In case of communication exception client instance is notified and new instance of client is created. If none of servers can be reached, an exception is thrown.
| c | Closure to be executed. | |
| cacheName | Cache name for which mapped node will be calculated. | |
| affKey | Affinity key. |
| GridClientException | In case of problems. |
std::map<std::string, std::shared_ptr<GridClientDataAffinity> > GridClientProjectionImpl::affinityMap [protected] |
Affinity functions.
std::shared_ptr<GridClientDataAffinity> GridClientProjectionImpl::dfltAffinity [protected] |
Default affinity.
TGridClientNodePredicatePtr GridClientProjectionImpl::filter [protected] |
The current filter for nodes in the sub-projection.
TGridClientLoadBalancerPtr GridClientProjectionImpl::loadBalancer_ [protected] |
Local Load balancer if there is any.
Projection listener.
const TGridClientSharedDataPtr GridClientProjectionImpl::sharedData [protected] |
Shared data used by all the instances of projections
1.7.1