MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TransporterFacade Class Reference
Inheritance diagram for TransporterFacade:
Collaboration diagram for TransporterFacade:

Classes

struct  ThreadData

Public Member Functions

 STATIC_CONST (MAX_NO_THREADS=4711)
 TransporterFacade (GlobalDictCache *cache)
int start_instance (NodeId, const ndb_mgm_configuration *)
void stop_instance ()
bool configure (NodeId, const ndb_mgm_configuration *)
Uint32 open_clnt (trp_client *, int blockNo=-1)
int close_clnt (trp_client *)
Uint32 get_active_ndb_objects () const
void ext_set_max_api_reg_req_interval (Uint32 ms)
void ext_update_connections ()
struct in_addr ext_get_connect_address (Uint32 nodeId)
void ext_forceHB ()
bool ext_isConnected (NodeId aNodeId)
void ext_doConnect (int aNodeId)
Uint32 getMinDbNodeVersion () const
NodeId ownId () const
void connected ()
void doConnect (int NodeId)
void reportConnected (int NodeId)
void doDisconnect (int NodeId)
void reportDisconnected (int NodeId)
NodeId get_an_alive_node ()
void trp_node_status (NodeId, Uint32 event)
void for_each (trp_client *clnt, const NdbApiSignal *aSignal, const LinearSectionPtr ptr[3])
void lock_mutex ()
void unlock_mutex ()
void forceSend (Uint32 block_number)
void checkForceSend (Uint32 block_number)
TransporterRegistryget_registry ()
void start_poll (trp_client *)
void do_poll (trp_client *clnt, Uint32 wait_time)
void complete_poll (trp_client *)
void wakeup (trp_client *)
void external_poll (Uint32 wait_time)
trp_clientget_poll_owner (bool) const
trp_clientremove_last_from_poll_queue ()
void add_to_poll_queue (trp_client *clnt)
void remove_from_poll_queue (trp_client *clnt)
void hb_received (NodeId n)
void set_auto_reconnect (int val)
int get_auto_reconnect () const
void deliver_signal (SignalHeader *const header, Uint8 prio, Uint32 *const signalData, LinearSectionPtr ptr[3])
int checkJobBuffer ()
void reportSendLen (NodeId nodeId, Uint32 count, Uint64 bytes)
void reportReceiveLen (NodeId nodeId, Uint32 count, Uint64 bytes)
void reportConnect (NodeId nodeId)
void reportDisconnect (NodeId nodeId, Uint32 errNo)
void reportError (NodeId nodeId, TransporterError errorCode, const char *info=0)
void transporter_recv_from (NodeId node)
Uint32 get_bytes_to_send_iovec (NodeId node, struct iovec *dst, Uint32 max)
Uint32 bytes_sent (NodeId node, Uint32 bytes)
bool has_data_to_send (NodeId node)
void reset_send_buffer (NodeId node, bool should_be_empty)
- Public Member Functions inherited from TransporterCallback
virtual void lock_transporter (NodeId node)
virtual void unlock_transporter (NodeId node)

Public Attributes

trp_clientm_poll_owner
trp_clientm_poll_queue_head
trp_clientm_poll_queue_tail
NdbMutex * theMutexPtr
GlobalDictCachem_globalDictCache

Friends

class trp_client
class ClusterMgr
class ArbitMgr
class Ndb_cluster_connection
class Ndb_cluster_connection_impl
void * runSendRequest_C (void *)
void * runReceiveResponse_C (void *)

Detailed Description

Definition at line 44 of file TransporterFacade.hpp.

Member Function Documentation

Uint32 TransporterFacade::bytes_sent ( NodeId  node,
Uint32  bytes 
)
inlinevirtual

Called when data has been sent, allowing to free / reuse the space. Passes number of bytes sent.

Note that this may be less than the sum of all iovec::iov_len supplied (in case of partial send). In particular, one iovec entry may have been partially sent, and may not be freed until another call to bytes_sent() which covers the rest of its data.

Returns total amount of unsent data in send buffers for this node.

Like get_bytes_to_send_iovec(), this is called during performSend().

Implements TransporterCallback.

Definition at line 188 of file TransporterFacade.hpp.

int TransporterFacade::checkJobBuffer ( )
virtual

Report connection broken

Implements TransporterCallback.

Definition at line 147 of file TransporterFacade.cpp.

bool TransporterFacade::configure ( NodeId  nodeId,
const ndb_mgm_configuration conf 
)

Keep value it set before connect (overriding config)

Also setup Loopback Transporter

Definition at line 605 of file TransporterFacade.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void TransporterFacade::deliver_signal ( SignalHeader *const  header,
Uint8  prio,
Uint32 *const  theData,
LinearSectionPtr  ptr[3] 
)
virtual

The execute function : Handle received signal

