MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SHM_Transporter Class Reference

More...

#include <SHM_Transporter.hpp>

Inheritance diagram for SHM_Transporter:
Collaboration diagram for SHM_Transporter:

Public Member Functions

 SHM_Transporter (TransporterRegistry &, const char *lHostName, const char *rHostName, int r_port, bool isMgmConnection, NodeId lNodeId, NodeId rNodeId, NodeId serverNodeId, bool checksum, bool signalId, key_t shmKey, Uint32 shmSize)
virtual ~SHM_Transporter ()
virtual bool configure_derived (const TransporterConfiguration *conf)
bool initTransporter ()
void getReceivePtr (Uint32 **ptr, Uint32 **eod)
void updateReceivePtr (Uint32 *ptr)
- Public Member Functions inherited from Transporter
virtual ~Transporter ()
virtual bool connect_client ()
bool connect_client (NDB_SOCKET_TYPE sockfd)
bool connect_server (NDB_SOCKET_TYPE socket, BaseString &errormsg)
virtual void doDisconnect ()
bool isConnected () const
NodeId getRemoteNodeId () const
NodeId getLocalNodeId () const
int get_s_port ()
void set_s_port (int port)
void update_status_overloaded (Uint32 used)
bool has_data_to_send ()
Uint32 get_max_send_buffer ()

Protected Member Functions

void disconnectImpl ()
virtual bool connect_server_impl (NDB_SOCKET_TYPE sockfd)
virtual bool connect_client_impl (NDB_SOCKET_TYPE sockfd)
bool connect_common (NDB_SOCKET_TYPE sockfd)
bool ndb_shm_create ()
bool ndb_shm_get ()
bool ndb_shm_attach ()
bool checkConnected ()
void setupBuffers ()
int doSend ()
- Protected Member Functions inherited from Transporter
 Transporter (TransporterRegistry &, TransporterType, const char *lHostName, const char *rHostName, int s_port, bool isMgmConnection, NodeId lNodeId, NodeId rNodeId, NodeId serverNodeId, int byteorder, bool compression, bool checksum, bool signalId, Uint32 max_send_buffer)
virtual bool configure (const TransporterConfiguration *conf)
virtual int pre_connect_options (NDB_SOCKET_TYPE sockfd)
TransporterCallbackget_callback_obj ()
void do_disconnect (int err)
void report_error (enum TransporterError err, const char *info=0)
Uint32 fetch_send_iovec_data (struct iovec dst[], Uint32 cnt)
void iovec_data_sent (int nBytesSent)

Protected Attributes

int m_remote_pid
Uint32 m_signal_threshold
- Protected Attributes inherited from Transporter
char remoteHostName [256]
char localHostName [256]
struct in_addr remoteHostAddress
struct in_addr localHostAddress
int m_s_port
const NodeId remoteNodeId
const NodeId localNodeId
const bool isServer
unsigned createIndex
int byteOrder
bool compressionUsed
bool checksumUsed
bool signalIdUsed
Packer m_packer
Uint32 m_max_send_buffer
Uint32 m_overload_limit
Uint32 m_os_max_iovec
Uint32 m_timeOutMillis
bool m_connected
TransporterType m_type
TransporterRegistrym_transporter_registry

Friends

class TransporterRegistry

Detailed Description

  • main class for the SHM transporter.

class SHMTransporter

Definition at line 34 of file SHM_Transporter.hpp.

Constructor & Destructor Documentation

SHM_Transporter::~SHM_Transporter ( )
virtual

SHM destructor

Definition at line 81 of file SHM_Transporter.cpp.

Here is the call graph for this function:

Member Function Documentation

bool SHM_Transporter::checkConnected ( )
protected

Check if there are two processes attached to the segment (a connection)

Returns
- True if the above holds. Otherwise false.

Definition at line 71 of file SHM_Transporter.unix.cpp.

Here is the caller graph for this function:

bool SHM_Transporter::connect_client_impl ( NDB_SOCKET_TYPE  sockfd)
protectedvirtual

Blocking

  1. Attach to shm segment
  2. Check if the segment is setup
  3. Check if the server set it up
  4. If all clear, return.
    Parameters
    timeOutMillis- the time to sleep before (ms) trying again.
    Returns
    - True if the client managed to hook up with the server, i.e., both agrees that the other one has setup the segment. Otherwise false.

Implements Transporter.

Definition at line 279 of file SHM_Transporter.cpp.

bool SHM_Transporter::connect_server_impl ( NDB_SOCKET_TYPE  sockfd)
protectedvirtual

Blocking

  1. Create shm segment
  2. Attach to it
  3. Wait for someone to attach (max wait = timeout), then rerun again until connection established.
    Parameters
    timeOutMillis- the time to sleep before (ms) trying again.
    Returns
    - True if the server managed to hook up with the client, i.e., both agrees that the other one has setup the segment. Otherwise false.

Implements Transporter.

Definition at line 213 of file SHM_Transporter.cpp.

void SHM_Transporter::disconnectImpl ( )
protectedvirtual

disconnect a segmnet

  1. deletes the shm buffer associated with a segment
  2. marks the segment for removal

Implements Transporter.

Definition at line 105 of file SHM_Transporter.unix.cpp.

int SHM_Transporter::doSend ( )
protectedvirtual

doSend (i.e signal receiver)

Implements Transporter.

Definition at line 376 of file SHM_Transporter.cpp.

Here is the call graph for this function:

bool SHM_Transporter::initTransporter ( )
virtual

Do initialization

Implements Transporter.

Definition at line 86 of file SHM_Transporter.cpp.

void SHM_Transporter::setupBuffers ( )
protected

Initialises the SHM_Reader and SHM_Writer on the segment

NOTE: There is 7th shared variable in Win2k (sharedCountAttached).

Definition at line 93 of file SHM_Transporter.cpp.


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