MySQL 5.6.14 Source Code Document
|
Classes | |
struct | AllocChunk |
struct | Callback |
struct | CallbackEntry |
struct | CallbackPtr |
struct | CallbackTable |
struct | FragmentInfo |
struct | FragmentSendInfo |
class | MutexManager |
struct | RoutePath |
struct | SyncThreadRecord |
struct | ThreadContext |
Public Types | |
typedef void(SimulatedBlock::* | CallbackFunction )(class Signal *, Uint32 callbackData, Uint32 returnCode) |
Public Member Functions | |
void | executeFunction (GlobalSignalNumber gsn, Signal *signal) |
Uint32 | instance () const |
SimulatedBlock * | getInstance (Uint32 instanceNumber) |
void | addInstance (SimulatedBlock *b, Uint32 theInstanceNo) |
virtual void | loadWorkers () |
void | assignToThread (ThreadContext ctx) |
uint32 | getThreadId () const |
void | assertOwnThread () |
void | synchronize_threads_for_blocks (Signal *, const Uint32 blocks[], const Callback &, JobBufferLevel=JBB) |
void | synchronize_path (Signal *, const Uint32 blocks[], const Callback &, JobBufferLevel=JBB) |
virtual const char * | get_filename (Uint32 fd) const |
EmulatedJamBuffer * | jamBuffer () const |
void | ignoreMutexUnlockCallback (Signal *signal, Uint32 ptrI, Uint32 retVal) |
virtual bool | getParam (const char *param, Uint32 *retVal) |
Public Attributes | |
MutexManager | c_mutexMgr |
SafeCounterManager | c_counterMgr |
Protected Types | |
enum | CallbackFlags { CALLBACK_DIRECT = 0x0001, CALLBACK_ACK = 0x0002 } |
enum | { THE_NULL_CALLBACK = 0 } |
typedef void(SimulatedBlock::* | ExecFunction )(Signal *signal) |
Protected Member Functions | |
SimulatedBlock (BlockNumber blockNumber, struct Block_context &ctx, Uint32 instanceNumber=0) | |
void | addRecSignalImpl (GlobalSignalNumber g, ExecFunction fun, bool f=false) |
void | installSimulatedBlockFunctions () |
void | initCommon () |
void | TheNULLCallbackFunction (class Signal *, Uint32, Uint32) |
void | execute (Signal *signal, Callback &c, Uint32 returnCode) |
void | sendSignal (BlockReference ref, GlobalSignalNumber gsn, Signal *signal, Uint32 length, JobBufferLevel jbuf) const |
void | sendSignal (NodeReceiverGroup rg, GlobalSignalNumber gsn, Signal *signal, Uint32 length, JobBufferLevel jbuf) const |
void | sendSignal (BlockReference ref, GlobalSignalNumber gsn, Signal *signal, Uint32 length, JobBufferLevel jbuf, SectionHandle *sections) const |
void | sendSignal (NodeReceiverGroup rg, GlobalSignalNumber gsn, Signal *signal, Uint32 length, JobBufferLevel jbuf, SectionHandle *sections) const |
void | sendSignal (BlockReference ref, GlobalSignalNumber gsn, Signal *signal, Uint32 length, JobBufferLevel jbuf, LinearSectionPtr ptr[3], Uint32 noOfSections) const |
void | sendSignal (NodeReceiverGroup rg, GlobalSignalNumber gsn, Signal *signal, Uint32 length, JobBufferLevel jbuf, LinearSectionPtr ptr[3], Uint32 noOfSections) const |
void | sendSignalNoRelease (BlockReference ref, GlobalSignalNumber gsn, Signal *signal, Uint32 length, JobBufferLevel jbuf, SectionHandle *sections) const |
void | sendSignalNoRelease (NodeReceiverGroup rg, GlobalSignalNumber gsn, Signal *signal, Uint32 length, JobBufferLevel jbuf, SectionHandle *sections) const |
void | sendSignalWithDelay (BlockReference ref, GlobalSignalNumber gsn, Signal *signal, Uint32 delayInMilliSeconds, Uint32 length) const |
void | sendSignalWithDelay (BlockReference ref, GlobalSignalNumber gsn, Signal *signal, Uint32 delayInMilliSeconds, Uint32 length, SectionHandle *sections) const |
void | EXECUTE_DIRECT (Uint32 block, Uint32 gsn, Signal *signal, Uint32 len, Uint32 givenInstanceNo=ZNIL) |
class SectionSegmentPool & | getSectionSegmentPool () |
void | release (SegmentedSectionPtr &ptr) |
void | release (SegmentedSectionPtrPOD &ptr) |
void | releaseSection (Uint32 firstSegmentIVal) |
void | releaseSections (struct SectionHandle &) |
bool | import (Ptr< SectionSegment > &first, const Uint32 *src, Uint32 len) |
bool | import (SegmentedSectionPtr &ptr, const Uint32 *src, Uint32 len) |
bool | appendToSection (Uint32 &firstSegmentIVal, const Uint32 *src, Uint32 len) |
bool | dupSection (Uint32 ©FirstIVal, Uint32 srcFirstIVal) |
bool | writeToSection (Uint32 firstSegmentIVal, Uint32 offset, const Uint32 *src, Uint32 len) |
void | handle_invalid_sections_in_send_signal (Signal *) const |
void | handle_lingering_sections_after_execute (Signal *) const |
void | handle_lingering_sections_after_execute (SectionHandle *) const |
void | handle_invalid_fragmentInfo (Signal *) const |
void | handle_send_failed (SendStatus, Signal *) const |
void | handle_out_of_longsignal_memory (Signal *) const |
void | sendRoutedSignal (RoutePath path[], Uint32 pathcnt, Uint32 dst[], Uint32 dstcnt, Uint32 gsn, Signal *, Uint32 len, JobBufferLevel prio, SectionHandle *handle=0) |
bool | checkNodeFailSequence (Signal *) |
bool | assembleFragments (Signal *signal) |
bool | assembleDroppedFragments (Signal *signal) |
STATIC_CONST (FRAGMENT_WORD_SIZE=240) | |
void | sendFragmentedSignal (BlockReference ref, GlobalSignalNumber gsn, Signal *signal, Uint32 length, JobBufferLevel jbuf, SectionHandle *sections, Callback &=TheEmptyCallback, Uint32 messageSize=FRAGMENT_WORD_SIZE) |
void | sendFragmentedSignal (NodeReceiverGroup rg, GlobalSignalNumber gsn, Signal *signal, Uint32 length, JobBufferLevel jbuf, SectionHandle *sections, Callback &=TheEmptyCallback, Uint32 messageSize=FRAGMENT_WORD_SIZE) |
void | sendFragmentedSignal (BlockReference ref, GlobalSignalNumber gsn, Signal *signal, Uint32 length, JobBufferLevel jbuf, LinearSectionPtr ptr[3], Uint32 noOfSections, Callback &=TheEmptyCallback, Uint32 messageSize=FRAGMENT_WORD_SIZE) |
void | sendFragmentedSignal (NodeReceiverGroup rg, GlobalSignalNumber gsn, Signal *signal, Uint32 length, JobBufferLevel jbuf, LinearSectionPtr ptr[3], Uint32 noOfSections, Callback &=TheEmptyCallback, Uint32 messageSize=FRAGMENT_WORD_SIZE) |
Uint32 | simBlockNodeFailure (Signal *signal, Uint32 failedNodeId, Callback &cb=TheEmptyCallback) |
bool | sendFirstFragment (FragmentSendInfo &info, NodeReceiverGroup rg, GlobalSignalNumber gsn, Signal *signal, Uint32 length, JobBufferLevel jbuf, SectionHandle *sections, bool noRelease, Uint32 messageSize=FRAGMENT_WORD_SIZE) |
bool | sendFirstFragment (FragmentSendInfo &info, NodeReceiverGroup rg, GlobalSignalNumber gsn, Signal *signal, Uint32 length, JobBufferLevel jbuf, LinearSectionPtr ptr[3], Uint32 noOfSections, Uint32 messageSize=FRAGMENT_WORD_SIZE) |
void | sendNextSegmentedFragment (Signal *signal, FragmentSendInfo &info) |
void | sendNextLinearFragment (Signal *signal, FragmentSendInfo &info) |
BlockNumber | number () const |
BlockReference | reference () const |
NodeId | getOwnNodeId () const |
void | refresh_watch_dog (Uint32 place=1) |
void | update_watch_dog_timer (Uint32 interval) |
void | progError (int line, int err_code, const char *extradata=NULL) const ATTRIBUTE_NORETURN |
NewVARIABLE * | allocateBat (int batSize) |
void | freeBat () |
BlockReference | calcInstanceBlockRef (BlockNumber aBlock) |
BlockReference | calcInstanceBlockRef (BlockNumber aBlock, NodeId aNode) |
void * | allocRecord (const char *type, size_t s, size_t n, bool clear=true, Uint32 paramId=0) |
void * | allocRecordAligned (const char *type, size_t s, size_t n, void **unaligned_buffer, Uint32 align=NDB_O_DIRECT_WRITE_ALIGNMENT, bool clear=true, Uint32 paramId=0) |
void | deallocRecord (void **, const char *type, size_t s, size_t n) |
Uint32 | allocChunks (AllocChunk dst[], Uint32arraysize, Uint32rg, Uint32pages, Uint32 paramId) |
void | infoEvent (const char *msg,...) const ATTRIBUTE_FORMAT(printf |
void void | warningEvent (const char *msg,...) const ATTRIBUTE_FORMAT(printf |
void void const NodeState & | getNodeState () const |
const NodeInfo & | getNodeInfo (NodeId nodeId) const |
NodeInfo & | setNodeInfo (NodeId) |
const NodeVersionInfo & | getNodeVersionInfo () const |
NodeVersionInfo & | setNodeVersionInfo () |
Uint32 | xfrm_key (Uint32 tab, const Uint32 *src, Uint32 *dst, Uint32 dstSize, Uint32 keyPartLen[MAX_ATTRIBUTES_IN_INDEX]) const |
Uint32 | xfrm_attr (Uint32 attrDesc, CHARSET_INFO *cs, const Uint32 *src, Uint32 &srcPos, Uint32 *dst, Uint32 &dstPos, Uint32 dstSize) const |
Uint32 | create_distr_key (Uint32 tableId, const Uint32 *src, Uint32 *dst, const Uint32 keyPaLen[MAX_ATTRIBUTES_IN_INDEX]) const |
void | wakeup () |
void | setup_wakeup () |
void | execNDB_TAMPER (Signal *signal) |
void | execNODE_STATE_REP (Signal *signal) |
void | execCHANGE_NODE_STATE_REQ (Signal *signal) |
void | execSIGNAL_DROPPED_REP (Signal *signal) |
void | execCONTINUE_FRAGMENTED (Signal *signal) |
void | execSTOP_FOR_CRASH (Signal *signal) |
void | execAPI_START_REP (Signal *signal) |
void | execNODE_START_REP (Signal *signal) |
void | execSEND_PACKED (Signal *signal) |
void | execLOCAL_ROUTE_ORD (Signal *) |
Uint32 | debugPrintFragmentCounts () |
void | fsRefError (Signal *signal, Uint32 line, const char *msg) |
void | execFSWRITEREF (Signal *signal) |
void | execFSREADREF (Signal *signal) |
void | execFSOPENREF (Signal *signal) |
void | execFSCLOSEREF (Signal *signal) |
void | execFSREMOVEREF (Signal *signal) |
void | execFSSYNCREF (Signal *signal) |
void | execFSAPPENDREF (Signal *signal) |
void | execute (Signal *signal, CallbackPtr &cptr, Uint32 returnCode) |
const CallbackEntry & | getCallbackEntry (Uint32 ci) |
void | sendCallbackConf (Signal *signal, Uint32 fullBlockNo, CallbackPtr &cptr, Uint32 returnCode) |
void | execCALLBACK_CONF (Signal *signal) |
void | ndbinfo_send_row (Signal *signal, const DbinfoScanReq &req, const Ndbinfo::Row &row, Ndbinfo::Ratelimit &rl) const |
void | ndbinfo_send_scan_break (Signal *signal, DbinfoScanReq &req, const Ndbinfo::Ratelimit &rl, Uint32 data1, Uint32 data2=0, Uint32 data3=0, Uint32 data4=0) const |
void | ndbinfo_send_scan_conf (Signal *signal, DbinfoScanReq &req, const Ndbinfo::Ratelimit &rl) const |
Static Protected Member Functions | |
static const NewVARIABLE * | getBat (BlockNumber blockNo, Uint32 instanceNo) |
static Uint16 | getBatSize (BlockNumber blockNo, Uint32 instanceNo) |
static BlockReference | calcTcBlockRef (NodeId aNode) |
static BlockReference | calcLqhBlockRef (NodeId aNode) |
static BlockReference | calcAccBlockRef (NodeId aNode) |
static BlockReference | calcTupBlockRef (NodeId aNode) |
static BlockReference | calcTuxBlockRef (NodeId aNode) |
static BlockReference | calcDihBlockRef (NodeId aNode) |
static BlockReference | calcQmgrBlockRef (NodeId aNode) |
static BlockReference | calcDictBlockRef (NodeId aNode) |
static BlockReference | calcNdbCntrBlockRef (NodeId aNode) |
static BlockReference | calcTrixBlockRef (NodeId aNode) |
static BlockReference | calcBackupBlockRef (NodeId aNode) |
static BlockReference | calcSumaBlockRef (NodeId aNode) |
static BlockReference | calcApiClusterMgrBlockRef (NodeId aNode) |
static int | sortchunks (const void *, const void *) |
Protected Attributes | |
ExecFunction | theExecArray [MAX_GSN+1] |
Block_context | m_ctx |
SafeArrayPool< GlobalPage > & | m_global_page_pool |
ArrayPool< GlobalPage > & | m_shared_page_pool |
CallbackTable * | m_callbackTableAddr |
ERROR_INSERT_VARIABLE |
Static Protected Attributes | |
static Callback | TheEmptyCallback = {0, 0} |
static Callback | TheNULLCallback |
Definition at line 106 of file SimulatedBlock.hpp.
|
protected |
Constructor
Definition at line 68 of file SimulatedBlock.cpp.
|
protected |
allocRecord Allocates memory for the datastructures where ndb keeps the data
Definition at line 1640 of file SimulatedBlock.cpp.
|
protected |
Assemble dropped fragments
Should be called at the start of a Dropped Signal Report (GSN_DROPPED_SIGNAL_REP) handler when it is expected that the block could receive fragmented signals. No dropped signal handling should be done until this method returns true.
First in train
FragInfo == 2 or 3
fragInfo = 2 Still waiting for final fragments. Return false to caller.
fragInfo = 3 All fragments received, remove entry from hash and return to caller for dropped signal handling.
Unable to find fragment
Definition at line 2359 of file SimulatedBlock.cpp.
|
protected |
Assemble fragments
First in train
Don't release allocated segments
FragInfo == 2 or 3
fragInfo = 2
fragInfo = 3
NOTE: Don't use EXECUTE_DIRECT as it sets sendersBlockRef to reference()
Unable to find fragment
Definition at line 2211 of file SimulatedBlock.cpp.
|
inline |
Assert that thread calling this function is "owner" of block instance
Definition at line 198 of file SimulatedBlock.hpp.
|
protected |
Check that signal sent from remote node is guaranteed to be correctly serialized wrt to NODE_FAILREP
Make sure that a signal being part of node-failure handling from a remote node, does not get to us before we got the NODE_FAILREP (this to avoid tricky state handling)
To ensure this, we send the signal via QMGR (GSN_COMMIT_FAILREQ) and NDBCNTR (which sends NODE_FAILREP)
The extra time should be negilable
Note, make an exception for signals sent by our self as they are only sent as a consequence of NODE_FAILREP
Definition at line 4260 of file SimulatedBlock.cpp.
|
protected |
|
protected |
Pack return signal
Definition at line 1914 of file SimulatedBlock.cpp.
|
protected |
This NDBCNTR error code 1001
Send to final destination(s);
Data is at end of this...
Put section 0 in signal->theData
Reroute
Definition at line 3951 of file SimulatedBlock.cpp.
|
inlineprotected |
In multithreaded NDB, blocks run in different threads, and EXECUTE_DIRECT (unlike sendSignal) is generally not thread-safe. So only allow EXECUTE_DIRECT between blocks that run in the same thread, unless caller explicitly marks it as being thread safe (eg NDBFS), by using an explicit instance argument. By default instance of sender is used. This is automatically thread-safe for worker instances (instance != 0).
Definition at line 1234 of file SimulatedBlock.hpp.
|
inline |
This point only passed if an error has occurred
Definition at line 1026 of file SimulatedBlock.hpp.
|
inlineprotected |
Get node info
Definition at line 1200 of file SimulatedBlock.hpp.
|
inlineprotected |
Get node state
Definition at line 1194 of file SimulatedBlock.hpp.
|
protected |
General info event (sent to cluster log)
Init and put it into the job buffer
Definition at line 1817 of file SimulatedBlock.cpp.
|
protected |
Prog error This function should be called when this node should be shutdown If the cause of the shutdown is known use extradata to add an errormessage describing the problem
Definition at line 1796 of file SimulatedBlock.cpp.
|
protected |
Refresh Watch Dog in initialising code
Definition at line 1779 of file SimulatedBlock.cpp.
|
protected |
sendFirstFragment Used by sendFragmentedSignal noRelease can only be used if the caller can guarantee not to free the supplied sections until all fragments have been sent.
Send signal directly
Setup info object
Clear sections in caller's handle. Actual send will consume them
Fragment id 0 is invalid
Definition at line 2762 of file SimulatedBlock.cpp.
|
protected |
Send signal directly
Indicate to sendLinearSignalFragment that we'r already done
Setup info object
Fragment id 0 is invalid
Definition at line 3121 of file SimulatedBlock.cpp.
|
protected |
Send signal fragment
Store "theData"
The section fits
Only one segment left to send send even if sizeLeft <= size
Less than one segment left (space) dont bother sending
Split list 1) Find place to split 2) Rewrite header (the part that will be sent) 3) Write new header (for remaining part) 4) Store new header on FragmentSendInfo - record
Rewrite header w.r.t size
Write/store "new" header
Store fragment id
Not finished
This is the last signal
Definition at line 3201 of file SimulatedBlock.cpp.
|
protected |
Send signal fragment
Setup main signal data from stored copy
The section fits
Only one segment left to send send even if sizeLeft <= size
Less than one segment left (space) dont bother sending
Split list 1) Find place to split 2) Rewrite header (the part that will be sent) 3) Write new header (for remaining part) 4) Store new header on FragmentSendInfo - record
Record details of the section pre-split This allows the split to be 'healed' afterwards in the no release case.
Rewrite header w.r.t size and last This is what will be sent in this fragment.
Write "new" list header This is what remains to be sent in this section
And store it on info-record
Store fragment id
Not finished
This is the last signal Release saved 'main signal' words segment
Definition at line 2865 of file SimulatedBlock.cpp.
|
protected |
we need to store theData in a section
Definition at line 3870 of file SimulatedBlock.cpp.
|
protected |
Check own node
Do the big loop
Definition at line 593 of file SimulatedBlock.cpp.
|
protected |
We have to copy the data
Definition at line 953 of file SimulatedBlock.cpp.
|
protected |
Check own node
We have to copy the data
Do the big loop
Definition at line 1065 of file SimulatedBlock.cpp.
|
protected |
We have to copy the data
Definition at line 703 of file SimulatedBlock.cpp.
|
protected |
Check own node
We have to copy the data
Do the big loop
Definition at line 822 of file SimulatedBlock.cpp.
|
protected |
Implementation the same as sendSignal(), except that the sections are duplicated when sending locally, and not released
Definition at line 1198 of file SimulatedBlock.cpp.
|
protected |
Implementation the same as sendSignal(), except that the sections are duplicated when sending locally, and not released
Check own node
Do the big loop
Definition at line 1313 of file SimulatedBlock.cpp.
|
protected |
setup struct for wakeup
Definition at line 4303 of file SimulatedBlock.cpp.
|
protected |
simBlockNodeFailure
Method must be called by blocks that send or receive remote Fragmented Signals when they detect a node (NDBD or API) failure. If the block needs to acknowledge or perform further processing after completing block-level node failure handling, it can supply a Callback which will be invoked when block-level node failure handling has completed. Otherwise TheEmptyCallback is used. If TheEmptyCallback is used, all failure handling is performed in the current timeslice, to avoid any races.
Parameters signal : Current signal* failedNodeId : Node id of failed node cb : Callback to be executed when block-level node failure handling completed. TheEmptyCallback is passed if no further processing is required. Returns Number of 'resources' cleaned up in call. Callback return code is total resources cleaned up.
Definition at line 2701 of file SimulatedBlock.cpp.
void SimulatedBlock::synchronize_path | ( | Signal * | signal, |
const Uint32 | blocks[], | ||
const Callback & | cb, | ||
JobBufferLevel | prio = JBB |
||
) |
This method make sure that the path specified in blocks[] will be traversed before returning
Definition at line 4166 of file SimulatedBlock.cpp.
void SimulatedBlock::synchronize_threads_for_blocks | ( | Signal * | signal, |
const Uint32 | blocks[], | ||
const Callback & | cb, | ||
JobBufferLevel | prio = JBB |
||
) |
This method will make sure that when callback in called each thread running an instance any of the threads in blocks[] will have executed a signal
Definition at line 4092 of file SimulatedBlock.cpp.
|
protected |
if ndbd, wakeup main-loop if sleeping on IO if ndbmtd wakeup thread running block-instance
Definition at line 4312 of file SimulatedBlock.cpp.
|
protected |
Init and put it into the job buffer
Definition at line 1862 of file SimulatedBlock.cpp.
|
protected |
Definition at line 3701 of file SimulatedBlock.cpp.
|
staticprotected |
Definition at line 246 of file SimulatedBlock.hpp.