Handle received signal immediately to avoid any unnecessary copying of data, allocation of memory and other things. Copying of data could be interesting to support several priority levels and to support a special memory structure when executing the signals. Neither of those are interesting when receiving data in the NDBAPI. The NDBAPI will thus read signal data directly as it was written by the sender (SCI sender is other node, Shared memory sender is other process and TCP/IP sender is the OS that writes the TCP/IP message into a message buffer).

Block number == 2047 is used to signal a signal that consists of multiple instances of the same signal. This is an effort to package the signals so as to avoid unnecessary communication overhead since TCP/IP has a great performance impact.

Since it contains at least two data packets we will first copy the signal data to safe place.

Set the data length of the signal and the receivers block reference and then call the API.

Implements TransporterCallback.

Definition at line 210 of file TransporterFacade.cpp.

Here is the call graph for this function:

void TransporterFacade::ext_set_max_api_reg_req_interval ( Uint32  ms)

These are functions used by ndb_mgmd

Definition at line 1990 of file TransporterFacade.cpp.

void TransporterFacade::for_each ( trp_client clnt,
const NdbApiSignal aSignal,
const LinearSectionPtr  ptr[3] 
)

Send signal to each registered object

Definition at line 667 of file TransporterFacade.cpp.

Here is the caller graph for this function:

Uint32 TransporterFacade::get_bytes_to_send_iovec ( NodeId  ,
struct iovec dst,
Uint32   
)
inlinevirtual

ToDo: In current patch, these are not used, instead we use default implementations in TransporterRegistry. Ask upper layer to supply a list of struct iovec's with data to send to a node.

The call should fill in data from all threads (if any).

The call will write at most MAX iovec structures starting at DST.

Returns number of entries filled-in on success, -1 on error.

Will be called from the thread that does performSend(), so multi-threaded use cases must be prepared for that and do any necessary locking.

Implements TransporterCallback.

Definition at line 184 of file TransporterFacade.hpp.

bool TransporterFacade::has_data_to_send ( NodeId  node)
inlinevirtual

Called to check if any data is available for sending with doSend().

Like get_bytes_to_send_iovec(), this is called during performSend().

Implements TransporterCallback.

Definition at line 192 of file TransporterFacade.hpp.

Uint32 TransporterFacade::open_clnt ( trp_client clnt,
int  blockNo = -1 
)

Register this block for sending/receiving signals block number to use, -1 => any blockNumber

Returns
BlockNumber or -1 for failure

Definition at line 733 of file TransporterFacade.cpp.

void TransporterFacade::reportConnect ( NodeId  nodeId)
virtual

Report connection established

Implements TransporterCallback.

Definition at line 114 of file TransporterFacade.cpp.

void TransporterFacade::reportDisconnect ( NodeId  nodeId,
Uint32  error 
)
virtual

Report connection broken

Implements TransporterCallback.

Definition at line 126 of file TransporterFacade.cpp.

void TransporterFacade::reportError ( NodeId  nodeId,
TransporterError  errorCode,
const char *  info = 0 
)
virtual

Called by transporter code to report error

This is called from TransporterRegistry::update_connections(), which only runs from the receive thread.

Implements TransporterCallback.

Definition at line 66 of file TransporterFacade.cpp.

void TransporterFacade::reportReceiveLen ( NodeId  nodeId,
Uint32  count,
Uint64  bytes 
)
virtual

Report average receive length in bytes (4096 last receives)

Implements TransporterCallback.

Definition at line 99 of file TransporterFacade.cpp.

void TransporterFacade::reportSendLen ( NodeId  nodeId,
Uint32  count,
Uint64  bytes 
)
virtual

Report average send length in bytes (4096 last sends)

Implements TransporterCallback.

Definition at line 84 of file TransporterFacade.cpp.

void TransporterFacade::reset_send_buffer ( NodeId  node,
bool  should_be_empty 
)
inlinevirtual

Called to completely empty the send buffer for a node (ie. disconnect).

Can be called to check that no one has written to the sendbuffer since it was reset last time by using the "should_be_emtpy" flag

Implements TransporterCallback.

Definition at line 196 of file TransporterFacade.hpp.

int TransporterFacade::start_instance ( NodeId  nodeId,
const ndb_mgm_configuration conf 
)

Note that this function needs no locking since it is only called from the constructor of Ndb (the NdbObject)

Which is protected by a mutex

Definition at line 344 of file TransporterFacade.cpp.

Here is the call graph for this function:

TransporterFacade::STATIC_CONST ( MAX_NO_THREADS  = 4711)

Max number of Ndb objects. (Ndb objects should not be shared by different threads.)

void TransporterFacade::stop_instance ( )

Note that this function need no locking since its only called from the destructor of Ndb (the NdbObject)

Which is protected by a mutex

Definition at line 397 of file TransporterFacade.cpp.

void TransporterFacade::transporter_recv_from ( NodeId  node)
virtual

Called from transporter code after a successful receive from a node.

Used for heartbeat detection by upper layer.

Implements TransporterCallback.

Definition at line 134 of file TransporterFacade.cpp.


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