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

More...

#include <SCI_Transporter.hpp>

Inheritance diagram for SCI_Transporter:
Collaboration diagram for SCI_Transporter:

Classes

struct  SciAdapter
struct  sourceSegm
struct  targetSegm

Public Member Functions

bool initTransporter ()
sci_error_t createSequence (Uint32 adapterid)
sci_error_t initLocalSegment ()
Uint32 remoteSegmentId (Uint16 localNodeId, Uint16 remoteNodeId)
Uint32 hostSegmentId (Uint16 localNodeId, Uint16 remoteNodeId)
void closeSCI ()
bool checkConnected ()
bool getConnectionStatus ()
- 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)
virtual int doSend ()=0
bool has_data_to_send ()
Uint32 get_max_send_buffer ()

Protected Member Functions

bool connect_server_impl (NDB_SOCKET_TYPE sockfd)
bool connect_client_impl (NDB_SOCKET_TYPE sockfd)
void disconnectImpl ()
- 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 bool configure_derived (const TransporterConfiguration *conf)=0
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)

Static Protected Member Functions

static bool initSCI ()

Friends

class TransporterRegistry

Additional Inherited Members

- 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

Detailed Description

  • main class for the SCI transporter.

The SCI Transporter

The design goal of the SCI transporter is to deliver high performance data transfers (low latency, high bandwidth) combined with very high availability (failover support). High performance is an inherit feature of SCI and the, whereas failover support is implemented at the application level. In SCI the programming model is similar to the shared memory paradigm. A process on one node (A) allocates a memory segment and import the segment to its virtual address space. Another node (B) can connect to the segment and map this segment into its virtual address space. If A writes data to the segment, then B can read it and vice versa, through ordinary loads and stores. This is also called PIO (programmable IO), and is one thing that distinguish SCI from other interconnects such as, ethernet, Gig-e, Myrinet, and Infiniband. By using PIO, lower network latency is achieved, compared to the interconnects mentioned above. In order for NDB to utilize SCI, the SCI transporter relies on the SISCI api. The SISCI api provides a high level abstraction to the low level SCI driver called PCISCI driver. The SISCI api provides functions to setup, export, and import memory segments in a process virtual address space, and also functions to guarantee the correctness of data transfers between nodes. Basically, the

In NDB Cluster, each SCI transporter creates a local segment that is mapped into the virtual address space. After the creation of the local segment, the SCI transporter connects to a segment created by another transporter at a remote node, and the maps the remote segment into its virtual address space. However, since NDB Cluster relies on redundancy at the network level, by using dual SCI adapters communication can be maintained even if one of the adapter cards fails (or anything on the network this adapter card exists in e.g. an SCI switch failure). class SCITransporter

Definition at line 70 of file SCI_Transporter.hpp.

Member Function Documentation

bool SCI_Transporter::checkConnected ( )

Check the status of the remote node, if it is connected or has disconnected

Returns
true if connected, otherwize false.

Definition at line 845 of file SCI_Transporter.cpp.

Here is the caller graph for this function:

void SCI_Transporter::closeSCI ( )

closeSCI closes the SCI virtual device

Definition at line 785 of file SCI_Transporter.cpp.

bool SCI_Transporter::connect_server_impl ( NDB_SOCKET_TYPE  sockfd)
protectedvirtual

Perform a connection between segment This is a client node, trying to connect to a remote segment.

Parameters
timeout,thetime the connect thread sleeps before retrying.
Returns
Returns true on success, otherwize falser

Implements Transporter.

Definition at line 671 of file SCI_Transporter.cpp.

sci_error_t SCI_Transporter::createSequence ( Uint32  adapterid)

Creates a sequence for error checking.

Parameters
adapteridthe adapter on which to create a new sequence.
Returns
SCI_ERR_OK if ok, otherwize something else.

Definition at line 711 of file SCI_Transporter.cpp.

void SCI_Transporter::disconnectImpl ( )
protectedvirtual

We will disconnect if:

  1. the other node has disconnected from us
  2. unrecoverable error in transmission, on both adapters
  3. if we are shutdown properly

Implements Transporter.

Definition at line 119 of file SCI_Transporter.cpp.

Here is the call graph for this function:

bool SCI_Transporter::getConnectionStatus ( )

Check if the segment are properly connected to each other (remotely and locally).

Returns
True if the both the local segment is mapped and the remote segment is mapped. Otherwize false.

Definition at line 815 of file SCI_Transporter.cpp.

Here is the caller graph for this function:

Uint32 SCI_Transporter::hostSegmentId ( Uint16  SciLocalNodeId,
Uint16  SciRemoteNodeId 
)
inline

The theLocalAdapterId combined with the theRemoteNodeId constructs (SCI ids)* a unique identifier for the local segment

Definition at line 352 of file SCI_Transporter.hpp.

Here is the caller graph for this function:

sci_error_t SCI_Transporter::initLocalSegment ( )

Initiate Local Segment: create a memory segment, prepare a memory segment, map the local segment into memory space and make segment available.

Returns
SCI_ERR_OK if ok, otherwize something else.

Prepare the segment

Make the local segment available

Definition at line 223 of file SCI_Transporter.cpp.

Here is the call graph for this function:

bool SCI_Transporter::initTransporter ( )
virtual

Init the transporter.

Returns
true if successful, otherwize false

Implements Transporter.

Definition at line 161 of file SCI_Transporter.cpp.

Uint32 SCI_Transporter::remoteSegmentId ( Uint16  SciLocalNodeId,
Uint16  SciRemoteNodeId 
)
inline

Calculate the segment id for the remote segment

Parameters
localNodeId- local id (e.g. 1 = mgm , 2 = ndb.2 etc.)
remoteNodeId- remote id (e.g. 1 = mgm , 2 = ndb.2 etc.)
Returns
a segment id

The theLocalAdapterId combined with the theRemoteNodeId constructs (SCI ids)* a unique identifier for the remote segment

Definition at line 363 of file SCI_Transporter.hpp.


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