diff options
Diffstat (limited to 'storage/ndb/include/kernel/signaldata')
172 files changed, 21895 insertions, 0 deletions
diff --git a/storage/ndb/include/kernel/signaldata/AbortAll.hpp b/storage/ndb/include/kernel/signaldata/AbortAll.hpp new file mode 100644 index 00000000000..2d7d3bd7c29 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/AbortAll.hpp @@ -0,0 +1,87 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef ABORT_ALL_REQ_HPP +#define ABORT_ALL_REQ_HPP + +#include "SignalData.hpp" + +class AbortAllReq { + + /** + * Reciver(s) + */ + friend class Dbtc; + + /** + * Sender + */ + friend class Ndbcntr; + +public: + STATIC_CONST( SignalLength = 2 ); + +public: + + Uint32 senderRef; + Uint32 senderData; +}; + +class AbortAllConf { + + /** + * Reciver(s) + */ + friend class Ndbcntr; + + /** + * Sender + */ + friend class Dbtc; + +public: + STATIC_CONST( SignalLength = 1 ); + +public: + Uint32 senderData; +}; + +class AbortAllRef { + + /** + * Reciver(s) + */ + friend class Ndbcntr; + + /** + * Sender + */ + friend class Dbtc; + +public: + STATIC_CONST( SignalLength = 2 ); + + enum ErrorCode { + InvalidState = 1, + AbortAlreadyInProgress = 2, + FunctionNotImplemented = 3 + }; +public: + Uint32 senderData; + Uint32 errorCode; +}; + +#endif + diff --git a/storage/ndb/include/kernel/signaldata/AccFrag.hpp b/storage/ndb/include/kernel/signaldata/AccFrag.hpp new file mode 100644 index 00000000000..c44e157485c --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/AccFrag.hpp @@ -0,0 +1,88 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef ACC_FRAG_HPP +#define ACC_FRAG_HPP + +#include "SignalData.hpp" + +class AccFragReq { + /** + * Sender(s) + */ + friend class Dblqh; + + /** + * Receiver(s) + */ + friend class Dbacc; +public: + STATIC_CONST( SignalLength = 12 ); + +private: + Uint32 userPtr; + Uint32 userRef; + Uint32 tableId; + Uint32 reqInfo; + Uint32 fragId; + Uint32 localKeyLen; + Uint32 maxLoadFactor; + Uint32 minLoadFactor; + Uint32 kValue; + Uint32 lhFragBits; + Uint32 lhDirBits; + Uint32 keyLength; +}; + +class AccFragConf { + /** + * Sender(s) + */ + friend class Dbacc; + + /** + * Receiver(s) + */ + friend class Dblqh; +public: + STATIC_CONST( SignalLength = 7 ); + +private: + Uint32 userPtr; + Uint32 rootFragPtr; + Uint32 fragId[2]; + Uint32 fragPtr[2]; + Uint32 rootHashCheck; +}; + +class AccFragRef { + /** + * Sender(s) + */ + friend class Dbacc; + + /** + * Receiver(s) + */ + friend class Dblqh; +public: + STATIC_CONST( SignalLength = 2 ); + +private: + Uint32 userPtr; + Uint32 errorCode; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/AccLock.hpp b/storage/ndb/include/kernel/signaldata/AccLock.hpp new file mode 100644 index 00000000000..bb7ed6dbe8b --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/AccLock.hpp @@ -0,0 +1,65 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef ACC_LOCK_HPP +#define ACC_LOCK_HPP + +#include "SignalData.hpp" + +/* + * Lock or unlock tuple. If lock request is queued, the reply is later + * via ACCKEYCONF. + */ +class AccLockReq { + friend class Dbacc; + friend class Dbtup; + friend class Dbtux; + friend bool printACC_LOCKREQ(FILE *, const Uint32*, Uint32, Uint16); +public: + enum RequestType { // first byte + LockShared = 1, + LockExclusive = 2, + Unlock = 3, + Abort = 4, + AbortWithConf = 5 + }; + enum RequestFlag { // second byte + }; + enum ReturnCode { + Success = 0, + IsBlocked = 1, // was put in lock queue + WouldBlock = 2, // if we add non-blocking option + Refused = 3, + NoFreeOp = 4 + }; + STATIC_CONST( LockSignalLength = 12 ); + STATIC_CONST( UndoSignalLength = 3 ); +private: + Uint32 returnCode; + Uint32 requestInfo; + Uint32 accOpPtr; + // rest only if lock request + Uint32 userPtr; + Uint32 userRef; + Uint32 tableId; + Uint32 fragId; + Uint32 fragPtrI; + Uint32 hashValue; + Uint32 tupAddr; + Uint32 transId1; + Uint32 transId2; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/AccScan.hpp b/storage/ndb/include/kernel/signaldata/AccScan.hpp new file mode 100644 index 00000000000..73d69825069 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/AccScan.hpp @@ -0,0 +1,222 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef ACC_SCAN_HPP +#define ACC_SCAN_HPP + +#include "SignalData.hpp" + +/* + * Used by ACC and TUX scan. + */ + +class AccScanReq { + /** + * Sender(s) + */ + friend class Dblqh; + + /** + * Reciver(s) + */ + friend class Dbacc; + friend class Dbtux; + friend class Dbtup; +public: + STATIC_CONST( SignalLength = 8 ); + +private: + Uint32 senderData; + Uint32 senderRef; + Uint32 tableId; + Uint32 fragmentNo; + Uint32 requestInfo; + Uint32 transId1; + Uint32 transId2; + union { + Uint32 savePointId; + Uint32 gci; + }; + + /** + * Previously there where also a scan type + */ + static Uint32 getLockMode(const Uint32 & requestInfo); + static Uint32 getReadCommittedFlag(const Uint32 & requestInfo); + static Uint32 getDescendingFlag(const Uint32 & requestInfo); + + static void setLockMode(Uint32 & requestInfo, Uint32 lockMode); + static void setReadCommittedFlag(Uint32 & requestInfo, Uint32 readCommitted); + static void setDescendingFlag(Uint32 & requestInfo, Uint32 descending); + + static Uint32 getNoDiskScanFlag(const Uint32 & requestInfo); + static void setNoDiskScanFlag(Uint32 & requestInfo, Uint32 nodisk); + + static Uint32 getNRScanFlag(const Uint32 & requestInfo); + static void setNRScanFlag(Uint32 & requestInfo, Uint32 nr); + + static Uint32 getLcpScanFlag(const Uint32 & requestInfo); + static void setLcpScanFlag(Uint32 & requestInfo, Uint32 nr); +}; + +/** + * Request Info + * + * l = Lock Mode - 1 Bit 2 + * h = Read Committed - 1 Bit 5 + * z = Descending (TUX) - 1 Bit 6 + * d = No disk scan - 1 Bit 7 + * n = Node recovery scan - 1 Bit 8 + * c = LCP scan - 1 Bit 9 + * + * 1111111111222222222233 + * 01234567890123456789012345678901 + * l hzdn + */ +#define AS_LOCK_MODE_SHIFT (2) +#define AS_LOCK_MODE_MASK (1) +#define AS_READ_COMMITTED_SHIFT (5) +#define AS_DESCENDING_SHIFT (6) +#define AS_NO_DISK_SCAN (7) +#define AS_NR_SCAN (8) +#define AS_LCP_SCAN (9) + +inline +Uint32 +AccScanReq::getLockMode(const Uint32 & requestInfo){ + return (requestInfo >> AS_LOCK_MODE_SHIFT) & AS_LOCK_MODE_MASK; +} + +inline +Uint32 +AccScanReq::getReadCommittedFlag(const Uint32 & requestInfo){ + return (requestInfo >> AS_READ_COMMITTED_SHIFT) & 1; +} + +inline +Uint32 +AccScanReq::getDescendingFlag(const Uint32 & requestInfo){ + return (requestInfo >> AS_DESCENDING_SHIFT) & 1; +} + +inline +void +AccScanReq::setLockMode(UintR & requestInfo, UintR val){ + ASSERT_MAX(val, AS_LOCK_MODE_MASK, "AccScanReq::setLockMode"); + requestInfo |= (val << AS_LOCK_MODE_SHIFT); +} + +inline +void +AccScanReq::setReadCommittedFlag(UintR & requestInfo, UintR val){ + ASSERT_BOOL(val, "AccScanReq::setReadCommittedFlag"); + requestInfo |= (val << AS_READ_COMMITTED_SHIFT); +} + +inline +void +AccScanReq::setDescendingFlag(UintR & requestInfo, UintR val){ + ASSERT_BOOL(val, "AccScanReq::setDescendingFlag"); + requestInfo |= (val << AS_DESCENDING_SHIFT); +} + +inline +Uint32 +AccScanReq::getNoDiskScanFlag(const Uint32 & requestInfo){ + return (requestInfo >> AS_NO_DISK_SCAN) & 1; +} + +inline +void +AccScanReq::setNoDiskScanFlag(UintR & requestInfo, UintR val){ + ASSERT_BOOL(val, "AccScanReq::setNoDiskScanFlag"); + requestInfo |= (val << AS_NO_DISK_SCAN); +} + +inline +Uint32 +AccScanReq::getNRScanFlag(const Uint32 & requestInfo){ + return (requestInfo >> AS_NR_SCAN) & 1; +} + +inline +void +AccScanReq::setNRScanFlag(UintR & requestInfo, UintR val){ + ASSERT_BOOL(val, "AccScanReq::setNoDiskScanFlag"); + requestInfo |= (val << AS_NR_SCAN); +} + +inline +Uint32 +AccScanReq::getLcpScanFlag(const Uint32 & requestInfo){ + return (requestInfo >> AS_LCP_SCAN) & 1; +} + +inline +void +AccScanReq::setLcpScanFlag(UintR & requestInfo, UintR val){ + ASSERT_BOOL(val, "AccScanReq::setNoDiskScanFlag"); + requestInfo |= (val << AS_LCP_SCAN); +} + +class AccScanConf { + /** + * Sender(s) + */ + friend class Dbacc; + friend class Dbtux; + friend class Dbtup; + + /** + * Reciver(s) + */ + friend class Dblqh; + + enum { + ZEMPTY_FRAGMENT = 0, + ZNOT_EMPTY_FRAGMENT = 1 + }; + +public: + STATIC_CONST( SignalLength = 8 ); + +private: + Uint32 scanPtr; + Uint32 accPtr; + Uint32 unused1; + Uint32 unused2; + Uint32 unused3; + Uint32 unused4; + Uint32 unused5; + Uint32 flag; +}; + +class AccCheckScan { + friend class Dbacc; + friend class Dbtux; + friend class Dbtup; + friend class Dblqh; + enum { + ZCHECK_LCP_STOP = 0, + ZNOT_CHECK_LCP_STOP = 1 + }; +public: + STATIC_CONST( SignalLength = 2 ); +private: + Uint32 accPtr; // scanptr.i in ACC or TUX + Uint32 checkLcpStop; // from enum +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/AccSizeAltReq.hpp b/storage/ndb/include/kernel/signaldata/AccSizeAltReq.hpp new file mode 100644 index 00000000000..b3b239640ae --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/AccSizeAltReq.hpp @@ -0,0 +1,52 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef ACC_SIZE_ALT_REQ_H +#define ACC_SIZE_ALT_REQ_H + +#include "SignalData.hpp" + +class AccSizeAltReq { + /** + * Sender(s) + */ + friend class ClusterConfiguration; + + /** + * Reciver(s) + */ + friend class Dbacc; +private: + /** + * Indexes in theData + */ + STATIC_CONST( IND_BLOCK_REF = 0 ); + STATIC_CONST( IND_DIR_RANGE = 1 ); + STATIC_CONST( IND_DIR_ARRAY = 2 ); + STATIC_CONST( IND_FRAGMENT = 3 ); + STATIC_CONST( IND_OP_RECS = 4 ); + STATIC_CONST( IND_OVERFLOW_RECS = 5 ); + STATIC_CONST( IND_PAGE8 = 6 ); + STATIC_CONST( IND_ROOT_FRAG = 7 ); + STATIC_CONST( IND_TABLE = 8 ); + STATIC_CONST( IND_SCAN = 9 ); + + /** + * Use the index definitions to use the signal data + */ + UintR theData[10]; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/AllocNodeId.hpp b/storage/ndb/include/kernel/signaldata/AllocNodeId.hpp new file mode 100644 index 00000000000..e37021ebbc8 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/AllocNodeId.hpp @@ -0,0 +1,66 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef ALLOC_NODE_ID_HPP +#define ALLOC_NODE_ID_HPP + +#include "SignalData.hpp" +#include <NodeBitmask.hpp> + +/** + * Request to allocate node id + */ +class AllocNodeIdReq { +public: + STATIC_CONST( SignalLength = 4 ); + + Uint32 senderRef; + Uint32 senderData; + Uint32 nodeId; + Uint32 nodeType; +}; + +class AllocNodeIdConf { +public: + STATIC_CONST( SignalLength = 3 ); + + Uint32 senderRef; + Uint32 senderData; + Uint32 nodeId; +}; + +class AllocNodeIdRef { +public: + STATIC_CONST( SignalLength = 5 ); + + enum ErrorCodes { + NoError = 0, + Undefined = 1, + NF_FakeErrorREF = 11, + Busy = 701, + NotMaster = 702, + NodeReserved = 1701, + NodeConnected = 1702, + NodeFailureHandlingNotCompleted = 1703, + NodeTypeMismatch = 1704 + }; + + Uint32 senderRef; + Uint32 senderData; + Uint32 nodeId; + Uint32 errorCode; + Uint32 masterRef; +}; +#endif diff --git a/storage/ndb/include/kernel/signaldata/AlterIndx.hpp b/storage/ndb/include/kernel/signaldata/AlterIndx.hpp new file mode 100644 index 00000000000..bd9bf9a1293 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/AlterIndx.hpp @@ -0,0 +1,270 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef ALTER_INDX_HPP +#define ALTER_INDX_HPP + +#include "SignalData.hpp" +#include <Bitmask.hpp> +#include <trigger_definitions.h> + +/** + * AlterIndxReq. + */ +class AlterIndxReq { + friend bool printALTER_INDX_REQ(FILE*, const Uint32*, Uint32, Uint16); + +public: + enum RequestType { + RT_UNDEFINED = 0, + RT_USER = 1, + RT_CREATE_INDEX = 2, + RT_DROP_INDEX = 3, + RT_SYSTEMRESTART = 4, + RT_NODERESTART = 5, + RT_DICT_PREPARE = 1 << 4, + RT_DICT_TC = 5 << 4, + RT_DICT_COMMIT = 0xC << 4, + RT_DICT_ABORT = 0xF << 4, + RT_TC = 5 << 8, + RT_TUX = 8 << 8 + }; + STATIC_CONST( SignalLength = 7 ); + +private: + Uint32 m_userRef; + Uint32 m_connectionPtr; + Uint32 m_requestInfo; + Uint32 m_tableId; + Uint32 m_indexId; // only set by DICT + Uint32 m_indexVersion; + Uint32 m_online; // new state 0-offline 1-online + // extra + Uint32 m_opKey; + +public: + Uint32 getUserRef() const { + return m_userRef; + } + void setUserRef(Uint32 val) { + m_userRef = val; + } + Uint32 getConnectionPtr() const { + return m_connectionPtr; + } + void setConnectionPtr(Uint32 val) { + m_connectionPtr = val; + } + AlterIndxReq::RequestType getRequestType() const { + const Uint32 val = BitmaskImpl::getField(1, &m_requestInfo, 0, 16); + return (AlterIndxReq::RequestType)val; + } + void setRequestType(AlterIndxReq::RequestType val) { + m_requestInfo = (Uint32)val; + } + Uint32 getRequestFlag() const { + return BitmaskImpl::getField(1, &m_requestInfo, 16, 16); + }; + void addRequestFlag(Uint32 val) { + val |= BitmaskImpl::getField(1, &m_requestInfo, 16, 16); + BitmaskImpl::setField(1, &m_requestInfo, 16, 16, val); + }; + Uint32 getTableId() const { + return m_tableId; + } + void setTableId(Uint32 val) { + m_tableId = val; + } + Uint32 getIndexId() const { + return m_indexId; + } + void setIndexId(Uint32 val) { + m_indexId = val; + } + Uint32 getIndexVersion() const { + return m_indexVersion; + } + void setIndexVersion(Uint32 val) { + m_indexVersion = val; + } + Uint32 getOnline() const { + return m_online; + } + void setOnline(Uint32 val) { + m_online = val; + } + Uint32 getOpKey() const { + return m_opKey; + } + void setOpKey(Uint32 val) { + m_opKey = val; + } +}; + +/** + * AlterIndxConf. + */ +class AlterIndxConf { + friend bool printALTER_INDX_CONF(FILE*, const Uint32*, Uint32, Uint16); + +public: + STATIC_CONST( InternalLength = 3 ); + STATIC_CONST( SignalLength = 6 ); + +private: + Uint32 m_userRef; + Uint32 m_connectionPtr; + Uint32 m_requestInfo; + Uint32 m_tableId; + Uint32 m_indexId; + Uint32 m_indexVersion; + +public: + Uint32 getUserRef() const { + return m_userRef; + } + void setUserRef(Uint32 val) { + m_userRef = val; + } + Uint32 getConnectionPtr() const { + return m_connectionPtr; + } + void setConnectionPtr(Uint32 val) { + m_connectionPtr = val; + } + AlterIndxReq::RequestType getRequestType() const { + return (AlterIndxReq::RequestType)m_requestInfo; + } + void setRequestType(AlterIndxReq::RequestType val) { + m_requestInfo = (Uint32)val; + } + Uint32 getTableId() const { + return m_tableId; + } + void setTableId(Uint32 val) { + m_tableId = val; + } + Uint32 getIndexId() const { + return m_indexId; + } + void setIndexId(Uint32 val) { + m_indexId = val; + } + Uint32 getIndexVersion() const { + return m_indexVersion; + } + void setIndexVersion(Uint32 val) { + m_indexVersion = val; + } +}; + +/** + * AlterIndxRef. + */ +class AlterIndxRef { + friend bool printALTER_INDX_REF(FILE*, const Uint32*, Uint32, Uint16); + +public: + enum ErrorCode { + NoError = 0, + Busy = 701, + NotMaster = 702, + IndexNotFound = 4243, + IndexExists = 4244, + BadRequestType = 4247, + NotAnIndex = 4254, + BadState = 4347, + Inconsistency = 4348 + }; + STATIC_CONST( SignalLength = AlterIndxConf::SignalLength + 3 ); + +private: + AlterIndxConf m_conf; + //Uint32 m_userRef; + //Uint32 m_connectionPtr; + //Uint32 m_requestInfo; + //Uint32 m_tableId; + //Uint32 m_indexId; + //Uint32 m_indexVersion; + Uint32 m_errorCode; + Uint32 m_errorLine; + union { + Uint32 m_errorNode; + Uint32 masterNodeId; // if NotMaster + }; +public: + AlterIndxConf* getConf() { + return &m_conf; + } + const AlterIndxConf* getConf() const { + return &m_conf; + } + Uint32 getUserRef() const { + return m_conf.getUserRef(); + } + void setUserRef(Uint32 val) { + m_conf.setUserRef(val); + } + Uint32 getConnectionPtr() const { + return m_conf.getConnectionPtr(); + } + void setConnectionPtr(Uint32 val) { + m_conf.setConnectionPtr(val); + } + AlterIndxReq::RequestType getRequestType() const { + return m_conf.getRequestType(); + } + void setRequestType(AlterIndxReq::RequestType val) { + m_conf.setRequestType(val); + } + Uint32 getTableId() const { + return m_conf.getTableId(); + } + void setTableId(Uint32 val) { + m_conf.setTableId(val); + } + Uint32 getIndexId() const { + return m_conf.getIndexId(); + } + void setIndexId(Uint32 val) { + m_conf.setIndexId(val); + } + Uint32 getIndexVersion() const { + return m_conf.getIndexVersion(); + } + void setIndexVersion(Uint32 val) { + m_conf.setIndexVersion(val); + } + AlterIndxRef::ErrorCode getErrorCode() const { + return (AlterIndxRef::ErrorCode)m_errorCode; + } + void setErrorCode(AlterIndxRef::ErrorCode val) { + m_errorCode = (Uint32)val; + } + Uint32 getErrorLine() const { + return m_errorLine; + } + void setErrorLine(Uint32 val) { + m_errorLine = val; + } + Uint32 getErrorNode() const { + return m_errorNode; + } + void setErrorNode(Uint32 val) { + m_errorNode = val; + } +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/AlterTab.hpp b/storage/ndb/include/kernel/signaldata/AlterTab.hpp new file mode 100644 index 00000000000..d47d68cd2f8 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/AlterTab.hpp @@ -0,0 +1,125 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef ALTER_TAB_HPP +#define ALTER_TAB_HPP + +#include "SignalData.hpp" +#include "GlobalSignalNumbers.h" + +/** + * AlterTab + * + * Implemenatation of AlterTable + */ +class AlterTabReq { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdict; + friend class Dbdih; + friend class Dbtc; + friend class Dblqh; + friend class Suma; + + /** + * For printing + */ + friend bool printALTER_TAB_REQ(FILE*, const Uint32*, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 9 ); + + enum RequestType { + AlterTablePrepare = 0, // Prepare alter table + AlterTableCommit = 1, // Commit alter table + AlterTableRevert = 2 // Prepare failed, revert instead + }; +private: + Uint32 senderRef; + Uint32 senderData; + Uint32 clientRef; + Uint32 clientData; + + Uint32 changeMask; + Uint32 tableId; + Uint32 tableVersion; + Uint32 gci; + Uint32 requestType; + + SECTION( DICT_TAB_INFO = 0 ); +}; + +struct AlterTabRef { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdict; + friend class Dbdih; + friend class Dbtc; + friend class Dblqh; + friend class Dbtup; + friend class SafeCounter; + + /** + * For printing + */ + friend bool printALTER_TAB_REF(FILE *, const Uint32 *, Uint32, Uint16); + + STATIC_CONST( SignalLength = 7 ); + STATIC_CONST( GSN = GSN_ALTER_TAB_REF ); + + enum ErrorCode { + NF_FakeErrorREF = 255 + }; + + Uint32 senderRef; + Uint32 senderData; + Uint32 errorCode; + Uint32 errorLine; + Uint32 errorKey; + Uint32 errorStatus; + Uint32 requestType; +}; + +class AlterTabConf { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdict; + friend class Dbdih; + friend class Dbtc; + friend class Dblqh; + friend class Dbtup; + + /** + * For printing + */ + friend bool printALTER_TAB_CONF(FILE *, const Uint32 *, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 7 ); + +private: + Uint32 senderRef; + Uint32 senderData; + Uint32 changeMask; + Uint32 tableId; + Uint32 tableVersion; + Uint32 gci; + Uint32 requestType; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/AlterTable.hpp b/storage/ndb/include/kernel/signaldata/AlterTable.hpp new file mode 100644 index 00000000000..6469e673370 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/AlterTable.hpp @@ -0,0 +1,285 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef ALTER_TABLE_HPP +#define ALTER_TABLE_HPP + +#include "SignalData.hpp" + +/** + * AlterTable + * + * This signal is sent by API to DICT/TRIX + * as a request to alter a secondary index + * and then from TRIX to TRIX(n) and TRIX to TC. + */ +class AlterTableReq { + /** + * Sender(s) + */ + // API + + /** + * Sender(s) / Reciver(s) + */ + friend class NdbTableImpl; + friend class NdbEventOperationImpl; + friend class NdbDictInterface; + friend class Dbdict; + friend class Suma; + + /** + * For printing + */ + friend bool printALTER_TABLE_REQ(FILE*, const Uint32*, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 5 ); + +private: + Uint32 senderData; + Uint32 senderRef; + Uint32 changeMask; + Uint32 tableId; + Uint32 tableVersion; + + SECTION( DICT_TAB_INFO = 0 ); + +/** + * ChangeMask + */ + +/* + n = Changed name + f = Changed frm + d = Changed fragment data + r = Changed range or list array + t = Changed tablespace name array + s = Changed tablespace id array + + 1111111111222222222233 + 01234567890123456789012345678901 + nf------------------------------ +*/ +#define NAME_SHIFT (0) +#define FRM_SHIFT (1) +#define FRAG_DATA_SHIFT (2) +#define RANGE_LIST_SHIFT (3) +#define TS_NAME_SHIFT (4) +#define TS_SHIFT (5) + + /** + * Getters and setters + */ + static Uint8 getNameFlag(const UintR & changeMask); + static void setNameFlag(UintR & changeMask, Uint32 nameFlg); + static Uint8 getFrmFlag(const UintR & changeMask); + static void setFrmFlag(UintR & changeMask, Uint32 frmFlg); + static Uint8 getFragDataFlag(const UintR & changeMask); + static void setFragDataFlag(UintR & changeMask, Uint32 fragFlg); + static Uint8 getRangeListFlag(const UintR & changeMask); + static void setRangeListFlag(UintR & changeMask, Uint32 rangeFlg); + static Uint8 getTsNameFlag(const UintR & changeMask); + static void setTsNameFlag(UintR & changeMask, Uint32 tsNameFlg); + static Uint8 getTsFlag(const UintR & changeMask); + static void setTsFlag(UintR & changeMask, Uint32 tsFlg); +}; + +inline +Uint8 +AlterTableReq::getTsFlag(const UintR & changeMask){ + return (Uint8)((changeMask >> TS_SHIFT) & 1); +} + +inline +void +AlterTableReq::setTsFlag(UintR & changeMask, Uint32 tsFlg){ + changeMask |= (tsFlg << TS_SHIFT); +} + +inline +Uint8 +AlterTableReq::getNameFlag(const UintR & changeMask){ + return (Uint8)((changeMask >> NAME_SHIFT) & 1); +} + +inline +void +AlterTableReq::setNameFlag(UintR & changeMask, Uint32 nameFlg){ + changeMask |= (nameFlg << NAME_SHIFT); +} + +inline +Uint8 +AlterTableReq::getFrmFlag(const UintR & changeMask){ + return (Uint8)((changeMask >> FRM_SHIFT) & 1); +} + +inline +void +AlterTableReq::setFrmFlag(UintR & changeMask, Uint32 frmFlg){ + changeMask |= (frmFlg << FRM_SHIFT); +} + +inline +Uint8 +AlterTableReq::getFragDataFlag(const UintR & changeMask){ + return (Uint8)((changeMask >> FRAG_DATA_SHIFT) & 1); +} + +inline +void +AlterTableReq::setFragDataFlag(UintR & changeMask, Uint32 fragDataFlg){ + changeMask |= (fragDataFlg << FRAG_DATA_SHIFT); +} + +inline +Uint8 +AlterTableReq::getRangeListFlag(const UintR & changeMask){ + return (Uint8)((changeMask >> RANGE_LIST_SHIFT) & 1); +} + +inline +void +AlterTableReq::setRangeListFlag(UintR & changeMask, Uint32 rangeFlg){ + changeMask |= (rangeFlg << RANGE_LIST_SHIFT); +} + +inline +Uint8 +AlterTableReq::getTsNameFlag(const UintR & changeMask){ + return (Uint8)((changeMask >> TS_NAME_SHIFT) & 1); +} + +inline +void +AlterTableReq::setTsNameFlag(UintR & changeMask, Uint32 tsNameFlg){ + changeMask |= (tsNameFlg << TS_NAME_SHIFT); +} + + +class AlterTableRef { + /** + * Sender(s) + */ + friend class Dbdict; + + /** + * Sender(s) / Reciver(s) + */ + friend class Ndbcntr; + friend class NdbDictInterface; + + /** + * For printing + */ + friend bool printALTER_TABLE_REF(FILE *, const Uint32 *, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 7 ); + + enum ErrorCode { + NoError = 0, + InvalidTableVersion = 241, + DropInProgress = 283, + Busy = 701, + BusyWithNR = 711, + NotMaster = 702, + InvalidFormat = 703, + AttributeNameTooLong = 704, + TableNameTooLong = 705, + Inconsistency = 706, + NoMoreTableRecords = 707, + NoMoreAttributeRecords = 708, + NoSuchTable = 709, + AttributeNameTwice = 720, + TableAlreadyExist = 721, + ArraySizeTooBig = 737, + RecordTooBig = 738, + InvalidPrimaryKeySize = 739, + NullablePrimaryKey = 740, + UnsupportedChange = 741, + BackupInProgress = 762, + IncompatibleVersions = 763 + }; + +private: + Uint32 senderData; + Uint32 senderRef; + Uint32 masterNodeId; + Uint32 errorCode; + Uint32 errorLine; + Uint32 errorKey; + Uint32 status; + +public: + Uint32 getErrorCode() const { + return errorCode; + } + Uint32 getErrorLine() const { + return errorLine; + } +}; + +class AlterTableConf { + /** + * Sender(s) + */ + friend class Dbdict; + + /** + * Sender(s) / Reciver(s) + */ + friend class Ndbcntr; + friend class NdbDictInterface; + + /** + * For printing + */ + friend bool printALTER_TABLE_CONF(FILE *, const Uint32 *, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 4 ); + +private: + Uint32 senderData; + Uint32 senderRef; + Uint32 tableId; + Uint32 tableVersion; +}; + +/** + * Inform API about change of table definition + */ +struct AlterTableRep +{ + friend bool printALTER_TABLE_REP(FILE*, const Uint32*, Uint32, Uint16); + + STATIC_CONST( SignalLength = 3 ); + + enum Change_type + { + CT_ALTERED = 0x1, + CT_DROPPED = 0x2 + }; + + Uint32 tableId; + Uint32 tableVersion; + Uint32 changeType; + + SECTION( TABLE_NAME = 0 ); +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/AlterTrig.hpp b/storage/ndb/include/kernel/signaldata/AlterTrig.hpp new file mode 100644 index 00000000000..5ecda1c470c --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/AlterTrig.hpp @@ -0,0 +1,287 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef ALTER_TRIG_HPP +#define ALTER_TRIG_HPP + +#include "SignalData.hpp" +#include <Bitmask.hpp> +#include <trigger_definitions.h> + +/** + * AlterTrigReq. + */ +class AlterTrigReq { + friend bool printALTER_TRIG_REQ(FILE*, const Uint32*, Uint32, Uint16); + +public: + enum RequestType { + RT_UNDEFINED = 0, + RT_USER = 1, + RT_CREATE_TRIGGER = 2, + RT_DROP_TRIGGER = 3, + RT_DICT_PREPARE = 1 << 4, + RT_DICT_TC = 5 << 4, + RT_DICT_LQH = 6 << 4, + RT_DICT_COMMIT = 0xC << 4, + RT_DICT_ABORT = 0xF << 4 + }; + STATIC_CONST( SignalLength = 8 ); + +private: + Uint32 m_userRef; + Uint32 m_connectionPtr; + Uint32 m_requestInfo; + Uint32 m_tableId; + Uint32 m_triggerId; + Uint32 m_triggerInfo; + Uint32 m_online; // new state 0-offline 1-online + Uint32 m_receiverRef; // receiver for subscription trigger + // extra + Uint32 m_opKey; + +public: + Uint32 getUserRef() const { + return m_userRef; + } + void setUserRef(Uint32 val) { + m_userRef = val; + } + Uint32 getConnectionPtr() const { + return m_connectionPtr; + } + void setConnectionPtr(Uint32 val) { + m_connectionPtr = val; + } + AlterTrigReq::RequestType getRequestType() const { + const Uint32 val = BitmaskImpl::getField(1, &m_requestInfo, 0, 16); + return (AlterTrigReq::RequestType)val; + } + void setRequestType(AlterTrigReq::RequestType val) { + m_requestInfo = (Uint32)val; + } + Uint32 getRequestFlag() const { + return BitmaskImpl::getField(1, &m_requestInfo, 16, 16); + }; + void addRequestFlag(Uint32 val) { + val |= BitmaskImpl::getField(1, &m_requestInfo, 16, 16); + BitmaskImpl::setField(1, &m_requestInfo, 16, 16, val); + }; + Uint32 getTableId() const { + return m_tableId; + } + void setTableId(Uint32 val) { + m_tableId = val; + } + Uint32 getTriggerId() const { + return m_triggerId; + } + void setTriggerId(Uint32 val) { + m_triggerId = val; + } + Uint32 getTriggerInfo() const { + return m_triggerInfo; + } + void setTriggerInfo(Uint32 val) { + m_triggerInfo = val; + } + TriggerType::Value getTriggerType() const { + const Uint32 val = BitmaskImpl::getField(1, &m_triggerInfo, 0, 8); + return (TriggerType::Value)val; + } + void setTriggerType(TriggerType::Value val) { + BitmaskImpl::setField(1, &m_triggerInfo, 0, 8, (Uint32)val); + } + TriggerActionTime::Value getTriggerActionTime() const { + const Uint32 val = BitmaskImpl::getField(1, &m_triggerInfo, 8, 8); + return (TriggerActionTime::Value)val; + } + void setTriggerActionTime(TriggerActionTime::Value val) { + BitmaskImpl::setField(1, &m_triggerInfo, 8, 8, (Uint32)val); + } + TriggerEvent::Value getTriggerEvent() const { + const Uint32 val = BitmaskImpl::getField(1, &m_triggerInfo, 16, 8); + return (TriggerEvent::Value)val; + } + void setTriggerEvent(TriggerEvent::Value val) { + BitmaskImpl::setField(1, &m_triggerInfo, 16, 8, (Uint32)val); + } + bool getMonitorReplicas() const { + return BitmaskImpl::getField(1, &m_triggerInfo, 24, 1); + } + void setMonitorReplicas(bool val) { + BitmaskImpl::setField(1, &m_triggerInfo, 24, 1, val); + } + bool getMonitorAllAttributes() const { + return BitmaskImpl::getField(1, &m_triggerInfo, 25, 1); + } + void setMonitorAllAttributes(bool val) { + BitmaskImpl::setField(1, &m_triggerInfo, 25, 1, val); + } + Uint32 getOnline() const { + return m_online; + } + void setOnline(Uint32 val) { + m_online = val; + } + Uint32 getReceiverRef() const { + return m_receiverRef; + } + void setReceiverRef(Uint32 val) { + m_receiverRef = val; + } + Uint32 getOpKey() const { + return m_opKey; + } + void setOpKey(Uint32 val) { + m_opKey = val; + } +}; + +/** + * AlterTrigConf. + */ +class AlterTrigConf { + friend bool printALTER_TRIG_CONF(FILE*, const Uint32*, Uint32, Uint16); + +public: + STATIC_CONST( InternalLength = 3 ); + STATIC_CONST( SignalLength = 5 ); + +private: + Uint32 m_userRef; + Uint32 m_connectionPtr; + Uint32 m_requestInfo; + Uint32 m_tableId; + Uint32 m_triggerId; + +public: + Uint32 getUserRef() const { + return m_userRef; + } + void setUserRef(Uint32 val) { + m_userRef = val; + } + Uint32 getConnectionPtr() const { + return m_connectionPtr; + } + void setConnectionPtr(Uint32 val) { + m_connectionPtr = val; + } + AlterTrigReq::RequestType getRequestType() const { + return (AlterTrigReq::RequestType)m_requestInfo; + } + void setRequestType(AlterTrigReq::RequestType val) { + m_requestInfo = (Uint32)val; + } + Uint32 getTableId() const { + return m_tableId; + } + void setTableId(Uint32 val) { + m_tableId = val; + } + Uint32 getTriggerId() const { + return m_triggerId; + } + void setTriggerId(Uint32 val) { + m_triggerId = val; + } +}; + +/** + * AlterTrigRef. + */ +class AlterTrigRef { + friend bool printALTER_TRIG_REF(FILE*, const Uint32*, Uint32, Uint16); + +public: + enum ErrorCode { + NoError = 0, + Busy = 701, + TriggerNotFound = 4238, + TriggerExists = 4239, + BadRequestType = 4247 + }; + STATIC_CONST( SignalLength = AlterTrigConf::SignalLength + 3 ); + +private: + AlterTrigConf m_conf; + //Uint32 m_userRef; + //Uint32 m_connectionPtr; + //Uint32 m_requestInfo; + //Uint32 m_tableId; + //Uint32 m_triggerId; + Uint32 m_errorCode; + Uint32 m_errorLine; + Uint32 m_errorNode; + +public: + AlterTrigConf* getConf() { + return &m_conf; + } + const AlterTrigConf* getConf() const { + return &m_conf; + } + Uint32 getUserRef() const { + return m_conf.getUserRef(); + } + void setUserRef(Uint32 val) { + m_conf.setUserRef(val); + } + Uint32 getConnectionPtr() const { + return m_conf.getConnectionPtr(); + } + void setConnectionPtr(Uint32 val) { + m_conf.setConnectionPtr(val); + } + AlterTrigReq::RequestType getRequestType() const { + return m_conf.getRequestType(); + } + void setRequestType(AlterTrigReq::RequestType val) { + m_conf.setRequestType(val); + } + Uint32 getTableId() const { + return m_conf.getTableId(); + } + void setTableId(Uint32 val) { + m_conf.setTableId(val); + } + Uint32 getTriggerId() const { + return m_conf.getTriggerId(); + } + void setTriggerId(Uint32 val) { + m_conf.setTriggerId(val); + } + ErrorCode getErrorCode() const { + return (ErrorCode)m_errorCode; + } + void setErrorCode(ErrorCode val) { + m_errorCode = (Uint32)val; + } + Uint32 getErrorLine() const { + return m_errorLine; + } + void setErrorLine(Uint32 val) { + m_errorLine = val; + } + Uint32 getErrorNode() const { + return m_errorNode; + } + void setErrorNode(Uint32 val) { + m_errorNode = val; + } +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/ApiBroadcast.hpp b/storage/ndb/include/kernel/signaldata/ApiBroadcast.hpp new file mode 100644 index 00000000000..8d71d335103 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/ApiBroadcast.hpp @@ -0,0 +1,30 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef API_BROADCAST_HPP +#define API_BROADCAST_HPP + +#include "SignalData.hpp" + +struct ApiBroadcastRep +{ + STATIC_CONST( SignalLength = 2 ); + + Uint32 gsn; + Uint32 minVersion; + Uint32 theData[1]; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/ApiRegSignalData.hpp b/storage/ndb/include/kernel/signaldata/ApiRegSignalData.hpp new file mode 100644 index 00000000000..119b2cdfc61 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/ApiRegSignalData.hpp @@ -0,0 +1,92 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef API_REGCONF_HPP +#define API_REGCONF_HPP + +#include <NodeState.hpp> + +class ApiRegReq { + /** + * Sender(s) + */ + friend class ClusterMgr; + + /** + * Reciver(s) + */ + friend class Qmgr; + +public: + STATIC_CONST( SignalLength = 2 ); + +private: + Uint32 ref; + Uint32 version; // Version of API node +}; + +/** + * + */ +class ApiRegRef { + /** + * Sender(s) + */ + friend class Qmgr; + + /** + * Reciver(s) + */ + friend class ClusterMgr; + +public: + STATIC_CONST( SignalLength = 3 ); + + enum ErrorCode { + WrongType = 1, + UnsupportedVersion = 2 + }; +private: + Uint32 ref; // Qmgr ref + Uint32 version; // Version of NDB node + Uint32 errorCode; +}; + +/** + * + */ +class ApiRegConf { + /** + * Sender(s) + */ + friend class Qmgr; + + /** + * Reciver(s) + */ + friend class ClusterMgr; + +public: + STATIC_CONST( SignalLength = 4 + NodeState::DataLength ); +private: + + Uint32 qmgrRef; + Uint32 version; // Version of NDB node + Uint32 apiHeartbeatFrequency; + Uint32 minDbVersion; + NodeState nodeState; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/ApiVersion.hpp b/storage/ndb/include/kernel/signaldata/ApiVersion.hpp new file mode 100644 index 00000000000..c895d881f61 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/ApiVersion.hpp @@ -0,0 +1,58 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef API_VERSION_HPP +#define API_VERSION_HPP + +class ApiVersionReq { +/** + * Sender(s) + */ + friend class MgmtSrv; + + /** + * Reciver(s) + */ + friend class Qmgr; +public: + STATIC_CONST( SignalLength = 3 ); + Uint32 senderRef; + Uint32 nodeId; //api node id + Uint32 version; // Version of API node + + +}; + + + +class ApiVersionConf { +/** + * Sender(s) + */ + friend class Qmgr; + + /** + * Reciver(s) + */ + friend class MgmtSrv; +public: + STATIC_CONST( SignalLength = 4 ); + Uint32 senderRef; + Uint32 nodeId; //api node id + Uint32 version; // Version of API node + Uint32 inet_addr; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/ArbitSignalData.hpp b/storage/ndb/include/kernel/signaldata/ArbitSignalData.hpp new file mode 100644 index 00000000000..ed7e3929414 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/ArbitSignalData.hpp @@ -0,0 +1,156 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef ARBIT_SIGNAL_DATA_H +#define ARBIT_SIGNAL_DATA_H + +#include <string.h> +#include <NodeBitmask.hpp> +#include <NdbTick.h> +#include <NdbHost.h> +#include "SignalData.hpp" +#include "SignalDataPrint.hpp" + +/** + * The ticket. + */ +class ArbitTicket { +private: + Uint32 data[2]; + +public: + ArbitTicket() {} + STATIC_CONST( DataLength = 2 ); + STATIC_CONST( TextLength = DataLength * 8 ); // hex digits + + inline void clear() { + data[0] = 0; + data[1] = 0; + } + + inline void update() { + Uint16 cnt = data[0] & 0xFFFF; // previous count + Uint16 pid = NdbHost_GetProcessId(); + data[0] = (pid << 16) | (cnt + 1); + data[1] = NdbTick_CurrentMillisecond(); + } + + inline bool match(ArbitTicket& aTicket) const { + return + data[0] == aTicket.data[0] && + data[1] == aTicket.data[1]; + } + + inline void getText(char *buf, size_t buf_len) const { + BaseString::snprintf(buf, buf_len, "%08x%08x", data[0], data[1]); + } + +/* inline char* getText() const { + static char buf[TextLength + 1]; + getText(buf, sizeof(buf)); + return buf; + } */ +}; + +/** + * Result codes. Part of signal data. Each signal uses only + * a subset but a common namespace is convenient. + */ +class ArbitCode { +public: + STATIC_CONST( ErrTextLength = 80 ); + + enum { + NoInfo = 0, + + // CFG signals + CfgRank1 = 1, // these have to be 1 and 2 + CfgRank2 = 2, + + // QMGR continueB thread state + ThreadStart = 11, // continueB thread started + + // PREP signals + PrepPart1 = 21, // zero old ticket + PrepPart2 = 22, // get new ticket + PrepAtrun = 23, // late joiner gets ticket at RUN time + + // arbitrator state + ApiStart = 31, // arbitrator thread started + ApiFail = 32, // arbitrator died + ApiExit = 33, // arbitrator reported it will exit + + // arbitration result + LoseNodes = 41, // lose on ndb node count + WinNodes = 42, // win on ndb node count + WinGroups = 43, // we win, no need for arbitration + LoseGroups = 44, // we lose, missing node group + Partitioning = 45, // possible network partitioning + WinChoose = 46, // positive reply + LoseChoose = 47, // negative reply + LoseNorun = 48, // arbitrator required but not running + LoseNocfg = 49, // arbitrator required but none configured + + // general error codes + ErrTicket = 91, // invalid arbitrator-ticket + ErrToomany = 92, // too many requests + ErrState = 93, // invalid state + ErrTimeout = 94, // timeout waiting for signals + ErrUnknown = 95 // unknown error + }; + + static inline void getErrText(Uint32 code, char* buf, size_t buf_len) { + switch (code) { + case ErrTicket: + BaseString::snprintf(buf, buf_len, "invalid arbitrator-ticket"); + break; + case ErrToomany: + BaseString::snprintf(buf, buf_len, "too many requests"); + break; + case ErrState: + BaseString::snprintf(buf, buf_len, "invalid state"); + break; + case ErrTimeout: + BaseString::snprintf(buf, buf_len, "timeout"); + break; + default: + BaseString::snprintf(buf, buf_len, "unknown error [code=%u]", code); + break; + } + } +}; + +/** + * Common class for arbitration signal data. + */ +class ArbitSignalData { +public: + Uint32 sender; // sender's node id (must be word 0) + Uint32 code; // result code or other info + Uint32 node; // arbitrator node id + ArbitTicket ticket; // ticket + NodeBitmask mask; // set of nodes + + ArbitSignalData() {} + STATIC_CONST( SignalLength = 3 + ArbitTicket::DataLength + NodeBitmask::Size ); + + inline bool match(ArbitSignalData& aData) const { + return + node == aData.node && + ticket.match(aData.ticket); + } +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/AttrInfo.hpp b/storage/ndb/include/kernel/signaldata/AttrInfo.hpp new file mode 100644 index 00000000000..eafa79f0258 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/AttrInfo.hpp @@ -0,0 +1,53 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef ATTRINFO_HPP +#define ATTRINFO_HPP + +#include "SignalData.hpp" + +class AttrInfo { + /** + * Sender(s) + */ + friend class DbUtil; + + /** + * Receiver(s) + */ + friend class Dbtup; + + /** + * Sender(s) / Receiver(s) + */ + friend class Dbtc; + friend class Dblqh; + friend class NdbScanOperation; + friend class Restore; + + friend bool printATTRINFO(FILE *, const Uint32 *, Uint32, Uint16); + +public: + STATIC_CONST( HeaderLength = 3 ); + STATIC_CONST( DataLength = 22 ); + STATIC_CONST( MaxSignalLength = HeaderLength + DataLength ); + +private: + Uint32 connectPtr; + Uint32 transId[2]; + Uint32 attrData[DataLength]; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/BackupContinueB.hpp b/storage/ndb/include/kernel/signaldata/BackupContinueB.hpp new file mode 100644 index 00000000000..d96173d6807 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/BackupContinueB.hpp @@ -0,0 +1,40 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef BACKUP_CONTINUEB_H +#define BACKUP_CONTINUEB_H + +#include "SignalData.hpp" + +class BackupContinueB { + /** + * Sender(s)/Reciver(s) + */ + friend class Backup; + friend bool printCONTINUEB_BACKUP(FILE * output, const Uint32 * theData, Uint32 len); +private: + enum { + START_FILE_THREAD = 0, + BUFFER_UNDERFLOW = 1, + BUFFER_FULL_SCAN = 2, + BUFFER_FULL_FRAG_COMPLETE = 3, + BUFFER_FULL_META = 4, + BACKUP_FRAGMENT_INFO = 5, + RESET_DISK_SPEED_COUNTER = 6, + ZDELAY_SCAN_NEXT = 7 + }; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/BackupImpl.hpp b/storage/ndb/include/kernel/signaldata/BackupImpl.hpp new file mode 100644 index 00000000000..5286c975f13 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/BackupImpl.hpp @@ -0,0 +1,384 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef BACKUP_IMPL_HPP +#define BACKUP_IMPL_HPP + +#include "SignalData.hpp" +#include <NodeBitmask.hpp> + +class DefineBackupReq { + /** + * Sender(s) + */ + friend class BackupMaster; + + /** + * Reciver(s) + */ + friend class Backup; + friend class Dblqh; + + friend bool printDEFINE_BACKUP_REQ(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 9 + NdbNodeBitmask::Size); + +private: + /** + * i - value of backup object + */ + Uint32 backupPtr; + + Uint32 backupId; + Uint32 clientRef; + Uint32 clientData; + Uint32 senderRef; + + /** + * Which node(s) is participating in the backup + */ + NdbNodeBitmask nodes; + + /** + * Generated random number + */ + Uint32 backupKey[2]; + + /** + * Length of backup data + */ + Uint32 backupDataLen; + + /** + * Backup flags + */ + /* & 0x3 - waitCompleted + */ + Uint32 flags; +}; + +class DefineBackupRef { + /** + * Sender(s) + */ + friend class Backup; + friend class Dblqh; + + /** + * Reciver(s) + */ + friend class BackupMaster; + + friend bool printDEFINE_BACKUP_REF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 4 ); + + enum ErrorCode { + Undefined = 1340, + FailedToAllocateBuffers = 1342, + FailedToSetupFsBuffers = 1343, + FailedToAllocateTables = 1344, + FailedInsertFileHeader = 1345, + FailedInsertTableList = 1346, + FailedAllocateTableMem = 1347, + FailedToAllocateFileRecord = 1348, + FailedToAllocateAttributeRecord = 1349 + }; +private: + Uint32 backupId; + Uint32 backupPtr; + Uint32 errorCode; + Uint32 nodeId; +}; + +class DefineBackupConf { + /** + * Sender(s) + */ + friend class Backup; + friend class Dblqh; + + /** + * Reciver(s) + */ + friend class BackupMaster; + + friend bool printDEFINE_BACKUP_CONF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 2 ); + +private: + Uint32 backupId; + Uint32 backupPtr; +}; + +class StartBackupReq { + /** + * Sender(s) + */ + friend class BackupMaster; + + /** + * Reciver(s) + */ + friend class Backup; + + friend bool printSTART_BACKUP_REQ(FILE *, const Uint32 *, Uint32, Uint16); +public: + + STATIC_CONST( SignalLength = 2 ); + +private: + Uint32 backupId; + Uint32 backupPtr; +}; + +class StartBackupRef { + /** + * Sender(s) + */ + friend class Backup; + + /** + * Reciver(s) + */ + friend class BackupMaster; + + friend bool printSTART_BACKUP_REF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 4 ); + + enum ErrorCode { + FailedToAllocateTriggerRecord = 1 + }; +private: + Uint32 backupId; + Uint32 backupPtr; + Uint32 errorCode; + Uint32 nodeId; +}; + +class StartBackupConf { + /** + * Sender(s) + */ + friend class Backup; + + /** + * Reciver(s) + */ + friend class BackupMaster; + + friend bool printSTART_BACKUP_CONF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 2 ); + +private: + Uint32 backupId; + Uint32 backupPtr; +}; + +class BackupFragmentReq { + /** + * Sender(s) + */ + friend class BackupMaster; + + /** + * Reciver(s) + */ + friend class Backup; + friend class Dblqh; + + friend bool printBACKUP_FRAGMENT_REQ(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 5 ); + +private: + Uint32 backupId; + Uint32 backupPtr; + Uint32 tableId; + Uint32 fragmentNo; + Uint32 count; +}; + +class BackupFragmentRef { + /** + * Sender(s) + */ + friend class Backup; + friend class Dblqh; + + /** + * Reciver(s) + */ + friend class BackupMaster; + + friend bool printBACKUP_FRAGMENT_REF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 5 ); + +private: + Uint32 backupId; + Uint32 backupPtr; + Uint32 errorCode; + Uint32 nodeId; +}; + +class BackupFragmentConf { + /** + * Sender(s) + */ + friend class Backup; + friend class Dblqh; + + /** + * Reciver(s) + */ + friend class BackupMaster; + + friend bool printBACKUP_FRAGMENT_CONF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 8 ); + +private: + Uint32 backupId; + Uint32 backupPtr; + Uint32 tableId; + Uint32 fragmentNo; + Uint32 noOfRecordsLow; + Uint32 noOfBytesLow; + Uint32 noOfRecordsHigh; + Uint32 noOfBytesHigh; +}; + +class BackupFragmentCompleteRep { +public: + STATIC_CONST( SignalLength = 8 ); + + Uint32 backupId; + Uint32 backupPtr; + Uint32 tableId; + Uint32 fragmentNo; + Uint32 noOfTableRowsLow; + Uint32 noOfFragmentRowsLow; + Uint32 noOfTableRowsHigh; + Uint32 noOfFragmentRowsHigh; +}; + +class StopBackupReq { + /** + * Sender(s) + */ + friend class BackupMaster; + + /** + * Reciver(s) + */ + friend class Backup; + + friend bool printSTOP_BACKUP_REQ(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 4 ); + +private: + Uint32 backupId; + Uint32 backupPtr; + Uint32 startGCP; + Uint32 stopGCP; +}; + +class StopBackupRef { + /** + * Sender(s) + */ + friend class Backup; + + /** + * Reciver(s) + */ + friend class BackupMaster; + + friend bool printSTOP_BACKUP_REF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 4 ); + +private: + Uint32 backupId; + Uint32 backupPtr; + Uint32 errorCode; + Uint32 nodeId; +}; + +class StopBackupConf { + /** + * Sender(s) + */ + friend class Backup; + + /** + * Reciver(s) + */ + friend class BackupMaster; + + friend bool printSTOP_BACKUP_CONF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 4 ); + +private: + Uint32 backupId; + Uint32 backupPtr; + Uint32 noOfLogBytes; + Uint32 noOfLogRecords; +}; + +class BackupStatusReq { + /** + * Sender(s) + */ + friend class BackupMaster; + + /** + * Reciver(s) + */ + friend class Backup; + + friend bool printBACKUP_STATUS_REQ(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 1 ); + +private: +}; + +class BackupStatusConf { + /** + * Sender(s) + */ + friend class Backup; + + /** + * Reciver(s) + */ + friend class BackupMaster; + + friend bool printBACKUP_STATUS_CONF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 1 ); + +private: +}; + + +#endif diff --git a/storage/ndb/include/kernel/signaldata/BackupSignalData.hpp b/storage/ndb/include/kernel/signaldata/BackupSignalData.hpp new file mode 100644 index 00000000000..21e24fcf5bc --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/BackupSignalData.hpp @@ -0,0 +1,260 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef BACKUP_HPP +#define BACKUP_HPP + +#include "SignalData.hpp" +#include <NodeBitmask.hpp> + +/** + * Request to start a backup + */ +class BackupReq { + /** + * Sender(s) + */ + friend class MgmtSrvr; + + /** + * Reciver(s) + */ + friend class Backup; + + friend bool printBACKUP_REQ(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 3 ); + +private: + Uint32 senderData; + Uint32 backupDataLen; + /* & 0x3 - waitCompleted + */ + Uint32 flags; +}; + +class BackupData { + /** + * Sender(s) + */ + friend class BackupMaster; + + /** + * Reciver(s) + */ + friend class Backup; + + friend bool printBACKUP_DATA(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 25 ); + + enum KeyValues { + /** + * Buffer(s) and stuff + */ + BufferSize = 1, // In MB + BlockSize = 2, // Write in chunks of this (in bytes) + MinWrite = 3, // Minimum write as multiple of blocksize + MaxWrite = 4, // Maximum write as multiple of blocksize + + // Max throughput + // Parallell files + + NoOfTables = 1000, + TableName = 1001 // char* + }; +private: + enum RequestType { + ClientToMaster = 1, + MasterToSlave = 2 + }; + Uint32 requestType; + + union { + Uint32 backupPtr; + Uint32 senderData; + }; + Uint32 backupId; + + /** + * totalLen = totalLen_offset >> 16 + * offset = totalLen_offset & 0xFFFF + */ + Uint32 totalLen_offset; + + /** + * Length in this = signal->length() - 3 + * Sender block ref = signal->senderBlockRef() + */ + Uint32 backupData[21]; +}; + +/** + * The request to start a backup was refused + */ +class BackupRef { + /** + * Sender(s) + */ + friend class Backup; + + /** + * Reciver(s) + */ + friend class MgmtSrvr; + + friend bool printBACKUP_REF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 3 ); + +private: + enum ErrorCodes { + Undefined = 1300, + IAmNotMaster = 1301, + OutOfBackupRecord = 1302, + OutOfResources = 1303, + SequenceFailure = 1304, + BackupDefinitionNotImplemented = 1305, + CannotBackupDiskless = 1306 + }; + Uint32 senderData; + Uint32 errorCode; + union { + Uint32 masterRef; + }; +}; + +/** + * The backup has started + */ +class BackupConf { + /** + * Sender(s) + */ + friend class Backup; + + /** + * Reciver(s) + */ + friend class MgmtSrvr; + + friend bool printBACKUP_CONF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 2 + NdbNodeBitmask::Size ); + +private: + Uint32 senderData; + Uint32 backupId; + NdbNodeBitmask nodes; +}; + +/** + * A backup has been aborted + */ +class BackupAbortRep { + /** + * Sender(s) + */ + friend class Backup; + + /** + * Reciver(s) + */ + friend class MgmtSrvr; + + friend bool printBACKUP_ABORT_REP(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 3 ); + +private: + Uint32 senderData; + Uint32 backupId; + Uint32 reason; +}; + +/** + * A backup has been completed + */ +class BackupCompleteRep { + /** + * Sender(s) + */ + friend class Backup; + + /** + * Reciver(s) + */ + friend class MgmtSrvr; + + friend bool printBACKUP_COMPLETE_REP(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 10 + NdbNodeBitmask::Size ); +private: + Uint32 senderData; + Uint32 backupId; + Uint32 startGCP; + Uint32 stopGCP; + Uint32 noOfBytesLow; + Uint32 noOfRecordsLow; + Uint32 noOfLogBytes; + Uint32 noOfLogRecords; + NdbNodeBitmask nodes; + Uint32 noOfBytesHigh; + Uint32 noOfRecordsHigh; +}; + +/** + * A master has finished taking-over backup responsiblility + */ +class BackupNFCompleteRep { + friend bool printBACKUP_NF_COMPLETE_REP(FILE*, const Uint32*, Uint32, Uint16); +}; + +/** + * Abort of backup + */ +class AbortBackupOrd { + /** + * Sender / Reciver + */ + friend class Backup; + friend class MgmtSrvr; + + friend bool printABORT_BACKUP_ORD(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 3 ); + + enum RequestType { + ClientAbort = 1321, + BackupComplete = 1322, + BackupFailure = 1323, // General backup failure coordinator -> slave + LogBufferFull = 1324, // slave -> coordinator + FileOrScanError = 1325, // slave -> coordinator + BackupFailureDueToNodeFail = 1326, // slave -> slave + OkToClean = 1327 // master -> slave + + ,AbortScan = 1328 + ,IncompatibleVersions = 1329 + }; +private: + Uint32 requestType; + Uint32 backupId; + union { + Uint32 backupPtr; + Uint32 senderData; + }; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/BlockCommitOrd.hpp b/storage/ndb/include/kernel/signaldata/BlockCommitOrd.hpp new file mode 100644 index 00000000000..924045926f9 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/BlockCommitOrd.hpp @@ -0,0 +1,61 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef BLOCK_COMMIT_ORD_HPP +#define BLOCK_COMMIT_ORD_HPP + +/** + * These two signals are sent via EXECUTE_DIRECT + * to DBDIH from QMGR + * + * Block make sure that no commit is performed + * Unblock turns on commit again + */ + +class BlockCommitOrd { + /** + * Sender(s) + */ + friend class Qmgr; + + /** + * Reciver(s) + */ + friend class Dbdih; +public: + STATIC_CONST( SignalLength = 1 ); + +private: + Uint32 failNo; // As used by Qmgr +}; + +class UnblockCommitOrd { + /** + * Sender(s) + */ + friend class Qmgr; + + /** + * Reciver(s) + */ + friend class Dbdih; +public: + STATIC_CONST( SignalLength = 1 ); + +private: + Uint32 failNo; // As used by Qmgr +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/BuildIndx.hpp b/storage/ndb/include/kernel/signaldata/BuildIndx.hpp new file mode 100644 index 00000000000..d52dee648b8 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/BuildIndx.hpp @@ -0,0 +1,307 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef BUILD_INDX_HPP +#define BUILD_INDX_HPP + +#include "SignalData.hpp" +#include <NodeBitmask.hpp> +#include <signaldata/DictTabInfo.hpp> + +/** + * BuildIndxReq + * + * This signal is sent by DICT to TRIX(n) + * as a request to build a secondary index + */ +class BuildIndxReq { + friend bool printBUILD_INDX_REQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); + +public: + enum RequestType { + RT_UNDEFINED = 0, + RT_USER = 1, + RT_ALTER_INDEX = 2, + RT_SYSTEMRESTART = 3, + RT_DICT_PREPARE = 1 << 4, + RT_DICT_TC = 5 << 4, + RT_DICT_TRIX = 7 << 4, + RT_DICT_TUX = 8 << 4, + RT_DICT_COMMIT = 0xC << 4, + RT_DICT_ABORT = 0xF << 4, + RT_TRIX = 7 << 8 + }; + STATIC_CONST( SignalLength = 9 ); + STATIC_CONST( INDEX_COLUMNS = 0 ); + STATIC_CONST( KEY_COLUMNS = 1 ); + STATIC_CONST( NoOfSections = 2 ); + +private: + Uint32 m_userRef; // user block reference + Uint32 m_connectionPtr; // user "schema connection" + Uint32 m_requestInfo; + Uint32 m_buildId; // Suma subscription id + Uint32 m_buildKey; // Suma subscription key + Uint32 m_tableId; // table being indexed + Uint32 m_indexType; // from DictTabInfo::TableType + Uint32 m_indexId; // table storing index + Uint32 m_parallelism; // number of parallel insert transactions + // extra + Uint32 m_opKey; + // Sent data ends here + Uint32 m_slack[25 - SignalLength - 1]; + Uint32 m_sectionBuffer[MAX_ATTRIBUTES_IN_TABLE * 2]; + +public: + Uint32 getUserRef() const { + return m_userRef; + } + void setUserRef(Uint32 val) { + m_userRef = val; + } + Uint32 getConnectionPtr() const { + return m_connectionPtr; + } + void setConnectionPtr(Uint32 val) { + m_connectionPtr = val; + } + BuildIndxReq::RequestType getRequestType() const { + const Uint32 val = BitmaskImpl::getField(1, &m_requestInfo, 0, 16); + return (BuildIndxReq::RequestType)val; + } + void setRequestType(BuildIndxReq::RequestType val) { + m_requestInfo = (Uint32)val; + } + Uint32 getRequestFlag() const { + const Uint32 val = BitmaskImpl::getField(1, &m_requestInfo, 16, 16); + return (BuildIndxReq::RequestType)val; + }; + void addRequestFlag(Uint32 val) { + val |= BitmaskImpl::getField(1, &m_requestInfo, 16, 16); + BitmaskImpl::setField(1, &m_requestInfo, 16, 16, val); + }; + Uint32 getTableId() const { + return m_tableId; + } + void setTableId(Uint32 val) { + m_tableId = val; + } + Uint32 getBuildId() const { + return m_buildId; + } + void setBuildId(Uint32 val) { + m_buildId = val; + } + Uint32 getBuildKey() const { + return m_buildKey; + } + void setBuildKey(Uint32 val) { + m_buildKey = val; + } + Uint32 getIndexType() const { + return m_indexType; + } + void setIndexType(Uint32 val) { + m_indexType = val; + } + Uint32 getIndexId() const { + return m_indexId; + } + void setIndexId(Uint32 val) { + m_indexId = val; + } + Uint32 getParallelism() const { + return m_parallelism; + } + void setParallelism(Uint32 val) { + m_parallelism = val; + } + Uint32 getOpKey() const { + return m_opKey; + } + void setOpKey(Uint32 val) { + m_opKey = val; + } + // Column order + void setColumnOrder(Uint32* indexBuf, Uint32 indexLen, + Uint32* keyBuf, Uint32 keyLen, + struct LinearSectionPtr orderPtr[]); +}; + +inline +void BuildIndxReq::setColumnOrder(Uint32* indexBuf, Uint32 indexLen, + Uint32* keyBuf, Uint32 keyLen, + struct LinearSectionPtr orderPtr[]) + +{ + printf("BuildIndxReq::setColumnOrder: indexLen %u, keyLen %u\n", indexLen, keyLen); + // Copy buffers + MEMCOPY_NO_WORDS(m_sectionBuffer, indexBuf, indexLen); + MEMCOPY_NO_WORDS(m_sectionBuffer + indexLen, keyBuf, keyLen); + orderPtr[INDEX_COLUMNS].p = m_sectionBuffer; + orderPtr[INDEX_COLUMNS].sz = indexLen; + orderPtr[KEY_COLUMNS].p = m_sectionBuffer + indexLen; + orderPtr[KEY_COLUMNS].sz = keyLen; +} + +/** + * BuildIndxConf + * + * This signal is sent back to DICT from TRIX + * as confirmation of succesfull index build + * (BuildIndxReq). + */ +class BuildIndxConf { + friend bool printBUILD_INDX_CONF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); + +public: + STATIC_CONST( InternalLength = 3 ); + STATIC_CONST( SignalLength = 6 ); + +private: + friend class BuildIndxRef; + Uint32 m_userRef; + Uint32 m_connectionPtr; + Uint32 m_requestInfo; + Uint32 m_tableId; + Uint32 m_indexType; + Uint32 m_indexId; + +public: + Uint32 getUserRef() const { + return m_userRef; + } + void setUserRef(Uint32 val) { + m_userRef = val; + } + Uint32 getConnectionPtr() const { + return m_connectionPtr; + } + void setConnectionPtr(Uint32 val) { + m_connectionPtr = val; + } + BuildIndxReq::RequestType getRequestType() const { + return (BuildIndxReq::RequestType)m_requestInfo; + } + void setRequestType(BuildIndxReq::RequestType val) { + m_requestInfo = (Uint32)val; + } + Uint32 getTableId() const { + return m_tableId; + } + void setTableId(Uint32 val) { + m_tableId = val; + } + Uint32 getIndexType() const { + return m_indexType; + } + void setIndexType(Uint32 val) { + m_indexType = val; + } + Uint32 getIndexId() const { + return m_indexId; + } + void setIndexId(Uint32 val) { + m_indexId = val; + } +}; + +/** + * BuildIndxRef + * + * This signal is sent back to API from DICT/TRIX + * as refusal of a failed index creation + * (BuildIndxReq). It is also sent as refusal + * from TC to TRIX and TRIX to DICT. + */ +class BuildIndxRef { + friend bool printBUILD_INDX_REF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); + +public: + enum ErrorCode { + NoError = 0, + Busy = 701, + NotMaster = 702, + BadRequestType = 4247, + InvalidPrimaryTable = 4249, + InvalidIndexType = 4250, + IndexNotUnique = 4251, + AllocationFailure = 4252, + InternalError = 4346 + }; + STATIC_CONST( SignalLength = BuildIndxConf::SignalLength + 2 ); + + //Uint32 m_userRef; + //Uint32 m_connectionPtr; + //Uint32 m_requestInfo; + //Uint32 m_tableId; + //Uint32 m_indexType; + //Uint32 m_indexId; + BuildIndxConf m_conf; + Uint32 m_errorCode; + Uint32 masterNodeId; + +public: + BuildIndxConf* getConf() { + return &m_conf; + } + const BuildIndxConf* getConf() const { + return &m_conf; + } + Uint32 getUserRef() const { + return m_conf.getUserRef(); + } + void setUserRef(Uint32 val) { + m_conf.setUserRef(val); + } + Uint32 getConnectionPtr() const { + return m_conf.getConnectionPtr(); + } + void setConnectionPtr(Uint32 val) { + m_conf.setConnectionPtr(val); + } + BuildIndxReq::RequestType getRequestType() const { + return m_conf.getRequestType(); + } + void setRequestType(BuildIndxReq::RequestType val) { + m_conf.setRequestType(val); + } + Uint32 getTableId() const { + return m_conf.getTableId(); + } + void setTableId(Uint32 val) { + m_conf.setTableId(val); + } + Uint32 getIndexType() const { + return m_conf.getIndexType(); + } + void setIndexType(Uint32 val) { + m_conf.setIndexType(val); + } + Uint32 getIndexId() const { + return m_conf.getIndexId(); + } + void setIndexId(Uint32 val) { + m_conf.setIndexId(val); + } + BuildIndxRef::ErrorCode getErrorCode() const { + return (BuildIndxRef::ErrorCode)m_errorCode; + } + void setErrorCode(BuildIndxRef::ErrorCode val) { + m_errorCode = (Uint32)val; + } +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/CheckNodeGroups.hpp b/storage/ndb/include/kernel/signaldata/CheckNodeGroups.hpp new file mode 100644 index 00000000000..6fc04a31709 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/CheckNodeGroups.hpp @@ -0,0 +1,60 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef CHECKNODEGROUPS_H +#define CHECKNODEGROUPS_H + +#include <string.h> +#include <NodeBitmask.hpp> +#include "SignalData.hpp" +#include "SignalDataPrint.hpp" + +/** + * Ask DIH to check if a node set can survive i.e. if it + * has at least one node in every node group. Returns one + * of Win, Lose, Partitioning. + * + * Same class is used for REQ and CONF. The REQ can also + * be executed as a direct signal. + */ +class CheckNodeGroups { +public: + Uint32 blockRef; // sender's node id + union { + Uint32 requestType; // direct flag, output code + Uint32 output; + }; + + Uint32 nodeId; // nodeId input for GetNodeGroupMembers + NodeBitmask mask; /* set of NDB nodes, input for ArbitCheck, + * output for GetNodeGroupMembers + */ + enum RequestType { + Direct = 0x1, + ArbitCheck = 0x2, + GetNodeGroup = 0x4, + GetNodeGroupMembers = 0x8 + }; + + enum Output { + Lose = 1, // we cannot survive + Win = 2, // we and only we can survive + Partitioning = 3 // possible network partitioning + }; + + STATIC_CONST( SignalLength = 3 + NodeBitmask::Size ); +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/CloseComReqConf.hpp b/storage/ndb/include/kernel/signaldata/CloseComReqConf.hpp new file mode 100644 index 00000000000..fbc92acfb2f --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/CloseComReqConf.hpp @@ -0,0 +1,52 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef CLOSE_COMREQCONF_HPP +#define CLOSE_COMREQCONF_HPP + +#include "SignalData.hpp" +#include <NodeBitmask.hpp> + +/** + * The Req signal is sent by Qmgr to Cmvmi + * and the Conf signal is sent back + * + * NOTE that the signals are identical + */ +class CloseComReqConf { + + /** + * Sender(s) / Reciver(s) + */ + friend class Qmgr; + friend class Cmvmi; + + /** + * For printing + */ + friend bool printCLOSECOMREQCONF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); + +public: + STATIC_CONST( SignalLength = 3 + NodeBitmask::Size ); +private: + + Uint32 xxxBlockRef; + Uint32 failNo; + + Uint32 noOfNodes; + Uint32 theNodes[NodeBitmask::Size]; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/CmInit.hpp b/storage/ndb/include/kernel/signaldata/CmInit.hpp new file mode 100644 index 00000000000..a61c58abb51 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/CmInit.hpp @@ -0,0 +1,47 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef CM_INIT_HPP +#define CM_INIT_HPP + +#include <NodeBitmask.hpp> + +/** + * + */ +class CmInit { + /** + * Sender(s) + */ + friend class Cmvmi; + + /** + * Reciver(s) + */ + friend class Qmgr; + +public: + STATIC_CONST( SignalLength = 4 + NodeBitmask::Size ); +private: + + Uint32 heartbeatDbDb; + Uint32 heartbeatDbApi; + Uint32 inactiveTransactionCheck; + Uint32 arbitTimeout; + + Uint32 allNdbNodes[NodeBitmask::Size]; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/CmRegSignalData.hpp b/storage/ndb/include/kernel/signaldata/CmRegSignalData.hpp new file mode 100644 index 00000000000..e2e35cc9f93 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/CmRegSignalData.hpp @@ -0,0 +1,212 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef CM_REG_HPP +#define CM_REG_HPP + +#include <NodeBitmask.hpp> + +/** + * This is the first distributed signal + * (the node tries to register in the cluster) + */ +class CmRegReq { + /** + * Sender(s) & Reciver(s) + */ + friend class Qmgr; + +public: + STATIC_CONST( SignalLength = 5 + NdbNodeBitmask::Size ); +private: + + Uint32 blockRef; + Uint32 nodeId; + Uint32 version; // See ndb_version.h + + Uint32 start_type; // As specified by cmd-line or mgm, NodeState::StartType + Uint32 latest_gci; // 0 means no fs + Uint32 skip_nodes[NdbNodeBitmask::Size]; // Nodes that does not _need_ + // to be part of restart +}; + +/** + * The node receving this signal has been accepted into the cluster + */ +class CmRegConf { + /** + * Sender(s) & Reciver(s) + */ + friend class Qmgr; + +public: + STATIC_CONST( SignalLength = 4 + NdbNodeBitmask::Size ); +private: + + Uint32 presidentBlockRef; + Uint32 presidentNodeId; + Uint32 presidentVersion; + + /** + * The dynamic id that the node reciving this signal has + */ + Uint32 dynamicId; + Uint32 allNdbNodes[NdbNodeBitmask::Size]; +}; + +/** + * + */ +class CmRegRef { + /** + * Sender(s) & Reciver(s) + */ + friend class Qmgr; + +public: + STATIC_CONST( SignalLength = 7 + NdbNodeBitmask::Size ); + + enum ErrorCode { + ZBUSY = 0, /* Only the president can send this */ + ZBUSY_PRESIDENT = 1,/* Only the president can send this */ + ZBUSY_TO_PRES = 2, /* Only the president can send this */ + ZNOT_IN_CFG = 3, /* Only the president can send this */ + ZELECTION = 4, /* Receiver is definitely not president, + * but we are not sure if sender ends up + * as president. */ + ZNOT_PRESIDENT = 5, /* We are not president */ + ZNOT_DEAD = 6, /* We are not dead when we are starting */ + ZINCOMPATIBLE_VERSION = 7, + ZINCOMPATIBLE_START_TYPE = 8, + ZSINGLE_USER_MODE = 9, /* The cluster is in single user mode, + * data node is not allowed to get added + * in the cluster while in single user mode */ + ZGENERIC = 100 /* The generic error code */ + }; +private: + + Uint32 blockRef; + Uint32 nodeId; + Uint32 errorCode; + /** + * Applicable if ZELECTION + */ + Uint32 presidentCandidate; + Uint32 candidate_latest_gci; // 0 means non + + /** + * Data for sending node sending node + */ + Uint32 latest_gci; + Uint32 start_type; + Uint32 skip_nodes[NdbNodeBitmask::Size]; // Nodes that does not _need_ + // to be part of restart +}; + +class CmAdd { + /** + * Sender(s) & Reciver(s) + */ + friend class Qmgr; + +public: + STATIC_CONST( SignalLength = 3 ); + +private: + enum RequestType { + Prepare = 0, + AddCommit = 1, + CommitNew = 2 + }; + + Uint32 requestType; + Uint32 startingNodeId; + Uint32 startingVersion; +}; + +class CmAckAdd { + /** + * Sender(s) & Reciver(s) + */ + friend class Qmgr; + +public: + STATIC_CONST( SignalLength = 3 ); + +private: + Uint32 senderNodeId; + Uint32 requestType; // see CmAdd::RequestType + Uint32 startingNodeId; +}; + +class CmNodeInfoReq { + /** + * Sender(s) & Reciver(s) + */ + friend class Qmgr; + +public: + STATIC_CONST( SignalLength = 3 ); + +private: + /** + * This is information for sending node (starting node) + */ + Uint32 nodeId; + Uint32 dynamicId; + Uint32 version; +}; + +class CmNodeInfoRef { + /** + * Sender(s) & Reciver(s) + */ + friend class Qmgr; + +public: + STATIC_CONST( SignalLength = 3 ); + + enum ErrorCode { + NotRunning = 1 + }; + +private: + Uint32 nodeId; + Uint32 errorCode; +}; + +class CmNodeInfoConf { + /** + * Sender(s) & Reciver(s) + */ + friend class Qmgr; + +public: + STATIC_CONST( SignalLength = 3 ); + +private: + Uint32 nodeId; + Uint32 dynamicId; + Uint32 version; +}; + +#endif + + + + + + + diff --git a/storage/ndb/include/kernel/signaldata/CmvmiCfgConf.hpp b/storage/ndb/include/kernel/signaldata/CmvmiCfgConf.hpp new file mode 100644 index 00000000000..dc2eaee786b --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/CmvmiCfgConf.hpp @@ -0,0 +1,48 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef CMVMI_CFGCONF_H +#define CMVMI_CFGCONF_H + +#include "SignalData.hpp" + +/** + * This signal is used for transfering the + * ISP_X Data + * + * I.e. Configuration data which is sent in a specific start phase + * + */ +class CmvmiCfgConf { + /** + * Sender(s) + */ + friend class Cmvmi; + + /** + * Reciver(s) + */ + friend class Ndbcntr; + +public: + STATIC_CONST( NO_OF_WORDS = 16 ); + STATIC_CONST( LENGTH = 17 ); +private: + + Uint32 startPhase; + Uint32 theData[NO_OF_WORDS]; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/CntrMasterConf.hpp b/storage/ndb/include/kernel/signaldata/CntrMasterConf.hpp new file mode 100644 index 00000000000..f2948a8835e --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/CntrMasterConf.hpp @@ -0,0 +1,46 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef CNTR_MASTERCONF_HPP +#define CNTR_MASTERCONF_HPP + +#include <NodeBitmask.hpp> + +/** + * This signals is sent by NdbCntr-Master to NdbCntr + */ +class CntrMasterConf { + /** + * Sender(s) + */ + + /** + * Sender(s) / Reciver(s) + */ + friend class Ndbcntr; + + /** + * Reciver(s) + */ + +public: + STATIC_CONST( SignalLength = 1 + NodeBitmask::Size ); +private: + + Uint32 noStartNodes; + Uint32 theNodes[NodeBitmask::Size]; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/CntrMasterReq.hpp b/storage/ndb/include/kernel/signaldata/CntrMasterReq.hpp new file mode 100644 index 00000000000..50ff9b95e6c --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/CntrMasterReq.hpp @@ -0,0 +1,49 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef CNTR_MASTERREQ_HPP +#define CNTR_MASTERREQ_HPP + +#include <NodeBitmask.hpp> + +/** + * This signals is sent by NdbCntr-Master to NdbCntr + */ +class CntrMasterReq { + /** + * Sender(s) + */ + + /** + * Sender(s) / Reciver(s) + */ + friend class Ndbcntr; + + /** + * Reciver(s) + */ + +public: + STATIC_CONST( SignalLength = 4 + NodeBitmask::Size ); +private: + + Uint32 userBlockRef; + Uint32 userNodeId; + Uint32 typeOfStart; + Uint32 noRestartNodes; + Uint32 theNodes[NodeBitmask::Size]; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/CntrStart.hpp b/storage/ndb/include/kernel/signaldata/CntrStart.hpp new file mode 100644 index 00000000000..9fc25a3fc4b --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/CntrStart.hpp @@ -0,0 +1,84 @@ +/* Copyright (C) 2004 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + +#ifndef CNTR_START_HPP +#define CNTR_START_HPP + +#include <NodeBitmask.hpp> + +/** + * + */ +class CntrStartReq { + /** + * Sender(s) / Reciver(s) + */ + friend class Ndbcntr; + + friend bool printCNTR_START_REQ(FILE*, const Uint32 *, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 3 ); +private: + + Uint32 nodeId; + Uint32 startType; + Uint32 lastGci; +}; + +class CntrStartRef { + /** + * Sender(s) / Reciver(s) + */ + friend class Ndbcntr; + + friend bool printCNTR_START_REF(FILE*, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 2 ); + + enum ErrorCode { + OK = 0, + NotMaster = 1, + StopInProgress = 2 + }; +private: + + Uint32 errorCode; + Uint32 masterNodeId; +}; + +class CntrStartConf { + /** + * Sender(s) / Reciver(s) + */ + friend class Ndbcntr; + friend struct UpgradeStartup; + + friend bool printCNTR_START_CONF(FILE*, const Uint32 *, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 4 + 2 * NdbNodeBitmask::Size ); + +private: + + Uint32 startType; + Uint32 startGci; + Uint32 masterNodeId; + Uint32 noStartNodes; + Uint32 startedNodes[NdbNodeBitmask::Size]; + Uint32 startingNodes[NdbNodeBitmask::Size]; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/ConfigParamId.hpp b/storage/ndb/include/kernel/signaldata/ConfigParamId.hpp new file mode 100644 index 00000000000..90d604fd024 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/ConfigParamId.hpp @@ -0,0 +1,70 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef ConfigParamId_H +#define ConfigParamId_H + + enum ConfigParamId { + + Id, + ExecuteOnComputer, + MaxNoOfSavedMessages, + ShmKey, + + LockPagesInMainMemory, + TimeBetweenWatchDogCheck, + StopOnError, + + MaxNoOfConcurrentOperations, + MaxNoOfConcurrentTransactions, + MemorySpaceIndexes, + MemorySpaceTuples, + MemoryDiskPages, + NoOfFreeDiskClusters, + NoOfDiskClusters, + + TimeToWaitAlive, + HeartbeatIntervalDbDb, + HeartbeatIntervalDbApi, + ArbitTimeout, + + TimeBetweenLocalCheckpoints, + TimeBetweenGlobalCheckpoints, + NoOfFragmentLogFiles, + NoOfConcurrentCheckpointsDuringRestart, + TransactionDeadlockDetectionTimeout, + TransactionInactiveTime, + NoOfConcurrentProcessesHandleTakeover, + + NoOfConcurrentCheckpointsAfterRestart, + + NoOfDiskPagesToDiskDuringRestartTUP, + NoOfDiskPagesToDiskAfterRestartTUP, + NoOfDiskPagesToDiskDuringRestartACC, + NoOfDiskPagesToDiskAfterRestartACC, + + NoOfDiskClustersPerDiskFile, + NoOfDiskFiles, + + MaxNoOfSavedEvents + }; + +#endif // ConfigParamId_H + + + + + + diff --git a/storage/ndb/include/kernel/signaldata/ContinueFragmented.hpp b/storage/ndb/include/kernel/signaldata/ContinueFragmented.hpp new file mode 100644 index 00000000000..31f47392a8b --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/ContinueFragmented.hpp @@ -0,0 +1,35 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef CONTINUE_FRAGMENTED_HPP +#define CONTINUE_FRAGMENTED_HPP + +#include "SignalData.hpp" + +class ContinueFragmented { + + /** + * Sender/Reciver(s) + */ + friend class SimulatedBlock; + + friend bool printCONTINUE_FRAGMENTED(FILE *,const Uint32 *, Uint32, Uint16); +public: + +private: + Uint32 line; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/CopyActive.hpp b/storage/ndb/include/kernel/signaldata/CopyActive.hpp new file mode 100644 index 00000000000..2107d63ca5d --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/CopyActive.hpp @@ -0,0 +1,83 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef COPY_ACTIVE_HPP +#define COPY_ACTIVE_HPP + +#include "SignalData.hpp" + +class CopyActiveReq { + /** + * Sender(s) + */ + friend class Dbdih; + + /** + * Receiver(s) + */ + friend class Dblqh; +public: + STATIC_CONST( SignalLength = 5 ); + +private: + Uint32 userPtr; + Uint32 userRef; + Uint32 tableId; + Uint32 fragId; + Uint32 distributionKey; +}; + +class CopyActiveConf { + /** + * Sender(s) + */ + friend class Dblqh; + + /** + * Receiver(s) + */ + friend class Dbdih; +public: + STATIC_CONST( SignalLength = 5 ); + +private: + Uint32 userPtr; + Uint32 startingNodeId; + Uint32 tableId; + Uint32 fragId; + Uint32 startGci; +}; +class CopyActiveRef { + /** + * Sender(s) + */ + friend class Dblqh; + + /** + * Receiver(s) + */ + friend class Dbdih; +public: + STATIC_CONST( SignalLength = 5 ); + +private: + Uint32 userPtr; + Uint32 startingNodeId; + Uint32 tableId; + Uint32 fragId; + Uint32 errorCode; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/CopyFrag.hpp b/storage/ndb/include/kernel/signaldata/CopyFrag.hpp new file mode 100644 index 00000000000..06dd4070264 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/CopyFrag.hpp @@ -0,0 +1,98 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef COPY_FRAG_HPP +#define COPY_FRAG_HPP + +#include "SignalData.hpp" + +class CopyFragReq { + /** + * Sender(s) + */ + friend class Dbdih; + + /** + * Receiver(s) + */ + friend class Dblqh; +public: + STATIC_CONST( SignalLength = 9 ); + +private: + Uint32 userPtr; + Uint32 userRef; + Uint32 tableId; + Uint32 fragId; + Uint32 nodeId; + Uint32 schemaVersion; + Uint32 distributionKey; + Uint32 gci; + Uint32 nodeCount; + Uint32 nodeList[1]; +}; + +class CopyFragConf { + /** + * Sender(s) + */ + friend class Dblqh; + + /** + * Receiver(s) + */ + friend class Dbdih; +public: + STATIC_CONST( SignalLength = 5 ); + +private: + Uint32 userPtr; + Uint32 sendingNodeId; + Uint32 startingNodeId; + Uint32 tableId; + Uint32 fragId; +}; +class CopyFragRef { + /** + * Sender(s) + */ + friend class Dblqh; + + /** + * Receiver(s) + */ + friend class Dbdih; +public: + STATIC_CONST( SignalLength = 6 ); + +private: + Uint32 userPtr; + Uint32 sendingNodeId; + Uint32 startingNodeId; + Uint32 tableId; + Uint32 fragId; + Uint32 errorCode; +}; + +struct UpdateFragDistKeyOrd +{ + Uint32 tableId; + Uint32 fragId; + Uint32 fragDistributionKey; + + STATIC_CONST( SignalLength = 3 ); +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/CopyGCIReq.hpp b/storage/ndb/include/kernel/signaldata/CopyGCIReq.hpp new file mode 100644 index 00000000000..c669e5cabee --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/CopyGCIReq.hpp @@ -0,0 +1,62 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef COPY_GCI_REQ_HPP +#define COPY_GCI_REQ_HPP + +#include "SignalData.hpp" + +/** + * This signal is used for transfering the sysfile + * between Dih on different nodes. + * + * The master will distributes the file to the other nodes + * + * Since the Sysfile can be larger than on StartMeConf signal, + * there might be more than on of these signals sent before + * the entire sysfile is transfered + + */ +class CopyGCIReq { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdih; + + friend bool printCOPY_GCI_REQ(FILE *, const Uint32 *, Uint32, Uint16); +public: + enum CopyReason { + IDLE = 0, + LOCAL_CHECKPOINT = 1, + RESTART = 2, + GLOBAL_CHECKPOINT = 3, + INITIAL_START_COMPLETED = 4 + }; + +private: + + Uint32 anyData; + Uint32 copyReason; + Uint32 startWord; + + /** + * No of free words to carry data + */ + STATIC_CONST( DATA_SIZE = 22 ); + + Uint32 data[DATA_SIZE]; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/CreateEvnt.hpp b/storage/ndb/include/kernel/signaldata/CreateEvnt.hpp new file mode 100644 index 00000000000..ac191536b18 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/CreateEvnt.hpp @@ -0,0 +1,484 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef CREATE_EVNT_HPP +#define CREATE_EVNT_HPP + +#include <ndberror.h> +#include "SignalData.hpp" +#include <NodeBitmask.hpp> +#include <signaldata/DictTabInfo.hpp> + +/** + * DropEvntReq. + */ +class DropEvntReq { + friend bool printDROP_EVNT_REQ(FILE*, const Uint32*, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 2 ); + SECTION( EVENT_NAME_SECTION = 0 ); + + union { // user block reference + Uint32 senderRef; + Uint32 m_userRef; + }; + union { + Uint32 senderData; + Uint32 m_userData; // user + }; + + Uint32 getUserRef() const { + return m_userRef; + } + void setUserRef(Uint32 val) { + m_userRef = val; + } + Uint32 getUserData() const { + return m_userData; + } + void setUserData(Uint32 val) { + m_userData = val; + } +}; + +/** + * DropEvntConf. + */ +class DropEvntConf { + friend bool printDROP_EVNT_CONF(FILE*, const Uint32*, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 2 ); + + union { // user block reference + Uint32 senderRef; + Uint32 m_userRef; + }; + union { + Uint32 senderData; + Uint32 m_userData; // user + }; + + Uint32 getUserRef() const { + return m_userRef; + } + void setUserRef(Uint32 val) { + m_userRef = val; + } + Uint32 getUserData() const { + return m_userData; + } + void setUserData(Uint32 val) { + m_userData = val; + } +}; + +/** + * DropEvntRef. + */ +class DropEvntRef { + friend bool printDROP_EVNT_REF(FILE*, const Uint32*, Uint32, Uint16); + +public: + enum ErrorCode { + NoError = 0, + Undefined = 1, + NF_FakeErrorREF = 11, + Busy = 701, + NotMaster = 702 + }; + STATIC_CONST( SignalLength = 7 ); + STATIC_CONST( SignalLength2 = SignalLength+1 ); + + union { // user block reference + Uint32 senderRef; + Uint32 m_userRef; + }; + union { + Uint32 senderData; + Uint32 m_userData; // user + }; + union { + Uint32 errorCode; + Uint32 m_errorCode; + }; + Uint32 m_errorLine; + Uint32 m_errorNode; + // with SignalLength2 + Uint32 m_masterNodeId; + Uint32 getUserRef() const { + return m_userRef; + } + void setUserRef(Uint32 val) { + m_userRef = val; + } + Uint32 getUserData() const { + return m_userData; + } + void setUserData(Uint32 val) { + m_userData = val; + } + Uint32 getErrorCode() const { + return m_errorCode; + } + void setErrorCode(Uint32 val) { + m_errorCode = val; + } + Uint32 getErrorLine() const { + return m_errorLine; + } + void setErrorLine(Uint32 val) { + m_errorLine = val; + } + Uint32 getErrorNode() const { + return m_errorNode; + } + void setErrorNode(Uint32 val) { + m_errorNode = val; + } + Uint32 getMasterNode() const { + return m_masterNodeId; + } + void setMasterNode(Uint32 val) { + m_masterNodeId = val; + } +}; + +/** + * CreateEvntReq. + */ +struct CreateEvntReq { + friend bool printCREATE_EVNT_REQ(FILE*, const Uint32*, Uint32, Uint16); + + enum RequestType { + RT_UNDEFINED = 0, + RT_USER_CREATE = 1, + RT_USER_GET = 2, + + RT_DICT_AFTER_GET = 0x1 << 4 + // RT_DICT_MASTER = 0x2 << 4, + + // RT_DICT_COMMIT = 0xC << 4, + // RT_DICT_ABORT = 0xF << 4, + // RT_TC = 5 << 8 + }; + enum EventFlags { + EF_REPORT_ALL = 0x1 << 16, + EF_REPORT_SUBSCRIBE = 0x2 << 16, + EF_ALL = 0xFFFF << 16 + }; + STATIC_CONST( SignalLengthGet = 3 ); + STATIC_CONST( SignalLengthCreate = 6+MAXNROFATTRIBUTESINWORDS ); + STATIC_CONST( SignalLength = 8+MAXNROFATTRIBUTESINWORDS ); + // SECTION( ATTRIBUTE_LIST_SECTION = 0 ); + SECTION( EVENT_NAME_SECTION = 0 ); + + union { + Uint32 m_userRef; // user block reference + Uint32 senderRef; // user block reference + }; + union { + Uint32 m_userData; // user + Uint32 senderData; // user + }; + Uint32 m_requestInfo; + Uint32 m_tableId; // table to event + Uint32 m_tableVersion; // table version + AttributeMask::Data m_attrListBitmask; + Uint32 m_eventType; // EventFlags (16 bits) + from DictTabInfo::TableType (16 bits) + Uint32 m_eventId; // event table id set by DICT/SUMA + Uint32 m_eventKey; // event table key set by DICT/SUMA + Uint32 getUserRef() const { + return m_userRef; + } + void setUserRef(Uint32 val) { + m_userRef = val; + } + Uint32 getUserData() const { + return m_userData; + } + void setUserData(Uint32 val) { + m_userData = val; + } + CreateEvntReq::RequestType getRequestType() const { + const Uint32 val = BitmaskImpl::getField(1, &m_requestInfo, 0, 16); + return (CreateEvntReq::RequestType)val; + } + void setRequestType(CreateEvntReq::RequestType val) { + m_requestInfo = (Uint32)val; + } + Uint32 getRequestFlag() const { + return BitmaskImpl::getField(1, &m_requestInfo, 16, 16); + }; + void addRequestFlag(Uint32 val) { + val |= BitmaskImpl::getField(1, &m_requestInfo, 16, 16); + BitmaskImpl::setField(1, &m_requestInfo, 16, 16, val); + }; + Uint32 getTableId() const { + return m_tableId; + } + void setTableId(Uint32 val) { + m_tableId = val; + } + Uint32 getTableVersion() const { + return m_tableVersion; + } + void setTableVersion(Uint32 val) { + m_tableVersion = val; + } + AttributeMask getAttrListBitmask() const { + AttributeMask tmp; + tmp.assign(m_attrListBitmask); + return tmp; + } + void setAttrListBitmask(const AttributeMask & val) { + AttributeMask::assign(m_attrListBitmask.data, val); + } + Uint32 getEventType() const { + return m_eventType & ~EF_ALL; + } + void setEventType(Uint32 val) { + m_eventType = (m_eventType & EF_ALL) | (~EF_ALL & (Uint32)val); + } + Uint32 getEventId() const { + return m_eventId; + } + void setEventId(Uint32 val) { + m_eventId = val; + } + Uint32 getEventKey() const { + return m_eventKey; + } + void setEventKey(Uint32 val) { + m_eventKey = val; + } + void clearFlags() { + m_eventType&= ~EF_ALL; + } + Uint32 getReportFlags() const { + return m_eventType & EF_ALL; + } + void setReportFlags(Uint32 val) { + m_eventType = (val & EF_ALL) | (m_eventType & ~EF_ALL); + } + Uint32 getReportAll() const { + return m_eventType & EF_REPORT_ALL ; + } + void setReportAll() { + m_eventType|= EF_REPORT_ALL; + } + Uint32 getReportSubscribe() const { + return m_eventType & EF_REPORT_SUBSCRIBE ; + } + void setReportSubscribe() { + m_eventType|= EF_REPORT_SUBSCRIBE; + } +}; + +/** + * CreateEvntConf. + */ +class CreateEvntConf { + friend bool printCREATE_EVNT_CONF(FILE*, const Uint32*, Uint32, Uint16); + +public: + // STATIC_CONST( InternalLength = 3 ); + STATIC_CONST( SignalLength = 8+MAXNROFATTRIBUTESINWORDS ); + + union { + Uint32 m_userRef; // user block reference + Uint32 senderRef; // user block reference + }; + union { + Uint32 m_userData; // user + Uint32 senderData; // user + }; + Uint32 m_requestInfo; + Uint32 m_tableId; + Uint32 m_tableVersion; // table version + AttributeMask m_attrListBitmask; + Uint32 m_eventType; + Uint32 m_eventId; + Uint32 m_eventKey; + + Uint32 getUserRef() const { + return m_userRef; + } + void setUserRef(Uint32 val) { + m_userRef = val; + } + Uint32 getUserData() const { + return m_userData; + } + void setUserData(Uint32 val) { + m_userData = val; + } + CreateEvntReq::RequestType getRequestType() const { + return (CreateEvntReq::RequestType)m_requestInfo; + } + void setRequestType(CreateEvntReq::RequestType val) { + m_requestInfo = (Uint32)val; + } + Uint32 getTableId() const { + return m_tableId; + } + void setTableId(Uint32 val) { + m_tableId = val; + } + Uint32 getTableVersion() const { + return m_tableVersion; + } + void setTableVersion(Uint32 val) { + m_tableVersion = val; + } + AttributeMask getAttrListBitmask() const { + return m_attrListBitmask; + } + void setAttrListBitmask(const AttributeMask & val) { + m_attrListBitmask = val; + } + Uint32 getEventType() const { + return m_eventType; + } + void setEventType(Uint32 val) { + m_eventType = (Uint32)val; + } + Uint32 getEventId() const { + return m_eventId; + } + void setEventId(Uint32 val) { + m_eventId = val; + } + Uint32 getEventKey() const { + return m_eventKey; + } + void setEventKey(Uint32 val) { + m_eventKey = val; + } +}; + +/** + * CreateEvntRef. + */ +struct CreateEvntRef { + friend class SafeCounter; + friend bool printCREATE_EVNT_REF(FILE*, const Uint32*, Uint32, Uint16); + + STATIC_CONST( SignalLength = 11 ); + STATIC_CONST( SignalLength2 = SignalLength + 1 ); + enum ErrorCode { + NoError = 0, + Undefined = 1, + NF_FakeErrorREF = 11, + Busy = 701, + NotMaster = 702 + }; + union { + Uint32 m_userRef; // user block reference + Uint32 senderRef; // user block reference + }; + union { + Uint32 m_userData; // user + Uint32 senderData; // user + }; + + Uint32 m_requestInfo; + Uint32 m_tableId; + Uint32 m_tableVersion; // table version + Uint32 m_eventType; + Uint32 m_eventId; + Uint32 m_eventKey; + Uint32 errorCode; + Uint32 m_errorLine; + Uint32 m_errorNode; + // with SignalLength2 + Uint32 m_masterNodeId; + Uint32 getUserRef() const { + return m_userRef; + } + void setUserRef(Uint32 val) { + m_userRef = val; + } + Uint32 getUserData() const { + return m_userData; + } + void setUserData(Uint32 val) { + m_userData = val; + } + CreateEvntReq::RequestType getRequestType() const { + return (CreateEvntReq::RequestType)m_requestInfo; + } + void setRequestType(CreateEvntReq::RequestType val) { + m_requestInfo = (Uint32)val; + } + Uint32 getTableId() const { + return m_tableId; + } + void setTableId(Uint32 val) { + m_tableId = val; + } + Uint32 getTableVersion() const { + return m_tableVersion; + } + void setTableVersion(Uint32 val) { + m_tableVersion = val; + } + + Uint32 getEventType() const { + return m_eventType; + } + void setEventType(Uint32 val) { + m_eventType = (Uint32)val; + } + Uint32 getEventId() const { + return m_eventId; + } + void setEventId(Uint32 val) { + m_eventId = val; + } + Uint32 getEventKey() const { + return m_eventKey; + } + void setEventKey(Uint32 val) { + m_eventKey = val; + } + + Uint32 getErrorCode() const { + return errorCode; + } + void setErrorCode(Uint32 val) { + errorCode = val; + } + Uint32 getErrorLine() const { + return m_errorLine; + } + void setErrorLine(Uint32 val) { + m_errorLine = val; + } + Uint32 getErrorNode() const { + return m_errorNode; + } + void setErrorNode(Uint32 val) { + m_errorNode = val; + } + Uint32 getMasterNode() const { + return m_masterNodeId; + } + void setMasterNode(Uint32 val) { + m_masterNodeId = val; + } +}; +#endif diff --git a/storage/ndb/include/kernel/signaldata/CreateFilegroup.hpp b/storage/ndb/include/kernel/signaldata/CreateFilegroup.hpp new file mode 100644 index 00000000000..d40f3f7d8cb --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/CreateFilegroup.hpp @@ -0,0 +1,199 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef CREATE_FILEGROUP_HPP +#define CREATE_FILEGROUP_HPP + +#include "SignalData.hpp" + +struct CreateFilegroupReq { + /** + * Sender(s) / Reciver(s) + */ + friend class NdbDictInterface; + friend class Dbdict; + + /** + * For printing + */ + friend bool printCREATE_FILEGROUP_REQ(FILE*, const Uint32*, Uint32, Uint16); + + STATIC_CONST( SignalLength = 3 ); + + Uint32 senderData; + Uint32 senderRef; + Uint32 objType; + SECTION( FILEGROUP_INFO = 0 ); +}; + +struct CreateFilegroupRef { + /** + * Sender(s) + */ + friend class Dbdict; + + /** + * Sender(s) / Reciver(s) + */ + friend class NdbDictInterface; + + /** + * For printing + */ + friend bool printCREATE_FILEGROUP_REF(FILE*, const Uint32*, Uint32, Uint16); + + STATIC_CONST( SignalLength = 7 ); + + enum ErrorCode { + NoError = 0, + Busy = 701, + NotMaster = 702, + NoMoreObjectRecords = 710, + InvalidFormat = 740, + OutOfFilegroupRecords = 765, + InvalidExtentSize = 764, + InvalidUndoBufferSize = 763, + NoSuchLogfileGroup = 767, + InvalidFilegroupVersion = 768 + }; + + Uint32 senderData; + Uint32 senderRef; + Uint32 masterNodeId; + Uint32 errorCode; + Uint32 errorLine; + Uint32 errorKey; + Uint32 status; +}; + +struct CreateFilegroupConf { + /** + * Sender(s) + */ + friend class Dbdict; + + /** + * Sender(s) / Reciver(s) + */ + friend class NdbDictInterface; + + /** + * For printing + */ + friend bool printCREATE_FILEGROUP_CONF(FILE*, const Uint32*, Uint32, Uint16); + + STATIC_CONST( SignalLength = 4 ); + + Uint32 senderData; + Uint32 senderRef; + Uint32 filegroupId; + Uint32 filegroupVersion; +}; + +struct CreateFileReq { + /** + * Sender(s) / Reciver(s) + */ + friend class NdbDictInterface; + friend class Dbdict; + friend class Tsman; + + /** + * For printing + */ + friend bool printCREATE_FILE_REQ(FILE*, const Uint32*, Uint32, Uint16); + + STATIC_CONST( SignalLength = 4 ); + + Uint32 senderData; + Uint32 senderRef; + Uint32 objType; + Uint32 requestInfo; + + enum RequstInfo + { + ForceCreateFile = 0x1 + }; + + SECTION( FILE_INFO = 0 ); +}; + +struct CreateFileRef { + /** + * Sender(s) + */ + friend class Dbdict; + + /** + * Sender(s) / Reciver(s) + */ + friend class NdbDictInterface; + + /** + * For printing + */ + friend bool printCREATE_FILE_REF(FILE*, const Uint32*, Uint32, Uint16); + + STATIC_CONST( SignalLength = 7 ); + + enum ErrorCode { + NoError = 0, + Busy = 701, + NotMaster = 702, + NoMoreObjectRecords = 710, + InvalidFormat = 752, + NoSuchFilegroup = 753, + InvalidFilegroupVersion = 754, + FilenameAlreadyExists = 760, + OutOfFileRecords = 751, + InvalidFileType = 750, + NotSupportedWhenDiskless = 775 + }; + + Uint32 senderData; + Uint32 senderRef; + Uint32 masterNodeId; + Uint32 errorCode; + Uint32 errorLine; + Uint32 errorKey; + Uint32 status; +}; + +struct CreateFileConf { + /** + * Sender(s) + */ + friend class Dbdict; + + /** + * Sender(s) / Reciver(s) + */ + friend class Ndbcntr; + friend class NdbDictInterface; + + /** + * For printing + */ + friend bool printCREATE_FILE_CONF(FILE*, const Uint32*, Uint32, Uint16); + + STATIC_CONST( SignalLength = 4 ); + + Uint32 senderData; + Uint32 senderRef; + Uint32 fileId; + Uint32 fileVersion; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/CreateFilegroupImpl.hpp b/storage/ndb/include/kernel/signaldata/CreateFilegroupImpl.hpp new file mode 100644 index 00000000000..6140e78cc5a --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/CreateFilegroupImpl.hpp @@ -0,0 +1,193 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef CREATE_FILEGROUP_IMPL_HPP +#define CREATE_FILEGROUP_IMPL_HPP + +#include "SignalData.hpp" + +struct CreateFilegroupImplReq { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdict; + friend class Tsman; + friend class Lgman; + + /** + * For printing + */ + friend bool printCREATE_FILEGROUP_IMPL_REQ(FILE*, const Uint32*, Uint32, Uint16); + + STATIC_CONST( TablespaceLength = 6 ); + STATIC_CONST( LogfileGroupLength = 5 ); + + Uint32 senderData; + Uint32 senderRef; + Uint32 filegroup_id; + Uint32 filegroup_version; + + union { + struct { + Uint32 extent_size; + Uint32 logfile_group_id; + } tablespace; + struct { + Uint32 buffer_size; // In pages + } logfile_group; + }; +}; + +struct CreateFilegroupImplRef { + /** + * Sender(s) + */ + friend class Dbdict; + friend class Tsman; + friend class Lgman; + + /** + * For printing + */ + friend bool printCREATE_FILEGROUP_IMPL_REF(FILE*, const Uint32*, Uint32, Uint16); + + STATIC_CONST( SignalLength = 3 ); + + enum ErrorCode { + NoError = 0, + FilegroupAlreadyExists = 1502, + OutOfFilegroupRecords = 1503, + OutOfLogBufferMemory = 1504, + OneLogfileGroupLimit = 1514 + }; + + Uint32 senderData; + Uint32 senderRef; + Uint32 errorCode; +}; + +struct CreateFilegroupImplConf { + /** + * Sender(s) + */ + friend class Dbdict; + friend class Tsman; + friend class Lgman; + + /** + * For printing + */ + friend bool printCREATE_FILEGROUP_IMPL_CONF(FILE*, const Uint32*, Uint32, Uint16); + + STATIC_CONST( SignalLength = 2 ); + + Uint32 senderData; + Uint32 senderRef; +}; + +struct CreateFileImplReq { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdict; + friend class Tsman; + friend class Lgman; + + /** + * For printing + */ + friend bool printCREATE_FILE_IMPL_REQ(FILE*, const Uint32*, Uint32, Uint16); + + STATIC_CONST( DatafileLength = 9 ); + STATIC_CONST( UndofileLength = 8 ); + STATIC_CONST( CommitLength = 6 ); + STATIC_CONST( AbortLength = 6 ); + SECTION( FILENAME = 0 ); + + enum RequestInfo { + Create = 0x1, + CreateForce = 0x2, + Open = 0x4, + Commit = 0x8, + Abort = 0x10 + }; + + Uint32 senderData; + Uint32 senderRef; + + Uint32 requestInfo; + Uint32 file_id; + Uint32 filegroup_id; + Uint32 filegroup_version; + Uint32 file_size_hi; + Uint32 file_size_lo; + + union { + struct { + Uint32 extent_size; + } tablespace; + }; +}; + +struct CreateFileImplRef { + friend class Dbdict; + friend class Tsman; + friend class Lgman; + + /** + * For printing + */ + friend bool printCREATE_FILE_IMPL_REF(FILE*, const Uint32*, Uint32, Uint16); + + STATIC_CONST( SignalLength = 5 ); + + enum ErrorCode { + NoError = 0, + InvalidFilegroup = 1505, + InvalidFilegroupVersion = 1506, + FileNoAlreadyExists = 1507, + OutOfFileRecords = 1508, + FileError = 1509, + InvalidFileMetadata = 1510, + OutOfMemory = 1511, + FileReadError = 1512, + FilegroupNotOnline = 1513 + }; + + Uint32 senderData; + Uint32 senderRef; + Uint32 errorCode; + Uint32 fsErrCode; + Uint32 osErrCode; +}; + +struct CreateFileImplConf { + friend class Dbdict; + friend class Tsman; + friend class Lgman; + + + /** + * For printing + */ + friend bool printCREATE_FILE_IMPL_CONF(FILE*, const Uint32*, Uint32, Uint16); + + STATIC_CONST( SignalLength = 4 ); + + Uint32 senderData; + Uint32 senderRef; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/CreateFrag.hpp b/storage/ndb/include/kernel/signaldata/CreateFrag.hpp new file mode 100644 index 00000000000..dad2aa542ca --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/CreateFrag.hpp @@ -0,0 +1,60 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef CREATE_FRAG_HPP +#define CREATE_FRAG_HPP + +class CreateFragReq { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdih; + +public: + STATIC_CONST( SignalLength = 8 ); + + enum ReplicaType { + STORED = 7, + COMMIT_STORED = 9 + }; +private: + + Uint32 userPtr; + BlockReference userRef; + Uint32 tableId; + Uint32 fragId; + Uint32 startingNodeId; + Uint32 copyNodeId; + Uint32 startGci; + Uint32 replicaType; +}; + +class CreateFragConf { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdih; + +public: + STATIC_CONST( SignalLength = 5 ); +private: + + Uint32 userPtr; + Uint32 tableId; + Uint32 fragId; + Uint32 sendingNodeId; + Uint32 startingNodeId; +}; +#endif diff --git a/storage/ndb/include/kernel/signaldata/CreateFragmentation.hpp b/storage/ndb/include/kernel/signaldata/CreateFragmentation.hpp new file mode 100644 index 00000000000..9a4adcd1a13 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/CreateFragmentation.hpp @@ -0,0 +1,98 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef CREATE_FRAGMENTATION_REQ_HPP +#define CREATE_FRAGMENTATION_REQ_HPP + +#include "SignalData.hpp" + +class CreateFragmentationReq { + /** + * Sender(s) + */ + friend class Dbdict; + + /** + * Receiver(s) + */ + friend class Dbdih; + + friend bool printCREATE_FRAGMENTATION_REQ(FILE *, + const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 5 ); + +private: + Uint32 senderRef; + Uint32 senderData; + Uint32 fragmentationType; + Uint32 noOfFragments; + Uint32 primaryTableId; // use same fragmentation as this table if not RNIL +}; + +class CreateFragmentationRef { + /** + * Sender(s) + */ + friend class Dbdih; + + /** + * Receiver(s) + */ + friend class Dbdict; + + friend bool printCREATE_FRAGMENTATION_REF(FILE *, + const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 3 ); + + enum ErrorCode { + OK = 0 + ,InvalidNodeGroup = 771 + ,InvalidFragmentationType = 772 + ,InvalidPrimaryTable = 749 + }; + +private: + Uint32 senderRef; + Uint32 senderData; + Uint32 errorCode; +}; + +class CreateFragmentationConf { + /** + * Sender(s) + */ + friend class Dbdih; + + /** + * Receiver(s) + */ + friend class Dbdict; + + friend bool printCREATE_FRAGMENTATION_CONF(FILE *, + const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 4 ); + SECTION( FRAGMENTS = 0 ); + +private: + Uint32 senderRef; + Uint32 senderData; + Uint32 noOfReplicas; + Uint32 noOfFragments; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/CreateIndx.hpp b/storage/ndb/include/kernel/signaldata/CreateIndx.hpp new file mode 100644 index 00000000000..58a5c2ced93 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/CreateIndx.hpp @@ -0,0 +1,299 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef CREATE_INDX_HPP +#define CREATE_INDX_HPP + +#include "SignalData.hpp" +#include <NodeBitmask.hpp> +#include <signaldata/DictTabInfo.hpp> + +/** + * CreateIndxReq. + */ +class CreateIndxReq { + friend bool printCREATE_INDX_REQ(FILE*, const Uint32*, Uint32, Uint16); + +public: + enum RequestType { + RT_UNDEFINED = 0, + RT_USER = 1, + RT_DICT_PREPARE = 1 << 4, + RT_DICT_COMMIT = 0xC << 4, + RT_DICT_ABORT = 0xF << 4, + RT_TC = 5 << 8 + }; + STATIC_CONST( SignalLength = 8 ); + SECTION( ATTRIBUTE_LIST_SECTION = 0 ); + SECTION( INDEX_NAME_SECTION = 1 ); + +private: + Uint32 m_connectionPtr; // user "schema connection" + Uint32 m_userRef; // user block reference + Uint32 m_requestInfo; + Uint32 m_tableId; // table to index + Uint32 m_indexType; // from DictTabInfo::TableType + Uint32 m_indexId; // index table id set by DICT + Uint32 m_indexVersion; // index table version set by DICT + Uint32 m_online; // alter online + // extra + Uint32 m_opKey; + +public: + Uint32 getUserRef() const { + return m_userRef; + } + void setUserRef(Uint32 val) { + m_userRef = val; + } + Uint32 getConnectionPtr() const { + return m_connectionPtr; + } + void setConnectionPtr(Uint32 val) { + m_connectionPtr = val; + } + CreateIndxReq::RequestType getRequestType() const { + const Uint32 val = BitmaskImpl::getField(1, &m_requestInfo, 0, 16); + return (CreateIndxReq::RequestType)val; + } + void setRequestType(CreateIndxReq::RequestType val) { + m_requestInfo = (Uint32)val; + } + Uint32 getRequestFlag() const { + return BitmaskImpl::getField(1, &m_requestInfo, 16, 16); + }; + void addRequestFlag(Uint32 val) { + val |= BitmaskImpl::getField(1, &m_requestInfo, 16, 16); + BitmaskImpl::setField(1, &m_requestInfo, 16, 16, val); + }; + Uint32 getTableId() const { + return m_tableId; + } + void setTableId(Uint32 val) { + m_tableId = val; + } + DictTabInfo::TableType getIndexType() const { + return (DictTabInfo::TableType)m_indexType; + } + void setIndexType(DictTabInfo::TableType val) { + m_indexType = (Uint32)val; + } + Uint32 getIndexId() const { + return m_indexId; + } + void setIndexId(Uint32 val) { + m_indexId = val; + } + Uint32 getOnline() const { + return m_online; + } + void setOnline(Uint32 val) { + m_online = val; + } + Uint32 getIndexVersion() const { + return m_indexVersion; + } + void setIndexVersion(Uint32 val) { + m_indexVersion = val; + } + Uint32 getOpKey() const { + return m_opKey; + } + void setOpKey(Uint32 val) { + m_opKey = val; + } +}; + +/** + * CreateIndxConf. + */ +class CreateIndxConf { + friend bool printCREATE_INDX_CONF(FILE*, const Uint32*, Uint32, Uint16); + +public: + STATIC_CONST( InternalLength = 3 ); + STATIC_CONST( SignalLength = 7 ); + +private: + Uint32 m_connectionPtr; + Uint32 m_userRef; + Uint32 m_requestInfo; + Uint32 m_tableId; + Uint32 m_indexType; + Uint32 m_indexId; + Uint32 m_indexVersion; + +public: + Uint32 getUserRef() const { + return m_userRef; + } + void setUserRef(Uint32 val) { + m_userRef = val; + } + Uint32 getConnectionPtr() const { + return m_connectionPtr; + } + void setConnectionPtr(Uint32 val) { + m_connectionPtr = val; + } + CreateIndxReq::RequestType getRequestType() const { + return (CreateIndxReq::RequestType)m_requestInfo; + } + void setRequestType(CreateIndxReq::RequestType val) { + m_requestInfo = (Uint32)val; + } + Uint32 getTableId() const { + return m_tableId; + } + void setTableId(Uint32 val) { + m_tableId = val; + } + DictTabInfo::TableType getIndexType() const { + return (DictTabInfo::TableType)m_indexType; + } + void setIndexType(DictTabInfo::TableType val) { + m_indexType = (Uint32)val; + } + Uint32 getIndexId() const { + return m_indexId; + } + void setIndexId(Uint32 val) { + m_indexId = val; + } + Uint32 getIndexVersion() const { + return m_indexVersion; + } + void setIndexVersion(Uint32 val) { + m_indexVersion = val; + } +}; + +/** + * CreateIndxRef. + */ +struct CreateIndxRef { + friend bool printCREATE_INDX_REF(FILE*, const Uint32*, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = CreateIndxReq::SignalLength + 3 ); + enum ErrorCode { + NoError = 0, + Busy = 701, + BusyWithNR = 711, + NotMaster = 702, + IndexOnDiskAttributeError = 756, + TriggerNotFound = 4238, + TriggerExists = 4239, + IndexNameTooLong = 4241, + TooManyIndexes = 4242, + IndexExists = 4244, + AttributeNullable = 4246, + BadRequestType = 4247, + InvalidName = 4248, + InvalidPrimaryTable = 4249, + InvalidIndexType = 4250, + NotUnique = 4251, + AllocationError = 4252, + CreateIndexTableFailed = 4253, + DuplicateAttributes = 4258, + TableIsTemporary = 776, + TableIsNotTemporary = 777, + NoLoggingTemporaryIndex = 778 + }; + + CreateIndxConf m_conf; + //Uint32 m_userRef; + //Uint32 m_connectionPtr; + //Uint32 m_requestInfo; + //Uint32 m_tableId; + //Uint32 m_indexType; + //Uint32 m_indexId; + //Uint32 m_indexVersion; + Uint32 m_errorCode; + Uint32 m_errorLine; + union { + Uint32 m_errorNode; + Uint32 masterNodeId; // If NotMaster + }; +public: + CreateIndxConf* getConf() { + return &m_conf; + } + const CreateIndxConf* getConf() const { + return &m_conf; + } + Uint32 getUserRef() const { + return m_conf.getUserRef(); + } + void setUserRef(Uint32 val) { + m_conf.setUserRef(val); + } + Uint32 getConnectionPtr() const { + return m_conf.getConnectionPtr(); + } + void setConnectionPtr(Uint32 val) { + m_conf.setConnectionPtr(val); + } + CreateIndxReq::RequestType getRequestType() const { + return m_conf.getRequestType(); + } + void setRequestType(CreateIndxReq::RequestType val) { + m_conf.setRequestType(val); + } + Uint32 getTableId() const { + return m_conf.getTableId(); + } + void setTableId(Uint32 val) { + m_conf.setTableId(val); + } + DictTabInfo::TableType getIndexType() const { + return m_conf.getIndexType(); + } + void setIndexType(DictTabInfo::TableType val) { + m_conf.setIndexType(val); + } + Uint32 getIndexId() const { + return m_conf.getIndexId(); + } + void setIndexId(Uint32 val) { + m_conf.setIndexId(val); + } + Uint32 getIndexVersion() const { + return m_conf.getIndexVersion(); + } + void setIndexVersion(Uint32 val) { + m_conf.setIndexVersion(val); + } + CreateIndxRef::ErrorCode getErrorCode() const { + return (CreateIndxRef::ErrorCode)m_errorCode; + } + void setErrorCode(CreateIndxRef::ErrorCode val) { + m_errorCode = (Uint32)val; + } + Uint32 getErrorLine() const { + return m_errorLine; + } + void setErrorLine(Uint32 val) { + m_errorLine = val; + } + Uint32 getErrorNode() const { + return m_errorNode; + } + void setErrorNode(Uint32 val) { + m_errorNode = val; + } +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/CreateObj.hpp b/storage/ndb/include/kernel/signaldata/CreateObj.hpp new file mode 100644 index 00000000000..59c014647b6 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/CreateObj.hpp @@ -0,0 +1,106 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef CREATE_OBJ_HPP +#define CREATE_OBJ_HPP + +#include "DictObjOp.hpp" +#include "SignalData.hpp" + +/** + * CreateObj + * + * Implemenatation of CreateObj + */ +struct CreateObjReq { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdict; + + /** + * For printing + */ + friend bool printCREATE_OBJ_REQ(FILE*, const Uint32*, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 10 ); + STATIC_CONST( GSN = GSN_CREATE_OBJ_REQ ); + +private: + Uint32 op_key; + Uint32 senderRef; + Uint32 senderData; + Uint32 requestInfo; + + Uint32 clientRef; + Uint32 clientData; + + Uint32 objId; + Uint32 objType; + Uint32 objVersion; + Uint32 gci; + + SECTION( DICT_OBJ_INFO = 0 ); +}; + +struct CreateObjRef { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdict; + friend class SafeCounter; + + /** + * For printing + */ + friend bool printCREATE_OBJ_REF(FILE *, const Uint32 *, Uint32, Uint16); + + STATIC_CONST( SignalLength = 6 ); + STATIC_CONST( GSN = GSN_CREATE_OBJ_REF ); + + enum ErrorCode { + NF_FakeErrorREF = 255 + }; + + + Uint32 senderRef; + Uint32 senderData; + Uint32 errorCode; + Uint32 errorLine; + Uint32 errorKey; + Uint32 errorStatus; +}; + +struct CreateObjConf { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdict; + + /** + * For printing + */ + friend bool printCREATE_OBJ_CONF(FILE *, const Uint32 *, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 2 ); + +private: + Uint32 senderRef; + Uint32 senderData; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/CreateTab.hpp b/storage/ndb/include/kernel/signaldata/CreateTab.hpp new file mode 100644 index 00000000000..51eed93bde9 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/CreateTab.hpp @@ -0,0 +1,108 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef CREATE_TAB_HPP +#define CREATE_TAB_HPP + +#include "SignalData.hpp" + +/** + * CreateTab + * + * Implemenatation of CreateTable + */ +class CreateTabReq { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdict; + + /** + * For printing + */ + friend bool printCREATE_TAB_REQ(FILE*, const Uint32*, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 8 ); + + enum RequestType { + CreateTablePrepare = 0, // Prepare create table + CreateTableCommit = 1, // Commit create table + CreateTableDrop = 2 // Prepare failed, drop instead + }; +private: + Uint32 senderRef; + Uint32 senderData; + Uint32 clientRef; + Uint32 clientData; + + Uint32 tableId; + Uint32 tableVersion; + Uint32 gci; + Uint32 requestType; + + SECTION( DICT_TAB_INFO = 0 ); + SECTION( FRAGMENTATION = 1 ); +}; + +struct CreateTabRef { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdict; + friend class SafeCounter; + + /** + * For printing + */ + friend bool printCREATE_TAB_REF(FILE *, const Uint32 *, Uint32, Uint16); + + STATIC_CONST( SignalLength = 6 ); + STATIC_CONST( GSN = GSN_CREATE_TAB_REF ); + + enum ErrorCode { + NF_FakeErrorREF = 255 + }; + + + Uint32 senderRef; + Uint32 senderData; + Uint32 errorCode; + Uint32 errorLine; + Uint32 errorKey; + Uint32 errorStatus; +}; + +class CreateTabConf { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdict; + friend class Suma; + + /** + * For printing + */ + friend bool printCREATE_TAB_CONF(FILE *, const Uint32 *, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 2 ); + +private: + Uint32 senderRef; + Uint32 senderData; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/CreateTable.hpp b/storage/ndb/include/kernel/signaldata/CreateTable.hpp new file mode 100644 index 00000000000..4257c0b20eb --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/CreateTable.hpp @@ -0,0 +1,148 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef CREATE_TABLE_HPP +#define CREATE_TABLE_HPP + +#include "SignalData.hpp" + +/** + * CreateTable + * + * This signal is sent by API to DICT/TRIX + * as a request to create a secondary index + * and then from TRIX to TRIX(n) and TRIX to TC. + */ +class CreateTableReq { + /** + * Sender(s) + */ + // API + + /** + * Sender(s) / Reciver(s) + */ + friend class NdbDictInterface; + friend class Dbdict; + friend class Ndbcntr; + + /** + * For printing + */ + friend bool printCREATE_TABLE_REQ(FILE*, const Uint32*, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 2 ); + +private: + Uint32 senderData; + Uint32 senderRef; + + SECTION( DICT_TAB_INFO = 0 ); +}; + +class CreateTableRef { + /** + * Sender(s) + */ + friend class Dbdict; + + /** + * Sender(s) / Reciver(s) + */ + friend class Ndbcntr; + friend class NdbDictInterface; + + /** + * For printing + */ + friend bool printCREATE_TABLE_REF(FILE *, const Uint32 *, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 7 ); + + enum ErrorCode { + NoError = 0, + Busy = 701, + BusyWithNR = 711, + NotMaster = 702, + InvalidFormat = 703, + AttributeNameTooLong = 704, + TableNameTooLong = 705, + Inconsistency = 706, + NoMoreTableRecords = 707, + NoMoreAttributeRecords = 708, + AttributeNameTwice = 720, + TableAlreadyExist = 721, + InvalidArraySize = 736, + ArraySizeTooBig = 737, + RecordTooBig = 738, + InvalidPrimaryKeySize = 739, + NullablePrimaryKey = 740, + InvalidCharset = 743, + InvalidTablespace = 755, + VarsizeBitfieldNotSupported = 757, + NotATablespace = 758, + InvalidTablespaceVersion = 759, + OutOfStringBuffer = 773, + NoLoggingTemporaryTable = 778 + }; + +private: + Uint32 senderData; + Uint32 senderRef; + Uint32 masterNodeId; + Uint32 errorCode; + Uint32 errorLine; + Uint32 errorKey; + Uint32 status; + +public: + Uint32 getErrorCode() const { + return errorCode; + } + Uint32 getErrorLine() const { + return errorLine; + } +}; + +class CreateTableConf { + /** + * Sender(s) + */ + friend class Dbdict; + + /** + * Sender(s) / Reciver(s) + */ + friend class Ndbcntr; + friend class NdbDictInterface; + + /** + * For printing + */ + friend bool printCREATE_TABLE_REF(FILE *, const Uint32 *, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 4 ); + +private: + Uint32 senderData; + Uint32 senderRef; + Uint32 tableId; + Uint32 tableVersion; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/CreateTrig.hpp b/storage/ndb/include/kernel/signaldata/CreateTrig.hpp new file mode 100644 index 00000000000..c02dac4228b --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/CreateTrig.hpp @@ -0,0 +1,422 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef CREATE_TRIG_HPP +#define CREATE_TRIG_HPP + +#include "SignalData.hpp" +#include <Bitmask.hpp> +#include <trigger_definitions.h> +#include <AttributeList.hpp> + +/** + * CreateTrigReq. + */ +class CreateTrigReq { + friend bool printCREATE_TRIG_REQ(FILE*, const Uint32*, Uint32, Uint16); + +public: + enum RequestType { + RT_UNDEFINED = 0, + RT_USER = 1, + RT_ALTER_INDEX = 2, + RT_BUILD_INDEX = 3, + RT_DICT_PREPARE = 1 << 4, + RT_DICT_CREATE = 2 << 4, + RT_DICT_COMMIT = 0xC << 4, + RT_DICT_ABORT = 0xF << 4, + RT_TC = 5 << 8, + RT_LQH = 6 << 8 + }; + STATIC_CONST( SignalLength = 9 + MAXNROFATTRIBUTESINWORDS); + SECTION( TRIGGER_NAME_SECTION = 0 ); + SECTION( ATTRIBUTE_MASK_SECTION = 1 ); // not yet in use + enum KeyValues { + TriggerNameKey = 0xa1 + }; + +private: + Uint32 m_userRef; + Uint32 m_connectionPtr; + Uint32 m_requestInfo; + Uint32 m_tableId; + Uint32 m_indexId; // only for index trigger + Uint32 m_triggerId; // only set by DICT + Uint32 m_triggerInfo; // flags | event | timing | type + Uint32 m_online; // alter online (not normally for subscription) + Uint32 m_receiverRef; // receiver for subscription trigger + AttributeMask m_attributeMask; + // extra + Uint32 m_opKey; + +public: + Uint32 getUserRef() const { + return m_userRef; + } + void setUserRef(Uint32 val) { + m_userRef = val; + } + Uint32 getConnectionPtr() const { + return m_connectionPtr; + } + void setConnectionPtr(Uint32 val) { + m_connectionPtr = val; + } + CreateTrigReq::RequestType getRequestType() const { + const Uint32 val = BitmaskImpl::getField(1, &m_requestInfo, 0, 16); + return (CreateTrigReq::RequestType)val; + } + void setRequestType(CreateTrigReq::RequestType val) { + m_requestInfo = (Uint32)val; + } + Uint32 getRequestFlag() const { + return BitmaskImpl::getField(1, &m_requestInfo, 16, 16); + }; + void addRequestFlag(Uint32 val) { + val |= BitmaskImpl::getField(1, &m_requestInfo, 16, 16); + BitmaskImpl::setField(1, &m_requestInfo, 16, 16, val); + }; + Uint32 getTableId() const { + return m_tableId; + } + void setTableId(Uint32 val) { + m_tableId = val; + } + Uint32 getIndexId() const { + return m_indexId; + } + void setIndexId(Uint32 val) { + m_indexId = val; + } + Uint32 getTriggerId() const { + return m_triggerId; + } + void setTriggerId(Uint32 val) { + m_triggerId = val; + } + Uint32 getTriggerInfo() const { + return m_triggerInfo; + } + void setTriggerInfo(Uint32 val) { + m_triggerInfo = val; + } + TriggerType::Value getTriggerType() const { + const Uint32 val = BitmaskImpl::getField(1, &m_triggerInfo, 0, 8); + return (TriggerType::Value)val; + } + void setTriggerType(TriggerType::Value val) { + BitmaskImpl::setField(1, &m_triggerInfo, 0, 8, (Uint32)val); + } + TriggerActionTime::Value getTriggerActionTime() const { + const Uint32 val = BitmaskImpl::getField(1, &m_triggerInfo, 8, 8); + return (TriggerActionTime::Value)val; + } + void setTriggerActionTime(TriggerActionTime::Value val) { + BitmaskImpl::setField(1, &m_triggerInfo, 8, 8, (Uint32)val); + } + TriggerEvent::Value getTriggerEvent() const { + const Uint32 val = BitmaskImpl::getField(1, &m_triggerInfo, 16, 8); + return (TriggerEvent::Value)val; + } + void setTriggerEvent(TriggerEvent::Value val) { + BitmaskImpl::setField(1, &m_triggerInfo, 16, 8, (Uint32)val); + } + bool getMonitorReplicas() const { + return BitmaskImpl::getField(1, &m_triggerInfo, 24, 1); + } + void setMonitorReplicas(bool val) { + BitmaskImpl::setField(1, &m_triggerInfo, 24, 1, val); + } + bool getMonitorAllAttributes() const { + return BitmaskImpl::getField(1, &m_triggerInfo, 25, 1); + } + void setMonitorAllAttributes(bool val) { + BitmaskImpl::setField(1, &m_triggerInfo, 25, 1, val); + } + bool getReportAllMonitoredAttributes() const { + return BitmaskImpl::getField(1, &m_triggerInfo, 26, 1); + } + void setReportAllMonitoredAttributes(bool val) { + BitmaskImpl::setField(1, &m_triggerInfo, 26, 1, val); + } + Uint32 getOnline() const { + return m_online; + } + void setOnline(Uint32 val) { + m_online = val; + } + Uint32 getReceiverRef() const { + return m_receiverRef; + } + void setReceiverRef(Uint32 val) { + m_receiverRef = val; + } + AttributeMask& getAttributeMask() { + return m_attributeMask; + } + const AttributeMask& getAttributeMask() const { + return m_attributeMask; + } + void clearAttributeMask() { + m_attributeMask.clear(); + } + void setAttributeMask(const AttributeMask& val) { + m_attributeMask = val; + } + void setAttributeMask(Uint16 val) { + m_attributeMask.set(val); + } + Uint32 getOpKey() const { + return m_opKey; + } + void setOpKey(Uint32 val) { + m_opKey = val; + } +}; + +/** + * CreateTrigConf. + */ +class CreateTrigConf { + friend bool printCREATE_TRIG_CONF(FILE*, const Uint32*, Uint32, Uint16); + +public: + STATIC_CONST( InternalLength = 3 ); + STATIC_CONST( SignalLength = 7 ); + +private: + Uint32 m_userRef; + Uint32 m_connectionPtr; + Uint32 m_requestInfo; + Uint32 m_tableId; + Uint32 m_indexId; + Uint32 m_triggerId; + Uint32 m_triggerInfo; // BACKUP wants this + +public: + Uint32 getUserRef() const { + return m_userRef; + } + void setUserRef(Uint32 val) { + m_userRef = val; + } + Uint32 getConnectionPtr() const { + return m_connectionPtr; + } + void setConnectionPtr(Uint32 val) { + m_connectionPtr = val; + } + CreateTrigReq::RequestType getRequestType() const { + return (CreateTrigReq::RequestType)m_requestInfo; + } + void setRequestType(CreateTrigReq::RequestType val) { + m_requestInfo = (Uint32)val; + } + Uint32 getTableId() const { + return m_tableId; + } + void setTableId(Uint32 val) { + m_tableId = val; + } + Uint32 getIndexId() const { + return m_indexId; + } + void setIndexId(Uint32 val) { + m_indexId = val; + } + Uint32 getTriggerId() const { + return m_triggerId; + } + void setTriggerId(Uint32 val) { + m_triggerId = val; + } + Uint32 getTriggerInfo() const { + return m_triggerInfo; + } + void setTriggerInfo(Uint32 val) { + m_triggerInfo = val; + } + TriggerType::Value getTriggerType() const { + const Uint32 val = BitmaskImpl::getField(1, &m_triggerInfo, 0, 8); + return (TriggerType::Value)val; + } + void setTriggerType(TriggerType::Value val) { + BitmaskImpl::setField(1, &m_triggerInfo, 0, 8, (Uint32)val); + } + TriggerActionTime::Value getTriggerActionTime() const { + const Uint32 val = BitmaskImpl::getField(1, &m_triggerInfo, 8, 8); + return (TriggerActionTime::Value)val; + } + void setTriggerActionTime(TriggerActionTime::Value val) { + BitmaskImpl::setField(1, &m_triggerInfo, 8, 8, (Uint32)val); + } + TriggerEvent::Value getTriggerEvent() const { + const Uint32 val = BitmaskImpl::getField(1, &m_triggerInfo, 16, 8); + return (TriggerEvent::Value)val; + } + void setTriggerEvent(TriggerEvent::Value val) { + BitmaskImpl::setField(1, &m_triggerInfo, 16, 8, (Uint32)val); + } + bool getMonitorReplicas() const { + return BitmaskImpl::getField(1, &m_triggerInfo, 24, 1); + } + void setMonitorReplicas(bool val) { + BitmaskImpl::setField(1, &m_triggerInfo, 24, 1, val); + } + bool getMonitorAllAttributes() const { + return BitmaskImpl::getField(1, &m_triggerInfo, 25, 1); + } + void setMonitorAllAttributes(bool val) { + BitmaskImpl::setField(1, &m_triggerInfo, 25, 1, val); + } +}; + +/** + * CreateTrigRef. + */ +class CreateTrigRef { + friend bool printCREATE_TRIG_REF(FILE*, const Uint32*, Uint32, Uint16); + +public: + enum ErrorCode { + NoError = 0, + Busy = 701, + NotMaster = 702, + TriggerNameTooLong = 4236, + TooManyTriggers = 4237, + TriggerNotFound = 4238, + TriggerExists = 4239, + UnsupportedTriggerType = 4240, + BadRequestType = 4247, + InvalidName = 4248, + InvalidTable = 4249 + }; + STATIC_CONST( SignalLength = CreateTrigConf::SignalLength + 3 ); + +private: + CreateTrigConf m_conf; + //Uint32 m_userRef; + //Uint32 m_connectionPtr; + //Uint32 m_requestInfo; + //Uint32 m_tableId; + //Uint32 m_indexId; + //Uint32 m_triggerId; + //Uint32 m_triggerInfo; + Uint32 m_errorCode; + Uint32 m_errorLine; + union { + Uint32 m_errorNode; + Uint32 masterNodeId; // When NotMaster + }; +public: + CreateTrigConf* getConf() { + return &m_conf; + } + const CreateTrigConf* getConf() const { + return &m_conf; + } + Uint32 getUserRef() const { + return m_conf.getUserRef(); + } + void setUserRef(Uint32 val) { + m_conf.setUserRef(val); + } + Uint32 getConnectionPtr() const { + return m_conf.getConnectionPtr(); + } + void setConnectionPtr(Uint32 val) { + m_conf.setConnectionPtr(val); + } + CreateTrigReq::RequestType getRequestType() const { + return m_conf.getRequestType(); + } + void setRequestType(CreateTrigReq::RequestType val) { + m_conf.setRequestType(val); + } + Uint32 getTableId() const { + return m_conf.getTableId(); + } + void setTableId(Uint32 val) { + m_conf.setTableId(val); + } + Uint32 getIndexId() const { + return m_conf.getIndexId(); + } + void setIndexId(Uint32 val) { + m_conf.setIndexId(val); + } + Uint32 getTriggerId() const { + return m_conf.getTriggerId(); + } + void setTriggerId(Uint32 val) { + m_conf.setTriggerId(val); + } + Uint32 getTriggerInfo() const { + return m_conf.getTriggerInfo(); + } + void setTriggerInfo(Uint32 val) { + m_conf.setTriggerInfo(val); + } + TriggerType::Value getTriggerType() const { + return m_conf.getTriggerType(); + } + void setTriggerType(TriggerType::Value val) { + m_conf.setTriggerType(val); + } + TriggerActionTime::Value getTriggerActionTime() const { + return m_conf.getTriggerActionTime(); + } + void setTriggerActionTime(TriggerActionTime::Value val) { + m_conf.setTriggerActionTime(val); + } + TriggerEvent::Value getTriggerEvent() const { + return m_conf.getTriggerEvent(); + } + void setTriggerEvent(TriggerEvent::Value val) { + m_conf.setTriggerEvent(val); + } + bool getMonitorReplicas() const { + return m_conf.getMonitorReplicas(); + } + void setMonitorReplicas(bool val) { + m_conf.setMonitorReplicas(val); + } + bool getMonitorAllAttributes() const { + return m_conf.getMonitorAllAttributes(); + } + void setMonitorAllAttributes(bool val) { + m_conf.setMonitorAllAttributes(val); + } + CreateTrigRef::ErrorCode getErrorCode() const { + return (CreateTrigRef::ErrorCode)m_errorCode; + } + void setErrorCode(CreateTrigRef::ErrorCode val) { + m_errorCode = (Uint32)val; + } + Uint32 getErrorLine() const { + return m_errorLine; + } + void setErrorLine(Uint32 val) { + m_errorLine = val; + } + Uint32 getErrorNode() const { + return m_errorNode; + } + void setErrorNode(Uint32 val) { + m_errorNode = val; + } +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/DiAddTab.hpp b/storage/ndb/include/kernel/signaldata/DiAddTab.hpp new file mode 100644 index 00000000000..787eb5eb6db --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/DiAddTab.hpp @@ -0,0 +1,91 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef DIADDTABREQ_HPP +#define DIADDTABREQ_HPP + +#include "SignalData.hpp" + +class DiAddTabReq { + /** + * Sender(s) + */ + friend class Dbdict; + + /** + * Receiver(s) + */ + friend class Dbdih; +public: + STATIC_CONST( SignalLength = 10 ); + SECTION( FRAGMENTATION = 0 ); + SECTION( TS_RANGE = 0 ); + +private: + Uint32 connectPtr; + Uint32 tableId; + Uint32 fragType; + Uint32 kValue; + Uint32 noOfReplicas; //Currently not used + Uint32 loggedTable; + Uint32 tableType; + Uint32 schemaVersion; + Uint32 primaryTableId; + Uint32 temporaryTable; +}; + +class DiAddTabRef { + /** + * Sender(s) + */ + friend class Dbdih; + + /** + * Receiver(s) + */ + friend class Dbdict; +public: + STATIC_CONST( SignalLength = 2 ); + +private: + union { + Uint32 connectPtr; + Uint32 senderData; + }; + Uint32 errorCode; +}; + +class DiAddTabConf { + /** + * Sender(s) + */ + friend class Dbdih; + + /** + * Receiver(s) + */ + friend class Dbdict; +public: + STATIC_CONST( SignalLength = 1 ); + +private: + union { + Uint32 connectPtr; + Uint32 senderData; + }; +}; + + +#endif diff --git a/storage/ndb/include/kernel/signaldata/DiGetNodes.hpp b/storage/ndb/include/kernel/signaldata/DiGetNodes.hpp new file mode 100644 index 00000000000..5e22c64143e --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/DiGetNodes.hpp @@ -0,0 +1,61 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef DIGETNODES_HPP +#define DIGETNODES_HPP + +#include <NodeBitmask.hpp> +#include <ndb_limits.h> + +/** + * + */ +class DiGetNodesConf { + /** + * Receiver(s) + */ + friend class Dbtc; + /** + * Sender(s) + */ + friend class Dbdih; +public: + STATIC_CONST( SignalLength = 3 + MAX_REPLICAS ); +private: + Uint32 zero; + Uint32 fragId; + Uint32 reqinfo; + Uint32 nodes[MAX_REPLICAS]; +}; +/** + * + */ +class DiGetNodesReq { + /** + * Sender(s) + */ + friend class Dbtc; + /** + * Receiver(s) + */ + friend class Dbdih; +public: + STATIC_CONST( SignalLength = 3 ); +private: + Uint32 notUsed; + Uint32 tableId; + Uint32 hashValue; +}; +#endif diff --git a/storage/ndb/include/kernel/signaldata/DictLock.hpp b/storage/ndb/include/kernel/signaldata/DictLock.hpp new file mode 100644 index 00000000000..9cf6199ae5c --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/DictLock.hpp @@ -0,0 +1,77 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef DICT_LOCK_HPP +#define DICT_LOCK_HPP + +#include "SignalData.hpp" + +// see comments in Dbdict.hpp + +class DictLockReq { + friend class Dbdict; + friend class Dbdih; +public: + STATIC_CONST( SignalLength = 3 ); + enum LockType { + NoLock = 0, + NodeRestartLock = 1 + }; +private: + Uint32 userPtr; + Uint32 lockType; + Uint32 userRef; +}; + +class DictLockConf { + friend class Dbdict; + friend class Dbdih; +public: + STATIC_CONST( SignalLength = 3 ); +private: + Uint32 userPtr; + Uint32 lockType; + Uint32 lockPtr; +}; + +class DictLockRef { + friend class Dbdict; + friend class Dbdih; +public: + STATIC_CONST( SignalLength = 3 ); + enum ErrorCode { + NotMaster = 1, + InvalidLockType = 2, + BadUserRef = 3, + TooLate = 4, + TooManyRequests = 5 + }; +private: + Uint32 userPtr; + Uint32 lockType; + Uint32 errorCode; +}; + +class DictUnlockOrd { + friend class Dbdict; + friend class Dbdih; +public: + STATIC_CONST( SignalLength = 2 ); +private: + Uint32 lockPtr; + Uint32 lockType; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/DictObjOp.hpp b/storage/ndb/include/kernel/signaldata/DictObjOp.hpp new file mode 100644 index 00000000000..c153731139c --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/DictObjOp.hpp @@ -0,0 +1,103 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef DICT_OBJ_OP_HPP +#define DICT_OBJ_OP_HPP + +struct DictObjOp { + + enum RequestType { + Prepare = 0, // Prepare create obj + Commit = 1, // Commit create obj + Abort = 2 // Prepare failed, drop instead + }; + + enum State { + Defined = 0, + Preparing = 1, + Prepared = 2, + Committing = 3, + Committed = 4, + Aborting = 5, + Aborted = 6 + }; +}; + +struct DictCommitReq +{ + Uint32 senderData; + Uint32 senderRef; + Uint32 op_key; + + STATIC_CONST( SignalLength = 3 ); + STATIC_CONST( GSN = GSN_DICT_COMMIT_REQ ); +}; + +struct DictCommitRef +{ + Uint32 senderData; + Uint32 senderRef; + Uint32 errorCode; + enum ErrorCode + { + NF_FakeErrorREF = 1 + }; + STATIC_CONST( SignalLength = 3 ); + STATIC_CONST( GSN = GSN_DICT_COMMIT_REF ); +}; + +struct DictCommitConf +{ + Uint32 senderData; + Uint32 senderRef; + + STATIC_CONST( SignalLength = 2 ); + STATIC_CONST( GSN = GSN_DICT_COMMIT_CONF ); +}; + +struct DictAbortReq +{ + Uint32 senderData; + Uint32 senderRef; + Uint32 op_key; + + STATIC_CONST( SignalLength = 3 ); + STATIC_CONST( GSN = GSN_DICT_ABORT_REQ ); +}; + +struct DictAbortRef +{ + Uint32 senderData; + Uint32 senderRef; + Uint32 errorCode; + enum ErrorCode + { + NF_FakeErrorREF = 1 + }; + STATIC_CONST( SignalLength = 3 ); + STATIC_CONST( GSN = GSN_DICT_ABORT_REF ); +}; + +struct DictAbortConf +{ + Uint32 senderData; + Uint32 senderRef; + + STATIC_CONST( SignalLength = 2 ); + STATIC_CONST( GSN = GSN_DICT_ABORT_CONF ); +}; + + +#endif diff --git a/storage/ndb/include/kernel/signaldata/DictSchemaInfo.hpp b/storage/ndb/include/kernel/signaldata/DictSchemaInfo.hpp new file mode 100644 index 00000000000..88919769b37 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/DictSchemaInfo.hpp @@ -0,0 +1,44 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef DICT_SCHEMA_INFO_HPP +#define DICT_SCHEMA_INFO_HPP + +#include "SignalData.hpp" + +class DictSchemaInfo { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdict; + +public: + STATIC_CONST( HeaderLength = 3 ); + STATIC_CONST( DataLength = 22 ); + +private: + Uint32 senderRef; + Uint32 offset; + Uint32 totalLen; + + /** + * Length in this = signal->length() - 3 + * Sender block ref = signal->senderBlockRef() + */ + + Uint32 schemaInfoData[22]; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/DictSizeAltReq.hpp b/storage/ndb/include/kernel/signaldata/DictSizeAltReq.hpp new file mode 100644 index 00000000000..a5b2584a374 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/DictSizeAltReq.hpp @@ -0,0 +1,50 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef DICT_SIZE_ALT_REQ_H +#define DICT_SIZE_ALT_REQ_H + + + +#include "SignalData.hpp" + +class DictSizeAltReq { + /** + * Sender(s) + */ + friend class ClusterConfiguration; + + /** + * Reciver(s) + */ + friend class Dbdict; +private: + /** + * Indexes in theData + */ + STATIC_CONST( IND_BLOCK_REF = 0 ); + STATIC_CONST( IND_ATTRIBUTE = 1 ); + STATIC_CONST( IND_CONNECT = 2 ); + STATIC_CONST( IND_FRAG_CONNECT = 3 ); + STATIC_CONST( IND_TABLE = 4 ); + STATIC_CONST( IND_TC_CONNECT = 5 ); + + /** + * Use the index definitions to use the signal data + */ + UintR theData[6]; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/DictStart.hpp b/storage/ndb/include/kernel/signaldata/DictStart.hpp new file mode 100644 index 00000000000..ec317149095 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/DictStart.hpp @@ -0,0 +1,53 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef DICT_START_HPP +#define DICT_START_HPP + +class DictStartReq { + /** + * Sender(s) + */ + friend class Dbdih; + /** + * Receiver(s) + */ + friend class Dbdict; + +public: + STATIC_CONST( SignalLength = 2 ); +private: + + Uint32 restartGci; + Uint32 senderRef; +}; + +class DictStartConf { + /** + * Sender(s) + */ + friend class Dbdict; + /** + * Receiver(s) + */ + friend class Dbdih; + +public: +private: + + Uint32 startingNodeId; + Uint32 startWord; +}; +#endif diff --git a/storage/ndb/include/kernel/signaldata/DictTabInfo.hpp b/storage/ndb/include/kernel/signaldata/DictTabInfo.hpp new file mode 100644 index 00000000000..bc41d8373fd --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/DictTabInfo.hpp @@ -0,0 +1,724 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef DICT_TAB_INFO_HPP +#define DICT_TAB_INFO_HPP + +#include "SignalData.hpp" +#include <AttributeDescriptor.hpp> +#include <SimpleProperties.hpp> +#include <ndb_limits.h> +#include <NdbSqlUtil.hpp> +#include <ndb_global.h> + +#ifndef my_decimal_h + +// sql/my_decimal.h requires many more sql/*.h new to ndb +// for now, copy the bit we need TODO proper fix + +#define DECIMAL_MAX_LENGTH ((8 * 9) - 8) + +#ifndef NOT_FIXED_DEC +#define NOT_FIXED_DEC 31 +#endif + +C_MODE_START +extern int decimal_bin_size(int, int); +C_MODE_END + +inline int my_decimal_get_binary_size(uint precision, uint scale) +{ + return decimal_bin_size((int)precision, (int)scale); +} + +#endif + +#define DTIMAP(x, y, z) \ + { DictTabInfo::y, my_offsetof(x, z), SimpleProperties::Uint32Value, 0, (~0), 0 } + +#define DTIMAP2(x, y, z, u, v) \ + { DictTabInfo::y, my_offsetof(x, z), SimpleProperties::Uint32Value, u, v, 0 } + +#define DTIMAPS(x, y, z, u, v) \ + { DictTabInfo::y, my_offsetof(x, z), SimpleProperties::StringValue, u, v, 0 } + +#define DTIMAPB(x, y, z, u, v, l) \ + { DictTabInfo::y, my_offsetof(x, z), SimpleProperties::BinaryValue, u, v, \ + my_offsetof(x, l) } + +#define DTIBREAK(x) \ + { DictTabInfo::x, 0, SimpleProperties::InvalidValue, 0, 0, 0 } + +class DictTabInfo { + /** + * Sender(s) / Reciver(s) + */ + // Blocks + friend class Backup; + friend class Dbdict; + friend class Ndbcntr; + friend class Trix; + friend class DbUtil; + // API + friend class NdbSchemaOp; + + /** + * For printing + */ + friend bool printDICTTABINFO(FILE * output, + const Uint32 * theData, + Uint32 len, + Uint16 receiverBlockNo); + +public: + enum RequestType { + CreateTableFromAPI = 1, + AddTableFromDict = 2, // Between DICT's + CopyTable = 3, // Between DICT's + ReadTableFromDiskSR = 4, // Local in DICT + GetTabInfoConf = 5, + AlterTableFromAPI = 6 + }; + + enum KeyValues { + TableName = 1, // String, Mandatory + TableId = 2, //Mandatory between DICT's otherwise not allowed + TableVersion = 3, //Mandatory between DICT's otherwise not allowed + TableLoggedFlag = 4, //Default Logged + NoOfKeyAttr = 5, //Default 1 + NoOfAttributes = 6, //Mandatory + NoOfNullable = 7, //Deafult 0 + NoOfVariable = 8, //Default 0 + TableKValue = 9, //Default 6 + MinLoadFactor = 10, //Default 70 + MaxLoadFactor = 11, //Default 80 + KeyLength = 12, //Default 1 (No of words in primary key) + FragmentTypeVal = 13, //Default AllNodesSmallTable + TableTypeVal = 18, //Default TableType::UserTable + PrimaryTable = 19, //Mandatory for index otherwise RNIL + PrimaryTableId = 20, //ditto + IndexState = 21, + InsertTriggerId = 22, + UpdateTriggerId = 23, + DeleteTriggerId = 24, + CustomTriggerId = 25, + FrmLen = 26, + FrmData = 27, + + TableTemporaryFlag = 28, //Default not Temporary + + FragmentCount = 128, // No of fragments in table (!fragment replicas) + FragmentDataLen = 129, + FragmentData = 130, // CREATE_FRAGMENTATION reply + TablespaceId = 131, + TablespaceVersion = 132, + TablespaceDataLen = 133, + TablespaceData = 134, + RangeListDataLen = 135, + RangeListData = 136, + ReplicaDataLen = 137, + ReplicaData = 138, + MaxRowsLow = 139, + MaxRowsHigh = 140, + DefaultNoPartFlag = 141, + LinearHashFlag = 142, + MinRowsLow = 143, + MinRowsHigh = 144, + + RowGCIFlag = 150, + RowChecksumFlag = 151, + + TableEnd = 999, + + AttributeName = 1000, // String, Mandatory + AttributeId = 1001, //Mandatory between DICT's otherwise not allowed + AttributeType = 1002, //for osu 4.1->5.0.x + AttributeSize = 1003, //Default DictTabInfo::a32Bit + AttributeArraySize = 1005, //Default 1 + AttributeKeyFlag = 1006, //Default noKey + AttributeStorageType = 1007, //Default NDB_STORAGETYPE_MEMORY + AttributeNullableFlag = 1008, //Default NotNullable + AttributeDKey = 1010, //Default NotDKey + AttributeExtType = 1013, //Default ExtUnsigned + AttributeExtPrecision = 1014, //Default 0 + AttributeExtScale = 1015, //Default 0 + AttributeExtLength = 1016, //Default 0 + AttributeAutoIncrement = 1017, //Default false + AttributeDefaultValue = 1018, //Default value (printable string), + AttributeArrayType = 1019, //Default NDB_ARRAYTYPE_FIXED + AttributeEnd = 1999 // + }; + // ---------------------------------------------------------------------- + // Part of the protocol is that we only transfer parameters which do not + // have a default value. Thus the default values are part of the protocol. + // ---------------------------------------------------------------------- + + + + // FragmentType constants + enum FragmentType { + AllNodesSmallTable = 0, + AllNodesMediumTable = 1, + AllNodesLargeTable = 2, + SingleFragment = 3, + DistrKeyHash = 4, + DistrKeyLin = 5, + UserDefined = 6, + DistrKeyUniqueHashIndex = 7, + DistrKeyOrderedIndex = 8 + }; + + // TableType constants + objects + enum TableType { + UndefTableType = 0, + SystemTable = 1, + UserTable = 2, + UniqueHashIndex = 3, + HashIndex = 4, + UniqueOrderedIndex = 5, + OrderedIndex = 6, + // constant 10 hardcoded in Dbdict.cpp + HashIndexTrigger = 11, + SubscriptionTrigger = 16, + ReadOnlyConstraint = 17, + IndexTrigger = 18, + + Tablespace = 20, ///< Tablespace + LogfileGroup = 21, ///< Logfile group + Datafile = 22, ///< Datafile + Undofile = 23 ///< Undofile + }; + + // used 1) until type BlobTable added 2) in upgrade code + static bool + isBlobTableName(const char* name, Uint32* ptab_id = 0, Uint32* pcol_no = 0); + + static inline bool + isTable(int tableType) { + return + tableType == SystemTable || + tableType == UserTable; + } + static inline bool + isIndex(int tableType) { + return + tableType == UniqueHashIndex || + tableType == HashIndex || + tableType == UniqueOrderedIndex || + tableType == OrderedIndex; + } + static inline bool + isUniqueIndex(int tableType) { + return + tableType == UniqueHashIndex || + tableType == UniqueOrderedIndex; + } + static inline bool + isNonUniqueIndex(int tableType) { + return + tableType == HashIndex || + tableType == OrderedIndex; + } + static inline bool + isHashIndex(int tableType) { + return + tableType == UniqueHashIndex || + tableType == HashIndex; + } + static inline bool + isOrderedIndex(int tableType) { + return + tableType == UniqueOrderedIndex || + tableType == OrderedIndex; + } + static inline bool + isTrigger(int tableType) { + return + tableType == HashIndexTrigger || + tableType == SubscriptionTrigger || + tableType == ReadOnlyConstraint || + tableType == IndexTrigger; + } + static inline bool + isFilegroup(int tableType) { + return + tableType == Tablespace || + tableType == LogfileGroup; + } + + static inline bool + isFile(int tableType) { + return + tableType == Datafile|| + tableType == Undofile; + } + + // Object state for translating from/to API + enum ObjectState { + StateUndefined = 0, + StateOffline = 1, + StateBuilding = 2, + StateDropping = 3, + StateOnline = 4, + StateBackup = 5, + StateBroken = 9 + }; + + // Object store for translating from/to API + enum ObjectStore { + StoreUndefined = 0, + StoreNotLogged = 1, + StorePermanent = 2 + }; + + // AttributeSize constants + STATIC_CONST( aBit = 0 ); + STATIC_CONST( an8Bit = 3 ); + STATIC_CONST( a16Bit = 4 ); + STATIC_CONST( a32Bit = 5 ); + STATIC_CONST( a64Bit = 6 ); + STATIC_CONST( a128Bit = 7 ); + + // Table data interpretation + struct Table { + char TableName[MAX_TAB_NAME_SIZE]; + Uint32 TableId; + char PrimaryTable[MAX_TAB_NAME_SIZE]; // Only used when "index" + Uint32 PrimaryTableId; + Uint32 TableLoggedFlag; + Uint32 TableTemporaryFlag; + Uint32 NoOfKeyAttr; + Uint32 NoOfAttributes; + Uint32 NoOfNullable; + Uint32 NoOfVariable; + Uint32 TableKValue; + Uint32 MinLoadFactor; + Uint32 MaxLoadFactor; + Uint32 KeyLength; + Uint32 FragmentType; + Uint32 TableType; + Uint32 TableVersion; + Uint32 IndexState; + Uint32 InsertTriggerId; + Uint32 UpdateTriggerId; + Uint32 DeleteTriggerId; + Uint32 CustomTriggerId; + Uint32 TablespaceId; + Uint32 TablespaceVersion; + Uint32 DefaultNoPartFlag; + Uint32 LinearHashFlag; + /* + TODO RONM: + We need to replace FRM, Fragment Data, Tablespace Data and in + very particular RangeListData with dynamic arrays + */ + Uint32 FrmLen; + char FrmData[MAX_FRM_DATA_SIZE]; + Uint32 FragmentCount; + Uint32 ReplicaDataLen; + Uint16 ReplicaData[MAX_FRAGMENT_DATA_BYTES]; + Uint32 FragmentDataLen; + Uint16 FragmentData[3*MAX_NDB_PARTITIONS]; + + Uint32 MaxRowsLow; + Uint32 MaxRowsHigh; + Uint32 MinRowsLow; + Uint32 MinRowsHigh; + + Uint32 TablespaceDataLen; + Uint32 TablespaceData[2*MAX_NDB_PARTITIONS]; + Uint32 RangeListDataLen; + char RangeListData[4*2*MAX_NDB_PARTITIONS*2]; + + Uint32 RowGCIFlag; + Uint32 RowChecksumFlag; + + Table() {} + void init(); + }; + + static const + SimpleProperties::SP2StructMapping TableMapping[]; + + static const Uint32 TableMappingSize; + + // AttributeExtType values + enum ExtType { + ExtUndefined = NdbSqlUtil::Type::Undefined, + ExtTinyint = NdbSqlUtil::Type::Tinyint, + ExtTinyunsigned = NdbSqlUtil::Type::Tinyunsigned, + ExtSmallint = NdbSqlUtil::Type::Smallint, + ExtSmallunsigned = NdbSqlUtil::Type::Smallunsigned, + ExtMediumint = NdbSqlUtil::Type::Mediumint, + ExtMediumunsigned = NdbSqlUtil::Type::Mediumunsigned, + ExtInt = NdbSqlUtil::Type::Int, + ExtUnsigned = NdbSqlUtil::Type::Unsigned, + ExtBigint = NdbSqlUtil::Type::Bigint, + ExtBigunsigned = NdbSqlUtil::Type::Bigunsigned, + ExtFloat = NdbSqlUtil::Type::Float, + ExtDouble = NdbSqlUtil::Type::Double, + ExtOlddecimal = NdbSqlUtil::Type::Olddecimal, + ExtOlddecimalunsigned = NdbSqlUtil::Type::Olddecimalunsigned, + ExtDecimal = NdbSqlUtil::Type::Decimal, + ExtDecimalunsigned = NdbSqlUtil::Type::Decimalunsigned, + ExtChar = NdbSqlUtil::Type::Char, + ExtVarchar = NdbSqlUtil::Type::Varchar, + ExtBinary = NdbSqlUtil::Type::Binary, + ExtVarbinary = NdbSqlUtil::Type::Varbinary, + ExtDatetime = NdbSqlUtil::Type::Datetime, + ExtDate = NdbSqlUtil::Type::Date, + ExtBlob = NdbSqlUtil::Type::Blob, + ExtText = NdbSqlUtil::Type::Text, + ExtBit = NdbSqlUtil::Type::Bit, + ExtLongvarchar = NdbSqlUtil::Type::Longvarchar, + ExtLongvarbinary = NdbSqlUtil::Type::Longvarbinary, + ExtTime = NdbSqlUtil::Type::Time, + ExtYear = NdbSqlUtil::Type::Year, + ExtTimestamp = NdbSqlUtil::Type::Timestamp + }; + + // Attribute data interpretation + struct Attribute { + char AttributeName[MAX_TAB_NAME_SIZE]; + Uint32 AttributeId; + Uint32 AttributeType; // for osu 4.1->5.0.x + Uint32 AttributeSize; + Uint32 AttributeArraySize; + Uint32 AttributeArrayType; + Uint32 AttributeKeyFlag; + Uint32 AttributeNullableFlag; + Uint32 AttributeDKey; + Uint32 AttributeExtType; + Uint32 AttributeExtPrecision; + Uint32 AttributeExtScale; + Uint32 AttributeExtLength; + Uint32 AttributeAutoIncrement; + Uint32 AttributeStorageType; + char AttributeDefaultValue[MAX_ATTR_DEFAULT_VALUE_SIZE]; + + Attribute() {} + void init(); + + inline + Uint32 sizeInWords() + { + return ((1 << AttributeSize) * AttributeArraySize + 31) >> 5; + } + + // compute old-sty|e attribute size and array size + inline bool + translateExtType() { + switch (AttributeExtType) { + case DictTabInfo::ExtUndefined: + return false; + case DictTabInfo::ExtTinyint: + case DictTabInfo::ExtTinyunsigned: + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = AttributeExtLength; + break; + case DictTabInfo::ExtSmallint: + case DictTabInfo::ExtSmallunsigned: + AttributeSize = DictTabInfo::a16Bit; + AttributeArraySize = AttributeExtLength; + break; + case DictTabInfo::ExtMediumint: + case DictTabInfo::ExtMediumunsigned: + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = 3 * AttributeExtLength; + break; + case DictTabInfo::ExtInt: + case DictTabInfo::ExtUnsigned: + AttributeSize = DictTabInfo::a32Bit; + AttributeArraySize = AttributeExtLength; + break; + case DictTabInfo::ExtBigint: + case DictTabInfo::ExtBigunsigned: + AttributeSize = DictTabInfo::a64Bit; + AttributeArraySize = AttributeExtLength; + break; + case DictTabInfo::ExtFloat: + AttributeSize = DictTabInfo::a32Bit; + AttributeArraySize = AttributeExtLength; + break; + case DictTabInfo::ExtDouble: + AttributeSize = DictTabInfo::a64Bit; + AttributeArraySize = AttributeExtLength; + break; + case DictTabInfo::ExtOlddecimal: + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = + (1 + AttributeExtPrecision + (int(AttributeExtScale) > 0)) * + AttributeExtLength; + break; + case DictTabInfo::ExtOlddecimalunsigned: + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = + (0 + AttributeExtPrecision + (int(AttributeExtScale) > 0)) * + AttributeExtLength; + break; + case DictTabInfo::ExtDecimal: + case DictTabInfo::ExtDecimalunsigned: + { + // copy from Field_new_decimal ctor + uint precision = AttributeExtPrecision; + uint scale = AttributeExtScale; + if (precision > DECIMAL_MAX_LENGTH || scale >= NOT_FIXED_DEC) + precision = DECIMAL_MAX_LENGTH; + uint bin_size = my_decimal_get_binary_size(precision, scale); + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = bin_size * AttributeExtLength; + } + break; + case DictTabInfo::ExtChar: + case DictTabInfo::ExtBinary: + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = AttributeExtLength; + break; + case DictTabInfo::ExtVarchar: + case DictTabInfo::ExtVarbinary: + if (AttributeExtLength > 0xff) + return false; + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = AttributeExtLength + 1; + break; + case DictTabInfo::ExtDatetime: + // to fix + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = 8 * AttributeExtLength; + break; + case DictTabInfo::ExtDate: + // to fix + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = 3 * AttributeExtLength; + break; + case DictTabInfo::ExtBlob: + case DictTabInfo::ExtText: + AttributeSize = DictTabInfo::an8Bit; + // head + inline part (length in precision lower half) + AttributeArraySize = (NDB_BLOB_HEAD_SIZE << 2) + (AttributeExtPrecision & 0xFFFF); + break; + case DictTabInfo::ExtBit: + AttributeSize = DictTabInfo::aBit; + AttributeArraySize = AttributeExtLength; + break; + case DictTabInfo::ExtLongvarchar: + case DictTabInfo::ExtLongvarbinary: + if (AttributeExtLength > 0xffff) + return false; + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = AttributeExtLength + 2; + break; + case DictTabInfo::ExtTime: + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = 3 * AttributeExtLength; + break; + case DictTabInfo::ExtYear: + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = 1 * AttributeExtLength; + break; + case DictTabInfo::ExtTimestamp: + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = 4 * AttributeExtLength; + break; + default: + return false; + }; + return true; + } + + inline void print(FILE *out) { + fprintf(out, "AttributeId = %d\n", AttributeId); + fprintf(out, "AttributeType = %d\n", AttributeType); + fprintf(out, "AttributeSize = %d\n", AttributeSize); + fprintf(out, "AttributeArraySize = %d\n", AttributeArraySize); + fprintf(out, "AttributeArrayType = %d\n", AttributeArrayType); + fprintf(out, "AttributeKeyFlag = %d\n", AttributeKeyFlag); + fprintf(out, "AttributeStorageType = %d\n", AttributeStorageType); + fprintf(out, "AttributeNullableFlag = %d\n", AttributeNullableFlag); + fprintf(out, "AttributeDKey = %d\n", AttributeDKey); + fprintf(out, "AttributeGroup = %d\n", AttributeGroup); + fprintf(out, "AttributeAutoIncrement = %d\n", AttributeAutoIncrement); + fprintf(out, "AttributeExtType = %d\n", AttributeExtType); + fprintf(out, "AttributeExtPrecision = %d\n", AttributeExtPrecision); + fprintf(out, "AttributeExtScale = %d\n", AttributeExtScale); + fprintf(out, "AttributeExtLength = %d\n", AttributeExtLength); + fprintf(out, "AttributeDefaultValue = \"%s\"\n", + AttributeDefaultValue ? AttributeDefaultValue : ""); + } + }; + + static const + SimpleProperties::SP2StructMapping AttributeMapping[]; + + static const Uint32 AttributeMappingSize; + + // Signal constants + STATIC_CONST( DataLength = 20 ); + STATIC_CONST( HeaderLength = 5 ); + +private: + Uint32 senderRef; + Uint32 senderData; + Uint32 requestType; + Uint32 totalLen; + Uint32 offset; + + /** + * Length of this data = signal->length() - HeaderLength + * Sender block ref = signal->senderBlockRef() + */ + + Uint32 tabInfoData[DataLength]; + +public: + enum Depricated + { + AttributeDGroup = 1009, //Default NotDGroup + AttributeStoredInd = 1011, //Default NotStored + TableStorageVal = 14, //Disk storage specified per attribute + SecondTableId = 17, //Mandatory between DICT's otherwise not allowed + FragmentKeyTypeVal = 16 //Default PrimaryKey + }; + + enum Unimplemented + { + ScanOptimised = 15, //Default updateOptimised + AttributeGroup = 1012, //Default 0 + FileNo = 102 + }; +}; + +#define DFGIMAP(x, y, z) \ + { DictFilegroupInfo::y, my_offsetof(x, z), SimpleProperties::Uint32Value, 0, (~0), 0 } + +#define DFGIMAP2(x, y, z, u, v) \ + { DictFilegroupInfo::y, my_offsetof(x, z), SimpleProperties::Uint32Value, u, v, 0 } + +#define DFGIMAPS(x, y, z, u, v) \ + { DictFilegroupInfo::y, my_offsetof(x, z), SimpleProperties::StringValue, u, v, 0 } + +#define DFGIMAPB(x, y, z, u, v, l) \ + { DictFilegroupInfo::y, my_offsetof(x, z), SimpleProperties::BinaryValue, u, v, \ + my_offsetof(x, l) } + +#define DFGIBREAK(x) \ + { DictFilegroupInfo::x, 0, SimpleProperties::InvalidValue, 0, 0, 0 } + +struct DictFilegroupInfo { + enum KeyValues { + FilegroupName = 1, + FilegroupType = 2, + FilegroupId = 3, + FilegroupVersion = 4, + + /** + * File parameters + */ + FileName = 100, + FileType = 101, + FileId = 103, + FileFGroupId = 104, + FileFGroupVersion = 105, + FileSizeHi = 106, + FileSizeLo = 107, + FileFreeExtents = 108, + FileVersion = 109, + FileEnd = 199, // + + /** + * Tablespace parameters + */ + TS_ExtentSize = 1000, // specified in bytes + TS_LogfileGroupId = 1001, + TS_LogfileGroupVersion = 1002, + TS_GrowLimit = 1003, // In bytes + TS_GrowSizeHi = 1004, + TS_GrowSizeLo = 1005, + TS_GrowPattern = 1006, + TS_GrowMaxSize = 1007, + + /** + * Logfile group parameters + */ + LF_UndoBufferSize = 2005, // In bytes + LF_UndoGrowLimit = 2000, // In bytes + LF_UndoGrowSizeHi = 2001, + LF_UndoGrowSizeLo = 2002, + LF_UndoGrowPattern = 2003, + LF_UndoGrowMaxSize = 2004, + LF_UndoFreeWordsHi = 2006, + LF_UndoFreeWordsLo = 2007 + }; + + // FragmentType constants + enum FileTypeValues { + Datafile = 0, + Undofile = 1 + //, Redofile + }; + + struct GrowSpec { + Uint32 GrowLimit; + Uint32 GrowSizeHi; + Uint32 GrowSizeLo; + char GrowPattern[PATH_MAX]; + Uint32 GrowMaxSize; + }; + + // Table data interpretation + struct Filegroup { + char FilegroupName[MAX_TAB_NAME_SIZE]; + Uint32 FilegroupType; // ObjType + Uint32 FilegroupId; + Uint32 FilegroupVersion; + + union { + Uint32 TS_ExtentSize; + Uint32 LF_UndoBufferSize; + }; + Uint32 TS_LogfileGroupId; + Uint32 TS_LogfileGroupVersion; + union { + GrowSpec TS_DataGrow; + GrowSpec LF_UndoGrow; + }; + //GrowSpec LF_RedoGrow; + Uint32 LF_UndoFreeWordsHi; + Uint32 LF_UndoFreeWordsLo; + Filegroup() {} + void init(); + }; + static const Uint32 MappingSize; + static const SimpleProperties::SP2StructMapping Mapping[]; + + struct File { + char FileName[PATH_MAX]; + Uint32 FileType; + Uint32 FileId; + Uint32 FileVersion; + Uint32 FilegroupId; + Uint32 FilegroupVersion; + Uint32 FileSizeHi; + Uint32 FileSizeLo; + Uint32 FileFreeExtents; + + File() {} + void init(); + }; + static const Uint32 FileMappingSize; + static const SimpleProperties::SP2StructMapping FileMapping[]; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/DihAddFrag.hpp b/storage/ndb/include/kernel/signaldata/DihAddFrag.hpp new file mode 100644 index 00000000000..123b81c9480 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/DihAddFrag.hpp @@ -0,0 +1,61 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef DIHADDFRAG_HPP +#define DIHADDFRAG_HPP + +#include <NodeBitmask.hpp> +#include <ndb_limits.h> + +/** + * + */ +class DihAddFragConf { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdih; + +public: + STATIC_CONST( SignalLength = 2 ); +private: + Uint32 senderNodeId; + Uint32 tableId; +}; +/** + * + */ +class DihAddFragReq { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdih; + +public: + STATIC_CONST( SignalLength = 10 + MAX_REPLICAS ); +private: + Uint32 masterRef; + Uint32 tableId; + Uint32 fragId; + Uint32 kValue; + Uint32 method; + Uint32 mask; + Uint32 hashPointer; + Uint32 noOfFragments; + Uint32 noOfBackups; + Uint32 storedTable; + Uint32 nodes[MAX_REPLICAS]; +}; +#endif diff --git a/storage/ndb/include/kernel/signaldata/DihContinueB.hpp b/storage/ndb/include/kernel/signaldata/DihContinueB.hpp new file mode 100644 index 00000000000..4bec9af4856 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/DihContinueB.hpp @@ -0,0 +1,76 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef DIH_CONTINUEB_H +#define DIH_CONTINUEB_H + +#include "SignalData.hpp" + +class DihContinueB { + /** + * Sender(s)/Reciver(s) + */ + friend class Dbdih; + friend bool printCONTINUEB_DBDIH(FILE * output, const Uint32 * theData, + Uint32 len, Uint16); +private: + enum Type { + ZPACK_TABLE_INTO_PAGES = 1, + ZPACK_FRAG_INTO_PAGES = 2, + ZREAD_PAGES_INTO_TABLE = 3, + ZREAD_PAGES_INTO_FRAG = 4, + //ZREAD_TAB_DESCRIPTION = 5, + ZCOPY_TABLE = 6, + ZCOPY_TABLE_NODE = 7, + ZSTART_FRAGMENT = 8, + ZCOMPLETE_RESTART = 9, + ZREAD_TABLE_FROM_PAGES = 10, + ZSR_PHASE2_READ_TABLE = 11, + ZCHECK_TC_COUNTER = 12, + ZCALCULATE_KEEP_GCI = 13, + ZSTORE_NEW_LCP_ID = 14, + ZTABLE_UPDATE = 15, + ZCHECK_LCP_COMPLETED = 16, + ZINIT_LCP = 17, + ZADD_TABLE_MASTER_PAGES = 19, + ZDIH_ADD_TABLE_MASTER = 20, + ZADD_TABLE_SLAVE_PAGES = 21, + ZDIH_ADD_TABLE_SLAVE = 22, + ZSTART_GCP = 23, + ZCOPY_GCI = 24, + ZEMPTY_VERIFY_QUEUE = 25, + ZCHECK_GCP_STOP = 26, + ZREMOVE_NODE_FROM_TABLE = 27, + ZCOPY_NODE = 28, + ZSTART_TAKE_OVER = 29, + ZCHECK_START_TAKE_OVER = 30, + ZTO_START_COPY_FRAG = 31, + ZINITIALISE_RECORDS = 33, + ZINVALIDATE_NODE_LCP = 34, + ZSTART_PERMREQ_AGAIN = 35, + SwitchReplica = 36, + ZSEND_START_TO = 37, + ZSEND_ADD_FRAG = 38, + ZSEND_CREATE_FRAG = 39, + ZSEND_UPDATE_TO = 40, + ZSEND_END_TO = 41, + + WAIT_DROP_TAB_WRITING_TO_FILE = 42, + CHECK_WAIT_DROP_TAB_FAILED_LQH = 43, + ZTO_START_FRAGMENTS = 44 + }; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/DihFragCount.hpp b/storage/ndb/include/kernel/signaldata/DihFragCount.hpp new file mode 100644 index 00000000000..90e943b7244 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/DihFragCount.hpp @@ -0,0 +1,66 @@ +/* Copyright (C) 2006 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef DIH_FRAG_COUNT_HPP +#define DIH_FRAG_COUNT_HPP + +#include "SignalData.hpp" + +/** + * DihFragCountReq + */ +class DihFragCountReq { + +public: + STATIC_CONST( SignalLength = 3 ); + STATIC_CONST( RetryInterval = 5 ); + Uint32 m_connectionData; + Uint32 m_tableRef; + Uint32 m_senderData; +}; + +/** + * DihFragCountConf + */ +class DihFragCountConf { + +public: + STATIC_CONST( SignalLength = 5 ); + Uint32 m_connectionData; + Uint32 m_tableRef; + Uint32 m_senderData; + Uint32 m_fragmentCount; + Uint32 m_noOfBackups; +}; + +/** + * DihFragCountRef + */ +class DihFragCountRef { + +public: + enum ErrorCode { + ErroneousState = 0, + ErroneousTableState = 1 + }; + STATIC_CONST( SignalLength = 5 ); + Uint32 m_connectionData; + Uint32 m_tableRef; + Uint32 m_senderData; + Uint32 m_error; + Uint32 m_tableStatus; // Dbdih::TabRecord::tabStatus +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/DihSizeAltReq.hpp b/storage/ndb/include/kernel/signaldata/DihSizeAltReq.hpp new file mode 100644 index 00000000000..9e901d5bf49 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/DihSizeAltReq.hpp @@ -0,0 +1,49 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef DIH_SIZE_ALT_REQ_H +#define DIH_SIZE_ALT_REQ_H + +#include "SignalData.hpp" + +class DihSizeAltReq { + /** + * Sender(s) + */ + friend class ClusterConfiguration; + + /** + * Reciver(s) + */ + friend class Dbdih; +private: + /** + * Indexes in theData + */ + STATIC_CONST( IND_BLOCK_REF = 0 ); + STATIC_CONST( IND_API_CONNECT = 1 ); + STATIC_CONST( IND_CONNECT = 2 ); + STATIC_CONST( IND_FRAG_CONNECT = 3 ); + STATIC_CONST( IND_MORE_NODES = 4 ); + STATIC_CONST( IND_REPLICAS = 5 ); + STATIC_CONST( IND_TABLE = 6 ); + + /** + * Use the index definitions to use the signal data + */ + UintR theData[7]; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/DihStartTab.hpp b/storage/ndb/include/kernel/signaldata/DihStartTab.hpp new file mode 100644 index 00000000000..434712dbf47 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/DihStartTab.hpp @@ -0,0 +1,64 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef DIH_STARTTAB__HPP +#define DIH_STARTTAB__HPP + +#include "SignalData.hpp" + +class DihStartTabReq { + /** + * Sender(s) + */ + friend class Dbdict; + + /** + * Receiver(s) + */ + friend class Dbdih; +public: + STATIC_CONST( HeaderLength = 3 ); + +private: + + Uint32 senderRef; + Uint32 senderData; + Uint32 noOfTables; + + struct { + Uint32 tableId; + Uint32 schemaVersion; + } tables[10]; +}; + +class DihStartTabConf { + /** + * Sender(s) + */ + friend class Dbdih; + + /** + * Receiver(s) + */ + friend class Dbdict; +public: + STATIC_CONST( SignalLength = 2 ); + +private: + Uint32 senderRef; + Uint32 senderData; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/DihSwitchReplica.hpp b/storage/ndb/include/kernel/signaldata/DihSwitchReplica.hpp new file mode 100644 index 00000000000..cbeeb60af92 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/DihSwitchReplica.hpp @@ -0,0 +1,71 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef DIH_SWITCH_REPLICA_HPP +#define DIH_SWITCH_REPLICA_HPP + +/** + * This signal is sent from master DIH to all DIH's + * switches primary / backup nodes for replica(s) + * + */ +class DihSwitchReplicaReq { + /** + * Sender/Reciver + */ + friend class Dbdih; + +public: + STATIC_CONST( SignalLength = 4 + MAX_REPLICAS ); + +private: + /** + * Request Info + * + */ + Uint32 senderRef; + Uint32 tableId; + Uint32 fragNo; + Uint32 noOfReplicas; + Uint32 newNodeOrder[MAX_REPLICAS]; +}; + +class DihSwitchReplicaRef { + /** + * Sender/Reciver + */ + friend class Dbdih; + +public: + STATIC_CONST( SignalLength = 2 ); + +private: + Uint32 senderNode; + Uint32 errorCode; // See StopPermRef::ErrorCode +}; + +class DihSwitchReplicaConf { + /** + * Sender/Reciver + */ + friend class Dbdih; + +public: + STATIC_CONST( SignalLength = 1 ); + +private: + Uint32 senderNode; +}; +#endif diff --git a/storage/ndb/include/kernel/signaldata/DisconnectRep.hpp b/storage/ndb/include/kernel/signaldata/DisconnectRep.hpp new file mode 100644 index 00000000000..26515fc0ef8 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/DisconnectRep.hpp @@ -0,0 +1,60 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef DISCONNECT_REP_HPP +#define DISCONNECT_REP_HPP + +#include "SignalData.hpp" + +/** + * + */ +class DisconnectRep { + /** + * Receiver(s) + */ + friend class Qmgr; + friend class Cmvmi; // Cmvmi + + /** + * Senders + */ + friend class Dbtc; + friend void reportDisconnect(void * , NodeId, Uint32); // TransporterCallback + + /** + * For printing + */ + friend bool printDISCONNECT_REP(FILE *, const Uint32 *, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 2 ); + + enum ErrCode { + // ErrorCodes come from different sources + // for example TransporterCallback.hpp + // or inet errno + // This one is selected not to conflict with any of them + TcReportNodeFailed = 0xFF000001 + }; + +private: + + Uint32 nodeId; + Uint32 err; +}; + + +#endif diff --git a/storage/ndb/include/kernel/signaldata/DropFilegroup.hpp b/storage/ndb/include/kernel/signaldata/DropFilegroup.hpp new file mode 100644 index 00000000000..0125e523653 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/DropFilegroup.hpp @@ -0,0 +1,193 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef DROP_FILEGROUP_HPP +#define DROP_FILEGROUP_HPP + +#include "SignalData.hpp" + +struct DropFilegroupReq { + /** + * Sender(s) / Reciver(s) + */ + friend class NdbDictInterface; + friend class Dbdict; + friend class Tsman; + + /** + * For printing + */ + friend bool printDROP_FILEGROUP_REQ(FILE*, const Uint32*, Uint32, Uint16); + + STATIC_CONST( SignalLength = 4 ); + STATIC_CONST( GSN = GSN_DROP_FILEGROUP_REQ ); + + Uint32 senderData; + Uint32 senderRef; + Uint32 filegroup_id; + Uint32 filegroup_version; +}; + +struct DropFilegroupRef { + /** + * Sender(s) + */ + friend class Dbdict; + + /** + * Sender(s) / Reciver(s) + */ + friend class Ndbcntr; + friend class NdbDictInterface; + + /** + * For printing + */ + friend bool printDROP_FILEGROUP_REF(FILE*, const Uint32*, Uint32, Uint16); + + STATIC_CONST( SignalLength = 7 ); + STATIC_CONST( GSN = GSN_DROP_FILEGROUP_REF ); + + enum ErrorCode { + NoError = 0, + Busy = 701, + NotMaster = 702, + NoSuchFilegroup = 767, + FilegroupInUse = 768, + InvalidSchemaObjectVersion = 774 + }; + + Uint32 senderData; + Uint32 senderRef; + Uint32 masterNodeId; + Uint32 errorCode; + Uint32 errorLine; + Uint32 errorKey; + +}; + +struct DropFilegroupConf { + /** + * Sender(s) + */ + friend class Dbdict; + + /** + * Sender(s) / Reciver(s) + */ + friend class Ndbcntr; + friend class NdbDictInterface; + + /** + * For printing + */ + friend bool printDROP_FILEGROUP_CONF(FILE*, const Uint32*, Uint32, Uint16); + + STATIC_CONST( SignalLength = 4 ); + STATIC_CONST( GSN = GSN_DROP_FILEGROUP_CONF ); + + Uint32 senderData; + Uint32 senderRef; + Uint32 filegroupId; + Uint32 filegroupVersion; +}; + +struct DropFileReq { + /** + * Sender(s) / Reciver(s) + */ + friend class NdbDictInterface; + friend class Dbdict; + friend class Tsman; + + /** + * For printing + */ + friend bool printDROP_FILE_REQ(FILE*, const Uint32*, Uint32, Uint16); + + STATIC_CONST( SignalLength = 4 ); + STATIC_CONST( GSN = GSN_DROP_FILE_REQ ); + + Uint32 senderData; + Uint32 senderRef; + Uint32 file_id; + Uint32 file_version; +}; + +struct DropFileRef { + /** + * Sender(s) + */ + friend class Dbdict; + + /** + * Sender(s) / Reciver(s) + */ + friend class Ndbcntr; + friend class NdbDictInterface; + + /** + * For printing + */ + friend bool printDROP_FILE_REF(FILE*, const Uint32*, Uint32, Uint16); + + STATIC_CONST( SignalLength = 7 ); + STATIC_CONST( GSN = GSN_DROP_FILE_REF ); + + enum ErrorCode { + NoError = 0, + Busy = 701, + NotMaster = 702, + NoSuchFile = 766, + DropUndoFileNotSupported = 769, + InvalidSchemaObjectVersion = 774 + }; + + Uint32 senderData; + Uint32 senderRef; + Uint32 masterNodeId; + Uint32 errorCode; + Uint32 errorLine; + Uint32 errorKey; + +}; + +struct DropFileConf { + /** + * Sender(s) + */ + friend class Dbdict; + + /** + * Sender(s) / Reciver(s) + */ + friend class Ndbcntr; + friend class NdbDictInterface; + + /** + * For printing + */ + friend bool printDROP_FILE_CONF(FILE*, const Uint32*, Uint32, Uint16); + + STATIC_CONST( SignalLength = 4 ); + STATIC_CONST( GSN = GSN_DROP_FILE_CONF ); + + Uint32 senderData; + Uint32 senderRef; + Uint32 fileId; + Uint32 fileVersion; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/DropFilegroupImpl.hpp b/storage/ndb/include/kernel/signaldata/DropFilegroupImpl.hpp new file mode 100644 index 00000000000..da1d953c1ca --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/DropFilegroupImpl.hpp @@ -0,0 +1,170 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef DROP_FILEGROUP_IMPL_HPP +#define DROP_FILEGROUP_IMPL_HPP + +#include "SignalData.hpp" + +struct DropFilegroupImplReq { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdict; + friend class Tsman; + friend class Lgman; + + /** + * For printing + */ + friend bool printDROP_FILEGROUP_IMPL_REQ(FILE*, const Uint32*, Uint32, Uint16); + + STATIC_CONST( SignalLength = 5 ); + + enum RequestInfo { + Prepare = 0x1, + Commit = 0x2, + Abort = 0x4 + }; + + Uint32 senderData; + Uint32 senderRef; + + Uint32 requestInfo; + Uint32 filegroup_id; + Uint32 filegroup_version; +}; + +struct DropFilegroupImplRef { + /** + * Sender(s) + */ + friend class Dbdict; + friend class Tsman; + friend class Lgman; + + /** + * For printing + */ + friend bool printDROP_FILEGROUP_IMPL_REF(FILE*, const Uint32*, Uint32, Uint16); + + STATIC_CONST( SignalLength = 3 ); + + enum ErrorCode { + NoError = 0, + NoSuchFilegroup = 767, + InvalidFilegroupVersion = 767, + FilegroupInUse = 768 + }; + + Uint32 senderData; + Uint32 senderRef; + Uint32 errorCode; +}; + +struct DropFilegroupImplConf { + /** + * Sender(s) + */ + friend class Dbdict; + friend class Tsman; + friend class Lgman; + + /** + * For printing + */ + friend bool printDROP_FILEGROUP_IMPL_CONF(FILE*, const Uint32*, Uint32, Uint16); + + STATIC_CONST( SignalLength = 2 ); + + Uint32 senderData; + Uint32 senderRef; +}; + +struct DropFileImplReq { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdict; + friend class Tsman; + friend class Lgman; + + /** + * For printing + */ + friend bool printDROP_FILE_IMPL_REQ(FILE*, const Uint32*, Uint32, Uint16); + + STATIC_CONST( SignalLength = 6 ); + + enum RequestInfo { + Prepare = 0x1, + Commit = 0x2, + Abort = 0x4 + }; + + Uint32 senderData; + Uint32 senderRef; + + Uint32 requestInfo; + Uint32 file_id; + Uint32 filegroup_id; + Uint32 filegroup_version; +}; + +struct DropFileImplRef { + friend class Dbdict; + friend class Tsman; + friend class Lgman; + + /** + * For printing + */ + friend bool printDROP_FILE_IMPL_REF(FILE*, const Uint32*, Uint32, Uint16); + + STATIC_CONST( SignalLength = 5 ); + + enum ErrorCode { + NoError = 0, + InvalidFilegroup = 767, + InvalidFilegroupVersion = 767, + NoSuchFile = 766, + FileInUse = 770 + }; + + Uint32 senderData; + Uint32 senderRef; + Uint32 errorCode; + Uint32 fsErrCode; + Uint32 osErrCode; +}; + +struct DropFileImplConf { + friend class Dbdict; + friend class Tsman; + friend class Lgman; + + + /** + * For printing + */ + friend bool printDROP_FILE_IMPL_CONF(FILE*, const Uint32*, Uint32, Uint16); + + STATIC_CONST( SignalLength = 2 ); + + Uint32 senderData; + Uint32 senderRef; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/DropIndx.hpp b/storage/ndb/include/kernel/signaldata/DropIndx.hpp new file mode 100644 index 00000000000..01d500f2d84 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/DropIndx.hpp @@ -0,0 +1,255 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef DROP_INDX_HPP +#define DROP_INDX_HPP + +#include "SignalData.hpp" +#include <NodeBitmask.hpp> + +/** + * DropIndxReq. + */ +class DropIndxReq { + friend bool printDROP_INDX_REQ(FILE*, const Uint32*, Uint32, Uint16); + +public: + enum RequestType { + RT_UNDEFINED = 0, + RT_USER = 1, + RT_DICT_PREPARE = 1 << 4, + RT_DICT_COMMIT = 0xC << 4, + RT_DICT_ABORT = 0xF << 4, + RT_TC = 5 << 8 + }; + STATIC_CONST( SignalLength = 6 ); + +private: + Uint32 m_connectionPtr; + Uint32 m_userRef; + Uint32 m_requestInfo; + Uint32 m_tableId; + Uint32 m_indexId; + Uint32 m_indexVersion; + // extra + Uint32 m_opKey; + +public: + Uint32 getConnectionPtr() const { + return m_connectionPtr; + } + void setConnectionPtr(Uint32 val) { + m_connectionPtr = val; + } + Uint32 getUserRef() const { + return m_userRef; + } + void setUserRef(Uint32 val) { + m_userRef = val; + } + DropIndxReq::RequestType getRequestType() const { + const Uint32 val = BitmaskImpl::getField(1, &m_requestInfo, 0, 16); + return (DropIndxReq::RequestType)val; + } + void setRequestType(DropIndxReq::RequestType val) { + m_requestInfo = (Uint32)val; + } + Uint32 getRequestFlag() const { + return BitmaskImpl::getField(1, &m_requestInfo, 16, 16); + }; + void addRequestFlag(Uint32 val) { + val |= BitmaskImpl::getField(1, &m_requestInfo, 16, 16); + BitmaskImpl::setField(1, &m_requestInfo, 16, 16, val); + }; + Uint32 getTableId() const { + return m_tableId; + } + void setTableId(Uint32 val) { + m_tableId = val; + } + Uint32 getIndexId() const { + return m_indexId; + } + void setIndexId(Uint32 val) { + m_indexId = val; + } + Uint32 getIndexVersion() const { + return m_indexVersion; + } + void setIndexVersion(Uint32 val) { + m_indexVersion = val; + } + Uint32 getOpKey() const { + return m_opKey; + } + void setOpKey(Uint32 val) { + m_opKey = val; + } +}; + +/** + * DropIndxConf. + */ +class DropIndxConf { + friend bool printDROP_INDX_CONF(FILE*, const Uint32*, Uint32, Uint16); + +public: + STATIC_CONST( InternalLength = 3 ); + STATIC_CONST( SignalLength = 6 ); + +private: + Uint32 m_connectionPtr; + Uint32 m_userRef; + Uint32 m_requestInfo; + Uint32 m_tableId; + Uint32 m_indexId; + Uint32 m_indexVersion; + +public: + Uint32 getConnectionPtr() const { + return m_connectionPtr; + } + void setConnectionPtr(Uint32 val) { + m_connectionPtr = val; + } + Uint32 getUserRef() const { + return m_userRef; + } + void setUserRef(Uint32 val) { + m_userRef = val; + } + DropIndxReq::RequestType getRequestType() const { + return (DropIndxReq::RequestType)m_requestInfo; + } + void setRequestType(DropIndxReq::RequestType val) { + m_requestInfo = val; + } + Uint32 getTableId() const { + return m_tableId; + } + void setTableId(Uint32 val) { + m_tableId = val; + } + Uint32 getIndexId() const { + return m_indexId; + } + void setIndexId(Uint32 val) { + m_indexId = val; + } + Uint32 getIndexVersion() const { + return m_indexVersion; + } + void setIndexVersion(Uint32 val) { + m_indexVersion = val; + } +}; + +/** + * DropIndxRef. + */ +struct DropIndxRef { + friend bool printDROP_INDX_REF(FILE*, const Uint32*, Uint32, Uint16); + +public: + enum ErrorCode { + NoError = 0, + InvalidIndexVersion = 241, + Busy = 701, + BusyWithNR = 711, + NotMaster = 702, + IndexNotFound = 4243, + BadRequestType = 4247, + InvalidName = 4248, + NotAnIndex = 4254 + }; + STATIC_CONST( SignalLength = DropIndxConf::SignalLength + 3 ); + + DropIndxConf m_conf; + //Uint32 m_userRef; + //Uint32 m_connectionPtr; + //Uint32 m_requestInfo; + //Uint32 m_tableId; + //Uint32 m_indexId; + //Uint32 m_indexVersion; + Uint32 m_errorCode; + Uint32 m_errorLine; + union { + Uint32 m_errorNode; + Uint32 masterNodeId; + }; +public: + DropIndxConf* getConf() { + return &m_conf; + } + const DropIndxConf* getConf() const { + return &m_conf; + } + Uint32 getConnectionPtr() const { + return m_conf.getConnectionPtr(); + } + void setConnectionPtr(Uint32 val) { + m_conf.setConnectionPtr(val); + } + Uint32 getUserRef() const { + return m_conf.getUserRef(); + } + void setUserRef(Uint32 val) { + m_conf.setUserRef(val); + } + DropIndxReq::RequestType getRequestType() const { + return m_conf.getRequestType(); + } + void setRequestType(DropIndxReq::RequestType val) { + m_conf.setRequestType(val); + } + Uint32 getTableId() const { + return m_conf.getTableId(); + } + void setTableId(Uint32 val) { + m_conf.setTableId(val); + } + Uint32 getIndexId() const { + return m_conf.getIndexId(); + } + void setIndexId(Uint32 val) { + m_conf.setIndexId(val); + } + Uint32 getIndexVersion() const { + return m_conf.getIndexVersion(); + } + void setIndexVersion(Uint32 val) { + m_conf.setIndexVersion(val); + } + DropIndxRef::ErrorCode getErrorCode() const { + return (DropIndxRef::ErrorCode)m_errorCode; + } + void setErrorCode(DropIndxRef::ErrorCode val) { + m_errorCode = (Uint32)val; + } + Uint32 getErrorLine() const { + return m_errorLine; + } + void setErrorLine(Uint32 val) { + m_errorLine = val; + } + Uint32 getErrorNode() const { + return m_errorNode; + } + void setErrorNode(Uint32 val) { + m_errorNode = val; + } +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/DropObj.hpp b/storage/ndb/include/kernel/signaldata/DropObj.hpp new file mode 100644 index 00000000000..278c9063c37 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/DropObj.hpp @@ -0,0 +1,117 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef DROP_OBJ_HPP +#define DROP_OBJ_HPP + +#include "DictObjOp.hpp" +#include "SignalData.hpp" + +struct DropObjReq +{ + /** + * Sender(s) + */ + friend class Dbdict; + + /** + * Receiver(s) + */ + friend class Dbtc; + friend class Dblqh; + friend class Dbacc; + friend class Dbtup; + friend class Dbtux; + friend class Dbdih; + + friend bool printDROP_OBJ_REQ(FILE *, const Uint32 *, Uint32, Uint16); + STATIC_CONST( SignalLength = 9 ); + + Uint32 op_key; + Uint32 objId; + Uint32 objType; + Uint32 objVersion; + + Uint32 senderRef; + Uint32 senderData; + + Uint32 requestInfo; + + Uint32 clientRef; + Uint32 clientData; +}; + +class DropObjConf { + /** + * Sender(s) + */ + friend class Dbtc; + friend class Dblqh; + friend class Dbacc; + friend class Dbtup; + friend class Dbtux; + friend class Dbdih; + + /** + * Receiver(s) + */ + friend class Dbdict; + + friend bool printDROP_OBJ_CONF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 3 ); + +private: + Uint32 senderRef; + Uint32 senderData; + Uint32 objId; +}; + +class DropObjRef { + /** + * Sender(s) + */ + friend class Dbtc; + friend class Dblqh; + friend class Dbacc; + friend class Dbtup; + friend class Dbtux; + friend class Dbdih; + + /** + * Receiver(s) + */ + friend class Dbdict; + + friend bool printDROP_OBJ_REF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 4 ); + + enum ErrorCode { + NoSuchObj = 1, + DropWoPrep = 2, // Calling Drop with first calling PrepDrop + PrepDropInProgress = 3, + DropInProgress = 4, + NF_FakeErrorREF = 5 + }; + +private: + Uint32 senderRef; + Uint32 senderData; + Uint32 objId; + Uint32 errorCode; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/DropTab.hpp b/storage/ndb/include/kernel/signaldata/DropTab.hpp new file mode 100644 index 00000000000..fd865bd3da2 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/DropTab.hpp @@ -0,0 +1,115 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef DROP_TAB_HPP +#define DROP_TAB_HPP + +#include "SignalData.hpp" + +class DropTabReq { + /** + * Sender(s) + */ + friend class Dbdict; + + /** + * Receiver(s) + */ + friend class Dbtc; + friend class Dblqh; + friend class Dbacc; + friend class Dbtup; + friend class Dbtux; + friend class Dbdih; + + friend bool printDROP_TAB_REQ(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 4 ); + + enum RequestType { + OnlineDropTab = 0, + CreateTabDrop = 1, + RestartDropTab = 2 + }; +private: + Uint32 senderRef; + Uint32 senderData; + Uint32 tableId; + Uint32 requestType; +}; + +class DropTabConf { + /** + * Sender(s) + */ + friend class Dbtc; + friend class Dblqh; + friend class Dbacc; + friend class Dbtup; + friend class Dbtux; + friend class Dbdih; + friend class Suma; + + /** + * Receiver(s) + */ + friend class Dbdict; + + friend bool printDROP_TAB_CONF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 3 ); + +private: + Uint32 senderRef; + Uint32 senderData; + Uint32 tableId; +}; + +class DropTabRef { + /** + * Sender(s) + */ + friend class Dbtc; + friend class Dblqh; + friend class Dbacc; + friend class Dbtup; + friend class Dbtux; + friend class Dbdih; + + /** + * Receiver(s) + */ + friend class Dbdict; + + friend bool printDROP_TAB_REF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 4 ); + + enum ErrorCode { + NoSuchTable = 1, + DropWoPrep = 2, // Calling Drop with first calling PrepDrop + PrepDropInProgress = 3, + DropInProgress = 4, + NF_FakeErrorREF = 5 + }; + +private: + Uint32 senderRef; + Uint32 senderData; + Uint32 tableId; + Uint32 errorCode; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/DropTabFile.hpp b/storage/ndb/include/kernel/signaldata/DropTabFile.hpp new file mode 100644 index 00000000000..d9e6b96b5a9 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/DropTabFile.hpp @@ -0,0 +1,63 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef DROP_TABFILE_HPP +#define DROP_TABFILE_HPP + +#include "SignalData.hpp" + +class DropTabFileReq { + /** + * Sender(s) + */ + friend class Dbdict; + + /** + * Receiver(s) + */ + friend class Dbdih; + friend class Dbacc; + friend class Dbtup; +public: + STATIC_CONST( SignalLength = 4 ); + +private: + Uint32 userPtr; + Uint32 userRef; + Uint32 primaryTableId; + Uint32 secondaryTableId; +}; +class DropTabFileConf { + /** + * Receiver(s) + */ + friend class Dbdict; + + /** + * Sender(s) + */ + friend class Dbdih; + friend class Dbacc; + friend class Dbtup; +public: + STATIC_CONST( SignalLength = 3 ); + +private: + Uint32 userPtr; + Uint32 senderRef; + Uint32 nodeId; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/DropTable.hpp b/storage/ndb/include/kernel/signaldata/DropTable.hpp new file mode 100644 index 00000000000..36268b23be1 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/DropTable.hpp @@ -0,0 +1,81 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef DROP_TABLE_HPP +#define DROP_TABLE_HPP + +#include "SignalData.hpp" + +class DropTableReq { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdict; + +public: + STATIC_CONST( SignalLength = 4 ); +public: + Uint32 senderData; + Uint32 senderRef; + Uint32 tableId; + Uint32 tableVersion; +}; + +class DropTableRef { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdict; + +public: + STATIC_CONST( SignalLength = 6 ); + +public: + Uint32 senderData; + Uint32 senderRef; + Uint32 tableId; + Uint32 tableVersion; + Uint32 errorCode; + Uint32 masterNodeId; + + enum ErrorCode { + Busy = 701, + BusyWithNR = 711, + NotMaster = 702, + NoSuchTable = 709, + InvalidTableVersion = 241, + DropInProgress = 283, + NoDropTableRecordAvailable = 1229, + BackupInProgress = 761 + }; +}; + +class DropTableConf { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdict; + +public: + STATIC_CONST( SignalLength = 4 ); + +public: + Uint32 senderData; + Uint32 senderRef; + Uint32 tableId; + Uint32 tableVersion; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/DropTrig.hpp b/storage/ndb/include/kernel/signaldata/DropTrig.hpp new file mode 100644 index 00000000000..27e1a67801d --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/DropTrig.hpp @@ -0,0 +1,299 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef DROP_TRIG_HPP +#define DROP_TRIG_HPP + +#include "SignalData.hpp" +#include <NodeBitmask.hpp> +#include <trigger_definitions.h> + +/** + * DropTrigReq. + */ +class DropTrigReq { + friend bool printDROP_TRIG_REQ(FILE*, const Uint32*, Uint32, Uint16); + +public: + enum RequestType { + RT_UNDEFINED = 0, + RT_USER = 1, + RT_ALTER_INDEX = 2, + RT_BUILD_INDEX = 3, + RT_DICT_PREPARE = 1 << 4, + RT_DICT_COMMIT = 0xC << 4, + RT_DICT_ABORT = 0xF << 4, + RT_TC = 5 << 8, + RT_LQH = 6 << 8 + }; + STATIC_CONST( SignalLength = 7 ); + SECTION( TRIGGER_NAME_SECTION = 0 ); // optional + enum KeyValues { + TriggerNameKey = 0xa1 + }; + +private: + Uint32 m_userRef; + Uint32 m_connectionPtr; + Uint32 m_requestInfo; + Uint32 m_tableId; + Uint32 m_indexId; // set by DICT if index trigger + Uint32 m_triggerId; // set by DICT based on name + Uint32 m_triggerInfo; // only for TUP + // extra + Uint32 m_opKey; + +public: + Uint32 getUserRef() const { + return m_userRef; + } + void setUserRef(Uint32 val) { + m_userRef = val; + } + Uint32 getConnectionPtr() const { + return m_connectionPtr; + } + void setConnectionPtr(Uint32 val) { + m_connectionPtr = val; + } + DropTrigReq::RequestType getRequestType() const { + const Uint32 val = BitmaskImpl::getField(1, &m_requestInfo, 0, 16); + return (DropTrigReq::RequestType)val; + } + void setRequestType(DropTrigReq::RequestType val) { + m_requestInfo = (Uint32)val; + } + Uint32 getRequestFlag() const { + return BitmaskImpl::getField(1, &m_requestInfo, 16, 16); + }; + void addRequestFlag(Uint32 val) { + val |= BitmaskImpl::getField(1, &m_requestInfo, 16, 16); + BitmaskImpl::setField(1, &m_requestInfo, 16, 16, val); + }; + Uint32 getTableId() const { + return m_tableId; + } + void setTableId(Uint32 val) { + m_tableId = val; + } + Uint32 getIndexId() const { + return m_indexId; + } + void setIndexId(Uint32 val) { + m_indexId = val; + } + Uint32 getTriggerId() const { + return m_triggerId; + } + void setTriggerId(Uint32 val) { + m_triggerId = val; + } + Uint32 getTriggerInfo() const { + return m_triggerInfo; + } + void setTriggerInfo(Uint32 val) { + m_triggerInfo = val; + } + TriggerType::Value getTriggerType() const { + const Uint32 val = BitmaskImpl::getField(1, &m_triggerInfo, 0, 8); + return (TriggerType::Value)val; + } + void setTriggerType(TriggerType::Value val) { + BitmaskImpl::setField(1, &m_triggerInfo, 0, 8, (Uint32)val); + } + TriggerActionTime::Value getTriggerActionTime() const { + const Uint32 val = BitmaskImpl::getField(1, &m_triggerInfo, 8, 8); + return (TriggerActionTime::Value)val; + } + void setTriggerActionTime(TriggerActionTime::Value val) { + BitmaskImpl::setField(1, &m_triggerInfo, 8, 8, (Uint32)val); + } + TriggerEvent::Value getTriggerEvent() const { + const Uint32 val = BitmaskImpl::getField(1, &m_triggerInfo, 16, 8); + return (TriggerEvent::Value)val; + } + void setTriggerEvent(TriggerEvent::Value val) { + BitmaskImpl::setField(1, &m_triggerInfo, 16, 8, (Uint32)val); + } + bool getMonitorReplicas() const { + return BitmaskImpl::getField(1, &m_triggerInfo, 24, 1); + } + void setMonitorReplicas(bool val) { + BitmaskImpl::setField(1, &m_triggerInfo, 24, 1, val); + } + bool getMonitorAllAttributes() const { + return BitmaskImpl::getField(1, &m_triggerInfo, 25, 1); + } + void setMonitorAllAttributes(bool val) { + BitmaskImpl::setField(1, &m_triggerInfo, 25, 1, val); + } + Uint32 getOpKey() const { + return m_opKey; + } + void setOpKey(Uint32 val) { + m_opKey = val; + } +}; + +/** + * DropTrigConf. + */ +class DropTrigConf { + friend bool printDROP_TRIG_CONF(FILE*, const Uint32*, Uint32, Uint16); + +public: + STATIC_CONST( InternalLength = 3 ); + STATIC_CONST( SignalLength = 6 ); + +private: + Uint32 m_userRef; + Uint32 m_connectionPtr; + Uint32 m_requestInfo; + Uint32 m_tableId; + Uint32 m_indexId; + Uint32 m_triggerId; + + // Public methods +public: + Uint32 getUserRef() const { + return m_userRef; + } + void setUserRef(Uint32 val) { + m_userRef = val; + } + Uint32 getConnectionPtr() const { + return m_connectionPtr; + } + void setConnectionPtr(Uint32 val) { + m_connectionPtr = val; + } + DropTrigReq::RequestType getRequestType() const { + return (DropTrigReq::RequestType)m_requestInfo; + } + void setRequestType(DropTrigReq::RequestType val) { + m_requestInfo = (Uint32)val; + } + Uint32 getTableId() const { + return m_tableId; + } + void setTableId(Uint32 val) { + m_tableId = val; + } + Uint32 getIndexId() const { + return m_indexId; + } + void setIndexId(Uint32 val) { + m_indexId = val; + } + Uint32 getTriggerId() const { + return m_triggerId; + } + void setTriggerId(Uint32 val) { + m_triggerId = val; + } +}; + +/** + * DropTrigRef. + */ +class DropTrigRef { + friend bool printDROP_TRIG_REF(FILE*, const Uint32*, Uint32, Uint16); + +public: + enum ErrorCode { + NoError = 0, + Busy = 701, + TriggerNotFound = 4238, + BadRequestType = 4247, + InvalidName = 4248 + }; + STATIC_CONST( SignalLength = DropTrigConf::SignalLength + 3 ); + +private: + DropTrigConf m_conf; + //Uint32 m_userRef; + //Uint32 m_connectionPtr; + //Uint32 m_requestInfo; + //Uint32 m_tableId; + //Uint32 m_indexId; + //Uint32 m_triggerId; + Uint32 m_errorCode; + Uint32 m_errorLine; + Uint32 m_errorNode; + +public: + DropTrigConf* getConf() { + return &m_conf; + } + const DropTrigConf* getConf() const { + return &m_conf; + } + Uint32 getUserRef() const { + return m_conf.getUserRef(); + } + void setUserRef(Uint32 val) { + m_conf.setUserRef(val); + } + Uint32 getConnectionPtr() const { + return m_conf.getConnectionPtr(); + } + void setConnectionPtr(Uint32 val) { + m_conf.setConnectionPtr(val); + } + DropTrigReq::RequestType getRequestType() const { + return m_conf.getRequestType(); + } + void setRequestType(DropTrigReq::RequestType val) { + m_conf.setRequestType(val); + } + Uint32 getTableId() const { + return m_conf.getTableId(); + } + void setTableId(Uint32 val) { + m_conf.setTableId(val); + } + Uint32 getIndexId() const { + return m_conf.getIndexId(); + } + void setIndexId(Uint32 val) { + m_conf.setIndexId(val); + } + Uint32 getTriggerId() const { + return m_conf.getTriggerId(); + } + void setTriggerId(Uint32 val) { + m_conf.setTriggerId(val); + } + DropTrigRef::ErrorCode getErrorCode() const { + return (DropTrigRef::ErrorCode)m_errorCode; + } + void setErrorCode(DropTrigRef::ErrorCode val) { + m_errorCode = (Uint32)val; + } + Uint32 getErrorLine() const { + return m_errorLine; + } + void setErrorLine(Uint32 val) { + m_errorLine = val; + } + Uint32 getErrorNode() const { + return m_errorNode; + } + void setErrorNode(Uint32 val) { + m_errorNode = val; + } +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp b/storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp new file mode 100644 index 00000000000..46c5ef3751b --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp @@ -0,0 +1,156 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef DUMP_STATE_ORD_HPP +#define DUMP_STATE_ORD_HPP + +#include "SignalData.hpp" + +/** + * DumpStateOrd is sent by the mgmtsrvr to CMVMI. + * CMVMI the redirect the signal to all blocks. + * + * The implementation of the DumpStateOrd should dump state information + * (typically using the infoEvent-function) + */ +class DumpStateOrd { + /** + * Sender/Reciver + */ + friend class Cmvmi; + + /** + * Sender(s) + */ + friend class MgmtSrvr; + + /** + * Reciver(s) + */ + friend class Dbacc; + friend class Dblqh; + friend class Dbtup; + friend class Dbtc; + friend class Ndbcntr; + friend class Qmgr; + friend class Dbdih; + friend class Dbdict; + friend class Ndbfs; + +public: + enum DumpStateType { + // 1 QMGR Dump information about phase 1 variables + // 13 CMVMI Dump signal counter + // 13 NDBCNTR Dump start phase information + // 13 NDBCNTR_REF Dump start phase information + CommitAckMarkersSize = 14, // TC+LQH Dump free size in commitAckMarkerP + CommitAckMarkersDump = 15, // TC+LQH Dump info in commitAckMarkerPool + DihDumpNodeRestartInfo = 16, // 16 DIH Dump node restart info + DihDumpNodeStatusInfo = 17,// 17 DIH Dump node status info + DihPrintFragmentation = 18,// 18 DIH Print fragmentation + // 19 NDBFS Fipple with O_SYNC, O_CREATE etc. + // 20-24 BACKUP + NdbcntrTestStopOnError = 25, + NdbcntrStopNodes = 70, + // 100-105 TUP and ACC + // 200-240 UTIL + // 300-305 TRIX + QmgrErr935 = 935, + NdbfsDumpFileStat = 400, + NdbfsDumpAllFiles = 401, + NdbfsDumpOpenFiles = 402, + NdbfsDumpIdleFiles = 403, + // 1222-1225 DICT + LqhDumpAllDefinedTabs = 1332, + LqhDumpNoLogPages = 1333, + LqhDumpOneScanRec = 2300, + LqhDumpAllScanRec = 2301, + LqhDumpAllActiveScanRec = 2302, + LqhDumpLcpState = 2303, + LqhErrorInsert5042 = 2315, + + AccDumpOneScanRec = 2400, + AccDumpAllScanRec = 2401, + AccDumpAllActiveScanRec = 2402, + AccDumpOneOperationRec = 2403, + AccDumpNumOpRecs = 2404, + AccDumpFreeOpRecs = 2405, + AccDumpNotFreeOpRecs = 2406, + DumpPageMemory = 1000, // Acc & TUP + TcDumpAllScanFragRec = 2500, + TcDumpOneScanFragRec = 2501, + TcDumpAllScanRec = 2502, + TcDumpAllActiveScanRec = 2503, + TcDumpOneScanRec = 2504, + TcDumpOneApiConnectRec = 2505, + TcDumpAllApiConnectRec = 2506, + TcSetTransactionTimeout = 2507, + TcSetApplTransactionTimeout = 2508, + StartTcTimer = 2509, + StopTcTimer = 2510, + StartPeriodicTcTimer = 2511, + TcStartDumpIndexOpCount = 2512, + TcDumpIndexOpCount = 2513, + CmvmiDumpConnections = 2600, + CmvmiDumpLongSignalMemory = 2601, + CmvmiSetRestartOnErrorInsert = 2602, + CmvmiTestLongSigWithDelay = 2603, + CmvmiDumpSubscriptions = 2604, /* note: done to respective outfile + to be able to debug if events + for some reason does not end up + in clusterlog */ + LCPContinue = 5900, + // 7000 DIH + // 7001 DIH + // 7002 DIH + // 7003 DIH + // 7004 DIH + // 7005 DIH + // 7006 DIH + // 7006 DIH + // 7007 DIH + // 7008 DIH + // 7009 DIH + // 7010 DIH + // 7011 DIH + // 7012 DIH + DihDumpLCPState= 7013, + DihDumpLCPMasterTakeOver = 7014, + // 7015 DIH + DihAllAllowNodeStart = 7016, + DihMinTimeBetweenLCP = 7017, + DihMaxTimeBetweenLCP = 7018, + // 7019 + // 7020 + // 7021 + EnableUndoDelayDataWrite = 7080, // DIH+ACC+TUP + DihSetTimeBetweenGcp = 7090, + DihStartLcpImmediately = 7099, + // 8000 Suma + // 12000 Tux + TuxLogToFile = 12001, + TuxSetLogFlags = 12002, + TuxMetaDataJunk = 12009, + + DumpTsman = 9800, + DumpLgman = 10000, + DumpPgman = 11000 + }; +public: + + Uint32 args[25]; // Generic argument +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/EmptyLcp.hpp b/storage/ndb/include/kernel/signaldata/EmptyLcp.hpp new file mode 100644 index 00000000000..60fccd742b6 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/EmptyLcp.hpp @@ -0,0 +1,76 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef EMPTY_LCPREQ_HPP +#define EMPTY_LCPREQ_HPP + +/** + * This signals is sent by Dbdih-Master to Dblqh + * as part of master take over after node crash + */ +class EmptyLcpReq { + /** + * Sender(s) + */ + friend class Dbdih; + + /** + * Sender(s) / Receiver(s) + */ + + /** + * Receiver(s) + */ + friend class Dblqh; + +public: + STATIC_CONST( SignalLength = 1 ); +private: + + Uint32 senderRef; +}; + +/** + * This signals is sent by Dblqh to Dbdih + * as part of master take over after node crash + */ +class EmptyLcpConf { + /** + * Sender(s) + */ + friend class Dblqh; + + /** + * Sender(s) / Receiver(s) + */ + + /** + * Receiver(s) + */ + friend class Dbdih; + +public: + STATIC_CONST( SignalLength = 6 ); +private: + + Uint32 senderNodeId; + Uint32 tableId; + Uint32 fragmentId; + Uint32 lcpNo; + Uint32 lcpId; + Uint32 idle; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/EndTo.hpp b/storage/ndb/include/kernel/signaldata/EndTo.hpp new file mode 100644 index 00000000000..0885edff45b --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/EndTo.hpp @@ -0,0 +1,48 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef END_TO_HPP +#define END_TO_HPP + +class EndToReq { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdih; + +public: + STATIC_CONST( SignalLength = 4 ); +private: + Uint32 userPtr; + BlockReference userRef; + Uint32 startingNodeId; + Uint32 nodeTakenOver; +}; + +class EndToConf { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdih; + +public: + STATIC_CONST( SignalLength = 3 ); +private: + + Uint32 userPtr; + Uint32 sendingNodeId; + Uint32 startingNodeId; +}; +#endif diff --git a/storage/ndb/include/kernel/signaldata/EventReport.hpp b/storage/ndb/include/kernel/signaldata/EventReport.hpp new file mode 100644 index 00000000000..e7b1fa3d79a --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/EventReport.hpp @@ -0,0 +1,101 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef SD_EVENT_REPORT_H +#define SD_EVENT_REPORT_H + +#include <ndb_logevent.h> +#include "SignalData.hpp" + +/** + * Send by different block to report that a event has taken place + * + * SENDER: *Block* + * RECIVER: SimBlockCMCtrBlck + */ +class EventReport { + friend class SimulatedBlock; + friend class Cmvmi; + friend class SimblockMissra; + friend class Dbacc; + friend class Dblqh; + friend class Dbtup; + friend class Dbtc; + friend class Ndbcntr; + friend class Qmgr; + friend class Dbdih; + friend class Dbdict; + friend class MgmtSrvr; + friend class Grep; +public: + /* + EventType defines what event reports to send. + + The ORDER is NOT important anymore. //ejonore 2003-07-24 15:03 + + HOW TO ADD A NEW EVENT + -------------------- + 1) Add SentHeartbeat EventType in the category where it belongs. + ... + // INFO + SentHeartbeat, + InfoEvent + ... + + 2) remeber to update # of events below. Just to keep count... + Number of event types = 53 + + 3) Add a new SentHeartBeat entry to EventLogger::matrix[]. + ... + // INFO + { EventReport::SentHeartbeat, LogLevel::llInfo, 11, INFO }, + { EventReport::InfoEvent, LogLevel::llInfo, 2, INFO } + ... + + 4) Add SentHeartbeat in EventLogger::getText() + + */ + void setNodeId(Uint32 nodeId); + Uint32 getNodeId() const; + void setEventType(Ndb_logevent_type type); + Ndb_logevent_type getEventType() const; + UintR eventType; // DATA 0 +}; + +inline +void +EventReport::setNodeId(Uint32 nodeId){ + eventType = (nodeId << 16) | (eventType & 0xFFFF); +} + +inline +Uint32 +EventReport::getNodeId() const { + return eventType >> 16; +} + +inline +void +EventReport::setEventType(Ndb_logevent_type type){ + eventType = (eventType & 0xFFFF0000) | (((UintR) type) & 0xFFFF); +} + +inline +Ndb_logevent_type +EventReport::getEventType() const { + return (Ndb_logevent_type)(eventType & 0xFFFF); +} + +#endif diff --git a/storage/ndb/include/kernel/signaldata/EventSubscribeReq.hpp b/storage/ndb/include/kernel/signaldata/EventSubscribeReq.hpp new file mode 100644 index 00000000000..d72b6dec3e5 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/EventSubscribeReq.hpp @@ -0,0 +1,65 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef SD_EVENT_SUB_REQ_H +#define SD_EVENT_SUB_REQ_H + +#include "SignalData.hpp" + +/** + * Requests change (new, update, delete) of event subscription, + * i.e. forwarding of events. + * + * SENDER: Mgm server + * RECIVER: SimBlockCMCtrBlck + */ + +struct EventSubscribeReq { + /** + * Receiver(s) + */ + friend class Cmvmi; + + /** + * Sender(s) + */ + friend class MgmtSrvr; + + STATIC_CONST( SignalLength = 2 + LogLevel::LOGLEVEL_CATEGORIES ); + + /** + * Note: If you use the same blockRef as you have used earlier, + * you update your ongoing subscription + */ + Uint32 blockRef; + + /** + * If you specify 0 entries, it's the same as cancelling an + * subscription + */ + Uint32 noOfEntries; + + Uint32 theData[LogLevel::LOGLEVEL_CATEGORIES]; + + EventSubscribeReq& operator= (const LogLevel& ll){ + noOfEntries = LogLevel::LOGLEVEL_CATEGORIES; + for(size_t i = 0; i<noOfEntries; i++){ + theData[i] = (i << 16) | ll.getLogLevel((LogLevel::EventCategory)i); + } + return * this; + } +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/ExecFragReq.hpp b/storage/ndb/include/kernel/signaldata/ExecFragReq.hpp new file mode 100644 index 00000000000..47155638b81 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/ExecFragReq.hpp @@ -0,0 +1,42 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef EXEC_FRAGREQ_HPP +#define EXEC_FRAGREQ_HPP + +#include "SignalData.hpp" + +class ExecFragReq { + /** + * Sender(s) + */ + friend class Dbdih; + + /** + * Receiver(s) + */ + friend class Dblqh; +public: + STATIC_CONST( SignalLength = 6 ); + +private: + Uint32 userPtr; + Uint32 userRef; + Uint32 tableId; + Uint32 fragId; + Uint32 startGci; + Uint32 lastGci; +}; +#endif diff --git a/storage/ndb/include/kernel/signaldata/Extent.hpp b/storage/ndb/include/kernel/signaldata/Extent.hpp new file mode 100644 index 00000000000..88f2e394233 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/Extent.hpp @@ -0,0 +1,120 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef NDB_EXTENT_HPP +#define NDB_EXTENT_HPP + +#include "SignalData.hpp" + +struct AllocExtentReq { + /** + * Sender(s) / Reciver(s) + */ + + /** + * For printing + */ + + STATIC_CONST( SignalLength = 3 ); + + enum ErrorCode { + UnmappedExtentPageIsNotImplemented = 1, + NoExtentAvailable = 1601 + }; + + union + { + struct + { + Uint32 tablespace_id; + Uint32 table_id; + Uint32 fragment_id; + } request; + struct + { + Uint32 errorCode; + Local_key page_id; + Uint32 page_count; + } reply; + }; +}; + +struct FreeExtentReq { + /** + * Sender(s) / Reciver(s) + */ + + /** + * For printing + */ + + STATIC_CONST( SignalLength = 4 ); + + enum ErrorCode { + UnmappedExtentPageIsNotImplemented = 1 + }; + + union + { + struct + { + Local_key key; + Uint32 table_id; + Uint32 tablespace_id; + Uint32 lsn_hi; + Uint32 lsn_lo; + } request; + struct + { + Uint32 errorCode; + } reply; + }; +}; + +struct AllocPageReq { + /** + * Sender(s) / Reciver(s) + */ + + /** + * For printing + */ + + STATIC_CONST( SignalLength = 3 ); + + enum ErrorCode { + UnmappedExtentPageIsNotImplemented = 1, + NoPageFree= 2 + }; + + Local_key key; // in out + Uint32 bits; // in out + union + { + struct + { + Uint32 table_id; + Uint32 fragment_id; + Uint32 tablespace_id; + } request; + struct + { + Uint32 errorCode; + } reply; + }; +}; + + +#endif diff --git a/storage/ndb/include/kernel/signaldata/FailRep.hpp b/storage/ndb/include/kernel/signaldata/FailRep.hpp new file mode 100644 index 00000000000..798ff3f5e47 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/FailRep.hpp @@ -0,0 +1,65 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef FAIL_REP_HPP +#define FAIL_REP_HPP + +#include "SignalData.hpp" +#include <NodeBitmask.hpp> + +/** + * + */ +class FailRep { + /** + * Sender(s) & Reciver(s) + */ + friend class Qmgr; + friend class Ndbcntr; + + /** + * For printing + */ + friend bool printFAIL_REP(FILE *, const Uint32 *, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 2 ); + STATIC_CONST( ExtraLength = 1 + NdbNodeBitmask::Size ); + + enum FailCause { + ZOWN_FAILURE=0, + ZOTHER_NODE_WHEN_WE_START=1, + ZIN_PREP_FAIL_REQ=2, + ZSTART_IN_REGREQ=3, + ZHEARTBEAT_FAILURE=4, + ZLINK_FAILURE=5, + ZOTHERNODE_FAILED_DURING_START=6, + ZMULTI_NODE_SHUTDOWN = 7, + ZPARTITIONED_CLUSTER = 8 + }; + +private: + + Uint32 failNodeId; + Uint32 failCause; + /** + * Used when failCause == ZPARTITIONED_CLUSTER + */ + Uint32 president; + Uint32 partition[NdbNodeBitmask::Size]; +}; + + +#endif diff --git a/storage/ndb/include/kernel/signaldata/FireTrigOrd.hpp b/storage/ndb/include/kernel/signaldata/FireTrigOrd.hpp new file mode 100644 index 00000000000..52e52e73c36 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/FireTrigOrd.hpp @@ -0,0 +1,200 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef FIRE_TRIG_ORD_HPP +#define FIRE_TRIG_ORD_HPP + +#include "SignalData.hpp" +#include <NodeBitmask.hpp> +#include <trigger_definitions.h> +#include <string.h> + +/** + * FireTrigOrd + * + * This signal is sent by TUP to signal + * that a trigger has fired + */ +class FireTrigOrd { + /** + * Sender(s) + */ + // API + + /** + * Sender(s) / Reciver(s) + */ + friend class Dbtup; + + /** + * Reciver(s) + */ + friend class Dbtc; + friend class Backup; + friend class SumaParticipant; + + /** + * For printing + */ + friend bool printFIRE_TRIG_ORD(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); + +public: + STATIC_CONST( SignalLength = 8 ); + STATIC_CONST( SignalWithGCILength = 9 ); + STATIC_CONST( SignalWithHashValueLength = 10 ); + +private: + Uint32 m_connectionPtr; + Uint32 m_userRef; + Uint32 m_triggerId; + TriggerEvent::Value m_triggerEvent; + Uint32 m_noPrimKeyWords; + Uint32 m_noBeforeValueWords; + Uint32 m_noAfterValueWords; + Uint32 fragId; + Uint32 m_gci; + Uint32 m_hashValue; + // Public methods +public: + Uint32 getConnectionPtr() const; + void setConnectionPtr(Uint32); + Uint32 getUserRef() const; + void setUserRef(Uint32); + Uint32 getTriggerId() const; + void setTriggerId(Uint32 anIndxId); + TriggerEvent::Value getTriggerEvent() const; + void setTriggerEvent(TriggerEvent::Value); + Uint32 getNoOfPrimaryKeyWords() const; + void setNoOfPrimaryKeyWords(Uint32); + Uint32 getNoOfBeforeValueWords() const; + void setNoOfBeforeValueWords(Uint32); + Uint32 getNoOfAfterValueWords() const; + void setNoOfAfterValueWords(Uint32); + Uint32 getGCI() const; + void setGCI(Uint32); + Uint32 getHashValue() const; + void setHashValue(Uint32); +}; + +inline +Uint32 FireTrigOrd::getConnectionPtr() const +{ + return m_connectionPtr; +} + +inline +void FireTrigOrd::setConnectionPtr(Uint32 aConnectionPtr) +{ + m_connectionPtr = aConnectionPtr; +} + +inline +Uint32 FireTrigOrd::getUserRef() const +{ + return m_userRef; +} + +inline +void FireTrigOrd::setUserRef(Uint32 aUserRef) +{ + m_userRef = aUserRef; +} + +inline +Uint32 FireTrigOrd::getTriggerId() const +{ + return m_triggerId; +} + +inline +void FireTrigOrd::setTriggerId(Uint32 aTriggerId) +{ + m_triggerId = aTriggerId; +} + +inline +TriggerEvent::Value FireTrigOrd::getTriggerEvent() const +{ + return m_triggerEvent; +} + +inline +void FireTrigOrd::setTriggerEvent(TriggerEvent::Value aTriggerEvent) +{ + m_triggerEvent = aTriggerEvent; +} + +inline +Uint32 FireTrigOrd::getNoOfPrimaryKeyWords() const +{ + return m_noPrimKeyWords; +} + +inline +void FireTrigOrd::setNoOfPrimaryKeyWords(Uint32 noPrim) +{ + m_noPrimKeyWords = noPrim; +} + +inline +Uint32 FireTrigOrd::getNoOfBeforeValueWords() const +{ + return m_noBeforeValueWords; +} + +inline +void FireTrigOrd::setNoOfBeforeValueWords(Uint32 noBefore) +{ + m_noBeforeValueWords = noBefore; +} + +inline +Uint32 FireTrigOrd::getNoOfAfterValueWords() const +{ + return m_noAfterValueWords; +} + +inline +void FireTrigOrd::setNoOfAfterValueWords(Uint32 noAfter) +{ + m_noAfterValueWords = noAfter; +} + +inline +Uint32 FireTrigOrd::getGCI() const +{ + return m_gci; +} + +inline +void FireTrigOrd::setGCI(Uint32 aGCI) +{ + m_gci = aGCI; +} + +inline +Uint32 FireTrigOrd::getHashValue() const +{ + return m_hashValue; +} + +inline +void FireTrigOrd::setHashValue(Uint32 flag) +{ + m_hashValue = flag; +} + + +#endif diff --git a/storage/ndb/include/kernel/signaldata/FsAppendReq.hpp b/storage/ndb/include/kernel/signaldata/FsAppendReq.hpp new file mode 100644 index 00000000000..dafd597dbe6 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/FsAppendReq.hpp @@ -0,0 +1,57 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef FS_APPENDREQ_H +#define FS_APPENDREQ_H + +#include "SignalData.hpp" + +/** + * + * SENDER: + * RECIVER: Ndbfs + */ +class FsAppendReq { + /** + * Reciver(s) + */ + friend class Ndbfs; + friend class VoidFs; + + /** + * Sender(s) + */ + friend class Backup; + + friend bool printFSAPPENDREQ(FILE * output, const Uint32 * theData, + Uint32 len, Uint16 receiverBlockNo); +public: + STATIC_CONST( SignalLength = 7 ); + +private: + + /** + * DATA VARIABLES + */ + UintR filePointer; // DATA 0 + UintR userReference; // DATA 1 + UintR userPointer; // DATA 2 + UintR varIndex; // DATA 3 + UintR offset; // DATA 4 + UintR size; // DATA 5 + UintR synch_flag; // DATA 6 +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/FsCloseReq.hpp b/storage/ndb/include/kernel/signaldata/FsCloseReq.hpp new file mode 100644 index 00000000000..41d12c71dd7 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/FsCloseReq.hpp @@ -0,0 +1,87 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef FS_CLOSE_REQ_H +#define FS_CLOSE_REQ_H + +#include "SignalData.hpp" + +/** + * + * SENDER: + * RECIVER: Ndbfs + */ +class FsCloseReq { + /** + * Reciver(s) + */ + friend class Ndbfs; // Reciver + friend class VoidFs; + friend class Lgman; + friend class Tsman; + + /** + * Sender(s) + */ + friend class Backup; + friend class Dbdict; + friend class Restore; + + /** + * For printing + */ + friend bool printFSCLOSEREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); + +public: + /** + * Length of signal + */ + STATIC_CONST( SignalLength = 4 ); + +private: + + /** + * DATA VARIABLES + */ + + UintR filePointer; // DATA 0 + UintR userReference; // DATA 1 + UintR userPointer; // DATA 2 + UintR fileFlag; // DATA 3 + + static bool getRemoveFileFlag(const UintR & fileflag); + static void setRemoveFileFlag(UintR & fileflag, bool removefile); + +}; + + +inline +bool +FsCloseReq::getRemoveFileFlag(const UintR & fileflag){ + return (fileflag == 1); +} + +inline +void +FsCloseReq::setRemoveFileFlag(UintR & fileflag, bool removefile){ +// ASSERT_BOOL(removefile, "FsCloseReq::setRemoveFileFlag"); + if (removefile) + fileflag = 1; + else + fileflag = 0; +} + + +#endif diff --git a/storage/ndb/include/kernel/signaldata/FsConf.hpp b/storage/ndb/include/kernel/signaldata/FsConf.hpp new file mode 100644 index 00000000000..87d56e9a364 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/FsConf.hpp @@ -0,0 +1,80 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef FS_CONF_H +#define FS_CONF_H + +#include "SignalData.hpp" + +/** + * FsConf - Common signal class for all CONF signals sent from Ndbfs + * GSN_FSCLOSECONF, GSN_FSOPENCONF, GSN_FSWRITECONF, GSN_FSREADCONF, + * GSN_FSSYNCCONF, GSN_FSREMOVECONF + */ + +/** + * + * SENDER: Ndbfs + * RECIVER: + */ +class FsConf { + /** + * Reciver(s) + */ + friend class Backup; + friend class Dbacc; + friend class Dbtup; + friend class Dbdict; + friend class Lgman; + friend class Tsman; + friend class Pgman; + friend class Restore; + /** + * Sender(s) + */ + friend class Ndbfs; + friend class VoidFs; + + /** + * For printing + */ + friend bool printFSCONF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); + +public: + /** + * Length of signal + */ + /** + * FSOPENCONF: static const UintR SignalLength = 2; + * FSCLOSECONF, FSREADCONF, FSWRITECONF, FSSYNCCONF: static const UintR SignalLength = 2; + */ + +private: + + /** + * DATA VARIABLES + */ + UintR userPointer; // DATA 0 + + // Data 1 + union { + UintR filePointer; // FSOPENCONF + Uint32 bytes_read; // FSREADCONF (when allow partial read) + }; +}; + + + +#endif diff --git a/storage/ndb/include/kernel/signaldata/FsOpenReq.hpp b/storage/ndb/include/kernel/signaldata/FsOpenReq.hpp new file mode 100644 index 00000000000..8d438f79259 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/FsOpenReq.hpp @@ -0,0 +1,333 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef FS_OPEN_REQ_H +#define FS_OPEN_REQ_H + +#include "SignalData.hpp" + +/** + * + * SENDER: + * RECIVER: Ndbfs + */ +class FsOpenReq { + /** + * Reciver(s) + */ + friend class Ndbfs; // Reciver + friend class AsyncFile; // Uses FsOpenReq to decode file open flags + friend class Filename; + friend class VoidFs; + + /** + * Sender(s) + */ + friend class Backup; + friend class Dbdict; + friend class Ndbcntr; // For initial start... + friend class Dbdih; + friend class Lgman; + friend class Tsman; + friend class Restore; + friend class Dblqh; + + /** + * For printing + */ + friend bool printFSOPENREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); + +public: + /** + * Length of signal + */ + STATIC_CONST( SignalLength = 11 ); + SECTION( FILENAME = 0 ); + +private: + + /** + * DATA VARIABLES + */ + + UintR userReference; // DATA 0 + UintR userPointer; // DATA 1 + UintR fileNumber[4]; // DATA 2 - 5 + UintR fileFlags; // DATA 6 + Uint32 page_size; + Uint32 file_size_hi; + Uint32 file_size_lo; + Uint32 auto_sync_size; // In bytes + + STATIC_CONST( OM_READONLY = 0 ); + STATIC_CONST( OM_WRITEONLY = 1 ); + STATIC_CONST( OM_READWRITE = 2 ); + + STATIC_CONST( OM_APPEND = 0x8 ); // Not Implemented on W2k + STATIC_CONST( OM_SYNC = 0x10 ); + STATIC_CONST( OM_CREATE = 0x100 ); + STATIC_CONST( OM_TRUNCATE = 0x200 ); + STATIC_CONST( OM_AUTOSYNC = 0x400 ); + + STATIC_CONST( OM_CREATE_IF_NONE = 0x0800 ); + STATIC_CONST( OM_INIT = 0x1000 ); // + STATIC_CONST( OM_CHECK_SIZE = 0x2000 ); + STATIC_CONST( OM_DIRECT = 0x4000 ); + + enum Suffixes { + S_DATA = 0, + S_FRAGLOG = 1, + S_LOGLOG = 2, + S_FRAGLIST = 3, + S_TABLELIST = 4, + S_SCHEMALOG = 5, + S_SYSFILE = 6, + S_LOG = 7, + S_CTL = 8 + }; + + static Uint32 getVersion(const Uint32 fileNumber[]); + static Uint32 getSuffix(const Uint32 fileNumber[]); + + static void setVersion(Uint32 fileNumber[], Uint8 val); + static void setSuffix(Uint32 fileNumber[], Uint8 val); + + /** + * V1 + */ + static Uint32 v1_getDisk(const Uint32 fileNumber[]); + static Uint32 v1_getTable(const Uint32 fileNumber[]); + static Uint32 v1_getFragment(const Uint32 fileNumber[]); + static Uint32 v1_getS(const Uint32 fileNumber[]); + static Uint32 v1_getP(const Uint32 fileNumber[]); + + static void v1_setDisk(Uint32 fileNumber[], Uint8 val); + static void v1_setTable(Uint32 fileNumber[], Uint32 val); + static void v1_setFragment(Uint32 fileNumber[], Uint32 val); + static void v1_setS(Uint32 fileNumber[], Uint32 val); + static void v1_setP(Uint32 fileNumber[], Uint8 val); + + /** + * V2 - Backup + */ + static Uint32 v2_getSequence(const Uint32 fileNumber[]); + static Uint32 v2_getNodeId(const Uint32 fileNumber[]); + static Uint32 v2_getCount(const Uint32 fileNumber[]); + + static void v2_setSequence(Uint32 fileNumber[], Uint32 no); + static void v2_setNodeId(Uint32 fileNumber[], Uint32 no); + static void v2_setCount(Uint32 fileNumber[], Uint32 no); + + /** + * V4 - LCP + */ + static Uint32 v5_getLcpNo(const Uint32 fileNumber[]); + static Uint32 v5_getTableId(const Uint32 fileNumber[]); + static Uint32 v5_getFragmentId(const Uint32 fileNumber[]); + + static void v5_setLcpNo(Uint32 fileNumber[], Uint32 no); + static void v5_setTableId(Uint32 fileNumber[], Uint32 no); + static void v5_setFragmentId(Uint32 fileNumber[], Uint32 no); +}; + +/** + * File flags (set according to solaris standard) + * + o = Open mode - 2 Bits -> max 3 + c = create new file - 1 Bit + t = truncate existing - 1 Bit + + 1111111111222222222233 + 01234567890123456789012345678901 + oo ct +*/ + + +/** + * -- v1 -- + * File number[0] = Table + * File number[1] = Fragment + * File number[2] = S-value + * File number[3] = + * p = v1_P 0 - 7 + * d = v1_disk 8 - 15 + * s = v1_suffix 16 - 23 + * v = version 24 - 31 + * + * 1111111111222222222233 + * 01234567890123456789012345678901 + * ppppppppddddddddssssssssvvvvvvvv + * + * -- v2 -- + * File number[0] = Backup Sequence Number + * File number[1] = Node Id + * File number[3] = + * v = version 24 - 31 + * s = v1_suffix 16 - 23 + * + * 1111111111222222222233 + * 01234567890123456789012345678901 + * ssssssssvvvvvvvv + * + * -- v3 -- + * File number[0] = Table + * File number[1] = LcpNo + * File number[2] = + * File number[3] = + * v = version 24 - 31 + * s = v1_suffix 16 - 23 + * + * 1111111111222222222233 + * 01234567890123456789012345678901 + * ssssssssvvvvvvvv + */ +inline +Uint32 FsOpenReq::getVersion(const Uint32 fileNumber[]){ + return (fileNumber[3] >> 24) & 0xff; +} + +inline +void FsOpenReq::setVersion(Uint32 fileNumber[], Uint8 val){ + const Uint32 t = fileNumber[3]; + fileNumber[3] = t & 0x00FFFFFF | (((Uint32)val) << 24); +} + +inline +Uint32 FsOpenReq::getSuffix(const Uint32 fileNumber[]){ + return (fileNumber[3] >> 16)& 0xff; +} + +inline +void FsOpenReq::setSuffix(Uint32 fileNumber[], Uint8 val){ + const Uint32 t = fileNumber[3]; + fileNumber[3] = t & 0xFF00FFFF | (((Uint32)val) << 16); +} + +inline +Uint32 FsOpenReq::v1_getDisk(const Uint32 fileNumber[]){ + return (fileNumber[3]>>8) & 0xff; +} + +inline +void FsOpenReq::v1_setDisk(Uint32 fileNumber[], Uint8 val){ + const Uint32 t = fileNumber[3]; + fileNumber[3] = t & 0xFFFF00FF | (((Uint32)val) << 8); +} + +inline +Uint32 FsOpenReq::v1_getTable(const Uint32 fileNumber[]){ + return fileNumber[0]; +} + +inline +void FsOpenReq::v1_setTable(Uint32 fileNumber[], Uint32 val){ + fileNumber[0] = val; +} + +inline +Uint32 FsOpenReq::v1_getFragment(const Uint32 fileNumber[]){ + return fileNumber[1]; +} + +inline +void FsOpenReq::v1_setFragment(Uint32 fileNumber[], Uint32 val){ + fileNumber[1] = val; +} + +inline +Uint32 FsOpenReq::v1_getS(const Uint32 fileNumber[]){ + return fileNumber[2]; +} + +inline +void FsOpenReq::v1_setS(Uint32 fileNumber[], Uint32 val){ + fileNumber[2] = val; +} + +inline +Uint32 FsOpenReq::v1_getP(const Uint32 fileNumber[]){ + return fileNumber[3] & 0xff; +} + +inline +void FsOpenReq::v1_setP(Uint32 fileNumber[], Uint8 val){ + const Uint32 t = fileNumber[3]; + fileNumber[3] = t & 0xFFFFFF00 | val; +} + +/****************/ +inline +Uint32 FsOpenReq::v2_getSequence(const Uint32 fileNumber[]){ + return fileNumber[0]; +} + +inline +void FsOpenReq::v2_setSequence(Uint32 fileNumber[], Uint32 val){ + fileNumber[0] = val; +} + +inline +Uint32 FsOpenReq::v2_getNodeId(const Uint32 fileNumber[]){ + return fileNumber[1]; +} + +inline +void FsOpenReq::v2_setNodeId(Uint32 fileNumber[], Uint32 val){ + fileNumber[1] = val; +} + +inline +Uint32 FsOpenReq::v2_getCount(const Uint32 fileNumber[]){ + return fileNumber[2]; +} + +inline +void FsOpenReq::v2_setCount(Uint32 fileNumber[], Uint32 val){ + fileNumber[2] = val; +} + +/****************/ +inline +Uint32 FsOpenReq::v5_getTableId(const Uint32 fileNumber[]){ + return fileNumber[0]; +} + +inline +void FsOpenReq::v5_setTableId(Uint32 fileNumber[], Uint32 val){ + fileNumber[0] = val; +} + +inline +Uint32 FsOpenReq::v5_getLcpNo(const Uint32 fileNumber[]){ + return fileNumber[1]; +} + +inline +void FsOpenReq::v5_setLcpNo(Uint32 fileNumber[], Uint32 val){ + fileNumber[1] = val; +} + +inline +Uint32 FsOpenReq::v5_getFragmentId(const Uint32 fileNumber[]){ + return fileNumber[2]; +} + +inline +void FsOpenReq::v5_setFragmentId(Uint32 fileNumber[], Uint32 val){ + fileNumber[2] = val; +} + +#endif + diff --git a/storage/ndb/include/kernel/signaldata/FsReadWriteReq.hpp b/storage/ndb/include/kernel/signaldata/FsReadWriteReq.hpp new file mode 100644 index 00000000000..cf3112ec523 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/FsReadWriteReq.hpp @@ -0,0 +1,171 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef FS_READWRITEREQ_H +#define FS_READWRITEREQ_H + +#include "SignalData.hpp" + +/** + * FsReadWriteReq - Common signal class for FSWRITEREQ and FSREADREQ + * + */ + +/** + * + * SENDER: + * RECIVER: Ndbfs + */ +class FsReadWriteReq { + /** + * Reciver(s) + */ + friend class Ndbfs; + friend class VoidFs; + friend class AsyncFile; + + /** + * Sender(s) + */ + friend class Dbdict; + friend class Lgman; + friend class Tsman; + friend class Pgman; + friend class Restore; + + /** + * For printing + */ + friend bool printFSREADWRITEREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); + +public: + /** + * Enum type for errorCode + */ + enum NdbfsFormatType { + fsFormatListOfPairs=0, + fsFormatArrayOfPages=1, + fsFormatListOfMemPages=2, + fsFormatGlobalPage=3, + fsFormatSharedPage=4, + fsFormatMax + }; + + /** + * Length of signal + */ + STATIC_CONST( FixedLength = 6 ); + +private: + + /** + * DATA VARIABLES + */ + UintR filePointer; // DATA 0 + UintR userReference; // DATA 1 + UintR userPointer; // DATA 2 + UintR operationFlag; // DATA 3 + UintR varIndex; // DATA 4 + UintR numberOfPages; // DATA 5 + +//------------------------------------------------------------- +// Variable sized part. Those will contain +// info about memory/file pages to read/write +//------------------------------------------------------------- + union { + UintR pageData[16]; // DATA 6 - 21 + struct { + Uint32 varIndex; // In unit cluster size + Uint32 fileOffset; // In unit page size + } listOfPair[8]; + struct { + Uint32 varIndex; + Uint32 fileOffset; + } arrayOfPages; + struct { + Uint32 varIndex[1]; // Size = numberOfPages + Uint32 fileOffset; + } listOfMemPages; + } data; + + static Uint8 getSyncFlag(const UintR & opFlag); + static void setSyncFlag(UintR & opFlag, Uint8 flag); + + static NdbfsFormatType getFormatFlag(const UintR & opFlag); + static void setFormatFlag(UintR & opFlag, Uint8 flag); + + static Uint32 getPartialReadFlag(UintR opFlag); + static void setPartialReadFlag(UintR & opFlag, Uint32 flag); +}; + +/** + * Operation flag + * + f = Format of pageData - 4 Bits -> max 15 + s = sync after write flag - 1 Bit + + 1111111111222222222233 + 01234567890123456789012345678901 + ffffs +*/ + +#define SYNC_SHIFT (4) +#define SYNC_MASK (0x01) + +#define FORMAT_MASK (0x0F) + +#define PARTIAL_READ_SHIFT (5) + +inline +Uint8 +FsReadWriteReq::getSyncFlag(const UintR & opFlag){ + return (Uint8)((opFlag >> SYNC_SHIFT) & SYNC_MASK); +} + +inline +FsReadWriteReq::NdbfsFormatType +FsReadWriteReq::getFormatFlag(const UintR & opFlag){ + return (NdbfsFormatType)(opFlag & FORMAT_MASK); +} + +inline +void +FsReadWriteReq::setSyncFlag(UintR & opFlag, Uint8 flag){ + ASSERT_BOOL(flag, "FsReadWriteReq::setSyncFlag"); + opFlag |= (flag << SYNC_SHIFT); +} + +inline +void +FsReadWriteReq::setFormatFlag(UintR & opFlag, Uint8 flag){ + ASSERT_MAX(flag, fsFormatMax, "FsReadWriteReq::setSyncFlag"); + opFlag |= flag; +} + +inline +void +FsReadWriteReq::setPartialReadFlag(UintR & opFlag, Uint32 flag){ + ASSERT_BOOL(flag, "FsReadWriteReq::setSyncFlag"); + opFlag |= (flag << PARTIAL_READ_SHIFT); +} + +inline +Uint32 +FsReadWriteReq::getPartialReadFlag(UintR opFlag){ + return (opFlag >> PARTIAL_READ_SHIFT) & 1; +} + + +#endif diff --git a/storage/ndb/include/kernel/signaldata/FsRef.hpp b/storage/ndb/include/kernel/signaldata/FsRef.hpp new file mode 100644 index 00000000000..ab5a269f496 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/FsRef.hpp @@ -0,0 +1,99 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef FS_REF_H +#define FS_REF_H + +#include <ndbd_exit_codes.h> +#include "SignalData.hpp" + +/** + * FsRef - Common signal class for all REF signals sent from Ndbfs + * GSN_FSCLOSEREF, GSN_FSOPENREF, GSN_FSWRITEREF, GSN_FSREADREF, + * GSN_FSSYNCREF + */ + + +/** + * + * SENDER: Ndbfs + * RECIVER: + */ +struct FsRef { + + friend bool printFSREF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); + + /** + * Enum type for errorCode + */ + STATIC_CONST( FS_ERR_BIT = 0x8000 ); + + enum NdbfsErrorCodeType { + fsErrNone=0, + fsErrEnvironmentError=NDBD_EXIT_AFS_ENVIRONMENT, + fsErrTemporaryNotAccessible=NDBD_EXIT_AFS_TEMP_NO_ACCESS, + fsErrNoSpaceLeftOnDevice=NDBD_EXIT_AFS_DISK_FULL, + fsErrPermissionDenied=NDBD_EXIT_AFS_PERMISSION_DENIED, + fsErrInvalidParameters=NDBD_EXIT_AFS_INVALID_PARAM, + fsErrUnknown=NDBD_EXIT_AFS_UNKNOWN, + fsErrNoMoreResources=NDBD_EXIT_AFS_NO_MORE_RESOURCES, + fsErrFileDoesNotExist=NDBD_EXIT_AFS_NO_SUCH_FILE, + fsErrReadUnderflow = NDBD_EXIT_AFS_READ_UNDERFLOW, + fsErrFileExists = FS_ERR_BIT | 12, + fsErrInvalidFileSize = FS_ERR_BIT | 13, + fsErrOutOfMemory = FS_ERR_BIT | 14, + fsErrMax + }; + /** + * Length of signal + */ + STATIC_CONST( SignalLength = 4 ); + + /** + * DATA VARIABLES + */ + UintR userPointer; // DATA 0 + UintR errorCode; // DATA 1 + UintR osErrorCode; // DATA 2 + UintR senderData; + + static NdbfsErrorCodeType getErrorCode(const UintR & errorcode); + static void setErrorCode(UintR & errorcode, NdbfsErrorCodeType errorcodetype); + static void setErrorCode(UintR & errorcode, UintR errorcodetype); + +}; + + +inline +FsRef::NdbfsErrorCodeType +FsRef::getErrorCode(const UintR & errorcode){ + return (NdbfsErrorCodeType)errorcode; +} + +inline +void +FsRef::setErrorCode(UintR & errorcode, NdbfsErrorCodeType errorcodetype){ + ASSERT_MAX(errorcodetype, fsErrMax, "FsRef::setErrorCode"); + errorcode = (UintR)errorcodetype; +} + +inline +void +FsRef::setErrorCode(UintR & errorcode, UintR errorcodetype){ + ASSERT_MAX(errorcodetype, fsErrMax, "FsRef::setErrorCode"); + errorcode = errorcodetype; +} + +#endif diff --git a/storage/ndb/include/kernel/signaldata/FsRemoveReq.hpp b/storage/ndb/include/kernel/signaldata/FsRemoveReq.hpp new file mode 100644 index 00000000000..24971a489e6 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/FsRemoveReq.hpp @@ -0,0 +1,77 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef FS_REMOVE_REQ_H +#define FS_REMOVE_REQ_H + +#include "SignalData.hpp" +#include "FsOpenReq.hpp" + +/** + * + * SENDER: + * RECIVER: Ndbfs + */ +class FsRemoveReq { + /** + * Reciver(s) + */ + friend class Ndbfs; // Reciver + friend class AsyncFile; // Uses FsOpenReq to decode file open flags + friend class Filename; + friend class VoidFs; + + /** + * Sender(s) + */ + friend class Backup; + friend class Dbdict; + friend class Dbacc; + friend class Dbtup; + friend class Ndbcntr; // For initial start... + +public: + /** + * Length of signal + */ + STATIC_CONST( SignalLength = 8 ); + +private: + + /** + * DATA VARIABLES + */ + + UintR userReference; // DATA 0 + UintR userPointer; // DATA 1 + UintR fileNumber[4]; // DATA 2 - 5 // See FsOpen for interpretation + + /** + * 0 = File -> rm file + * 1 = Directory -> rm -r path + */ + UintR directory; + + /** + * If directory = 1 + * + * 0 = remove only files/direcories in directory specified in fileNumber + * 1 = remove directory specified in fileNumber + */ + UintR ownDirectory; +}; + +#endif + diff --git a/storage/ndb/include/kernel/signaldata/GCPSave.hpp b/storage/ndb/include/kernel/signaldata/GCPSave.hpp new file mode 100644 index 00000000000..61a0414c093 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/GCPSave.hpp @@ -0,0 +1,97 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef GCP_SAVE_HPP +#define GCP_SAVE_HPP + +#include "SignalData.hpp" + +/** + * GCPSaveReq / (Ref/Conf) is sent as part of GCP + */ +class GCPSaveReq { + /** + * Sender(s) + */ + friend class Dbdih; + + /** + * Reciver(s) + */ + friend class Dblqh; + + friend bool printGCPSaveReq(FILE * output, const Uint32 * theData, + Uint32 len, Uint16 receiverBlockNo); +public: + STATIC_CONST( SignalLength = 3 ); + +private: + Uint32 dihBlockRef; + Uint32 dihPtr; + Uint32 gci; +}; + +class GCPSaveRef { + /** + * Sender(s) + */ + friend class Dblqh; + + /** + * Reciver(s) + */ + friend class Dbdih; + + friend bool printGCPSaveRef(FILE * output, const Uint32 * theData, + Uint32 len, Uint16 receiverBlockNo); +public: + STATIC_CONST( SignalLength = 4 ); + + enum ErrorCode { + NodeShutdownInProgress = 1, + FakedSignalDueToNodeFailure = 2, + NodeRestartInProgress = 3 + }; + +private: + Uint32 dihPtr; + Uint32 nodeId; + Uint32 gci; + Uint32 errorCode; +}; + +class GCPSaveConf { + /** + * Sender(s) + */ + friend class Dblqh; + + /** + * Reciver(s) + */ + friend class Dbdih; + + friend bool printGCPSaveConf(FILE * output, const Uint32 * theData, + Uint32 len, Uint16 receiverBlockNo); +public: + STATIC_CONST( SignalLength = 3 ); + +private: + Uint32 dihPtr; + Uint32 nodeId; + Uint32 gci; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/GetTabInfo.hpp b/storage/ndb/include/kernel/signaldata/GetTabInfo.hpp new file mode 100644 index 00000000000..0a5e38fa91a --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/GetTabInfo.hpp @@ -0,0 +1,127 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef GET_INFO_TAB_HPP +#define GET_INFO_TAB_HPP + +#include "SignalData.hpp" + +/** + * GetTabInfo - Get table info from DICT + * + * Successfull return = series of DICTTABINFO-signals + */ +class GetTabInfoReq { + /** + * Sender(s) / Reciver(s) + */ + // Blocks + friend class Dbdict; + friend class Backup; + friend class Trix; + friend class DbUtil; + // API + friend class Table; + + friend bool printGET_TABINFO_REQ(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 5 ); +public: + Uint32 senderData; + Uint32 senderRef; + Uint32 requestType; // Bitmask of GetTabInfoReq::RequestType + union { + Uint32 tableId; + Uint32 tableNameLen; + }; + Uint32 unused; // This is located here so that Req & Ref have the same format + + enum RequestType { + RequestById = 0, + RequestByName = 1, + LongSignalConf = 2 + }; + SECTION( TABLE_NAME = 0 ); +}; + +class GetTabInfoRef { + /** + * Sender(s) / Reciver(s) + */ + // Blocks + friend class Dbdict; + friend class Backup; + friend class Trix; + friend class DbUtil; + // API + friend class Table; + + friend bool printGET_TABINFO_REF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 5 ); +public: + Uint32 senderData; + Uint32 senderRef; + Uint32 requestType; // Bitmask of GetTabInfoReq::RequestType + union { + Uint32 tableId; + Uint32 tableNameLen; + }; + Uint32 errorCode; + + enum ErrorCode { + InvalidTableId = 709, + TableNotDefined = 723, + TableNameTooLong = 702, + NoFetchByName = 710, + Busy = 701 + }; +}; + +class GetTabInfoConf { + /** + * Sender(s) / Reciver(s) + */ + // Blocks + friend class Dbdict; + friend class Backup; + friend class Trix; + friend class DbUtil; + friend class Suma; + // API + friend class Table; + + friend bool printGET_TABINFO_CONF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 6 ); + + SECTION( DICT_TAB_INFO = 0 ); +public: + Uint32 senderData; + Uint32 tableId; + union { + Uint32 gci; // For table + Uint32 freeWordsHi; // for logfile group m_free_file_words + }; + union { + Uint32 totalLen; // In words + Uint32 freeExtents; + Uint32 freeWordsLo; // for logfile group m_free_file_words + }; + Uint32 tableType; + Uint32 senderRef; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/GetTableId.hpp b/storage/ndb/include/kernel/signaldata/GetTableId.hpp new file mode 100644 index 00000000000..8c785a911ab --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/GetTableId.hpp @@ -0,0 +1,92 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef GET_TABLEID_HPP +#define GET_TABLEID_HPP + +#include "SignalData.hpp" + +/** + * Convert tabname to table id + */ +class GetTableIdReq { + /** + * Sender(s) / Reciver(s) + */ + // Blocks + friend class Dbdict; + friend class SumaParticipant; + + friend bool printGET_TABLEID_REQ(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 3 ); +public: + Uint32 senderData; + Uint32 senderRef; + Uint32 len; + SECTION( TABLE_NAME = 0 ); +}; + + +/** + * Convert tabname to table id + */ +class GetTableIdRef { + /** + * Sender(s) / Reciver(s) + */ + // Blocks + friend class Dbdict; + friend class SumaParticipant; + friend bool printGET_TABLEID_REF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 3 ); +public: + Uint32 senderData; + Uint32 senderRef; + Uint32 err; + + enum ErrorCode { + InvalidTableId = 709, + TableNotDefined = 723, + TableNameTooLong = 702, + EmptyTable = 1111 + }; +}; + + +/** + * Convert tabname to table id + */ +class GetTableIdConf { + /** + * Sender(s) / Reciver(s) + */ + // Blocks + friend class Dbdict; + friend class SumaParticipant; + friend bool printGET_TABLEID_CONF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 4 ); +public: + Uint32 senderData; + Uint32 senderRef; + Uint32 tableId; + Uint32 schemaVersion; + +}; + + +#endif diff --git a/storage/ndb/include/kernel/signaldata/GrepImpl.hpp b/storage/ndb/include/kernel/signaldata/GrepImpl.hpp new file mode 100644 index 00000000000..335c78f58eb --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/GrepImpl.hpp @@ -0,0 +1,890 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef GREP_IMPL_HPP +#define GREP_IMPL_HPP + +#include "SignalData.hpp" +#include <GrepError.hpp> +#include <NodeBitmask.hpp> + + + +/***************************************************************************** + * GREP REQ Request a Global Replication (between SS and PS) + *****************************************************************************/ +/** + * @class GrepReq + * @brief + */ +class GrepReq +{ + /** + * Sender(s)/Reciver(s) + */ + friend class Grep; + +public: + enum Request { + START = 0, ///< Start Global Replication (all phases) + SLOWSTOP = 1, ///< Stop after finishing applying current GCI epoch + FASTSTOP = 2, ///< Stop after finishing applying all PS GCI epochs + STATUS = 3, ///< Status + REMOVE_BUFFERS = 4, ///< Remove buffers from PS and SS + + START_SUBSCR = 5, + START_METALOG = 6, ///< Start Global Replication Logging of Metadata + START_METASCAN = 7, ///< Start Global Replication Scanning of Metadata + START_DATALOG = 8, ///< Start Global Replication Logging of table data + START_DATASCAN = 9, ///< Start Global Replication Scanning of table data + START_REQUESTOR = 10, ///< Start Global Replication Requestor + START_TRANSFER = 11, ///< Start SS-PS transfer + START_APPLY = 12, ///< Start applying GCI epochs in SS + START_DELETE = 13, ///< Start deleting buffers at PS/SS REP automatic. + + STOP_SUBSCR = 14, ///< Remove subscription + STOP_METALOG = 15, ///< Stop Global Replication Logging of Metadata + STOP_METASCAN = 16, ///< Stop Global Replication Scanning of Metadata + STOP_DATALOG = 17, ///< Stop Global Replication Logging of table data + STOP_DATASCAN = 18, ///< Stop Global Replication Scanning of table data + STOP_REQUESTOR = 19, ///< Stop Global Replication Requestor + STOP_TRANSFER = 20, ///< Stop SS-PS transfer + STOP_APPLY = 21, ///< Stop applying GCI epochs in SS + STOP_DELETE = 22, ///< Stop deleting buffers at PS/SS REP automatically + CREATE_SUBSCR = 23, ///< Create subscription ID in SUMA + DROP_TABLE = 24, ///< Create subscription ID in SUMA + STOP = 25, + + NO_REQUEST = 0xffffffff + }; + + STATIC_CONST( SignalLength = 2 ); + + Uint32 senderRef; + Uint32 request; +}; + + +/***************************************************************************** + * CREATE Between SS and PS (DB and REP nodes) + *****************************************************************************/ +/** + * @class GrepSubCreateReq + * @brief + */ +class GrepSubCreateReq +{ + /** + * Sender(s)/Reciver(s) + */ + friend class Grep; + + friend bool printGREP_SUB_CREATE_REQ(FILE *, + const Uint32 *, + Uint32, + Uint16); +public: + STATIC_CONST( SignalLength = 5 ); + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 subscriptionType; + Uint32 senderRef; + Uint32 senderData; + SECTION( TABLE_LIST = 0 ); +}; + +/** + * @class GrepSubCreateReq + * @brief + */ +class GrepSubCreateRef +{ + /** + * Sender(s)/Reciver(s) + */ + friend class Grep; + + friend bool printGREP_SUB_CREATE_REF(FILE *, + const Uint32 *, + Uint32, + Uint16); +public: + STATIC_CONST( SignalLength = 6 ); + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 subscriptionType; + Uint32 err; + Uint32 senderRef; + Uint32 senderData; +}; + + +/** + * @class GrepSubCreateConf + * @brief + */ +class GrepSubCreateConf +{ + /** + * Sender(s)/Reciver(s) + */ + friend class Grep; + + friend bool printGREP_SUB_CREATE_CONF(FILE *, + const Uint32 *, + Uint32, + Uint16); +public: + STATIC_CONST( SignalLength = 6 ); + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 subscriptionType; + Uint32 senderRef; + Uint32 senderData; + Uint32 noOfNodeGroups; +}; + + + +/***************************************************************************** + * CREATE Internal between PS DB nodes + *****************************************************************************/ + +/** + * @class GrepCreateReq + * @brief + */ +class GrepCreateReq { + /** + * Sender(s)/Reciver(s) + */ + friend class GrepParticipant; + + friend bool printGREP_CREATE_REQ(FILE *, + const Uint32 *, + Uint32, + Uint16); +public: + STATIC_CONST( SignalLength = 8 ); + + Uint32 senderRef; + Uint32 senderData; + Uint32 subscriberData; + Uint32 subscriberRef; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 subscriptionType; + SECTION( TABLE_LIST = 0 ); +}; + + +/** + * @class GrepCreateRef + * @brief + */ +class GrepCreateRef { + /** + * Sender(s)/Reciver(s) + */ + + friend class GrepParticipant; + + friend bool printGREP_CREATE_REF(FILE *, + const Uint32 *, + Uint32, + Uint16); +public: + enum ErrorCode { + NF_FakeErrorREF = GrepError::NF_FakeErrorREF + }; + STATIC_CONST( SignalLength = 6 ); + Uint32 senderRef; + Uint32 senderData; + union { + Uint32 err; + Uint32 errorCode; + }; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 subscriptionType; +}; + + +/** + * @class GrepCreateConf + * @brief + */ +class GrepCreateConf { + /** + * Sender(s)/Reciver(s) + */ + + friend class GrepParticipant; + + friend bool printGREP_CREATE_CONF(FILE *, + const Uint32 *, + Uint32, + Uint16); +public: + STATIC_CONST( SignalLength = 6 ); + Uint32 senderNodeId; + Uint32 senderRef; + Uint32 senderData; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 subscriptionType; +}; + + +/***************************************************************************** + * START Between SS and PS (DB and REP nodes) + *****************************************************************************/ + +/** + * @class GrepSubStartReq + * @brief + */ +class GrepSubStartReq { + /** + * Sender(s)/Reciver(s) + */ + friend class Grep; + + friend bool printGREP_SUB_START_REQ(FILE *, + const Uint32 *, + Uint32, + Uint16); +public: + STATIC_CONST( SignalLength = 5 ); + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 senderRef; + Uint32 senderData; + Uint32 part; +}; + +/** + * @class GrepSubStartRef + * @brief + */ +class GrepSubStartRef { + /** + * Sender(s)/Reciver(s) + */ + friend class Grep; + + friend bool printGREP_SUB_START_REF(FILE *, + const Uint32 *, + Uint32, + Uint16); +public: + STATIC_CONST( SignalLength = 6 ); + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 err; + Uint32 senderRef; + Uint32 senderData; + Uint32 part; +}; + + + +/** + * @class GrepSubStartConf + * @brief + */ +class GrepSubStartConf { + /** + * Sender(s)/Reciver(s) + */ + friend class Grep; + + friend bool printGREP_SUB_START_CONF(FILE *, + const Uint32 *, + Uint32, + Uint16); +public: + STATIC_CONST( SignalLength = 6 ); + + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 senderRef; + Uint32 senderData; + Uint32 part; + Uint32 firstGCI; +}; + + +/***************************************************************************** + * START Internal between PS DB nodes + *****************************************************************************/ + +/** + * @class GrepStartReq + * @brief + */ +class GrepStartReq { + /** + * Sender(s)/Reciver(s) + */ + friend class GrepParticipant; + + friend bool printGREP_START_REQ(FILE *, + const Uint32 *, + Uint32, + Uint16); +public: + STATIC_CONST( SignalLength = 4 ); + + Uint32 senderData; + Uint32 part; + Uint32 subscriptionId; + Uint32 subscriptionKey; +}; + + +/** + * @class GrepStartRef + * @brief + */ +class GrepStartRef { + /** + * Sender(s)/Reciver(s) + */ + + friend class GrepParticipant; + + friend bool printGREP_START_REF(FILE *, + const Uint32 *, + Uint32, + Uint16); +public: + enum ErrorCode { + NF_FakeErrorREF = GrepError::NF_FakeErrorREF + }; + STATIC_CONST( SignalLength = 6 ); + Uint32 senderRef; + Uint32 senderData; + Uint32 part; + Uint32 subscriptionId; + Uint32 subscriptionKey; + union { + Uint32 err; + Uint32 errorCode; + }; +}; + + +/** + * @class GrepStartConf + * @brief + */ +class GrepStartConf { + /** + * Sender(s)/Reciver(s) + */ + + friend class GrepParticipant; + + friend bool printGREP_START_CONF(FILE *, + const Uint32 *, + Uint32, + Uint16); + public: + STATIC_CONST( SignalLength = 7 ); + + Uint32 senderRef; + Uint32 senderData; + Uint32 part; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 firstGCI; + Uint32 senderNodeId; + }; + + +/***************************************************************************** + * SCAN (SYNC) Between SS and PS (REP and DB nodes) + *****************************************************************************/ + +/** + * @class GrepSubSyncReq + * @brief + */ +class GrepSubSyncReq { + /** + * Sender(s)/Reciver(s) + */ + friend class Grep; + + friend bool printGREP_SUB_SYNC_REQ(FILE *, + const Uint32 *, + Uint32, + Uint16); +public: + STATIC_CONST( SignalLength = 5 ); + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 senderRef; + Uint32 senderData; + Uint32 part; +}; + + +/** + * @class GrepSubSyncRef + * @brief + */ +class GrepSubSyncRef { + /** + * Sender(s)/Reciver(s) + */ + friend class Grep; + + friend bool printGREP_SUB_SYNC_REF(FILE *, + const Uint32 *, + Uint32, + Uint16); +public: + STATIC_CONST( SignalLength = 6 ); + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 senderRef; + Uint32 err; + Uint32 senderData; + Uint32 part; +}; + + +/** + * @class GrepSubSyncConf + * @brief + */ +class GrepSubSyncConf { + /** + * Sender(s)/Reciver(s) + */ + friend class Grep; + + friend bool printGREP_SUB_SYNC_CONF(FILE *, + const Uint32 *, + Uint32, + Uint16); + public: + STATIC_CONST( SignalLength = 7 ); + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 senderRef; + Uint32 senderData; + Uint32 part; + Uint32 firstGCI; + Uint32 lastGCI; +}; + + + +/***************************************************************************** + * SCAN (SYNC) Internal between PS DB nodes + *****************************************************************************/ + +/** + * @class GrepSyncReq + * @brief + */ +class GrepSyncReq { + /** + * Sender(s)/Reciver(s) + */ + friend class GrepParticipant; + + friend bool printGREP_SYNC_REQ(FILE *, + const Uint32 *, + Uint32, + Uint16); +public: + STATIC_CONST( SignalLength = 4 ); + + Uint32 senderData; + Uint32 part; + Uint32 subscriptionId; + Uint32 subscriptionKey; +}; + + +/** + * @class GrepSyncRef + * @brief + */ +class GrepSyncRef { + /** + * Sender(s)/Reciver(s) + */ + + friend class GrepParticipant; + + friend bool printGREP_SYNC_REF(FILE *, + const Uint32 *, + Uint32, + Uint16); +public: + enum ErrorCode { + NF_FakeErrorREF = GrepError::NF_FakeErrorREF + }; + STATIC_CONST( SignalLength = 6 ); + Uint32 senderRef; + Uint32 senderData; + Uint32 part; + Uint32 subscriptionId; + Uint32 subscriptionKey; + union { + Uint32 err; + Uint32 errorCode; + }; +}; + + +/** + * @class GrepSyncConf + * @brief + */ +class GrepSyncConf +{ + /** + * Sender(s)/Reciver(s) + */ + friend class GrepParticipant; + + friend bool printGREP_SYNC_CONF(FILE *, const Uint32 *, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 8 ); + Uint32 senderRef; + Uint32 senderData; + Uint32 part; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 senderNodeId; + Uint32 firstGCI; + Uint32 lastGCI; +}; + +/***************************************************************************** + * ABORT - remove subscription + *****************************************************************************/ + +/** + * @class GrepSubRemoveReq + * @brief Between PS and SS + */ +class GrepSubRemoveReq { + /** + * Sender(s)/Reciver(s) + */ + friend class Grep; + + friend bool printGREP_SUB_REMOVE_REQ(FILE *, const Uint32 *, + Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 4 ); + + Uint32 senderRef; + Uint32 senderData; + Uint32 subscriptionId; + Uint32 subscriptionKey; +}; + + +/** + * @class GrepSubRemoveRef + * @brief Between PS and SS + */ +class GrepSubRemoveRef { + /** + * Sender(s)/Reciver(s) + */ + friend class Grep; + + friend bool printGREP_SUB_REMOVE_REF(FILE *, const Uint32 *, + Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 5 ); + + Uint32 senderRef; + Uint32 senderData; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 err; +}; + + +/** + * @class + * @brief + */ +class GrepSubRemoveConf { + /** + * Sender(s)/Reciver(s) + */ + friend class Grep; + + friend bool printGREP_SUB_REMOVE_CONF(FILE *, + const Uint32 *, + Uint32, + Uint16); +public: + STATIC_CONST( SignalLength = 4 ); + + Uint32 senderRef; + Uint32 senderData; + Uint32 subscriptionId; + Uint32 subscriptionKey; +}; + + +/** + * @class + * @brief + */ +class GrepRemoveReq { + /** + * Sender(s)/Reciver(s) + */ + friend class GrepParticipant; + + friend bool printGREP_REMOVE_REQ(FILE *, + const Uint32 *, + Uint32, + Uint16); +public: + STATIC_CONST( SignalLength = 4 ); + + Uint32 senderRef; + Uint32 senderData; + Uint32 subscriptionId; + Uint32 subscriptionKey; +}; + + +/** + * @class + * @brief + */ +class GrepRemoveRef { + /** + * Sender(s)/Reciver(s) + */ + + friend class GrepParticipant; + + friend bool printGREP_REMOVE_REF(FILE *, + const Uint32 *, + Uint32, + Uint16); +public: + enum ErrorCode { + NF_FakeErrorREF = GrepError::NF_FakeErrorREF + }; + STATIC_CONST( SignalLength = 5 ); + Uint32 senderRef; + Uint32 senderData; + Uint32 subscriptionId; + Uint32 subscriptionKey; + union { + Uint32 err; + Uint32 errorCode; + }; +}; + + +/** + * @class + * @brief + */ +class GrepRemoveConf { + /** + * Sender(s)/Reciver(s) + */ + + friend class GrepParticipant; + + friend bool printGREP_REMOVE_CONF(FILE *, + const Uint32 *, + Uint32, + Uint16); +public: + STATIC_CONST( SignalLength = 5 ); + Uint32 senderRef; + Uint32 senderData; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 senderNodeId; +}; + + +/***************************************************************************** + * WAIT FOR CGP + *****************************************************************************/ + +/** + * @class GrepWaitGcpReq + * @brief + */ +class GrepWaitGcpReq { + /** + * Sender(s)/Reciver(s) + */ + + friend class GrepParticipant; + + friend bool printGREP_WAITGCP_REQ(FILE *, const Uint32 *, + Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 5 ); + + Uint32 senderData; + Uint32 gcp; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 senderNodeId; +}; + +/** + * @class GrepWaitGcpConf + * @brief + */ +class GrepWaitGcpConf { + /** + * Sender(s)/Reciver(s) + */ + + friend class GrepParticipant; + + friend bool printGREP_WAITGCP_CONF(FILE *, + const Uint32 *, + Uint32, + Uint16); +public: + STATIC_CONST( SignalLength = 4 ); + + Uint32 senderData; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 senderNodeId; +}; + + + +class GrepCreateSubscriptionIdConf { + friend class Grep; + + friend bool printGREP_CREATE_SUBSCRIPTION_ID_CONF(FILE *, const Uint32 *, + Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 3 ); + + Uint32 subscriptionId; + Uint32 subscriptionKey; + union { // Haven't decide what to call it + Uint32 senderData; + Uint32 subscriberData; + }; +}; + + + +class GrepStartMe { + friend class Grep; + friend bool printGREP_START_ME(FILE *, const Uint32 *, + Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 1 ); + Uint32 senderRef; +}; + + + + +/** + * @class GrepAddSubReq + * @brief + */ +class GrepAddSubReq { + /** + * Sender(s)/Reciver(s) + */ + friend class GrepParticipant; + + friend bool printGREP_ADD_SUB_REQ(FILE *, + const Uint32 *, + Uint32, + Uint16); +public: + STATIC_CONST( SignalLength = 7 ); + Uint32 senderRef; + Uint32 senderData; + Uint32 subscriberData; + Uint32 subscriberRef; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 subscriptionType; +}; + + +/** + * @class GrepAddSubRef + * @brief + */ +class GrepAddSubRef { + /** + * Sender(s)/Reciver(s) + */ + + friend class GrepParticipant; + + friend bool printGREP_CREATE_REF(FILE *, + const Uint32 *, + Uint32, + Uint16); +public: + STATIC_CONST( SignalLength = 5 ); + Uint32 senderData; + Uint32 err; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 subscriptionType; +}; + + +/** + * @class GrepAddSubConf + * @brief + */ +class GrepAddSubConf { + /** + * Sender(s)/Reciver(s) + */ + + friend class GrepParticipant; + + friend bool printGREP_CREATE_CONF(FILE *, + const Uint32 *, + Uint32, + Uint16); +public: + STATIC_CONST( SignalLength = 1 ); + Uint32 noOfSub; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/HotSpareRep.hpp b/storage/ndb/include/kernel/signaldata/HotSpareRep.hpp new file mode 100644 index 00000000000..c3e2922f1d7 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/HotSpareRep.hpp @@ -0,0 +1,47 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef HOT_SPAREREP_HPP +#define HOT_SPAREREP_HPP + +#include <NodeBitmask.hpp> + +/** + * This signals is sent by Dbdih to Dbdict + */ +class HotSpareRep { + /** + * Sender(s) + */ + friend class Dbdih; + + /** + * Sender(s) / Reciver(s) + */ + + /** + * Reciver(s) + */ + friend class Dbdict; + +public: + STATIC_CONST( SignalLength = 1 + NodeBitmask::Size ); +private: + + Uint32 noHotSpareNodes; + Uint32 theHotSpareNodes[NodeBitmask::Size]; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/IndxAttrInfo.hpp b/storage/ndb/include/kernel/signaldata/IndxAttrInfo.hpp new file mode 100755 index 00000000000..f42e9ff8657 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/IndxAttrInfo.hpp @@ -0,0 +1,55 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef INDX_ATTRINFO_HPP +#define INDX_ATTRINFO_HPP + +#include "SignalData.hpp" + +class IndxAttrInfo { + /** + * Sender(s) + */ + friend class NdbIndexOperation; + + /** + * Receiver(s) + */ + friend class Dbtc; + + friend bool printINDXATTRINFO(FILE *, const Uint32 *, Uint32, Uint16); + +public: + STATIC_CONST( HeaderLength = 3 ); + STATIC_CONST( DataLength = 22 ); + STATIC_CONST( MaxSignalLength = HeaderLength + DataLength); + + // Public methods +public: + Uint32* getData() const; + +private: + Uint32 connectPtr; + Uint32 transId[2]; + Uint32 attrData[DataLength]; +}; + +inline +Uint32* IndxAttrInfo::getData() const +{ + return (Uint32*)&attrData[0]; +} + +#endif diff --git a/storage/ndb/include/kernel/signaldata/IndxKeyInfo.hpp b/storage/ndb/include/kernel/signaldata/IndxKeyInfo.hpp new file mode 100755 index 00000000000..82ba9ae6c3f --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/IndxKeyInfo.hpp @@ -0,0 +1,55 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef INDX_KEY_INFO_HPP +#define INDX_KEY_INFO_HPP + +#include "SignalData.hpp" + +class IndxKeyInfo { + /** + * Sender(s) + */ + friend class NdbIndexOperation; + + /** + * Reciver(s) + */ + friend class Dbtc; + + friend bool printINDXKEYINFO(FILE *, const Uint32 *, Uint32, Uint16); + +public: + STATIC_CONST( HeaderLength = 3 ); + STATIC_CONST( DataLength = 20 ); + STATIC_CONST( MaxSignalLength = HeaderLength + DataLength ); + + // Public methods +public: + Uint32* getData() const; + +private: + Uint32 connectPtr; + Uint32 transId[2]; + Uint32 keyData[DataLength]; +}; + +inline +Uint32* IndxKeyInfo::getData() const +{ + return (Uint32*)&keyData[0]; +} + +#endif diff --git a/storage/ndb/include/kernel/signaldata/InvalidateNodeLCPConf.hpp b/storage/ndb/include/kernel/signaldata/InvalidateNodeLCPConf.hpp new file mode 100644 index 00000000000..49293a5d18b --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/InvalidateNodeLCPConf.hpp @@ -0,0 +1,40 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef INVALIDATE_NODE_LCP_CONF_HPP +#define INVALIDATE_NODE_LCP_CONF_HPP + +/** + * This signal is sent from the non-master DIH to master DIHs + * + */ +class InvalidateNodeLCPConf { + + /** + * Sender/Receiver + */ + friend class Dbdih; + + /** + * NodeId of sending node + * which is "done" + */ + Uint32 sendingNodeId; + +public: + STATIC_CONST( SignalLength = 1 ); +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/InvalidateNodeLCPReq.hpp b/storage/ndb/include/kernel/signaldata/InvalidateNodeLCPReq.hpp new file mode 100644 index 00000000000..57f9870d019 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/InvalidateNodeLCPReq.hpp @@ -0,0 +1,41 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef INVALIDATE_NODE_LCP_REQ_HPP +#define INVALIDATE_NODE_LCP_REQ_HPP + +/** + * This signal is sent from the master DIH to all DIHs + * when a node is starting without filesystem. + * + * All DIHs must then "forgett" that the starting node has + * performed LCP + * + * @see StartPermReq + */ +class InvalidateNodeLCPReq { + + /** + * Sender/Receiver + */ + friend class Dbdih; + + Uint32 startingNodeId; + +public: + STATIC_CONST( SignalLength = 1 ); +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/KeyInfo.hpp b/storage/ndb/include/kernel/signaldata/KeyInfo.hpp new file mode 100644 index 00000000000..48bb028d726 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/KeyInfo.hpp @@ -0,0 +1,47 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef KEY_INFO_HPP +#define KEY_INFO_HPP + +#include "SignalData.hpp" + +class KeyInfo { + /** + * Sender(s) + */ + friend class DbUtil; + friend class NdbOperation; + friend class NdbScanOperation; + friend class NdbIndexScanOperation; + friend class Restore; + + /** + * Reciver(s) + */ + friend class Dbtc; + +public: + STATIC_CONST( HeaderLength = 3 ); + STATIC_CONST( DataLength = 20 ); + STATIC_CONST( MaxSignalLength = HeaderLength + DataLength ); + +private: + Uint32 connectPtr; + Uint32 transId[2]; + Uint32 keyData[DataLength]; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/LCP.hpp b/storage/ndb/include/kernel/signaldata/LCP.hpp new file mode 100644 index 00000000000..844b5de0afd --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/LCP.hpp @@ -0,0 +1,218 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef LCP_SIGNAL_DATA_HPP +#define LCP_SIGNAL_DATA_HPP + +#include "SignalData.hpp" +#include <NodeBitmask.hpp> + +class StartLcpReq { + /** + * Sender(s) + */ + friend class Dbdih; + + /** + * Sender(s) / Receiver(s) + */ + + /** + * Receiver(s) + */ + friend class Dblqh; + + friend bool printSTART_LCP_REQ(FILE *, const Uint32 *, Uint32, Uint16); +public: + + STATIC_CONST( SignalLength = 2 + 2 * NdbNodeBitmask::Size ); +private: + Uint32 senderRef; + Uint32 lcpId; + + NdbNodeBitmask participatingDIH; + NdbNodeBitmask participatingLQH; +}; + +class StartLcpConf { + /** + * Sender(s) + */ + friend class Dblqh; + + /** + * Sender(s) / Receiver(s) + */ + + /** + * Receiver(s) + */ + friend class Dbdih; + + friend bool printSTART_LCP_CONF(FILE *, const Uint32 *, Uint32, Uint16); +public: + + STATIC_CONST( SignalLength = 2 ); +private: + Uint32 senderRef; + Uint32 lcpId; +}; + +/** + * This signals is sent by Dbdih to Dblqh + * to order checkpointing of a certain + * fragment. + */ +class LcpFragOrd { + /** + * Sender(s) + */ + friend class Dbdih; + friend class Lgman; + friend class Pgman; + friend class Dbtup; + + /** + * Sender(s) / Receiver(s) + */ + + /** + * Receiver(s) + */ + friend class Dblqh; + + friend bool printLCP_FRAG_ORD(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 6 ); +private: + + Uint32 tableId; + Uint32 fragmentId; + Uint32 lcpNo; + Uint32 lcpId; + Uint32 lastFragmentFlag; + Uint32 keepGci; +}; + + +class LcpFragRep { + /** + * Sender(s) and receiver(s) + */ + friend class Dbdih; + + /** + * Sender(s) + */ + friend class Dblqh; + + friend bool printLCP_FRAG_REP(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 7 ); + +private: + Uint32 nodeId; + Uint32 lcpId; + Uint32 lcpNo; + Uint32 tableId; + Uint32 fragId; + Uint32 maxGciCompleted; + Uint32 maxGciStarted; +}; + +class LcpCompleteRep { + /** + * Sender(s) and receiver(s) + */ + friend class Dbdih; + + /** + * Sender(s) + */ + friend class Dblqh; + + friend bool printLCP_COMPLETE_REP(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 3 ); + +private: + Uint32 nodeId; + Uint32 blockNo; + Uint32 lcpId; +}; + +struct LcpPrepareReq +{ + Uint32 senderData; + Uint32 senderRef; + Uint32 lcpNo; + Uint32 tableId; + Uint32 fragmentId; + Uint32 lcpId; + Uint32 backupPtr; + Uint32 backupId; + + STATIC_CONST( SignalLength = 8 ); +}; + +struct LcpPrepareRef +{ + Uint32 senderData; + Uint32 senderRef; + Uint32 tableId; + Uint32 fragmentId; + Uint32 errorCode; + + STATIC_CONST( SignalLength = 5 ); +}; + +struct LcpPrepareConf +{ + Uint32 senderData; + Uint32 senderRef; + Uint32 tableId; + Uint32 fragmentId; + + STATIC_CONST( SignalLength = 4 ); +}; + +struct EndLcpReq +{ + Uint32 senderData; + Uint32 senderRef; + Uint32 backupPtr; + Uint32 backupId; + + STATIC_CONST( SignalLength = 4 ); +}; + +struct EndLcpRef +{ + Uint32 senderData; + Uint32 senderRef; + Uint32 errorCode; + + STATIC_CONST( SignalLength = 3 ); +}; + +struct EndLcpConf +{ + Uint32 senderData; + Uint32 senderRef; + + STATIC_CONST( SignalLength = 2 ); +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/LgmanContinueB.hpp b/storage/ndb/include/kernel/signaldata/LgmanContinueB.hpp new file mode 100644 index 00000000000..b1d0f392817 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/LgmanContinueB.hpp @@ -0,0 +1,38 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef LGMAN_CONTINUEB_H +#define LGMAN_CONTINUEB_H + +#include "SignalData.hpp" + +struct LgmanContinueB { + + enum { + CUT_LOG_TAIL = 0 + ,FILTER_LOG = 1 + ,FLUSH_LOG = 2 + ,PROCESS_LOG_BUFFER_WAITERS = 3 + ,FIND_LOG_HEAD = 4 + ,EXECUTE_UNDO_RECORD = 5 + ,READ_UNDO_LOG = 6 + ,STOP_UNDO_LOG = 7 + ,PROCESS_LOG_SYNC_WAITERS = 8 + ,FORCE_LOG_SYNC = 9 + ,DROP_FILEGROUP = 10 + }; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/ListTables.hpp b/storage/ndb/include/kernel/signaldata/ListTables.hpp new file mode 100644 index 00000000000..75cad41d03a --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/ListTables.hpp @@ -0,0 +1,177 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef LIST_TABLES_HPP +#define LIST_TABLES_HPP + +#include <Bitmask.hpp> +#include "SignalData.hpp" + +/** + * It is convenient to pack request/response data per table in one + * 32-bit word... + */ +class ListTablesData { +public: + static Uint32 getTableId(Uint32 data) { + return BitmaskImpl::getField(1, &data, 0, 12); + } + static void setTableId(Uint32& data, Uint32 val) { + BitmaskImpl::setField(1, &data, 0, 12, val); + } + static Uint32 getTableType(Uint32 data) { + return BitmaskImpl::getField(1, &data, 12, 8); + } + static void setTableType(Uint32& data, Uint32 val) { + BitmaskImpl::setField(1, &data, 12, 8, val); + } + static Uint32 getTableStore(Uint32 data) { + return BitmaskImpl::getField(1, &data, 20, 3); + } + static void setTableStore(Uint32& data, Uint32 val) { + BitmaskImpl::setField(1, &data, 20, 3, val); + } + static Uint32 getTableTemp(Uint32 data) { + return BitmaskImpl::getField(1, &data, 23, 1); + } + static void setTableTemp(Uint32& data, Uint32 val) { + BitmaskImpl::setField(1, &data, 23, 1, val); + } + static Uint32 getTableState(Uint32 data) { + return BitmaskImpl::getField(1, &data, 24, 4); + } + static void setTableState(Uint32& data, Uint32 val) { + BitmaskImpl::setField(1, &data, 24, 4, val); + } + static Uint32 getListNames(Uint32 data) { + return BitmaskImpl::getField(1, &data, 28, 1); + } + static void setListNames(Uint32& data, Uint32 val) { + BitmaskImpl::setField(1, &data, 28, 1, val); + } + static Uint32 getListIndexes(Uint32 data) { + return BitmaskImpl::getField(1, &data, 29, 1); + } + static void setListIndexes(Uint32& data, Uint32 val) { + BitmaskImpl::setField(1, &data, 29, 1, val); + } +}; + +class ListTablesReq { + /** + * Sender(s) + */ + friend class Backup; + friend class Table; + friend class Suma; + + /** + * Reciver(s) + */ + friend class Dbdict; + +public: + STATIC_CONST( SignalLength = 3 ); + +public: + Uint32 senderData; + Uint32 senderRef; + Uint32 requestData; + + Uint32 getTableId() { + return ListTablesData::getTableId(requestData); + } + void setTableId(Uint32 val) { + ListTablesData::setTableId(requestData, val); + } + Uint32 getTableType() const { + return ListTablesData::getTableType(requestData); + } + void setTableType(Uint32 val) { + ListTablesData::setTableType(requestData, val); + } + Uint32 getListNames() const { + return ListTablesData::getListNames(requestData); + } + void setListNames(Uint32 val) { + ListTablesData::setListNames(requestData, val); + } + Uint32 getListIndexes() const { + return ListTablesData::getListIndexes(requestData); + } + void setListIndexes(Uint32 val) { + ListTablesData::setListIndexes(requestData, val); + } +}; + +class ListTablesConf { + /** + * Sender(s) + */ + friend class Dbdict; + + /** + * Reciver(s) + */ + friend class Backup; + friend class Table; + friend class Suma; + +public: + /** + * Note: last signal is indicated by having length < 25 + */ + STATIC_CONST( SignalLength = 25 ); + STATIC_CONST( HeaderLength = 2 ); + STATIC_CONST( DataLength = 23 ); + +public: + Uint32 senderData; + Uint32 counter; + Uint32 tableData[DataLength]; + + static Uint32 getTableId(Uint32 data) { + return ListTablesData::getTableId(data); + } + void setTableId(unsigned pos, Uint32 val) { + ListTablesData::setTableId(tableData[pos], val); + } + static Uint32 getTableType(Uint32 data) { + return ListTablesData::getTableType(data); + } + void setTableType(unsigned pos, Uint32 val) { + ListTablesData::setTableType(tableData[pos], val); + } + static Uint32 getTableStore(Uint32 data) { + return ListTablesData::getTableStore(data); + } + void setTableStore(unsigned pos, Uint32 val) { + ListTablesData::setTableStore(tableData[pos], val); + } + static Uint32 getTableState(Uint32 data) { + return ListTablesData::getTableState(data); + } + void setTableState(unsigned pos, Uint32 val) { + ListTablesData::setTableState(tableData[pos], val); + } + static Uint32 getTableTemp(Uint32 data) { + return ListTablesData::getTableTemp(data); + } + void setTableTemp(unsigned pos, Uint32 val) { + ListTablesData::setTableTemp(tableData[pos], val); + } +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/LqhFrag.hpp b/storage/ndb/include/kernel/signaldata/LqhFrag.hpp new file mode 100644 index 00000000000..40ed73ad2e7 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/LqhFrag.hpp @@ -0,0 +1,258 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef LQH_FRAG_HPP +#define LQH_FRAG_HPP + +#include "SignalData.hpp" + +class AddFragReq { + /** + * Sender(s) + */ + friend class Dbdih; + + /** + * Receiver(s) + */ + friend class Dbdict; + + friend bool printADD_FRAG_REQ(FILE *, const Uint32 *, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 11 ); + + enum RequestInfo { + CreateInRunning = 0x8000000, + TemporaryTable = 0x00000010 + }; +private: + Uint32 dihPtr; + Uint32 senderData; // The same data as sent in DIADDTABREQ + Uint32 fragmentId; + Uint32 requestInfo; + Uint32 tableId; + Uint32 nextLCP; + Uint32 nodeId; + Uint32 totalFragments; + Uint32 startGci; + Uint32 tablespaceId; + Uint32 logPartId; +}; + +class AddFragRef { + /** + * Sender(s) + */ + friend class Dbdict; + + /** + * Receiver(s) + */ + friend class Dbdih; + + friend bool printADD_FRAG_REF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 1 ); + +private: + Uint32 dihPtr; +}; + +class AddFragConf { + /** + * Sender(s) + */ + friend class Dbdict; + + /** + * Receiver(s) + */ + friend class Dbdih; + + friend bool printADD_FRAG_CONF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 2 ); + +private: + Uint32 dihPtr; + Uint32 fragId; +}; + +class LqhFragReq { + /** + * Sender(s) + */ + friend class Dbdict; + + /** + * Receiver(s) + */ + friend class Dblqh; + + friend bool printLQH_FRAG_REQ(FILE *, const Uint32 *, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 24 ); + + enum RequestInfo { + CreateInRunning = 0x8000000, + TemporaryTable = 0x00000010 + }; + +private: + Uint32 senderData; + Uint32 senderRef; + Uint32 fragmentId; + Uint32 requestInfo; + Uint32 maxLoadFactor; + Uint32 minLoadFactor; + Uint32 kValue; + Uint32 schemaVersion; + Uint32 nextLCP; + Uint32 noOfCharsets; + Uint32 startGci; + Uint32 tableType; // DictTabInfo::TableType + Uint32 primaryTableId; // table of index or RNIL + Uint32 tablespace_id; // RNIL for MM table + Uint16 tableId; + Uint16 localKeyLength; + Uint16 lh3DistrBits; + Uint16 lh3PageBits; + Uint16 noOfAttributes; + Uint16 noOfNullAttributes; + Uint16 noOfPagesToPreAllocate; + Uint16 keyLength; + Uint16 noOfKeyAttr; + Uint8 checksumIndicator; + Uint8 GCPIndicator; + Uint32 logPartId; + Uint32 maxRowsLow; + Uint32 maxRowsHigh; + Uint32 minRowsLow; + Uint32 minRowsHigh; +}; + +class LqhFragConf { + /** + * Sender(s) + */ + friend class Dblqh; + + /** + * Receiver(s) + */ + friend class Dbdict; + + friend bool printLQH_FRAG_CONF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 2 ); + +private: + Uint32 senderData; + Uint32 lqhFragPtr; +}; + +class LqhFragRef { + /** + * Sender(s) + */ + friend class Dblqh; + + /** + * Receiver(s) + */ + friend class Dbdict; + + friend bool printLQH_FRAG_REF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 2 ); + +private: + Uint32 senderData; + Uint32 errorCode; +}; + +class LqhAddAttrReq { + /** + * Sender(s) + */ + friend class Dbdict; + + /** + * Receiver(s) + */ + friend class Dblqh; + + friend bool printLQH_ADD_ATTR_REQ(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( HeaderLength = 4 ); + STATIC_CONST( EntryLength = 3 ); + STATIC_CONST( MAX_ATTRIBUTES = 6 ); + struct Entry { + Uint32 attrId; // for index, includes primary attr id << 16 + Uint32 attrDescriptor; // 2 words type info + Uint32 extTypeInfo; + }; +private: + Uint32 lqhFragPtr; + Uint32 noOfAttributes; + Uint32 senderData; + Uint32 senderAttrPtr; + Entry attributes[MAX_ATTRIBUTES]; +}; + +class LqhAddAttrRef { + /** + * Sender(s) + */ + friend class Dblqh; + + /** + * Receiver(s) + */ + friend class Dbdict; + + friend bool printLQH_ADD_ATTR_REF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 2 ); + +private: + Uint32 senderData; + Uint32 errorCode; +}; + +class LqhAddAttrConf { + /** + * Sender(s) + */ + friend class Dblqh; + + /** + * Receiver(s) + */ + friend class Dbdict; + + friend bool printLQH_ADD_ATTR_CONF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 3 ); + +private: + Uint32 senderData; + Uint32 senderAttrPtr; + Uint32 fragId; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/LqhKey.hpp b/storage/ndb/include/kernel/signaldata/LqhKey.hpp new file mode 100644 index 00000000000..15ed7c25395 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/LqhKey.hpp @@ -0,0 +1,611 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef LQH_KEY_H +#define LQH_KEY_H + +#include "SignalData.hpp" + +class LqhKeyReq { + /** + * Reciver(s) + */ + friend class Dblqh; // Reciver + + /** + * Sender(s) + */ + friend class Dbtc; + friend class Restore; + + /** + * For printing + */ + friend bool printLQHKEYREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); + +public: + STATIC_CONST( FixedSignalLength = 11 ); + +private: + + /** + * DATA VARIABLES + */ +//------------------------------------------------------------- +// Unconditional part. First 10 words +//------------------------------------------------------------- + UintR clientConnectPtr; // DATA 0 + UintR attrLen; // DATA 1 + UintR hashValue; // DATA 2 + UintR requestInfo; // DATA 3 + UintR tcBlockref; // DATA 4 + UintR tableSchemaVersion; // DATA 5 + UintR fragmentData; // DATA 6 + UintR transId1; // DATA 7 + UintR transId2; // DATA 8 + UintR savePointId; // DATA 9 + union { + /** + * When sent from TC -> LQH this variable contains scanInfo + * When send from LQH -> LQH this variable contains noFiredTriggers + */ + UintR noFiredTriggers; // DATA 10 + Uint32 scanInfo; // DATA 10 + }; + +//------------------------------------------------------------- +// Variable sized key part. Those will be placed to +// pack the signal in an appropriate manner. +//------------------------------------------------------------- + UintR variableData[10]; // DATA 11 - 21 + + static UintR getAttrLen(const UintR & scanInfoAttrLen); + static UintR getScanTakeOverFlag(const UintR & scanInfoAttrLen); + static UintR getStoredProcFlag(const UintR & scanData); + static UintR getDistributionKey(const UintR & scanData); + + static UintR getTableId(const UintR & tableSchemaVersion); + static UintR getSchemaVersion(const UintR & tableSchemaVersion); + + static UintR getFragmentId(const UintR & fragmentData); + static UintR getNextReplicaNodeId(const UintR & fragmentData); + + static Uint8 getLockType(const UintR & requestInfo); + static Uint8 getDirtyFlag(const UintR & requestInfo); + static Uint8 getInterpretedFlag(const UintR & requestInfo); + static Uint8 getSimpleFlag(const UintR & requestInfo); + static Uint8 getOperation(const UintR & requestInfo); + static Uint8 getSeqNoReplica(const UintR & requestInfo); + static Uint8 getLastReplicaNo(const UintR & requestInfo); + static Uint8 getAIInLqhKeyReq(const UintR & requestInfo); + static UintR getKeyLen(const UintR & requestInfo); + static UintR getSameClientAndTcFlag(const UintR & requestInfo); + static UintR getReturnedReadLenAIFlag(const UintR & requestInfo); + static UintR getApplicationAddressFlag(const UintR & requestInfo); + static UintR getMarkerFlag(const UintR & requestInfo); + static UintR getNoDiskFlag(const UintR & requestInfo); + + /** + * Setters + */ + + static void setAttrLen(UintR & scanInfoAttrLen, UintR val); + static void setScanTakeOverFlag(UintR & scanInfoAttrLen, UintR val); + static void setStoredProcFlag(UintR & scanData, UintR val); + static void setDistributionKey(UintR & scanData, UintR val); + + static void setTableId(UintR & tableSchemaVersion, UintR val); + static void setSchemaVersion(UintR & tableSchemaVersion, UintR val); + + static void setFragmentId(UintR & fragmentData, UintR val); + static void setNextReplicaNodeId(UintR & fragmentData, UintR val); + + static void setLockType(UintR & requestInfo, UintR val); + static void setDirtyFlag(UintR & requestInfo, UintR val); + static void setInterpretedFlag(UintR & requestInfo, UintR val); + static void setSimpleFlag(UintR & requestInfo, UintR val); + static void setOperation(UintR & requestInfo, UintR val); + static void setSeqNoReplica(UintR & requestInfo, UintR val); + static void setLastReplicaNo(UintR & requestInfo, UintR val); + static void setAIInLqhKeyReq(UintR & requestInfo, UintR val); + static void setKeyLen(UintR & requestInfo, UintR val); + static void setSameClientAndTcFlag(UintR & requestInfo, UintR val); + static void setReturnedReadLenAIFlag(UintR & requestInfo, UintR val); + static void setApplicationAddressFlag(UintR & requestInfo, UintR val); + static void setMarkerFlag(UintR & requestInfo, UintR val); + static void setNoDiskFlag(UintR & requestInfo, UintR val); + + static UintR getRowidFlag(const UintR & requestInfo); + static void setRowidFlag(UintR & requestInfo, UintR val); + + /** + * When doing DIRTY WRITES + */ + static UintR getGCIFlag(const UintR & requestInfo); + static void setGCIFlag(UintR & requestInfo, UintR val); + + static UintR getNrCopyFlag(const UintR & requestInfo); + static void setNrCopyFlag(UintR & requestInfo, UintR val); +}; + +/** + * Request Info + * + * k = Key len - 10 Bits (0-9) max 1023 + * l = Last Replica No - 2 Bits -> Max 3 (10-11) + + IF version < NDBD_ROWID_VERSION + * t = Lock type - 3 Bits -> Max 7 (12-14) + * p = Application Addr. Ind - 1 Bit (15) + * d = Dirty indicator - 1 Bit (16) + * i = Interpreted indicator - 1 Bit (17) + * s = Simple indicator - 1 Bit (18) + * o = Operation - 3 Bits (19-21) + * r = Sequence replica - 2 Bits (22-23) + * a = Attr Info in LQHKEYREQ - 3 Bits (24-26) + * c = Same client and tc - 1 Bit (27) + * u = Read Len Return Ind - 1 Bit (28) + * m = Commit ack marker - 1 Bit (29) + * x = No disk usage - 1 Bit (30) + * z = Use rowid for insert - 1 Bit (31) + * g = gci flag - 1 Bit (12) + * n = NR copy - 1 Bit (13) + + * 1111111111222222222233 + * 01234567890123456789012345678901 + * kkkkkkkkkklltttpdisooorraaacumxz + * kkkkkkkkkkllgn pdisooorraaacumxz + */ + +#define RI_KEYLEN_SHIFT (0) +#define RI_KEYLEN_MASK (1023) +#define RI_LAST_REPL_SHIFT (10) +#define RI_LAST_REPL_MASK (3) +#define RI_LOCK_TYPE_SHIFT (12) +#define RI_LOCK_TYPE_MASK (7) +#define RI_APPL_ADDR_SHIFT (15) +#define RI_DIRTY_SHIFT (16) +#define RI_INTERPRETED_SHIFT (17) +#define RI_SIMPLE_SHIFT (18) +#define RI_OPERATION_SHIFT (19) +#define RI_OPERATION_MASK (7) +#define RI_SEQ_REPLICA_SHIFT (22) +#define RI_SEQ_REPLICA_MASK (3) +#define RI_AI_IN_THIS_SHIFT (24) +#define RI_AI_IN_THIS_MASK (7) +#define RI_SAME_CLIENT_SHIFT (27) +#define RI_RETURN_AI_SHIFT (28) +#define RI_MARKER_SHIFT (29) +#define RI_NODISK_SHIFT (30) +#define RI_ROWID_SHIFT (31) +#define RI_GCI_SHIFT (12) +#define RI_NR_COPY_SHIFT (13) + +/** + * Scan Info + * + * a = Attr Len - 16 Bits -> max 65535 (0-15) + * p = Stored Procedure Ind - 1 Bit (16) + * d = Distribution key - 8 Bit -> max 255 (17-24) + * t = Scan take over indicator - 1 Bit (25) + * + * 1111111111222222222233 + * 01234567890123456789012345678901 + * aaaaaaaaaaaaaaaapddddddddt + */ + +#define SI_ATTR_LEN_MASK (65535) +#define SI_ATTR_LEN_SHIFT (0) +#define SI_STORED_PROC_SHIFT (16) +#define SI_DISTR_KEY_MASK (255) +#define SI_DISTR_KEY_SHIFT (17) +#define SI_SCAN_TO_SHIFT (25) +#define SI_SCAN_INFO_MASK (63) +#define SI_SCAN_INFO_SHIFT (26) + +inline +UintR +LqhKeyReq::getAttrLen(const UintR & scanData) +{ + return (scanData >> SI_ATTR_LEN_SHIFT) & SI_ATTR_LEN_MASK; +} + +inline +Uint32 +LqhKeyReq::getScanTakeOverFlag(const UintR & scanData) +{ + return (scanData >> SI_SCAN_TO_SHIFT) & 1; +} + +inline +UintR +LqhKeyReq::getStoredProcFlag(const UintR & scanData){ + return (scanData >> SI_STORED_PROC_SHIFT) & 1; +} + +inline +UintR +LqhKeyReq::getDistributionKey(const UintR & scanData){ + return (scanData >> SI_DISTR_KEY_SHIFT) & SI_DISTR_KEY_MASK; +} + +inline +UintR LqhKeyReq::getTableId(const UintR & tableSchemaVersion) +{ + return tableSchemaVersion & 0xFFFF; +} + +inline +UintR LqhKeyReq::getSchemaVersion(const UintR & tableSchemaVersion) +{ + return tableSchemaVersion >> 16; +} + +inline +UintR LqhKeyReq::getFragmentId(const UintR & fragmentData) +{ + return fragmentData & 0xFFFF; +} + +inline +UintR LqhKeyReq::getNextReplicaNodeId(const UintR & fragmentData) +{ + return fragmentData >> 16; +} + +inline +Uint8 LqhKeyReq::getLastReplicaNo(const UintR & requestInfo) +{ + return (requestInfo >> RI_LAST_REPL_SHIFT) & RI_LAST_REPL_MASK; +} + +inline +Uint8 LqhKeyReq::getLockType(const UintR & requestInfo) +{ + return (requestInfo >> RI_LOCK_TYPE_SHIFT) & RI_LOCK_TYPE_MASK; +} + +inline +Uint8 LqhKeyReq::getDirtyFlag(const UintR & requestInfo) +{ + return (requestInfo >> RI_DIRTY_SHIFT) & 1; +} + +inline +Uint8 LqhKeyReq::getInterpretedFlag(const UintR & requestInfo) +{ + return (requestInfo >> RI_INTERPRETED_SHIFT) & 1; +} + +inline +Uint8 LqhKeyReq::getSimpleFlag(const UintR & requestInfo) +{ + return (requestInfo >> RI_SIMPLE_SHIFT) & 1; +} + +inline +Uint8 LqhKeyReq::getOperation(const UintR & requestInfo) +{ + return (requestInfo >> RI_OPERATION_SHIFT) & RI_OPERATION_MASK; +} + +inline +Uint8 LqhKeyReq::getSeqNoReplica(const UintR & requestInfo) +{ + return (requestInfo >> RI_SEQ_REPLICA_SHIFT) & RI_SEQ_REPLICA_MASK; +} + + +inline +Uint8 LqhKeyReq::getAIInLqhKeyReq(const UintR & requestInfo) +{ + return (requestInfo >> RI_AI_IN_THIS_SHIFT) & RI_AI_IN_THIS_MASK; +} + +inline +UintR LqhKeyReq::getKeyLen(const UintR & requestInfo) +{ + return (requestInfo >> RI_KEYLEN_SHIFT) & RI_KEYLEN_MASK; +} + +inline +UintR +LqhKeyReq::getSameClientAndTcFlag(const UintR & requestInfo) +{ + return (requestInfo >> RI_SAME_CLIENT_SHIFT) & 1; +} + +inline +UintR LqhKeyReq::getReturnedReadLenAIFlag(const UintR & requestInfo) +{ + return (requestInfo >> RI_RETURN_AI_SHIFT) & 1; +} + +inline +UintR +LqhKeyReq::getApplicationAddressFlag(const UintR & requestInfo){ + return (requestInfo >> RI_APPL_ADDR_SHIFT) & 1; +} + +inline +void +LqhKeyReq::setAttrLen(UintR & scanInfoAttrLen, UintR val){ + ASSERT_MAX(val, SI_ATTR_LEN_MASK, "LqhKeyReq::setAttrLen"); + scanInfoAttrLen |= (val << SI_ATTR_LEN_SHIFT); +} + + +inline +void +LqhKeyReq::setScanTakeOverFlag(UintR & scanInfoAttrLen, UintR val){ + ASSERT_BOOL(val, "LqhKeyReq::setScanTakeOverFlag"); + scanInfoAttrLen |= (val << SI_SCAN_TO_SHIFT); +} +inline +void + +LqhKeyReq::setStoredProcFlag(UintR & scanData, UintR val){ + ASSERT_BOOL(val, "LqhKeyReq::setStoredProcFlag"); + scanData |= (val << SI_STORED_PROC_SHIFT); +} + +inline +void + +LqhKeyReq::setDistributionKey(UintR & scanData, UintR val){ + ASSERT_MAX(val, SI_DISTR_KEY_MASK, "LqhKeyReq::setDistributionKey"); + scanData |= (val << SI_DISTR_KEY_SHIFT); +} + +#if 0 +inline +void + +LqhKeyReq::setTableId(UintR & tableSchemaVersion, UintR val){ + +} +inline +void +LqhKeyReq::setSchemaVersion(UintR & tableSchemaVersion, UintR val); + +inline +void +LqhKeyReq::setFragmentId(UintR & fragmentData, UintR val); + +inline +void +LqhKeyReq::setNextReplicaNodeId(UintR & fragmentData, UintR val); +#endif + +inline +void +LqhKeyReq::setLockType(UintR & requestInfo, UintR val){ + ASSERT_MAX(val, RI_LOCK_TYPE_MASK, "LqhKeyReq::setLockType"); + requestInfo |= (val << RI_LOCK_TYPE_SHIFT); +} + +inline +void +LqhKeyReq::setDirtyFlag(UintR & requestInfo, UintR val){ + ASSERT_BOOL(val, "LqhKeyReq::setDirtyFlag"); + requestInfo |= (val << RI_DIRTY_SHIFT); +} + +inline +void +LqhKeyReq::setInterpretedFlag(UintR & requestInfo, UintR val){ + ASSERT_BOOL(val, "LqhKeyReq::setInterpretedFlag"); + requestInfo |= (val << RI_INTERPRETED_SHIFT); +} + +inline +void +LqhKeyReq::setSimpleFlag(UintR & requestInfo, UintR val){ + ASSERT_BOOL(val, "LqhKeyReq::setSimpleFlag"); + requestInfo |= (val << RI_SIMPLE_SHIFT); +} + +inline +void +LqhKeyReq::setOperation(UintR & requestInfo, UintR val){ + ASSERT_MAX(val, RI_OPERATION_MASK, "LqhKeyReq::setOperation"); + requestInfo |= (val << RI_OPERATION_SHIFT); +} + +inline +void +LqhKeyReq::setSeqNoReplica(UintR & requestInfo, UintR val){ + ASSERT_MAX(val, RI_SEQ_REPLICA_MASK, "LqhKeyReq::setSeqNoReplica"); + requestInfo |= (val << RI_SEQ_REPLICA_SHIFT); +} + +inline +void +LqhKeyReq::setLastReplicaNo(UintR & requestInfo, UintR val){ + ASSERT_MAX(val, RI_LAST_REPL_MASK, "LqhKeyReq::setLastReplicaNo"); + requestInfo |= (val << RI_LAST_REPL_SHIFT); +} + +inline +void +LqhKeyReq::setAIInLqhKeyReq(UintR & requestInfo, UintR val){ + ASSERT_MAX(val, RI_AI_IN_THIS_MASK, "LqhKeyReq::setAIInLqhKeyReq"); + requestInfo |= (val << RI_AI_IN_THIS_SHIFT); +} + +inline +void +LqhKeyReq::setKeyLen(UintR & requestInfo, UintR val){ + ASSERT_MAX(val, RI_KEYLEN_MASK, "LqhKeyReq::setKeyLen"); + requestInfo |= (val << RI_KEYLEN_SHIFT); +} + +inline +void +LqhKeyReq::setSameClientAndTcFlag(UintR & requestInfo, UintR val){ + ASSERT_BOOL(val, "LqhKeyReq::setSameClientAndTcFlag"); + requestInfo |= (val << RI_SAME_CLIENT_SHIFT); +} + +inline +void +LqhKeyReq::setReturnedReadLenAIFlag(UintR & requestInfo, UintR val){ + ASSERT_BOOL(val, "LqhKeyReq::setReturnedReadLenAIFlag"); + requestInfo |= (val << RI_RETURN_AI_SHIFT); +} + +inline +void +LqhKeyReq::setApplicationAddressFlag(UintR & requestInfo, UintR val){ + ASSERT_BOOL(val, "LqhKeyReq::setApplicationAddressFlag"); + requestInfo |= (val << RI_APPL_ADDR_SHIFT); +} + +/**** */ + +inline +void +LqhKeyReq::setMarkerFlag(UintR & requestInfo, UintR val){ + ASSERT_BOOL(val, "LqhKeyReq::setMarkerFlag"); + requestInfo |= (val << RI_MARKER_SHIFT); +} + +inline +UintR +LqhKeyReq::getMarkerFlag(const UintR & requestInfo){ + return (requestInfo >> RI_MARKER_SHIFT) & 1; +} + +inline +void +LqhKeyReq::setNoDiskFlag(UintR & requestInfo, UintR val){ + ASSERT_BOOL(val, "LqhKeyReq::setNoDiskFlag"); + requestInfo |= (val << RI_NODISK_SHIFT); +} + +inline +UintR +LqhKeyReq::getNoDiskFlag(const UintR & requestInfo){ + return (requestInfo >> RI_NODISK_SHIFT) & 1; +} + +inline +void +LqhKeyReq::setRowidFlag(UintR & requestInfo, UintR val){ + ASSERT_BOOL(val, "LqhKeyReq::setRowidFlag"); + requestInfo |= (val << RI_ROWID_SHIFT); +} + +inline +UintR +LqhKeyReq::getRowidFlag(const UintR & requestInfo){ + return (requestInfo >> RI_ROWID_SHIFT) & 1; +} + +inline +void +LqhKeyReq::setGCIFlag(UintR & requestInfo, UintR val){ + ASSERT_BOOL(val, "LqhKeyReq::setGciFlag"); + requestInfo |= (val << RI_GCI_SHIFT); +} + +inline +UintR +LqhKeyReq::getGCIFlag(const UintR & requestInfo){ + return (requestInfo >> RI_GCI_SHIFT) & 1; +} + +inline +void +LqhKeyReq::setNrCopyFlag(UintR & requestInfo, UintR val){ + ASSERT_BOOL(val, "LqhKeyReq::setNrCopyFlag"); + requestInfo |= (val << RI_NR_COPY_SHIFT); +} + +inline +UintR +LqhKeyReq::getNrCopyFlag(const UintR & requestInfo){ + return (requestInfo >> RI_NR_COPY_SHIFT) & 1; +} + +class LqhKeyConf { + /** + * Reciver(s) + */ + friend class Dbtc; + friend class Restore; + + /** + * Sender(s) + */ + friend class Dblqh; + + // Sent in a packed signal + friend class PackedSignal; + /** + * For printing + */ + friend bool printPACKED_SIGNAL(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); + friend bool printLQHKEYCONF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); + +public: + STATIC_CONST( SignalLength = 7 ); + +private: + + /** + * DATA VARIABLES + */ + Uint32 connectPtr; + Uint32 opPtr; + Uint32 userRef; + Uint32 readLen; + Uint32 transId1; + Uint32 transId2; + Uint32 noFiredTriggers; +}; + +class LqhKeyRef { + /** + * Reciver(s) + */ + friend class Dbtc; + + /** + * Sender(s) + */ + friend class Dblqh; + + /** + * For printing + */ + friend bool printLQHKEYREF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); + +public: + STATIC_CONST( SignalLength = 5 ); + +private: + + /** + * DATA VARIABLES + */ + Uint32 userRef; + Uint32 connectPtr; + Uint32 errorCode; + Uint32 transId1; + Uint32 transId2; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/LqhSizeAltReq.hpp b/storage/ndb/include/kernel/signaldata/LqhSizeAltReq.hpp new file mode 100644 index 00000000000..109f7343678 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/LqhSizeAltReq.hpp @@ -0,0 +1,52 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef LQH_SIZE_ALT_REQ_H +#define LQH_SIZE_ALT_REQ_H + + + +#include "SignalData.hpp" + +class LqhSizeAltReq { + /** + * Sender(s) + */ + friend class ClusterConfiguration; + + /** + * Reciver(s) + */ + friend class Dblqh; +private: + /** + * Indexes in theData + */ + STATIC_CONST( IND_BLOCK_REF = 0); + STATIC_CONST( IND_FRAG = 1); + STATIC_CONST( IND_CONNECT = 2); + STATIC_CONST( IND_TABLE = 3); + STATIC_CONST( IND_TC_CONNECT = 4); + STATIC_CONST( IND_REPLICAS = 5); + STATIC_CONST( IND_LOG_FILES = 6); + STATIC_CONST( IND_SCAN = 7); + + /** + * Use the index definitions to use the signal data + */ + UintR theData[8]; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/LqhTransConf.hpp b/storage/ndb/include/kernel/signaldata/LqhTransConf.hpp new file mode 100644 index 00000000000..4a72d344ad6 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/LqhTransConf.hpp @@ -0,0 +1,217 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef LQH_TRANS_CONF_H +#define LQH_TRANS_CONF_H + +#include "SignalData.hpp" + +/** + * This signal is sent as response to a LQH_TRANSREQ + * which is sent as by a take-over TC + */ +class LqhTransConf { + /** + * Reciver(s) + */ + friend class Dbtc; + + /** + * Sender(s) + */ + friend class Dblqh; + + friend bool printLQH_TRANSCONF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 15 ); +private: + + /** + * This type describes the state of the operation returned in this signal + */ + enum OperationStatus { + InvalidStatus = 0, /**< This status should never be sent in a signal + it is only used for initializing variables so that + you can easily later check if they have changed */ + LastTransConf = 4, /**< This status indicates that LQH has finished the scan + of operations belonging to the died TC. + Data 0 - 2 is valid */ + + Prepared = 2, + Committed = 3, + Aborted = 1, + Marker = 5 /**< This means that the only thing left is a marker, + Data 0 - 6 is valid */ + }; + + /** + * DATA VARIABLES + */ + Uint32 tcRef; // 0 + Uint32 lqhNodeId; // 1 + Uint32 operationStatus; // 2 See enum OperationStatus + Uint32 transId1; // 3 + Uint32 transId2; // 4 + Uint32 apiRef; // 5 + Uint32 apiOpRec; // 6 + Uint32 lqhConnectPtr; + Uint32 oldTcOpRec; + Uint32 requestInfo; + Uint32 gci; + Uint32 nextNodeId1; + Uint32 nextNodeId2; + Uint32 nextNodeId3; + Uint32 tableId; + + /** + * Getters + */ + static Uint32 getReplicaNo(Uint32 & requestInfo); + static Uint32 getReplicaType(Uint32 & requestInfo); + static Uint32 getLastReplicaNo(Uint32 & requestInfo); + static Uint32 getSimpleFlag(Uint32 & requestInfo); + static Uint32 getDirtyFlag(Uint32 & requestInfo); + static Uint32 getOperation(Uint32 & requestInfo); + static Uint32 getMarkerFlag(Uint32 & requestInfo); + + static void setReplicaNo(UintR & requestInfo, UintR val); + static void setReplicaType(UintR & requestInfo, UintR val); + static void setLastReplicaNo(UintR & requestInfo, UintR val); + static void setSimpleFlag(UintR & requestInfo, UintR val); + static void setDirtyFlag(UintR & requestInfo, UintR val); + static void setOperation(UintR & requestInfo, UintR val); + static void setMarkerFlag(Uint32 & requestInfo, Uint32 val); +}; + +/** + * Request Info + * + * t = replica type - 2 Bits (0-1) + * r = Replica No - 2 Bits (2-3) + * l = Last Replica No - 2 Bits (4-5) + * s = Simple - 1 Bits (6) + * d = Dirty - 1 Bit (7) + * o = Operation - 3 Bit (8-9) + * m = Marker present - 1 Bit (10) + * + * 1111111111222222222233 + * 01234567890123456789012345678901 + * ttrrllsdooom + */ +#define LTC_REPLICA_TYPE_SHIFT (0) +#define LTC_REPLICA_TYPE_MASK (3) +#define LTC_REPLICA_NO_SHIFT (2) +#define LTC_REPLICA_NO_MASK (3) +#define LTC_LAST_REPLICA_SHIFT (4) +#define LTC_LAST_REPLICA_MASK (3) +#define LTC_SIMPLE_SHIFT (6) +#define LTC_DIRTY_SHIFT (7) +#define LTC_OPERATION_SHIFT (8) +#define LTC_OPERATION_MASK (7) +#define LTC_MARKER_SHIFT (10) + +inline +Uint32 +LqhTransConf::getReplicaType(Uint32 & requestInfo){ + return (requestInfo >> LTC_REPLICA_TYPE_SHIFT) & LTC_REPLICA_TYPE_MASK; +} + +inline +Uint32 +LqhTransConf::getReplicaNo(Uint32 & requestInfo){ + return (requestInfo >> LTC_REPLICA_NO_SHIFT) & LTC_REPLICA_NO_MASK; +} + +inline +Uint32 +LqhTransConf::getLastReplicaNo(Uint32 & requestInfo){ + return (requestInfo >> LTC_LAST_REPLICA_SHIFT) & LTC_LAST_REPLICA_MASK; +} + +inline +Uint32 +LqhTransConf::getSimpleFlag(Uint32 & requestInfo){ + return (requestInfo >> LTC_SIMPLE_SHIFT) & 1; +} + +inline +Uint32 +LqhTransConf::getDirtyFlag(Uint32 & requestInfo){ + return (requestInfo >> LTC_DIRTY_SHIFT) & 1; +} + +inline +Uint32 +LqhTransConf::getOperation(Uint32 & requestInfo){ + return (requestInfo >> LTC_OPERATION_SHIFT) & LTC_OPERATION_MASK; +} + +inline +Uint32 +LqhTransConf::getMarkerFlag(Uint32 & requestInfo){ + return (requestInfo >> LTC_MARKER_SHIFT) & 1; +} + + +inline +void +LqhTransConf::setReplicaNo(UintR & requestInfo, UintR val){ + ASSERT_MAX(val, LTC_REPLICA_NO_MASK, "LqhTransConf::setReplicaNo"); + requestInfo |= (val << LTC_REPLICA_NO_SHIFT); +} + +inline +void +LqhTransConf::setReplicaType(UintR & requestInfo, UintR val){ + ASSERT_MAX(val, LTC_REPLICA_TYPE_MASK, "LqhTransConf::setReplicaType"); + requestInfo |= (val << LTC_REPLICA_TYPE_SHIFT); +} + +inline +void +LqhTransConf::setLastReplicaNo(UintR & requestInfo, UintR val){ + ASSERT_MAX(val, LTC_LAST_REPLICA_MASK, "LqhTransConf::setLastReplicaNo"); + requestInfo |= (val << LTC_LAST_REPLICA_SHIFT); +} + +inline +void +LqhTransConf::setSimpleFlag(UintR & requestInfo, UintR val){ + ASSERT_BOOL(val, "LqhTransConf::setSimpleFlag"); + requestInfo |= (val << LTC_SIMPLE_SHIFT); +} + +inline +void +LqhTransConf::setDirtyFlag(UintR & requestInfo, UintR val){ + ASSERT_BOOL(val, "LqhTransConf::setDirtyFlag"); + requestInfo |= (val << LTC_DIRTY_SHIFT); +} + +inline +void +LqhTransConf::setOperation(UintR & requestInfo, UintR val){ + ASSERT_MAX(val, LTC_OPERATION_MASK, "LqhTransConf::setOperation"); + requestInfo |= (val << LTC_OPERATION_SHIFT); +} + +inline +void +LqhTransConf::setMarkerFlag(UintR & requestInfo, UintR val){ + ASSERT_BOOL(val, "LqhTransConf::setMarkerFlag"); + requestInfo |= (val << LTC_MARKER_SHIFT); +} + +#endif diff --git a/storage/ndb/include/kernel/signaldata/ManagementServer.hpp b/storage/ndb/include/kernel/signaldata/ManagementServer.hpp new file mode 100644 index 00000000000..c97a252d638 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/ManagementServer.hpp @@ -0,0 +1,86 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef MANAGEMENTSERVER_HPP +#define MANAGEMENTSERVER_HPP + +#include "SignalData.hpp" + +/** + * Request to lock configuration + */ +class MgmLockConfigReq { + friend class MgmtSrvr; + +public: + STATIC_CONST( SignalLength = 1 ); + +private: + Uint32 newConfigGeneration; +}; + +/** + * Confirm configuration lock + */ +class MgmLockConfigRep { + friend class MgmtSrvr; +public: + STATIC_CONST( SignalLength = 1 ); + + /* Error codes */ + enum ErrorCode { + OK, + UNKNOWN_ERROR, + GENERATION_MISMATCH, + ALREADY_LOCKED + }; + +private: + Uint32 errorCode; +}; + +/** + * Unlock configuration + */ +class MgmUnlockConfigReq { + friend class MgmtSrvr; + +public: + STATIC_CONST( SignalLength = 1 ); + +private: + Uint32 commitConfig; +}; + +/** + * Confirm config unlock + */ +class MgmUnlockConfigRep { + friend class MgmtSrvr; +public: + STATIC_CONST( SignalLength = 1 ); + + /* Error codes */ + enum ErrorCode { + OK, + UNKNOWN_ERROR, + NOT_LOCKED + }; + +private: + Uint32 errorCode; +}; + +#endif /* !MANAGEMENTSERVER_HPP */ diff --git a/storage/ndb/include/kernel/signaldata/MasterGCP.hpp b/storage/ndb/include/kernel/signaldata/MasterGCP.hpp new file mode 100644 index 00000000000..683a1ac869f --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/MasterGCP.hpp @@ -0,0 +1,83 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef MASTER_GCP_HPP +#define MASTER_GCP_HPP + +#include <NodeBitmask.hpp> + +/** + * + */ +class MasterGCPConf { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdih; + +public: + STATIC_CONST( SignalLength = 8 + NdbNodeBitmask::Size ); + + enum State { + GCP_READY = 0, + GCP_PREPARE_RECEIVED = 1, + GCP_COMMIT_RECEIVED = 2, + GCP_TC_FINISHED = 3 + }; +private: + /** + * Data replied + */ + Uint32 gcpState; + Uint32 senderNodeId; + Uint32 failedNodeId; + Uint32 newGCP; + Uint32 latestLCP; + Uint32 oldestRestorableGCI; + Uint32 keepGCI; + Uint32 lcpActive[NdbNodeBitmask::Size]; +}; +/** + * + */ +class MasterGCPReq { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdih; + +public: + STATIC_CONST( SignalLength = 2 ); +private: + Uint32 masterRef; + Uint32 failedNodeId; +}; + +/** + * + */ +class MasterGCPRef { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdih; + +public: + STATIC_CONST( SignalLength = 2 ); +private: + Uint32 senderNodeId; + Uint32 failedNodeId; +}; +#endif diff --git a/storage/ndb/include/kernel/signaldata/MasterLCP.hpp b/storage/ndb/include/kernel/signaldata/MasterLCP.hpp new file mode 100644 index 00000000000..b9fbff2313d --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/MasterLCP.hpp @@ -0,0 +1,85 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef MASTER_LCP_HPP +#define MASTER_LCP_HPP + +#include <NdbOut.hpp> +#include "SignalData.hpp" + +/** + * + */ +class MasterLCPConf { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdih; + + friend bool printMASTER_LCP_CONF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 3 ); + + enum State { + LCP_STATUS_IDLE = 0, + LCP_STATUS_ACTIVE = 2, + LCP_TAB_COMPLETED = 8, + LCP_TAB_SAVED = 9 + }; + + friend NdbOut& operator<<(NdbOut&, const State&); + +private: + /** + * Data replied + */ + Uint32 senderNodeId; + Uint32 lcpState; + Uint32 failedNodeId; +}; +/** + * + */ +class MasterLCPReq { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdih; + + friend bool printMASTER_LCP_REQ(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 2 ); +private: + Uint32 masterRef; + Uint32 failedNodeId; +}; + +class MasterLCPRef { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdih; + + friend bool printMASTER_LCP_REF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 2 ); +private: + /** + * Data replied + */ + Uint32 senderNodeId; + Uint32 failedNodeId; +}; +#endif diff --git a/storage/ndb/include/kernel/signaldata/NFCompleteRep.hpp b/storage/ndb/include/kernel/signaldata/NFCompleteRep.hpp new file mode 100644 index 00000000000..18b201021b5 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/NFCompleteRep.hpp @@ -0,0 +1,63 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef NF_COMPLETE_REP_HPP +#define NF_COMPLETE_REP_HPP + +#include "SignalData.hpp" + +/** + * NFCompleteRep - Node Fail Complete Report + * + * This signal is sent by a block(or a node) + * when it has finished cleaning up after a node failure. + * + * It's also sent from Qmgr to the clusterMgr in API + * to tell the API that it can now abort all transactions still waiting for response + * from the failed NDB node + * + */ +struct NFCompleteRep { + + friend bool printNF_COMPLETE_REP(FILE *, const Uint32 *, Uint32, Uint16); + + STATIC_CONST( SignalLength = 5 ); + + /** + * Which block has completed... + * + * NOTE: 0 means the node has completed + */ + Uint32 blockNo; + + /** + * Which node has completed... + */ + Uint32 nodeId; + + /** + * Which node has failed + */ + Uint32 failedNodeId; + + /** + * Is this the original message or a delayed variant. + */ + Uint32 unused; // originalMessage + + Uint32 from; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/NdbSttor.hpp b/storage/ndb/include/kernel/signaldata/NdbSttor.hpp new file mode 100644 index 00000000000..e5e5dfb829c --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/NdbSttor.hpp @@ -0,0 +1,84 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef NDB_STTOR_HPP +#define NDB_STTOR_HPP + +#include "SignalData.hpp" + +class NdbSttor { + /** + * Sender(s) + */ + friend class NdbCntr; + + /** + * Reciver(s) + */ + friend class Ndbcntr; + friend class Dbdict; + friend class Dbdih; + friend class Dblqh; + friend class Dbtc; + friend class ClusterMgr; + friend class Trix; + friend class Backup; + friend class Suma; + friend class Grep; + + friend bool printNDB_STTOR(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 5 ); + STATIC_CONST( DataLength = 16 ); +private: + + Uint32 senderRef; + Uint32 nodeId; + Uint32 internalStartPhase; + Uint32 typeOfStart; + Uint32 masterNodeId; + Uint32 unused; + Uint32 config[DataLength]; +}; + +class NdbSttorry { + /** + * Receiver(s) + */ + friend class NdbCntr; + + /** + * Sender(s) + */ + friend class Ndbcntr; + friend class Dbdict; + friend class Dbdih; + friend class Dblqh; + friend class Dbtc; + friend class ClusterMgr; + friend class Trix; + friend class Backup; + friend class Suma; + friend class Grep; + + friend bool printNDB_STTORRY(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 1 ); +private: + + Uint32 senderRef; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/NdbfsContinueB.hpp b/storage/ndb/include/kernel/signaldata/NdbfsContinueB.hpp new file mode 100644 index 00000000000..22e6e8e3e0b --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/NdbfsContinueB.hpp @@ -0,0 +1,35 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef NDBFS_CONTINUEB_H +#define NDBFS_CONTINUEB_H + +#include "SignalData.hpp" + +class NdbfsContinueB { + /** + * Sender(s)/Reciver(s) + */ + friend class Ndbfs; + friend bool printCONTINUEB_NDBFS(FILE * output, const Uint32 * theData, + Uint32 len, Uint16); +private: + enum { + ZSCAN_MEMORYCHANNEL_10MS_DELAY = 0, + ZSCAN_MEMORYCHANNEL_NO_DELAY = 1 + }; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/NextScan.hpp b/storage/ndb/include/kernel/signaldata/NextScan.hpp new file mode 100644 index 00000000000..3cc227785b4 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/NextScan.hpp @@ -0,0 +1,59 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef NEXT_SCAN_HPP +#define NEXT_SCAN_HPP + +#include "SignalData.hpp" + +class NextScanReq { + friend class Dblqh; + friend class Dbacc; + friend class Dbtux; + friend class Dbtup; +public: + // two sets of defs picked from lqh/acc + enum ScanFlag { + ZSCAN_NEXT = 1, + ZSCAN_NEXT_COMMIT = 2, + ZSCAN_COMMIT = 3, // new + ZSCAN_CLOSE = 6, + ZSCAN_NEXT_ABORT = 12 + }; + STATIC_CONST( SignalLength = 3 ); +private: + Uint32 accPtr; // scan record in ACC/TUX + Uint32 accOperationPtr; + Uint32 scanFlag; +}; + +class NextScanConf { + friend class Dbacc; + friend class Dbtux; + friend class Dbtup; + friend class Dblqh; +public: + // length is less if no keyinfo or no next result + STATIC_CONST( SignalLength = 11 ); +private: + Uint32 scanPtr; // scan record in LQH + Uint32 accOperationPtr; + Uint32 fragId; + Uint32 localKey[2]; + Uint32 localKeyLength; + Uint32 gci; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/NodeFailRep.hpp b/storage/ndb/include/kernel/signaldata/NodeFailRep.hpp new file mode 100644 index 00000000000..a7c55e8fff1 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/NodeFailRep.hpp @@ -0,0 +1,41 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef NODE_FAILREP_HPP +#define NODE_FAILREP_HPP + +#include "SignalData.hpp" +#include <NodeBitmask.hpp> + +/** + * This signals is sent by Qmgr to NdbCntr + * and then from NdbCntr sent to: dih, dict, lqh, tc & API + */ +struct NodeFailRep { + STATIC_CONST( SignalLength = 3 + NodeBitmask::Size ); + + Uint32 failNo; + + /** + * Note: This field is only set when signals is sent FROM Ndbcntr + * (not when signal is sent from Qmgr) + */ + Uint32 masterNodeId; + + Uint32 noOfNodes; + Uint32 theNodes[NodeBitmask::Size]; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/NodeStateSignalData.hpp b/storage/ndb/include/kernel/signaldata/NodeStateSignalData.hpp new file mode 100644 index 00000000000..0c15f3f968b --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/NodeStateSignalData.hpp @@ -0,0 +1,93 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef NODE_STATE_SIGNAL_DATA_HPP +#define NODE_STATE_SIGNAL_DATA_HPP + +#include <NodeState.hpp> + +/** + * NodeStateRep + * + * Sent so that all blocks will update their NodeState + */ +class NodeStateRep { + /** + * Sender(s) + */ + friend class Ndbcntr; + + /** + * Reciver + */ + friend class SimulatedBlock; + +public: + STATIC_CONST( SignalLength = NodeState::DataLength ); +private: + + NodeState nodeState; +}; + +/** + * ChangeNodeStateReq + * + * Sent by NdbCntr when synchronous NodeState updates are needed + */ +class ChangeNodeStateReq { + /** + * Sender(s) + */ + friend class Ndbcntr; + + /** + * Reciver + */ + friend class SimulatedBlock; + +public: + STATIC_CONST( SignalLength = 2 + NodeState::DataLength ); +public: + + Uint32 senderRef; + Uint32 senderData; + NodeState nodeState; +}; + +/** + * ChangeNodeStateConf + * + * Sent by SimulatedBlock as a confirmation to ChangeNodeStateReq + */ +class ChangeNodeStateConf { + /** + * Sender(s) + */ + friend class SimulatedBlock; + + /** + * Reciver + */ + friend class NdbCntr; + +public: + STATIC_CONST( SignalLength = 1 ); +private: + + Uint32 senderData; +}; + + +#endif diff --git a/storage/ndb/include/kernel/signaldata/PackedSignal.hpp b/storage/ndb/include/kernel/signaldata/PackedSignal.hpp new file mode 100644 index 00000000000..50f9517b1c8 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/PackedSignal.hpp @@ -0,0 +1,42 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef PACKED_SIGNAL_HPP +#define PACKED_SIGNAL_HPP + +#include "SignalData.hpp" + +// -------- CODES FOR COMPRESSED SIGNAL (PACKED_SIGNAL) ------- +#define ZCOMMIT 0 +#define ZCOMPLETE 1 +#define ZCOMMITTED 2 +#define ZCOMPLETED 3 +#define ZLQHKEYCONF 4 +#define ZREMOVE_MARKER 5 + +class PackedSignal { + + static Uint32 getSignalType(Uint32 data); + + /** + * For printing + */ + friend bool printPACKED_SIGNAL(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); +}; + +inline +Uint32 PackedSignal::getSignalType(Uint32 data) { return data >> 28; } + +#endif diff --git a/storage/ndb/include/kernel/signaldata/PgmanContinueB.hpp b/storage/ndb/include/kernel/signaldata/PgmanContinueB.hpp new file mode 100644 index 00000000000..2cb89360a75 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/PgmanContinueB.hpp @@ -0,0 +1,36 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef PGMAN_CONTINUEB_H +#define PGMAN_CONTINUEB_H + +#include "SignalData.hpp" + +class PgmanContinueB { + /** + * Sender(s)/Reciver(s) + */ + friend class Pgman; +private: + enum { + STATS_LOOP = 0, + BUSY_LOOP = 1, + CLEANUP_LOOP = 2, + LCP_LOOP = 3, + LCP_LOCKED = 4 + }; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/PrepDropTab.hpp b/storage/ndb/include/kernel/signaldata/PrepDropTab.hpp new file mode 100644 index 00000000000..9fed2f287d2 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/PrepDropTab.hpp @@ -0,0 +1,171 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef PREP_DROP_TAB_HPP +#define PREP_DROP_TAB_HPP + +#include "SignalData.hpp" + +class PrepDropTabReq { + /** + * Sender(s) + */ + friend class Dbdict; + + /** + * Receiver(s) + */ + friend class Dbtc; + friend class Dblqh; + friend class Dbdih; + + friend bool printPREP_DROP_TAB_REQ(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 4 ); + +private: + Uint32 senderRef; + Uint32 senderData; + Uint32 tableId; + Uint32 requestType; // @see DropTabReq::RequestType +}; + +class PrepDropTabConf { + /** + * Sender(s) + */ + friend class Dbtc; + friend class Dblqh; + friend class Dbdih; + + /** + * Receiver(s) + */ + friend class Dbdict; + + friend bool printPREP_DROP_TAB_CONF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 3 ); + +private: + Uint32 senderRef; + Uint32 senderData; + Uint32 tableId; +}; + +class PrepDropTabRef { + /** + * Sender(s) + */ + friend class Dbtc; + friend class Dblqh; + friend class Dbdih; + + /** + * Receiver(s) + */ + friend class Dbdict; + + friend bool printPREP_DROP_TAB_REF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 4 ); + + enum ErrorCode { + OK = 0, + NoSuchTable = 1, + PrepDropInProgress = 2, + DropInProgress = 3, + InvalidTableState = 4, + NF_FakeErrorREF = 5 + }; + +private: + Uint32 senderRef; + Uint32 senderData; + Uint32 tableId; + Uint32 errorCode; +}; + +class WaitDropTabReq { + /** + * Sender + */ + friend class Dbtc; + friend class Dbdih; + + /** + * Receiver(s) + */ + friend class Dblqh; + + friend bool printWAIT_DROP_TAB_REQ(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 2 ); + + Uint32 tableId; + Uint32 senderRef; +}; + +class WaitDropTabRef { + /** + * Sender + */ + friend class Dblqh; + + /** + * Receiver(s) + */ + friend class Dbtc; + friend class Dbdih; + + friend bool printWAIT_DROP_TAB_REF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 4 ); + + enum ErrorCode { + NoSuchTable = 1, + IllegalTableState = 2, + DropInProgress = 3, + NF_FakeErrorREF = 4 + }; + + Uint32 tableId; + Uint32 senderRef; + Uint32 errorCode; + Uint32 tableStatus; +}; + + +class WaitDropTabConf { + /** + * Sender + */ + friend class Dblqh; + + /** + * Receiver(s) + */ + friend class Dbtc; + friend class Dbdih; + + friend bool printWAIT_DROP_TAB_CONF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 2 ); + + Uint32 tableId; + Uint32 senderRef; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/PrepFailReqRef.hpp b/storage/ndb/include/kernel/signaldata/PrepFailReqRef.hpp new file mode 100644 index 00000000000..e7b83f6b316 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/PrepFailReqRef.hpp @@ -0,0 +1,48 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef PREP_FAILREQREF_HPP +#define PREP_FAILREQREF_HPP + +#include "SignalData.hpp" +#include <NodeBitmask.hpp> + +/** + * The Req signal is sent by Qmgr to Qmgr + * and the Ref signal might be sent back + * + * NOTE that the signals are identical + */ +class PrepFailReqRef { + + /** + * Sender(s) / Reciver(s) + */ + friend class Qmgr; + + friend bool printPREPFAILREQREF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); + +public: + STATIC_CONST( SignalLength = 3 + NodeBitmask::Size ); +private: + + Uint32 xxxBlockRef; + Uint32 failNo; + + Uint32 noOfNodes; + Uint32 theNodes[NodeBitmask::Size]; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/ReadConfig.hpp b/storage/ndb/include/kernel/signaldata/ReadConfig.hpp new file mode 100644 index 00000000000..68a32ec4e68 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/ReadConfig.hpp @@ -0,0 +1,39 @@ +/* Copyright (C) 2004 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + +#ifndef READ_CONFIG_HPP +#define READ_CONFIG_HPP + +/** + */ +class ReadConfigReq { +public: + STATIC_CONST( SignalLength = 3 ); + + Uint32 senderRef; + Uint32 senderData; + Uint32 noOfParameters; // 0 Means read all relevant for block + Uint32 parameters[1]; // see mgmapi_config_parameters.h +}; + +class ReadConfigConf { +public: + STATIC_CONST( SignalLength = 2 ); + + Uint32 senderRef; + Uint32 senderData; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/ReadNodesConf.hpp b/storage/ndb/include/kernel/signaldata/ReadNodesConf.hpp new file mode 100644 index 00000000000..f42c9249418 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/ReadNodesConf.hpp @@ -0,0 +1,84 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef READ_NODESCONF_HPP +#define READ_NODESCONF_HPP + +#include <NodeBitmask.hpp> + +/** + * This signals is sent by Qmgr to NdbCntr + * and then from NdbCntr sent to: dih, dict, lqh, tc + * + * NOTE Only noOfNodes & allNodes are valid when sent from Qmgr + */ +class ReadNodesConf { + /** + * Sender(s) + */ + friend class Qmgr; + + /** + * Sender(s) / Reciver(s) + */ + friend class Ndbcntr; + + /** + * Reciver(s) + */ + friend class Dbdih; + friend class Dbdict; + friend class Dblqh; + friend class Dbtc; + friend class Trix; + friend class Backup; + friend class Suma; + friend class Grep; + + friend bool printREAD_NODES_CONF(FILE*, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 3 + 5*NdbNodeBitmask::Size ); +private: + + Uint32 noOfNodes; + Uint32 ndynamicId; + + /** + * + * NOTE Not valid when send from Qmgr + */ + Uint32 masterNodeId; + + /** + * This array defines all the ndb nodes in the system + */ + union { + Uint32 allNodes[NdbNodeBitmask::Size]; + Uint32 definedNodes[NdbNodeBitmask::Size]; + }; + + /** + * This array describes wheather the nodes are currently active + * + * NOTE Not valid when send from Qmgr + */ + Uint32 inactiveNodes[NdbNodeBitmask::Size]; + + Uint32 clusterNodes[NdbNodeBitmask::Size]; // From Qmgr + Uint32 startingNodes[NdbNodeBitmask::Size]; // From Cntr + Uint32 startedNodes[NdbNodeBitmask::Size]; // From Cntr +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/RelTabMem.hpp b/storage/ndb/include/kernel/signaldata/RelTabMem.hpp new file mode 100644 index 00000000000..372ef58d283 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/RelTabMem.hpp @@ -0,0 +1,68 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef REL_TABMEM_HPP +#define REL_TABMEM_HPP + +#include "SignalData.hpp" + +class RelTabMemReq { + /** + * Sender(s) and Receiver(s) + */ + friend class Dbdict; + + /** + * Receiver(s) + */ + friend class Dbacc; + friend class Dbdih; + friend class Dblqh; + friend class Dbtc; + friend class Dbtup; +public: + STATIC_CONST( SignalLength = 4 ); + +private: + Uint32 userPtr; + Uint32 userRef; + Uint32 primaryTableId; + Uint32 secondaryTableId; +}; + +class RelTabMemConf { + /** + * Sender(s) and Receiver(s) + */ + friend class Dbdict; + + /** + * Sender(s) + */ + friend class Dbacc; + friend class Dbdih; + friend class Dblqh; + friend class Dbtc; + friend class Dbtup; +public: + STATIC_CONST( SignalLength = 2 ); + +private: + Uint32 userPtr; + Uint32 senderRef; + Uint32 nodeId; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/RepImpl.hpp b/storage/ndb/include/kernel/signaldata/RepImpl.hpp new file mode 100644 index 00000000000..a82ae979d4d --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/RepImpl.hpp @@ -0,0 +1,499 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef REP_IMPL_HPP +#define REP_IMPL_HPP + +#include "SignalData.hpp" +#include <NodeBitmask.hpp> +#include <ndb_limits.h> +#include <debugger/GrepError.hpp> + +/** + * RecordType + * sz = no of elems in enum + * @todo support for meta_log must be added + */ +enum RecordType +{ + DATA_SCAN = 0, + DATA_LOG = 1, + META_SCAN = 2, + // META_LOG = 3, //removed META_LOG. not supported + RecordTypeSize = 3 // =4 if meta log is supported +}; + +/** + * Wait GCP + */ +class RepWaitGcpReq +{ + /** + * Sender(s)/Reciver(s) + */ + friend class Rep; + friend class GrepParticipant; + friend bool printREP_WAITGCP_REQ(FILE *, const Uint32 *, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 5 ); + Uint32 senderData; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 gcp; + Uint32 senderNodeId; +}; + +class RepWaitGcpConf +{ + /** + * Sender(s)/Reciver(s) + */ + friend class Rep; + friend class GrepParticipant; + + friend bool printREP_WAITGCP_CONF(FILE *, const Uint32 *, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 5 ); + Uint32 senderData; + Uint32 senderRef; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 senderNodeId; +}; + +class RepWaitGcpRef +{ + /** + * Sender(s)/Reciver(s) + */ + friend class Rep; + friend class GrepParticipant; + + friend bool printREP_WAITGCP_REF(FILE *, const Uint32 *, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 6 ); + Uint32 senderData; + Uint32 senderRef; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 senderNodeId; + GrepError::GE_Code err; +}; + +class RepGetGciReq +{ + /** + * Sender(s)/Reciver(s) + */ + friend class Rep; + friend class Grep; + + friend bool printREP_GET_GCI_REQ(FILE *, const Uint32 *, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 3 ); + Uint32 senderData; + Uint32 senderRef; + Uint32 nodeGrp; +}; + +class RepGetGciConf +{ + /** + * Sender(s)/Reciver(s) + */ + friend class Rep; + + friend bool printREP_GET_GCI_CONF(FILE *, const Uint32 *, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 7 ); + Uint32 senderData; + Uint32 senderRef; + Uint32 nodeGrp; + Uint32 firstPSGCI; + Uint32 lastPSGCI; + Uint32 firstSSGCI; + Uint32 lastSSGCI; +}; + +class RepGetGciRef +{ + /** + * Sender(s)/Reciver(s) + */ + friend class Rep; + + friend bool printREP_GET_GCI_REF(FILE *, const Uint32 *, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 8); + Uint32 senderData; + Uint32 senderRef; + Uint32 nodeGrp; + Uint32 firstPSGCI; + Uint32 lastPSGCI; + Uint32 firstSSGCI; + Uint32 lastSSGCI; + GrepError::GE_Code err; +}; + +class RepGetGciBufferReq { + /** + * Sender(s)/Reciver(s) + */ + friend class Rep; + + friend bool printREP_GET_GCIBUFFER_REQ(FILE *, const Uint32 *, + Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 5 ); + Uint32 senderRef; + Uint32 senderData; + Uint32 firstGCI; + Uint32 lastGCI; + Uint32 nodeGrp; +}; + + +class RepGetGciBufferConf { + /** + * Sender(s)/Reciver(s) + */ + friend class Rep; + + friend bool printREP_GET_GCIBUFFER_CONF(FILE *, const Uint32 *, + Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 8 ); + Uint32 senderData; + Uint32 senderRef; + Uint32 firstPSGCI; + Uint32 lastPSGCI; + Uint32 firstSSGCI; + Uint32 lastSSGCI; + Uint32 currentGCIBuffer; + Uint32 nodeGrp; +}; + +class RepGetGciBufferRef +{ + /** + * Sender(s)/Reciver(s) + */ + friend class Rep; + + friend bool printREP_GET_GCIBUFFER_REF(FILE *, const Uint32 *, + Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 9 ); + Uint32 senderData; + Uint32 senderRef; + Uint32 firstPSGCI; + Uint32 lastPSGCI; + Uint32 firstSSGCI; + Uint32 lastSSGCI; + Uint32 currentGCIBuffer; + Uint32 nodeGrp; + GrepError::GE_Code err; +}; + +class RepInsertGciBufferReq +{ + /** + * Sender(s)/Reciver(s) + */ + friend class Rep; + + friend bool printREP_INSERT_GCIBUFFER_REQ(FILE *, const Uint32 *, + Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 5 ); + Uint32 senderData; + Uint32 senderRef; + Uint32 gci; + Uint32 nodeGrp; + Uint32 force; +}; + +class RepInsertGciBufferRef +{ + /** + * Sender(s)/Reciver(s) + */ + friend class Rep; + + friend bool printREP_INSERT_GCIBUFFER_REF(FILE *, const Uint32 *, + Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 7 ); + Uint32 senderData; + Uint32 senderRef; + Uint32 gci; + Uint32 nodeGrp; + Uint32 tableId; + Uint32 force; + GrepError::GE_Code err; +}; + +class RepInsertGciBufferConf +{ + /** + * Sender(s)/Reciver(s) + */ + friend class Rep; + + friend bool printREP_INSERT_GCIBUFFER_CONF(FILE *, const Uint32 *, + Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 5 ); + Uint32 senderData; + Uint32 senderRef; + Uint32 gci; + Uint32 nodeGrp; + Uint32 force; +}; + + +class RepClearPSGciBufferReq +{ + /** + * Sender(s)/Reciver(s) + */ + friend class Rep; + + friend bool printREP_CLEAR_PS_GCIBUFFER_REQ(FILE *, const Uint32 *, + Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 5 ); + Uint32 senderData; + Uint32 senderRef; + Uint32 firstGCI; + Uint32 lastGCI; + Uint32 nodeGrp; +}; + +class RepClearPSGciBufferRef +{ + /** + * Sender(s)/Reciver(s) + */ + friend class Rep; + + friend bool printREP_CLEAR_PS_GCIBUFFER_REF(FILE *, const Uint32 *, + Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 7 ); + Uint32 senderData; + Uint32 senderRef; + Uint32 firstGCI; + Uint32 lastGCI; + Uint32 currentGCI; + Uint32 nodeGrp; + GrepError::GE_Code err; +}; + +class RepClearPSGciBufferConf +{ + /** + * Sender(s)/Reciver(s) + */ + friend class Rep; + + friend bool printREP_CLEAR_PS_GCIBUFFER_CONF(FILE *, const Uint32 *, + Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 5 ); + Uint32 senderData; + Uint32 senderRef; + Uint32 firstGCI; + Uint32 lastGCI; + Uint32 nodeGrp; +}; + +class RepClearSSGciBufferReq +{ + /** + * Sender(s)/Reciver(s) + */ + friend class Rep; + + friend bool printREP_CLEAR_SS_GCIBUFFER_REQ(FILE *, const Uint32 *, + Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 5 ); + Uint32 senderData; + Uint32 senderRef; + Uint32 firstGCI; + Uint32 lastGCI; + Uint32 nodeGrp; +}; + +class RepClearSSGciBufferRef +{ + /** + * Sender(s)/Reciver(s) + */ + friend class Rep; + + friend bool printREP_CLEAR_SS_GCIBUFFER_REF(FILE *, const Uint32 *, + Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 7 ); + Uint32 senderData; + Uint32 senderRef; + Uint32 firstGCI; + Uint32 lastGCI; + Uint32 currentGCI; + Uint32 nodeGrp; + GrepError::GE_Code err; +}; + +class RepClearSSGciBufferConf +{ + /** + * Sender(s)/Reciver(s) + */ + friend class Rep; + + friend bool printREP_CLEAR_SS_GCIBUFFER_CONF(FILE *, const Uint32 *, + Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 5 ); + Uint32 senderData; + Uint32 senderRef; + Uint32 firstGCI; + Uint32 lastGCI; + Uint32 nodeGrp; +}; + + +class RepDataPage +{ + /** + * Sender(s)/Reciver(s) + */ + friend class Rep; + + friend bool printREP_DATA_PAGE(FILE *, const Uint32 *, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 4 ); + Uint32 senderData; + Uint32 senderRef; + Uint32 nodeGrp; + Uint32 gci; +}; + + +class RepGciBufferAccRep +{ + /** + * Sender(s)/Reciver(s) + */ + friend class Rep; + + friend bool printREP_GCIBUFFER_ACC_REP(FILE *, const Uint32 *, + Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 5 ); + Uint32 senderData; + Uint32 senderRef; + Uint32 nodeGrp; + Uint32 gci; + Uint32 totalSentBytes; +}; + +class RepDropTableReq +{ + /** + * Sender(s)/Reciver(s) + */ + friend class Rep; + + friend bool printREP_DROP_TABLE_REQ(FILE *, const Uint32 *, + Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 4 ); + Uint32 tableId; + // char tableName[MAX_TAB_NAME_SIZE]; +}; + +class RepDropTableRef +{ + /** + * Sender(s)/Reciver(s) + */ + friend class Rep; + + friend bool printREP_DROP_TABLE_REF(FILE *, const Uint32 *, + Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 4 ); + Uint32 tableId; + // char tableName[MAX_TAB_NAME_SIZE]; +}; + +class RepDropTableConf +{ + /** + * Sender(s)/Reciver(s) + */ + friend class Rep; + + friend bool printREP_DROP_TABLE_CONF(FILE *, const Uint32 *, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 4 ); + Uint32 tableId; + //char tableName[MAX_TAB_NAME_SIZE]; +}; + +class RepDisconnectRep +{ + /** + * Sender(s)/Reciver(s) + */ + friend class Rep; + friend class Grep; + + friend bool printREP_DISCONNECT_REP(FILE *, const Uint32 *, Uint32, Uint16); + +public: + enum NodeType { + DB = 0, + REP = 1 + }; + STATIC_CONST( SignalLength = 7 ); + Uint32 senderData; + Uint32 senderRef; + Uint32 nodeId; + Uint32 nodeType; + Uint32 subId; + Uint32 subKey; + Uint32 err; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/RestoreContinueB.hpp b/storage/ndb/include/kernel/signaldata/RestoreContinueB.hpp new file mode 100644 index 00000000000..60e133f7c2b --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/RestoreContinueB.hpp @@ -0,0 +1,37 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef RESTORE_CONTINUEB_H +#define RESTORE_CONTINUEB_H + +#include "SignalData.hpp" + +class RestoreContinueB { + /** + * Sender(s)/Reciver(s) + */ + friend class Restore; + friend bool printCONTINUEB_RESTORE(FILE * output, const Uint32 * theData, Uint32 len); +private: + enum { + START_FILE_THREAD = 0, + BUFFER_UNDERFLOW = 1, + BUFFER_FULL_SCAN = 2, + BUFFER_FULL_FRAG_COMPLETE = 3, + BUFFER_FULL_META = 4 + }; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/RestoreImpl.hpp b/storage/ndb/include/kernel/signaldata/RestoreImpl.hpp new file mode 100644 index 00000000000..60acebdd809 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/RestoreImpl.hpp @@ -0,0 +1,65 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef RESTORE_SIGNAL_DATA_HPP +#define RESTORE_SIGNAL_DATA_HPP + +#include "SignalData.hpp" + +struct RestoreLcpReq +{ + Uint32 senderData; + Uint32 senderRef; + Uint32 lcpNo; + Uint32 tableId; + Uint32 fragmentId; + Uint32 lcpId; + STATIC_CONST( SignalLength = 6 ); +}; + +struct RestoreLcpRef +{ + Uint32 senderData; + Uint32 senderRef; + Uint32 errorCode; + Uint32 extra[1]; + STATIC_CONST( SignalLength = 3 ); + + enum ErrorCode + { + OK = 0, + NoFileRecord = 1, + OutOfDataBuffer = 2, + OutOfReadBufferPages = 3, + InvalidFileFormat = 4 + }; +}; + +struct RestoreLcpConf +{ + Uint32 senderData; + Uint32 senderRef; + STATIC_CONST( SignalLength = 2 ); +}; + +struct RestoreContinueB { + + enum { + RESTORE_NEXT = 0, + READ_FILE = 1 + }; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/ResumeReq.hpp b/storage/ndb/include/kernel/signaldata/ResumeReq.hpp new file mode 100644 index 00000000000..5ef57a9b700 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/ResumeReq.hpp @@ -0,0 +1,68 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef RESUME_REQ_HPP +#define RESUME_REQ_HPP + +#include "SignalData.hpp" + +class ResumeReq { + + /** + * Reciver(s) + */ + friend class Ndbcntr; + + /** + * Sender + */ + friend class MgmtSrvr; + +public: + STATIC_CONST( SignalLength = 2 ); + +public: + + Uint32 senderRef; + Uint32 senderData; +}; + +class ResumeRef { + + /** + * Reciver(s) + */ + friend class MgmtSrvr; + + /** + * Sender + */ + friend class Ndbcntr; + +public: + STATIC_CONST( SignalLength = 2 ); + + enum ErrorCode { + OK = 0, + NodeShutdownInProgress = 1, + SystemShutdownInProgress = 2, + NodeShutdownWouldCauseSystemCrash = 3 + }; + +public: + Uint32 senderData; + Uint32 errorCode; +}; +#endif diff --git a/storage/ndb/include/kernel/signaldata/RouteOrd.hpp b/storage/ndb/include/kernel/signaldata/RouteOrd.hpp new file mode 100644 index 00000000000..01ed8fd98f2 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/RouteOrd.hpp @@ -0,0 +1,34 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef ROUTE_ORD_HPP +#define ROUTE_ORD_HPP + +#include "SignalData.hpp" +#include <NodeBitmask.hpp> + +/** + * Request to allocate node id + */ +struct RouteOrd { + STATIC_CONST( SignalLength = 4 ); + + Uint32 dstRef; + Uint32 srcRef; + Uint32 gsn; + Uint32 cnt; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/ScanFrag.hpp b/storage/ndb/include/kernel/signaldata/ScanFrag.hpp new file mode 100644 index 00000000000..c06ad20b6a2 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/ScanFrag.hpp @@ -0,0 +1,398 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef SCAN_FRAG_HPP +#define SCAN_FRAG_HPP + +#include "SignalData.hpp" +#include "ndb_limits.h" + +class ScanFragReq { + /** + * Sender(s) + */ + friend class Dbtc; + friend class Backup; + friend class Suma; + + /** + * Reciver(s) + */ + friend class Dblqh; +public: + STATIC_CONST( SignalLength = 12 ); + + friend bool printSCAN_FRAGREQ(FILE *, const Uint32*, Uint32, Uint16); + +public: + Uint32 senderData; + Uint32 resultRef; // Where to send the result + Uint32 savePointId; + Uint32 requestInfo; + Uint32 tableId; + Uint32 fragmentNoKeyLen; + Uint32 schemaVersion; + Uint32 transId1; + Uint32 transId2; + Uint32 clientOpPtr; + Uint32 batch_size_rows; + Uint32 batch_size_bytes; + + static Uint32 getLockMode(const Uint32 & requestInfo); + static Uint32 getHoldLockFlag(const Uint32 & requestInfo); + static Uint32 getKeyinfoFlag(const Uint32 & requestInfo); + static Uint32 getReadCommittedFlag(const Uint32 & requestInfo); + static Uint32 getRangeScanFlag(const Uint32 & requestInfo); + static Uint32 getDescendingFlag(const Uint32 & requestInfo); + static Uint32 getTupScanFlag(const Uint32 & requestInfo); + static Uint32 getAttrLen(const Uint32 & requestInfo); + static Uint32 getScanPrio(const Uint32 & requestInfo); + static Uint32 getNoDiskFlag(const Uint32 & requestInfo); + static Uint32 getLcpScanFlag(const Uint32 & requestInfo); + + static void setLockMode(Uint32 & requestInfo, Uint32 lockMode); + static void setHoldLockFlag(Uint32 & requestInfo, Uint32 holdLock); + static void setKeyinfoFlag(Uint32 & requestInfo, Uint32 keyinfo); + static void setReadCommittedFlag(Uint32 & requestInfo, Uint32 readCommitted); + static void setRangeScanFlag(Uint32 & requestInfo, Uint32 rangeScan); + static void setDescendingFlag(Uint32 & requestInfo, Uint32 descending); + static void setTupScanFlag(Uint32 & requestInfo, Uint32 tupScan); + static void setAttrLen(Uint32 & requestInfo, Uint32 attrLen); + static void setScanPrio(Uint32& requestInfo, Uint32 prio); + static void setNoDiskFlag(Uint32& requestInfo, Uint32 val); + static void setLcpScanFlag(Uint32 & requestInfo, Uint32 val); +}; + +class KeyInfo20 { + /** + * Sender(s) + */ + friend class Dblqh; + + /** + * Reciver(s) + */ + friend class Backup; + friend class NdbOperation; + friend class NdbScanReceiver; +public: + STATIC_CONST( HeaderLength = 5); + STATIC_CONST( DataLength = 20 ); + + + static Uint32 setScanInfo(Uint32 noOfOps, Uint32 scanNo); + static Uint32 getScanNo(Uint32 scanInfo); + static Uint32 getScanOp(Uint32 scanInfo); + +public: + Uint32 clientOpPtr; + Uint32 keyLen; + Uint32 scanInfo_Node; + Uint32 transId1; + Uint32 transId2; + Uint32 keyData[DataLength]; +}; + +class ScanFragConf { + /** + * Sender(s) + */ + friend class Dblqh; + + /** + * Reciver(s) + */ + friend class Dbtc; + friend class Backup; + friend class Suma; +public: + STATIC_CONST( SignalLength = 6 ); + +public: + Uint32 senderData; + Uint32 completedOps; + Uint32 fragmentCompleted; + Uint32 transId1; + Uint32 transId2; + Uint32 total_len; +}; + +class ScanFragRef { + /** + * Sender(s) + */ + friend class Dblqh; + + /** + * Reciver(s) + */ + friend class Dbtc; + friend class Backup; + friend class Suma; +public: + STATIC_CONST( SignalLength = 4 ); +public: + enum ErrorCode { + ZNO_FREE_TC_CONREC_ERROR = 484, + ZTOO_FEW_CONCURRENT_OPERATIONS = 485, + ZTOO_MANY_CONCURRENT_OPERATIONS = 486, + ZSCAN_NO_FRAGMENT_ERROR = 487, + ZTOO_MANY_ACTIVE_SCAN_ERROR = 488, + ZNO_FREE_SCANREC_ERROR = 489, + ZWRONG_BATCH_SIZE = 1230, + ZSTANDBY_SCAN_ERROR = 1209, + ZSCAN_BOOK_ACC_OP_ERROR = 1219, + ZUNKNOWN_TRANS_ERROR = 1227 + }; + + Uint32 senderData; + Uint32 transId1; + Uint32 transId2; + Uint32 errorCode; +}; + +/** + * This is part of Scan Fragment protocol + * + * Not to be confused with ScanNextReq in Scan Table protocol + */ +class ScanFragNextReq { + /** + * Sender(s) + */ + friend class Dbtc; + friend class Backup; + friend class Suma; + + /** + * Reciver(s) + */ + friend class Dblqh; + + friend bool printSCANFRAGNEXTREQ(FILE * output, const Uint32 * theData, + Uint32 len, Uint16 receiverBlockNo); +public: + STATIC_CONST( SignalLength = 6 ); + +public: + Uint32 senderData; + Uint32 closeFlag; + Uint32 transId1; + Uint32 transId2; + Uint32 batch_size_rows; + Uint32 batch_size_bytes; +}; + +/** + * Request Info + * + * a = Length of attrinfo - 16 Bits (16-31) + * c = LCP scan - 1 Bit 3 + * d = No disk - 1 Bit 4 + * l = Lock Mode - 1 Bit 5 + * h = Hold lock - 1 Bit 7 + * k = Keyinfo - 1 Bit 8 + * r = read committed - 1 Bit 9 + * x = range scan - 1 Bit 6 + * z = descending - 1 Bit 10 + * t = tup scan - 1 Bit 11 (implies x=z=0) + * p = Scan prio - 4 Bits (12-15) -> max 15 + * + * 1111111111222222222233 + * 01234567890123456789012345678901 + * dlxhkrztppppaaaaaaaaaaaaaaaa + */ +#define SF_LOCK_MODE_SHIFT (5) +#define SF_LOCK_MODE_MASK (1) + +#define SF_NO_DISK_SHIFT (4) +#define SF_HOLD_LOCK_SHIFT (7) +#define SF_KEYINFO_SHIFT (8) +#define SF_READ_COMMITTED_SHIFT (9) +#define SF_RANGE_SCAN_SHIFT (6) +#define SF_DESCENDING_SHIFT (10) +#define SF_TUP_SCAN_SHIFT (11) +#define SF_LCP_SCAN_SHIFT (3) + +#define SF_ATTR_LEN_SHIFT (16) +#define SF_ATTR_LEN_MASK (65535) + +#define SF_PRIO_SHIFT 12 +#define SF_PRIO_MASK 15 + +inline +Uint32 +ScanFragReq::getLockMode(const Uint32 & requestInfo){ + return (requestInfo >> SF_LOCK_MODE_SHIFT) & SF_LOCK_MODE_MASK; +} + +inline +Uint32 +ScanFragReq::getHoldLockFlag(const Uint32 & requestInfo){ + return (requestInfo >> SF_HOLD_LOCK_SHIFT) & 1; +} + +inline +Uint32 +ScanFragReq::getKeyinfoFlag(const Uint32 & requestInfo){ + return (requestInfo >> SF_KEYINFO_SHIFT) & 1; +} + +inline +Uint32 +ScanFragReq::getRangeScanFlag(const Uint32 & requestInfo){ + return (requestInfo >> SF_RANGE_SCAN_SHIFT) & 1; +} + +inline +Uint32 +ScanFragReq::getDescendingFlag(const Uint32 & requestInfo){ + return (requestInfo >> SF_DESCENDING_SHIFT) & 1; +} + +inline +Uint32 +ScanFragReq::getTupScanFlag(const Uint32 & requestInfo){ + return (requestInfo >> SF_TUP_SCAN_SHIFT) & 1; +} + +inline +Uint32 +ScanFragReq::getReadCommittedFlag(const Uint32 & requestInfo){ + return (requestInfo >> SF_READ_COMMITTED_SHIFT) & 1; +} + +inline +Uint32 +ScanFragReq::getAttrLen(const Uint32 & requestInfo){ + return (requestInfo >> SF_ATTR_LEN_SHIFT) & SF_ATTR_LEN_MASK; +} + +inline +Uint32 +ScanFragReq::getScanPrio(const Uint32 & requestInfo){ + return (requestInfo >> SF_PRIO_SHIFT) & SF_PRIO_MASK; +} + +inline +void +ScanFragReq::setScanPrio(UintR & requestInfo, UintR val){ + ASSERT_MAX(val, SF_PRIO_MASK, "ScanFragReq::setScanPrio"); + requestInfo |= (val << SF_PRIO_SHIFT); +} + +inline +void +ScanFragReq::setLockMode(UintR & requestInfo, UintR val){ + ASSERT_MAX(val, SF_LOCK_MODE_MASK, "ScanFragReq::setLockMode"); + requestInfo |= (val << SF_LOCK_MODE_SHIFT); +} + +inline +void +ScanFragReq::setHoldLockFlag(UintR & requestInfo, UintR val){ + ASSERT_BOOL(val, "ScanFragReq::setHoldLockFlag"); + requestInfo |= (val << SF_HOLD_LOCK_SHIFT); +} + +inline +void +ScanFragReq::setKeyinfoFlag(UintR & requestInfo, UintR val){ + ASSERT_BOOL(val, "ScanFragReq::setKeyinfoFlag"); + requestInfo |= (val << SF_KEYINFO_SHIFT); +} + +inline +void +ScanFragReq::setReadCommittedFlag(UintR & requestInfo, UintR val){ + ASSERT_BOOL(val, "ScanFragReq::setReadCommittedFlag"); + requestInfo |= (val << SF_READ_COMMITTED_SHIFT); +} + +inline +void +ScanFragReq::setRangeScanFlag(UintR & requestInfo, UintR val){ + ASSERT_BOOL(val, "ScanFragReq::setRangeScanFlag"); + requestInfo |= (val << SF_RANGE_SCAN_SHIFT); +} + +inline +void +ScanFragReq::setDescendingFlag(UintR & requestInfo, UintR val){ + ASSERT_BOOL(val, "ScanFragReq::setDescendingFlag"); + requestInfo |= (val << SF_DESCENDING_SHIFT); +} + +inline +void +ScanFragReq::setTupScanFlag(UintR & requestInfo, UintR val){ + ASSERT_BOOL(val, "ScanFragReq::setTupScanFlag"); + requestInfo |= (val << SF_TUP_SCAN_SHIFT); +} + +inline +void +ScanFragReq::setAttrLen(UintR & requestInfo, UintR val){ + ASSERT_MAX(val, SF_ATTR_LEN_MASK, "ScanFragReq::setAttrLen"); + requestInfo |= (val << SF_ATTR_LEN_SHIFT); +} + +inline +Uint32 +ScanFragReq::getNoDiskFlag(const Uint32 & requestInfo){ + return (requestInfo >> SF_NO_DISK_SHIFT) & 1; +} + +inline +void +ScanFragReq::setNoDiskFlag(UintR & requestInfo, UintR val){ + ASSERT_BOOL(val, "ScanFragReq::setNoDiskFlag"); + requestInfo |= (val << SF_NO_DISK_SHIFT); +} + +inline +Uint32 +ScanFragReq::getLcpScanFlag(const Uint32 & requestInfo){ + return (requestInfo >> SF_LCP_SCAN_SHIFT) & 1; +} + +inline +void +ScanFragReq::setLcpScanFlag(UintR & requestInfo, UintR val){ + ASSERT_BOOL(val, "ScanFragReq::setLcpScanFlag"); + requestInfo |= (val << SF_LCP_SCAN_SHIFT); +} + +inline +Uint32 +KeyInfo20::setScanInfo(Uint32 opNo, Uint32 scanNo){ + ASSERT_MAX(opNo, 1023, "KeyInfo20::setScanInfo"); + ASSERT_MAX(scanNo, 255, "KeyInfo20::setScanInfo"); + return (opNo << 8) + scanNo; +} + +inline +Uint32 +KeyInfo20::getScanNo(Uint32 scanInfo){ + return scanInfo & 0xFF; +} + +inline +Uint32 +KeyInfo20::getScanOp(Uint32 scanInfo){ + return (scanInfo >> 8) & 0x3FF; +} + +#endif diff --git a/storage/ndb/include/kernel/signaldata/ScanTab.hpp b/storage/ndb/include/kernel/signaldata/ScanTab.hpp new file mode 100644 index 00000000000..571fc374eab --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/ScanTab.hpp @@ -0,0 +1,460 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef SCAN_TAB_H +#define SCAN_TAB_H + +#include "SignalData.hpp" + +/** + * + * SENDER: API + * RECIVER: Dbtc + */ +class ScanTabReq { + /** + * Reciver(s) + */ + friend class Dbtc; // Reciver + + /** + * Sender(s) + */ + friend class NdbTransaction; + friend class NdbScanOperation; + friend class NdbIndexScanOperation; + + /** + * For printing + */ + friend bool printSCANTABREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); + +public: + /** + * Length of signal + */ + STATIC_CONST( StaticLength = 11 ); + +private: + + // Type definitions + + /** + * DATA VARIABLES + */ + UintR apiConnectPtr; // DATA 0 + UintR attrLenKeyLen; // DATA 1 + UintR requestInfo; // DATA 2 + UintR tableId; // DATA 3 + UintR tableSchemaVersion; // DATA 4 + UintR storedProcId; // DATA 5 + UintR transId1; // DATA 6 + UintR transId2; // DATA 7 + UintR buddyConPtr; // DATA 8 + UintR batch_byte_size; // DATA 9 + UintR first_batch_size; // DATA 10 + + /** + * Optional + */ + Uint32 distributionKey; + + /** + * Get:ers for requestInfo + */ + static Uint8 getParallelism(const UintR & requestInfo); + static Uint8 getLockMode(const UintR & requestInfo); + static Uint8 getHoldLockFlag(const UintR & requestInfo); + static Uint8 getReadCommittedFlag(const UintR & requestInfo); + static Uint8 getRangeScanFlag(const UintR & requestInfo); + static Uint8 getDescendingFlag(const UintR & requestInfo); + static Uint8 getTupScanFlag(const UintR & requestInfo); + static Uint8 getKeyinfoFlag(const UintR & requestInfo); + static Uint16 getScanBatch(const UintR & requestInfo); + static Uint8 getDistributionKeyFlag(const UintR & requestInfo); + static UintR getNoDiskFlag(const UintR & requestInfo); + + /** + * Set:ers for requestInfo + */ + static void clearRequestInfo(UintR & requestInfo); + static void setParallelism(UintR & requestInfo, Uint32 flag); + static void setLockMode(UintR & requestInfo, Uint32 flag); + static void setHoldLockFlag(UintR & requestInfo, Uint32 flag); + static void setReadCommittedFlag(UintR & requestInfo, Uint32 flag); + static void setRangeScanFlag(UintR & requestInfo, Uint32 flag); + static void setDescendingFlag(UintR & requestInfo, Uint32 flag); + static void setTupScanFlag(UintR & requestInfo, Uint32 flag); + static void setKeyinfoFlag(UintR & requestInfo, Uint32 flag); + static void setScanBatch(Uint32& requestInfo, Uint32 sz); + static void setDistributionKeyFlag(Uint32& requestInfo, Uint32 flag); + static void setNoDiskFlag(UintR & requestInfo, UintR val); +}; + +/** + * Request Info + * + p = Parallelism - 8 Bits -> Max 256 (Bit 0-7) + l = Lock mode - 1 Bit 8 + h = Hold lock mode - 1 Bit 10 + c = Read Committed - 1 Bit 11 + k = Keyinfo - 1 Bit 12 + t = Tup scan - 1 Bit 13 + z = Descending (TUX) - 1 Bit 14 + x = Range Scan (TUX) - 1 Bit 15 + b = Scan batch - 10 Bit 16-25 (max 1023) + d = Distribution key flag + n = No disk flag + + 1111111111222222222233 + 01234567890123456789012345678901 + pppppppplnhcktzxbbbbbbbbbb +*/ + +#define PARALLELL_SHIFT (0) +#define PARALLELL_MASK (255) + +#define LOCK_MODE_SHIFT (8) +#define LOCK_MODE_MASK (1) + +#define HOLD_LOCK_SHIFT (10) +#define HOLD_LOCK_MASK (1) + +#define KEYINFO_SHIFT (12) +#define KEYINFO_MASK (1) + +#define READ_COMMITTED_SHIFT (11) +#define READ_COMMITTED_MASK (1) + +#define RANGE_SCAN_SHIFT (15) +#define RANGE_SCAN_MASK (1) + +#define DESCENDING_SHIFT (14) +#define DESCENDING_MASK (1) + +#define TUP_SCAN_SHIFT (13) +#define TUP_SCAN_MASK (1) + +#define SCAN_BATCH_SHIFT (16) +#define SCAN_BATCH_MASK (1023) + +#define SCAN_DISTR_KEY_SHIFT (26) + +#define SCAN_NODISK_SHIFT (9) + +inline +Uint8 +ScanTabReq::getParallelism(const UintR & requestInfo){ + return (Uint8)((requestInfo >> PARALLELL_SHIFT) & PARALLELL_MASK); +} + +inline +Uint8 +ScanTabReq::getLockMode(const UintR & requestInfo){ + return (Uint8)((requestInfo >> LOCK_MODE_SHIFT) & LOCK_MODE_MASK); +} + +inline +Uint8 +ScanTabReq::getHoldLockFlag(const UintR & requestInfo){ + return (Uint8)((requestInfo >> HOLD_LOCK_SHIFT) & HOLD_LOCK_MASK); +} + +inline +Uint8 +ScanTabReq::getReadCommittedFlag(const UintR & requestInfo){ + return (Uint8)((requestInfo >> READ_COMMITTED_SHIFT) & READ_COMMITTED_MASK); +} + +inline +Uint8 +ScanTabReq::getRangeScanFlag(const UintR & requestInfo){ + return (Uint8)((requestInfo >> RANGE_SCAN_SHIFT) & RANGE_SCAN_MASK); +} + +inline +Uint8 +ScanTabReq::getDescendingFlag(const UintR & requestInfo){ + return (Uint8)((requestInfo >> DESCENDING_SHIFT) & DESCENDING_MASK); +} + +inline +Uint8 +ScanTabReq::getTupScanFlag(const UintR & requestInfo){ + return (Uint8)((requestInfo >> TUP_SCAN_SHIFT) & TUP_SCAN_MASK); +} + +inline +Uint16 +ScanTabReq::getScanBatch(const Uint32 & requestInfo){ + return (Uint16)((requestInfo >> SCAN_BATCH_SHIFT) & SCAN_BATCH_MASK); +} + +inline +void +ScanTabReq::clearRequestInfo(UintR & requestInfo){ + requestInfo = 0; +} + +inline +void +ScanTabReq::setParallelism(UintR & requestInfo, Uint32 type){ + ASSERT_MAX(type, PARALLELL_MASK, "ScanTabReq::setParallellism"); + requestInfo |= (type << PARALLELL_SHIFT); +} + +inline +void +ScanTabReq::setLockMode(UintR & requestInfo, Uint32 mode){ + ASSERT_MAX(mode, LOCK_MODE_MASK, "ScanTabReq::setLockMode"); + requestInfo |= (mode << LOCK_MODE_SHIFT); +} + +inline +void +ScanTabReq::setHoldLockFlag(UintR & requestInfo, Uint32 flag){ + ASSERT_BOOL(flag, "ScanTabReq::setHoldLockFlag"); + requestInfo |= (flag << HOLD_LOCK_SHIFT); +} + +inline +void +ScanTabReq::setReadCommittedFlag(UintR & requestInfo, Uint32 flag){ + ASSERT_BOOL(flag, "ScanTabReq::setReadCommittedFlag"); + requestInfo |= (flag << READ_COMMITTED_SHIFT); +} + +inline +void +ScanTabReq::setRangeScanFlag(UintR & requestInfo, Uint32 flag){ + ASSERT_BOOL(flag, "ScanTabReq::setRangeScanFlag"); + requestInfo |= (flag << RANGE_SCAN_SHIFT); +} + +inline +void +ScanTabReq::setDescendingFlag(UintR & requestInfo, Uint32 flag){ + ASSERT_BOOL(flag, "ScanTabReq::setDescendingFlag"); + requestInfo |= (flag << DESCENDING_SHIFT); +} + +inline +void +ScanTabReq::setTupScanFlag(UintR & requestInfo, Uint32 flag){ + ASSERT_BOOL(flag, "ScanTabReq::setTupScanFlag"); + requestInfo |= (flag << TUP_SCAN_SHIFT); +} + +inline +void +ScanTabReq::setScanBatch(Uint32 & requestInfo, Uint32 flag){ + ASSERT_MAX(flag, SCAN_BATCH_MASK, "ScanTabReq::setScanBatch"); + requestInfo &= ~(SCAN_BATCH_MASK << SCAN_BATCH_SHIFT); + requestInfo |= (flag << SCAN_BATCH_SHIFT); +} + +inline +Uint8 +ScanTabReq::getKeyinfoFlag(const UintR & requestInfo){ + return (Uint8)((requestInfo >> KEYINFO_SHIFT) & KEYINFO_MASK); +} + +inline +void +ScanTabReq::setKeyinfoFlag(UintR & requestInfo, Uint32 flag){ + ASSERT_BOOL(flag, "ScanTabReq::setKeyinfoFlag"); + requestInfo |= (flag << KEYINFO_SHIFT); +} + +inline +Uint8 +ScanTabReq::getDistributionKeyFlag(const UintR & requestInfo){ + return (Uint8)((requestInfo >> SCAN_DISTR_KEY_SHIFT) & 1); +} + +inline +void +ScanTabReq::setDistributionKeyFlag(UintR & requestInfo, Uint32 flag){ + ASSERT_BOOL(flag, "ScanTabReq::setKeyinfoFlag"); + requestInfo |= (flag << SCAN_DISTR_KEY_SHIFT); +} + +inline +UintR +ScanTabReq::getNoDiskFlag(const UintR & requestInfo){ + return (requestInfo >> SCAN_NODISK_SHIFT) & 1; +} + +inline +void +ScanTabReq::setNoDiskFlag(UintR & requestInfo, Uint32 flag){ + ASSERT_BOOL(flag, "TcKeyReq::setNoDiskFlag"); + requestInfo |= (flag << SCAN_NODISK_SHIFT); +} + +/** + * + * SENDER: Dbtc + * RECIVER: API + */ +class ScanTabConf { + /** + * Reciver(s) + */ + friend class NdbTransaction; // Reciver + + /** + * Sender(s) + */ + friend class Dbtc; + + /** + * For printing + */ + friend bool printSCANTABCONF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); + +public: + /** + * Length of signal + */ + STATIC_CONST( SignalLength = 4 ); + STATIC_CONST( EndOfData = (1 << 31) ); + +private: + + // Type definitions + + /** + * DATA VARIABLES + */ + UintR apiConnectPtr; // DATA 0 + UintR requestInfo; // DATA 1 + UintR transId1; // DATA 2 + UintR transId2; // DATA 3 + + struct OpData { + Uint32 apiPtrI; + Uint32 tcPtrI; + Uint32 info; + }; + + static Uint32 getLength(Uint32 opDataInfo) { return opDataInfo >> 10; }; + static Uint32 getRows(Uint32 opDataInfo) { return opDataInfo & 1023;} +}; + +/** + * request info + * + o = received operations - 7 Bits -> Max 255 (Bit 0-7) + s = status of scan - 2 Bits -> Max ??? (Bit 8-?) + + 1111111111222222222233 + 01234567890123456789012345678901 + ooooooooss +*/ + +#define OPERATIONS_SHIFT (0) +#define OPERATIONS_MASK (0xFF) + +#define STATUS_SHIFT (8) +#define STATUS_MASK (0xFF) + + +/** + * + * SENDER: Dbtc + * RECIVER: API + */ +class ScanTabRef { + /** + * Reciver(s) + */ + friend class NdbTransaction; // Reciver + + /** + * Sender(s) + */ + friend class Dbtc; + + /** + * For printing + */ + friend bool printSCANTABREF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); + +public: + /** + * Length of signal + */ + STATIC_CONST( SignalLength = 5 ); + +private: + + // Type definitions + + /** + * DATA VARIABLES + */ + UintR apiConnectPtr; // DATA 0 + UintR transId1; // DATA 1 + UintR transId2; // DATA 2 + UintR errorCode; // DATA 3 + UintR closeNeeded; // DATA 4 + +}; + +/** + * + * SENDER: API + * RECIVER: Dbtc + */ +class ScanNextReq { + /** + * Reciver(s) + */ + friend class Dbtc; // Reciver + + /** + * Sender(s) + */ + friend class NdbOperation; + + /** + * For printing + */ + friend bool printSCANNEXTREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); + +public: + /** + * Length of signal + */ + STATIC_CONST( SignalLength = 4 ); + +private: + + // Type definitions + + /** + * DATA VARIABLES + */ + UintR apiConnectPtr; // DATA 0 + UintR stopScan; // DATA 1 + UintR transId1; // DATA 2 + UintR transId2; // DATA 3 + + // stopScan = 1, stop this scan + +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/SetLogLevelOrd.hpp b/storage/ndb/include/kernel/signaldata/SetLogLevelOrd.hpp new file mode 100644 index 00000000000..942baf2a9ad --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/SetLogLevelOrd.hpp @@ -0,0 +1,84 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef SET_LOGLEVEL_ORD_HPP +#define SET_LOGLEVEL_ORD_HPP + +#include <LogLevel.hpp> +#include "EventSubscribeReq.hpp" +#include "SignalData.hpp" + +/** + * + */ +class SetLogLevelOrd { + /** + * Sender(s) + */ + friend class MgmtSrvr; /* XXX can probably be removed */ + friend class MgmApiSession; + friend class CommandInterpreter; + + /** + * Reciver(s) + */ + friend class Cmvmi; + + friend class NodeLogLevel; + +private: + STATIC_CONST( SignalLength = 1 + LogLevel::LOGLEVEL_CATEGORIES ); + + Uint32 noOfEntries; + Uint32 theData[LogLevel::LOGLEVEL_CATEGORIES]; + + void clear(); + + /** + * Note level is valid as 0-15 + */ + void setLogLevel(LogLevel::EventCategory ec, int level = 7); + + SetLogLevelOrd& operator= (const LogLevel& ll){ + noOfEntries = LogLevel::LOGLEVEL_CATEGORIES; + for(size_t i = 0; i<noOfEntries; i++){ + theData[i] = (i << 16) | ll.getLogLevel((LogLevel::EventCategory)i); + } + return * this; + } + + SetLogLevelOrd& operator= (const EventSubscribeReq& ll){ + noOfEntries = ll.noOfEntries; + for(size_t i = 0; i<noOfEntries; i++){ + theData[i] = ll.theData[i]; + } + return * this; + } +}; + +inline +void +SetLogLevelOrd::clear(){ + noOfEntries = 0; +} + +inline +void +SetLogLevelOrd::setLogLevel(LogLevel::EventCategory ec, int level){ + theData[noOfEntries] = (ec << 16) | level; + noOfEntries++; +} + +#endif diff --git a/storage/ndb/include/kernel/signaldata/SetVarReq.hpp b/storage/ndb/include/kernel/signaldata/SetVarReq.hpp new file mode 100644 index 00000000000..a4bf54d2a2a --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/SetVarReq.hpp @@ -0,0 +1,83 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef SETVARREQ_H +#define SETVARREQ_H + +#include "SignalData.hpp" +#include "ConfigParamId.hpp" + +class SetVarReq { + +public: + + + static UintR size(); + + void mgmtSrvrBlockRef(UintR mgmtSrvrBlockRef); + UintR mgmtSrvrBlockRef(void) const; + + void variable(ConfigParamId variable); + ConfigParamId variable(void) const; + + void value(UintR value); + UintR value(void) const; + + +private: + + UintR _mgmtSrvrBlockRef; + UintR _variable; + UintR _value; +}; + + + +inline UintR SetVarReq::size(void) { + return 3; +} + + +inline void SetVarReq::mgmtSrvrBlockRef(UintR mgmtSrvrBlockRef) { + _mgmtSrvrBlockRef = mgmtSrvrBlockRef; +} + +inline UintR SetVarReq::mgmtSrvrBlockRef(void) const { + return _mgmtSrvrBlockRef; +} + + +inline void SetVarReq::variable(ConfigParamId variable) { + _variable = variable; +} + + +inline ConfigParamId SetVarReq::variable(void) const { + return static_cast<ConfigParamId>(_variable); +} + + +inline void SetVarReq::value(UintR value) { + _value = value; +} + +inline UintR SetVarReq::value(void) const { + return _value; +} + + + +#endif // SETVARREQ_H + diff --git a/storage/ndb/include/kernel/signaldata/SignalData.hpp b/storage/ndb/include/kernel/signaldata/SignalData.hpp new file mode 100644 index 00000000000..812a0dda6f8 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/SignalData.hpp @@ -0,0 +1,226 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef SIGNAL_DATA_H +#define SIGNAL_DATA_H + +#include <ndb_global.h> +#include <kernel/ndb_limits.h> +#include <kernel/kernel_types.h> +#include <BaseString.hpp> + +#define ASSERT_BOOL(flag, message) assert(flag<=1) +#define ASSERT_RANGE(value, min, max, message) \ + assert((value) >= (min) && (value) <= (max)) +#define ASSERT_MAX(value, max, message) assert((value) <= (max)) + +#define SECTION(x) STATIC_CONST(x) + +// defines for setter and getters on commonly used member data in signals + +#define GET_SET_SENDERDATA \ + Uint32 getSenderData() { return senderData; }; \ + void setSenderData(Uint32 _s) { senderData = _s; }; + +#define GET_SET_SENDERREF \ + Uint32 getSenderRef() { return senderRef; }; \ + void setSenderRef(Uint32 _s) { senderRef = _s; }; + +#define GET_SET_PREPAREID \ + Uint32 getPrepareId() { return prepareId; }; \ + void setPrepareId(Uint32 _s) { prepareId = _s; }; + +#define GET_SET_ERRORCODE \ + Uint32 getErrorCode() { return errorCode; }; \ + void setErrorCode(Uint32 _s) { errorCode = _s; }; + +#define GET_SET_TCERRORCODE \ + Uint32 getTCErrorCode() { return TCErrorCode; }; \ + void setTCErrorCode(Uint32 _s) { TCErrorCode = _s; }; + +#define GSN_PRINT_SIGNATURE(f) bool f(FILE *, const Uint32 *, Uint32, Uint16) + +GSN_PRINT_SIGNATURE(printTCKEYREQ); +GSN_PRINT_SIGNATURE(printTCKEYCONF); +GSN_PRINT_SIGNATURE(printTCKEYREF); +GSN_PRINT_SIGNATURE(printLQHKEYREQ); +GSN_PRINT_SIGNATURE(printLQHKEYCONF); +GSN_PRINT_SIGNATURE(printLQHKEYREF); +GSN_PRINT_SIGNATURE(printTUPKEYREQ); +GSN_PRINT_SIGNATURE(printTUPKEYCONF); +GSN_PRINT_SIGNATURE(printTUPKEYREF); +GSN_PRINT_SIGNATURE(printTUPCOMMITREQ); +GSN_PRINT_SIGNATURE(printCONTINUEB); +GSN_PRINT_SIGNATURE(printFSOPENREQ); +GSN_PRINT_SIGNATURE(printFSCLOSEREQ); +GSN_PRINT_SIGNATURE(printFSREADWRITEREQ); +GSN_PRINT_SIGNATURE(printFSREADWRITEREQ); +GSN_PRINT_SIGNATURE(printFSREF); +GSN_PRINT_SIGNATURE(printFSREF); +GSN_PRINT_SIGNATURE(printFSREF); +GSN_PRINT_SIGNATURE(printFSREF); +GSN_PRINT_SIGNATURE(printFSREF); +GSN_PRINT_SIGNATURE(printFSCONF); +GSN_PRINT_SIGNATURE(printFSCONF); +GSN_PRINT_SIGNATURE(printFSCONF); +GSN_PRINT_SIGNATURE(printFSCONF); +GSN_PRINT_SIGNATURE(printFSCONF); +GSN_PRINT_SIGNATURE(printCLOSECOMREQCONF); +GSN_PRINT_SIGNATURE(printCLOSECOMREQCONF); +GSN_PRINT_SIGNATURE(printPACKED_SIGNAL); +GSN_PRINT_SIGNATURE(printPREPFAILREQREF); +GSN_PRINT_SIGNATURE(printPREPFAILREQREF); +GSN_PRINT_SIGNATURE(printALTER_TABLE_REQ); +GSN_PRINT_SIGNATURE(printALTER_TABLE_CONF); +GSN_PRINT_SIGNATURE(printALTER_TABLE_REF); +GSN_PRINT_SIGNATURE(printALTER_TAB_REQ); +GSN_PRINT_SIGNATURE(printALTER_TAB_CONF); +GSN_PRINT_SIGNATURE(printALTER_TAB_REF); +GSN_PRINT_SIGNATURE(printCREATE_TRIG_REQ); +GSN_PRINT_SIGNATURE(printCREATE_TRIG_CONF); +GSN_PRINT_SIGNATURE(printCREATE_TRIG_REF); +GSN_PRINT_SIGNATURE(printALTER_TRIG_REQ); +GSN_PRINT_SIGNATURE(printALTER_TRIG_CONF); +GSN_PRINT_SIGNATURE(printALTER_TRIG_REF); +GSN_PRINT_SIGNATURE(printDROP_TRIG_REQ); +GSN_PRINT_SIGNATURE(printDROP_TRIG_CONF); +GSN_PRINT_SIGNATURE(printDROP_TRIG_REF); +GSN_PRINT_SIGNATURE(printFIRE_TRIG_ORD); +GSN_PRINT_SIGNATURE(printTRIG_ATTRINFO); +GSN_PRINT_SIGNATURE(printCREATE_INDX_REQ); +GSN_PRINT_SIGNATURE(printCREATE_INDX_CONF); +GSN_PRINT_SIGNATURE(printCREATE_INDX_REF); +GSN_PRINT_SIGNATURE(printDROP_INDX_REQ); +GSN_PRINT_SIGNATURE(printDROP_INDX_CONF); +GSN_PRINT_SIGNATURE(printDROP_INDX_REF); +GSN_PRINT_SIGNATURE(printALTER_INDX_REQ); +GSN_PRINT_SIGNATURE(printALTER_INDX_CONF); +GSN_PRINT_SIGNATURE(printALTER_INDX_REF); +GSN_PRINT_SIGNATURE(printTCINDXREQ); +GSN_PRINT_SIGNATURE(printTCINDXCONF); +GSN_PRINT_SIGNATURE(printTCINDXREF); +GSN_PRINT_SIGNATURE(printINDXKEYINFO); +GSN_PRINT_SIGNATURE(printINDXATTRINFO); +GSN_PRINT_SIGNATURE(printFSAPPENDREQ); +GSN_PRINT_SIGNATURE(printBACKUP_REQ); +GSN_PRINT_SIGNATURE(printBACKUP_DATA); +GSN_PRINT_SIGNATURE(printBACKUP_REF); +GSN_PRINT_SIGNATURE(printBACKUP_CONF); +GSN_PRINT_SIGNATURE(printABORT_BACKUP_ORD); +GSN_PRINT_SIGNATURE(printBACKUP_ABORT_REP); +GSN_PRINT_SIGNATURE(printBACKUP_COMPLETE_REP); +GSN_PRINT_SIGNATURE(printBACKUP_NF_COMPLETE_REP); +GSN_PRINT_SIGNATURE(printDEFINE_BACKUP_REQ); +GSN_PRINT_SIGNATURE(printDEFINE_BACKUP_REF); +GSN_PRINT_SIGNATURE(printDEFINE_BACKUP_CONF); +GSN_PRINT_SIGNATURE(printSTART_BACKUP_REQ); +GSN_PRINT_SIGNATURE(printSTART_BACKUP_REF); +GSN_PRINT_SIGNATURE(printSTART_BACKUP_CONF); +GSN_PRINT_SIGNATURE(printBACKUP_FRAGMENT_REQ); +GSN_PRINT_SIGNATURE(printBACKUP_FRAGMENT_REF); +GSN_PRINT_SIGNATURE(printBACKUP_FRAGMENT_CONF); +GSN_PRINT_SIGNATURE(printSTOP_BACKUP_REQ); +GSN_PRINT_SIGNATURE(printSTOP_BACKUP_REF); +GSN_PRINT_SIGNATURE(printSTOP_BACKUP_CONF); +GSN_PRINT_SIGNATURE(printBACKUP_STATUS_REQ); +GSN_PRINT_SIGNATURE(printBACKUP_STATUS_CONF); +GSN_PRINT_SIGNATURE(printUTIL_SEQUENCE_REQ); +GSN_PRINT_SIGNATURE(printUTIL_SEQUENCE_REF); +GSN_PRINT_SIGNATURE(printUTIL_SEQUENCE_CONF); +GSN_PRINT_SIGNATURE(printUTIL_PREPARE_REQ); +GSN_PRINT_SIGNATURE(printUTIL_PREPARE_REF); +GSN_PRINT_SIGNATURE(printUTIL_PREPARE_CONF); +GSN_PRINT_SIGNATURE(printUTIL_EXECUTE_REQ); +GSN_PRINT_SIGNATURE(printUTIL_EXECUTE_REF); +GSN_PRINT_SIGNATURE(printUTIL_EXECUTE_CONF); +GSN_PRINT_SIGNATURE(printSCANTABREQ); +GSN_PRINT_SIGNATURE(printSCANTABCONF); +GSN_PRINT_SIGNATURE(printSCANTABREF); +GSN_PRINT_SIGNATURE(printSCANNEXTREQ); +GSN_PRINT_SIGNATURE(printLQH_FRAG_REQ); +GSN_PRINT_SIGNATURE(printLQH_FRAG_REF); +GSN_PRINT_SIGNATURE(printLQH_FRAG_CONF); +GSN_PRINT_SIGNATURE(printPREP_DROP_TAB_REQ); +GSN_PRINT_SIGNATURE(printPREP_DROP_TAB_REF); +GSN_PRINT_SIGNATURE(printPREP_DROP_TAB_CONF); +GSN_PRINT_SIGNATURE(printDROP_TAB_REQ); +GSN_PRINT_SIGNATURE(printDROP_TAB_REF); +GSN_PRINT_SIGNATURE(printDROP_TAB_CONF); +GSN_PRINT_SIGNATURE(printLCP_FRAG_ORD); +GSN_PRINT_SIGNATURE(printLCP_FRAG_REP); +GSN_PRINT_SIGNATURE(printLCP_COMPLETE_REP); +GSN_PRINT_SIGNATURE(printSTART_LCP_REQ); +GSN_PRINT_SIGNATURE(printSTART_LCP_CONF); +GSN_PRINT_SIGNATURE(printMASTER_LCP_REQ); +GSN_PRINT_SIGNATURE(printMASTER_LCP_REF); +GSN_PRINT_SIGNATURE(printMASTER_LCP_CONF); +GSN_PRINT_SIGNATURE(printCOPY_GCI_REQ); +GSN_PRINT_SIGNATURE(printSYSTEM_ERROR); +GSN_PRINT_SIGNATURE(printSTART_REC_REQ); +GSN_PRINT_SIGNATURE(printSTART_REC_CONF); +GSN_PRINT_SIGNATURE(printNF_COMPLETE_REP); +GSN_PRINT_SIGNATURE(printSIGNAL_DROPPED_REP); +GSN_PRINT_SIGNATURE(printFAIL_REP); +GSN_PRINT_SIGNATURE(printDISCONNECT_REP); +GSN_PRINT_SIGNATURE(printSUB_CREATE_REQ); +GSN_PRINT_SIGNATURE(printSUB_CREATE_CONF); +GSN_PRINT_SIGNATURE(printSUB_CREATE_REF); +GSN_PRINT_SIGNATURE(printSUB_REMOVE_REQ); +GSN_PRINT_SIGNATURE(printSUB_REMOVE_CONF); +GSN_PRINT_SIGNATURE(printSUB_REMOVE_REF); +GSN_PRINT_SIGNATURE(printSUB_START_REQ); +GSN_PRINT_SIGNATURE(printSUB_START_REF); +GSN_PRINT_SIGNATURE(printSUB_START_CONF); +GSN_PRINT_SIGNATURE(printSUB_STOP_REQ); +GSN_PRINT_SIGNATURE(printSUB_STOP_REF); +GSN_PRINT_SIGNATURE(printSUB_STOP_CONF); +GSN_PRINT_SIGNATURE(printSUB_SYNC_REQ); +GSN_PRINT_SIGNATURE(printSUB_SYNC_REF); +GSN_PRINT_SIGNATURE(printSUB_SYNC_CONF); +GSN_PRINT_SIGNATURE(printSUB_META_DATA); +GSN_PRINT_SIGNATURE(printSUB_TABLE_DATA); +GSN_PRINT_SIGNATURE(printSUB_SYNC_CONTINUE_REQ); +GSN_PRINT_SIGNATURE(printSUB_SYNC_CONTINUE_REF); +GSN_PRINT_SIGNATURE(printSUB_SYNC_CONTINUE_CONF); +GSN_PRINT_SIGNATURE(printSUB_GCP_COMPLETE_REP); +GSN_PRINT_SIGNATURE(printCREATE_FRAGMENTATION_REQ); +GSN_PRINT_SIGNATURE(printCREATE_FRAGMENTATION_REF); +GSN_PRINT_SIGNATURE(printCREATE_FRAGMENTATION_CONF); +GSN_PRINT_SIGNATURE(printUTIL_CREATE_LOCK_REQ); +GSN_PRINT_SIGNATURE(printUTIL_CREATE_LOCK_REF); +GSN_PRINT_SIGNATURE(printUTIL_CREATE_LOCK_CONF); +GSN_PRINT_SIGNATURE(printUTIL_DESTROY_LOCK_REQ); +GSN_PRINT_SIGNATURE(printUTIL_DESTROY_LOCK_REF); +GSN_PRINT_SIGNATURE(printUTIL_DESTROY_LOCK_CONF); +GSN_PRINT_SIGNATURE(printUTIL_LOCK_REQ); +GSN_PRINT_SIGNATURE(printUTIL_LOCK_REF); +GSN_PRINT_SIGNATURE(printUTIL_LOCK_CONF); +GSN_PRINT_SIGNATURE(printUTIL_UNLOCK_REQ); +GSN_PRINT_SIGNATURE(printUTIL_UNLOCK_REF); +GSN_PRINT_SIGNATURE(printUTIL_UNLOCK_CONF); +GSN_PRINT_SIGNATURE(printCNTR_START_REQ); +GSN_PRINT_SIGNATURE(printCNTR_START_REF); +GSN_PRINT_SIGNATURE(printCNTR_START_CONF); +GSN_PRINT_SIGNATURE(printREAD_NODES_CONF); +GSN_PRINT_SIGNATURE(printTUX_MAINT_REQ); +GSN_PRINT_SIGNATURE(printACC_LOCKREQ); +GSN_PRINT_SIGNATURE(printLQH_TRANSCONF); +GSN_PRINT_SIGNATURE(printSCAN_FRAGREQ); + +GSN_PRINT_SIGNATURE(printCONTINUEB_NDBFS); +GSN_PRINT_SIGNATURE(printCONTINUEB_DBDIH); +GSN_PRINT_SIGNATURE(printSTART_FRAG_REQ); + +#endif diff --git a/storage/ndb/include/kernel/signaldata/SignalDataPrint.hpp b/storage/ndb/include/kernel/signaldata/SignalDataPrint.hpp new file mode 100644 index 00000000000..1d0b3a17bfd --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/SignalDataPrint.hpp @@ -0,0 +1,35 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef SIGNAL_DATA_PRINT_H +#define SIGNAL_DATA_PRINT_H + +#include <ndb_global.h> +#include <kernel_types.h> + +/** + * Typedef for a Signal Data Print Function + */ +typedef bool (* SignalDataPrintFunction)(FILE * output, const Uint32 * theData, Uint32 len, BlockNumber receiverBlockNo); + +struct NameFunctionPair { + GlobalSignalNumber gsn; + SignalDataPrintFunction function; +}; + +extern const NameFunctionPair SignalDataPrintFunctions[]; +extern const unsigned short NO_OF_PRINT_FUNCTIONS; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/SignalDroppedRep.hpp b/storage/ndb/include/kernel/signaldata/SignalDroppedRep.hpp new file mode 100644 index 00000000000..fd6d5afabce --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/SignalDroppedRep.hpp @@ -0,0 +1,43 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef SIGNAL_DROPPED_HPP +#define SIGNAL_DROPPED_HPP + +#include "SignalData.hpp" + +class SignalDroppedRep { + + /** + * Reciver(s) + */ + friend class SimulatedBlock; + + /** + * Sender (TransporterCallback.cpp) + */ + friend void execute(void * , struct SignalHeader* const, Uint8, + Uint32* const, struct LinearSectionPtr ptr[3]); + + friend bool printSIGNAL_DROPPED_REP(FILE *, const Uint32 *, Uint32, Uint16); +public: +private: + Uint32 originalGsn; + Uint32 originalLength; + Uint32 originalSectionCount; + Uint32 originalData[1]; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/SrFragidConf.hpp b/storage/ndb/include/kernel/signaldata/SrFragidConf.hpp new file mode 100644 index 00000000000..e534378779e --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/SrFragidConf.hpp @@ -0,0 +1,42 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef SR_FRAGIDCONF_HPP +#define SR_FRAGIDCONF_HPP + +#include "SignalData.hpp" + +class SrFragidConf { + /** + * Sender(s) + */ + friend class Dbacc; + + /** + * Receiver(s) + */ + friend class Dblqh; +public: + STATIC_CONST( SignalLength = 10 ); + +private: + Uint32 lcpPtr; + Uint32 accPtr; + Uint32 noLocFrag; + Uint32 fragId[4]; + Uint32 fragPtr[2]; + Uint32 hashCheckBit; +}; +#endif diff --git a/storage/ndb/include/kernel/signaldata/StartFragReq.hpp b/storage/ndb/include/kernel/signaldata/StartFragReq.hpp new file mode 100644 index 00000000000..46a3251e812 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/StartFragReq.hpp @@ -0,0 +1,47 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef START_FRAGREQ_HPP +#define START_FRAGREQ_HPP + +#include "SignalData.hpp" + +class StartFragReq { + /** + * Sender(s) + */ + friend class Dbdih; + + /** + * Receiver(s) + */ + friend class Dblqh; +public: + STATIC_CONST( SignalLength = 19 ); + + friend bool printSTART_FRAG_REQ(FILE *, const Uint32 *, Uint32, Uint16); + + Uint32 userPtr; + Uint32 userRef; + Uint32 lcpNo; + Uint32 lcpId; + Uint32 tableId; + Uint32 fragId; + Uint32 noOfLogNodes; + Uint32 lqhLogNode[4]; + Uint32 startGci[4]; + Uint32 lastGci[4]; +}; +#endif diff --git a/storage/ndb/include/kernel/signaldata/StartInfo.hpp b/storage/ndb/include/kernel/signaldata/StartInfo.hpp new file mode 100644 index 00000000000..733082cae1e --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/StartInfo.hpp @@ -0,0 +1,83 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef START_INFO_HPP +#define START_INFO_HPP + +/** + * This signal is sent from the master DIH to all DIHs + * when a node is starting. + * If the typeStart is initial node restart then the node + * has started without filesystem. + * All DIHs must then "forget" that the starting node has + * performed LCP's ever. + * + * @see StartPermReq + */ + +class StartInfoReq { + /** + * Sender/Receiver + */ + friend class Dbdih; + + Uint32 startingNodeId; + Uint32 typeStart; + Uint32 systemFailureNo; + +public: + STATIC_CONST( SignalLength = 3 ); +}; + +class StartInfoConf { + + /** + * Sender/Receiver + */ + friend class Dbdih; + + /** + * NodeId of sending node + * which is "done" + */ + Uint32 sendingNodeId; + Uint32 startingNodeId; + +public: + STATIC_CONST( SignalLength = 2 ); +}; + +class StartInfoRef { + + /** + * Sender/Receiver + */ + friend class Dbdih; + + /** + * NodeId of sending node + * The node was refused to start. This could be + * because there are still processes handling + * previous information from the starting node. + */ + Uint32 sendingNodeId; + Uint32 startingNodeId; + Uint32 errorCode; + +public: + STATIC_CONST( SignalLength = 3 ); +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/StartMe.hpp b/storage/ndb/include/kernel/signaldata/StartMe.hpp new file mode 100644 index 00000000000..56b20efe951 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/StartMe.hpp @@ -0,0 +1,62 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef START_ME_HPP +#define START_ME_HPP + +/** + * This signal is sent... + * + * It also contains the Sysfile. + * Since the Sysfile can be larger than on StartMeConf signal, + * there might be more than on of these signals sent before + * the entire sysfile is transfered + * + */ +class StartMeReq { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdih; + +public: + STATIC_CONST( SignalLength = 2 ); +private: + + Uint32 startingRef; + Uint32 startingVersion; +}; + +class StartMeConf { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdih; + +public: + STATIC_CONST( SignalLength = 25 ); +private: + + Uint32 startingNodeId; + Uint32 startWord; + + /** + * No of free words to carry data + */ + STATIC_CONST( DATA_SIZE = 23 ); + + Uint32 data[DATA_SIZE]; +}; +#endif diff --git a/storage/ndb/include/kernel/signaldata/StartOrd.hpp b/storage/ndb/include/kernel/signaldata/StartOrd.hpp new file mode 100644 index 00000000000..03092719629 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/StartOrd.hpp @@ -0,0 +1,47 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef START_ORD_HPP +#define START_ORD_HPP + +#include "SignalData.hpp" +#include "StopReq.hpp" + +class StartOrd { +public: + /** + * Senders + */ + friend class ThreadConfig; + friend class MgmtSrvr; + friend class Ndbcntr; + + /** + * Receivers + */ + friend class SimBlockCMCtrBlck; + + /** + * RequestInfo - See StopReq for getters/setters + */ + Uint32 restartInfo; + +public: + STATIC_CONST( SignalLength = 1 ); +}; + + +#endif + diff --git a/storage/ndb/include/kernel/signaldata/StartPerm.hpp b/storage/ndb/include/kernel/signaldata/StartPerm.hpp new file mode 100644 index 00000000000..ffb16bfec9d --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/StartPerm.hpp @@ -0,0 +1,73 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef START_PERM_REQ_HPP +#define START_PERM_REQ_HPP + +/** + * This signal is sent by starting DIH to master DIH + * + * Used when starting in an already started cluster + * + */ +class StartPermReq { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdih; + +public: + STATIC_CONST( SignalLength = 3 ); +private: + + Uint32 blockRef; + Uint32 nodeId; + Uint32 startType; +}; + +class StartPermConf { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdih; + +public: + STATIC_CONST( SignalLength = 2 ); +private: + + Uint32 startingNodeId; + Uint32 systemFailureNo; +}; + +class StartPermRef { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdih; + +public: + STATIC_CONST( SignalLength = 2 ); +private: + + Uint32 startingNodeId; + Uint32 errorCode; + + enum ErrorCode + { + ZNODE_ALREADY_STARTING_ERROR = 305, + InitialStartRequired = 320 + }; +}; +#endif diff --git a/storage/ndb/include/kernel/signaldata/StartRec.hpp b/storage/ndb/include/kernel/signaldata/StartRec.hpp new file mode 100644 index 00000000000..24367c541ab --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/StartRec.hpp @@ -0,0 +1,60 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef START_REC_HPP +#define START_REC_HPP + +#include "SignalData.hpp" + +class StartRecReq { + /** + * Sender(s) + */ + friend class Dbdih; + /** + * Receiver(s) + */ + friend class Dblqh; + + friend bool printSTART_REC_REQ(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 5 ); +private: + + Uint32 receivingNodeId; + Uint32 senderRef; + Uint32 keepGci; + Uint32 lastCompletedGci; + Uint32 newestGci; +}; + +class StartRecConf { + /** + * Sender(s) + */ + friend class Dblqh; + /** + * Receiver(s) + */ + friend class Dbdih; + + friend bool printSTART_REC_CONF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 1 ); +private: + + Uint32 startingNodeId; +}; +#endif diff --git a/storage/ndb/include/kernel/signaldata/StartTo.hpp b/storage/ndb/include/kernel/signaldata/StartTo.hpp new file mode 100644 index 00000000000..f8ac256e98f --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/StartTo.hpp @@ -0,0 +1,49 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef START_TO_HPP +#define START_TO_HPP + +class StartToReq { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdih; + +public: + STATIC_CONST( SignalLength = 5 ); +private: + Uint32 userPtr; + BlockReference userRef; + Uint32 startingNodeId; + Uint32 nodeTakenOver; + bool nodeRestart; +}; + +class StartToConf { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdih; + +public: + STATIC_CONST( SignalLength = 3 ); +private: + + Uint32 userPtr; + Uint32 sendingNodeId; + Uint32 startingNodeId; +}; +#endif diff --git a/storage/ndb/include/kernel/signaldata/StopMe.hpp b/storage/ndb/include/kernel/signaldata/StopMe.hpp new file mode 100644 index 00000000000..98531bffa00 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/StopMe.hpp @@ -0,0 +1,69 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef STOP_ME_HPP +#define STOP_ME_HPP + +/** + * This signal is sent by ndbcntr to local DIH + * + * If local DIH then sends it to all DIH's + * + * @see StopPermReq + * @see StartMeReq + * @see StartPermReq + */ +class StopMeReq { + + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdih; + + /** + * Sender + */ + friend class Ndbcntr; + +public: + STATIC_CONST( SignalLength = 2 ); +private: + + Uint32 senderRef; + Uint32 senderData; +}; + +class StopMeConf { + + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdih; + + /** + * Reciver(s) + */ + friend class Ndbcntr; + +public: + STATIC_CONST( SignalLength = 2 ); + +private: + Uint32 senderRef; + Uint32 senderData; +}; + + +#endif diff --git a/storage/ndb/include/kernel/signaldata/StopPerm.hpp b/storage/ndb/include/kernel/signaldata/StopPerm.hpp new file mode 100644 index 00000000000..145a120646a --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/StopPerm.hpp @@ -0,0 +1,95 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef STOP_PERM_HPP +#define STOP_PERM_HPP + +/** + * This signal is sent by ndbcntr to local DIH + * + * If local DIH is not master, it forwards it to master DIH + * and start acting as a proxy + * + * @see StopMeReq + * @see StartMeReq + * @see StartPermReq + */ +class StopPermReq { + + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdih; + + /** + * Sender + */ + friend class Ndbcntr; + +public: + STATIC_CONST( SignalLength = 2 ); +public: + + Uint32 senderRef; + Uint32 senderData; +}; + +class StopPermConf { + + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdih; + + /** + * Reciver(s) + */ + friend class Ndbcntr; + +public: + STATIC_CONST( SignalLength = 1 ); + +private: + Uint32 senderData; +}; + +class StopPermRef { + + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdih; + + /** + * Reciver(s) + */ + friend class Ndbcntr; + +public: + STATIC_CONST( SignalLength = 2 ); + + enum ErrorCode { + StopOK = 0, + NodeStartInProgress = 1, + NodeShutdownInProgress = 2, + NF_CausedAbortOfStopProcedure = 3 + }; + +private: + Uint32 errorCode; + Uint32 senderData; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/StopReq.hpp b/storage/ndb/include/kernel/signaldata/StopReq.hpp new file mode 100644 index 00000000000..a065f528735 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/StopReq.hpp @@ -0,0 +1,216 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef STOP_REQ_HPP +#define STOP_REQ_HPP + +#include "SignalData.hpp" + +class StopReq +{ + /** + * Reciver(s) + */ + friend class Ndbcntr; + + /** + * Sender + */ + friend class MgmtSrvr; + +public: + STATIC_CONST( SignalLength = 9 + NdbNodeBitmask::Size); + +public: + Uint32 senderRef; + Uint32 senderData; + + Uint32 requestInfo; + Uint32 singleuser; // Indicates whether or not to enter + // single user mode. + // Only in conjunction with system stop + Uint32 singleUserApi; // allowed api in singleuser + + Int32 apiTimeout; // Timeout before api transactions are refused + Int32 transactionTimeout; // Timeout before transactions are aborted + Int32 readOperationTimeout; // Timeout before read operations are aborted + Int32 operationTimeout; // Timeout before all operations are aborted + + Uint32 nodes[NdbNodeBitmask::Size]; + + static void setSystemStop(Uint32 & requestInfo, bool value); + static void setPerformRestart(Uint32 & requestInfo, bool value); + static void setNoStart(Uint32 & requestInfo, bool value); + static void setInitialStart(Uint32 & requestInfo, bool value); + /** + * Don't perform "graceful" shutdown/restart... + */ + static void setStopAbort(Uint32 & requestInfo, bool value); + static void setStopNodes(Uint32 & requestInfo, bool value); + + static bool getSystemStop(const Uint32 & requestInfo); + static bool getPerformRestart(const Uint32 & requestInfo); + static bool getNoStart(const Uint32 & requestInfo); + static bool getInitialStart(const Uint32 & requestInfo); + static bool getStopAbort(const Uint32 & requestInfo); + static bool getStopNodes(const Uint32 & requestInfo); +}; + +struct StopConf +{ + STATIC_CONST( SignalLength = 2 ); + Uint32 senderData; + union { + Uint32 nodeState; + Uint32 nodeId; + }; +}; + +class StopRef +{ + /** + * Reciver(s) + */ + friend class MgmtSrvr; + + /** + * Sender + */ + friend class Ndbcntr; + +public: + STATIC_CONST( SignalLength = 3 ); + + enum ErrorCode { + OK = 0, + NodeShutdownInProgress = 1, + SystemShutdownInProgress = 2, + NodeShutdownWouldCauseSystemCrash = 3, + TransactionAbortFailed = 4, + UnsupportedNodeShutdown = 5, + MultiNodeShutdownNotMaster = 6 + }; + +public: + Uint32 senderData; + Uint32 errorCode; + Uint32 masterNodeId; +}; + +inline +bool +StopReq::getSystemStop(const Uint32 & requestInfo) +{ + return requestInfo & 1; +} + +inline +bool +StopReq::getPerformRestart(const Uint32 & requestInfo) +{ + return requestInfo & 2; +} + +inline +bool +StopReq::getNoStart(const Uint32 & requestInfo) +{ + return requestInfo & 4; +} + +inline +bool +StopReq::getInitialStart(const Uint32 & requestInfo) +{ + return requestInfo & 8; +} + +inline +bool +StopReq::getStopAbort(const Uint32 & requestInfo) +{ + return requestInfo & 32; +} + +inline +bool +StopReq::getStopNodes(const Uint32 & requestInfo) +{ + return requestInfo & 64; +} + + +inline +void +StopReq::setSystemStop(Uint32 & requestInfo, bool value) +{ + if(value) + requestInfo |= 1; + else + requestInfo &= ~1; +} + +inline +void +StopReq::setPerformRestart(Uint32 & requestInfo, bool value) +{ + if(value) + requestInfo |= 2; + else + requestInfo &= ~2; +} + +inline +void +StopReq::setNoStart(Uint32 & requestInfo, bool value) +{ + if(value) + requestInfo |= 4; + else + requestInfo &= ~4; +} + +inline +void +StopReq::setInitialStart(Uint32 & requestInfo, bool value) +{ + if(value) + requestInfo |= 8; + else + requestInfo &= ~8; +} + +inline +void +StopReq::setStopAbort(Uint32 & requestInfo, bool value) +{ + if(value) + requestInfo |= 32; + else + requestInfo &= ~32; +} + +inline +void +StopReq::setStopNodes(Uint32 & requestInfo, bool value) +{ + if(value) + requestInfo |= 64; + else + requestInfo &= ~64; +} + +#endif + diff --git a/storage/ndb/include/kernel/signaldata/SumaImpl.hpp b/storage/ndb/include/kernel/signaldata/SumaImpl.hpp new file mode 100644 index 00000000000..077ea8e879c --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/SumaImpl.hpp @@ -0,0 +1,543 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef SUMA_IMPL_HPP +#define SUMA_IMPL_HPP + +#include "SignalData.hpp" +#include <NodeBitmask.hpp> + + +struct SubCreateReq { + /** + * Sender(s)/Reciver(s) + */ + friend struct Grep; + friend struct SumaParticipant; + + friend bool printSUB_CREATE_REQ(FILE *, const Uint32 *, Uint32, Uint16); + STATIC_CONST( SignalLength = 6 ); + STATIC_CONST( SignalLength2 = 7 ); + + enum SubscriptionType { + SingleTableScan = 1, // + DatabaseSnapshot = 2, // All tables/all data (including new ones) + TableEvent = 3, // + SelectiveTableSnapshot = 4, // User defines tables + RemoveFlags = 0xff, + GetFlags = 0xff << 16, + AddTableFlag = 0x1 << 16, + RestartFlag = 0x2 << 16, + ReportAll = 0x4 << 16, + ReportSubscribe= 0x8 << 16 + }; + + Uint32 senderRef; + Uint32 senderData; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 subscriptionType; + Uint32 tableId; + Uint32 state; +}; + +struct SubCreateRef { + /** + * Sender(s)/Reciver(s) + */ + friend struct Grep; + friend struct SumaParticipant; + + friend bool printSUB_CREATE_REF(FILE *, const Uint32 *, Uint32, Uint16); + STATIC_CONST( SignalLength = 3 ); + + Uint32 senderRef; + Uint32 senderData; + Uint32 errorCode; +}; + +struct SubCreateConf { + /** + * Sender(s)/Reciver(s) + */ + friend struct Grep; + friend struct SumaParticipant; + + friend bool printSUB_CREATE_CONF(FILE *, const Uint32 *, Uint32, Uint16); + STATIC_CONST( SignalLength = 2 ); + + Uint32 senderRef; + Uint32 senderData; +}; + +struct SubscriptionData { + enum Part { + MetaData = 1, + TableData = 2 + }; +}; + +struct SubStartReq { + /** + * Sender(s)/Reciver(s) + */ + friend struct Suma; + + friend bool printSUB_START_REQ(FILE *, const Uint32 *, Uint32, Uint16); + STATIC_CONST( SignalLength = 6 ); + STATIC_CONST( SignalLength2 = SignalLength+1 ); + + Uint32 senderRef; + Uint32 senderData; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 part; // SubscriptionData::Part + Uint32 subscriberData; + Uint32 subscriberRef; +}; + +struct SubStartRef { + /** + * Sender(s)/Reciver(s) + */ + friend struct Suma; + + friend bool printSUB_START_REF(FILE *, const Uint32 *, Uint32, Uint16); + enum ErrorCode { + Undefined = 1, + NF_FakeErrorREF = 11, + Busy = 701, + NotMaster = 702 + }; + + STATIC_CONST( SignalLength = 7 ); + STATIC_CONST( SignalLength2 = SignalLength+1 ); + + Uint32 senderRef; + Uint32 senderData; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 part; // SubscriptionData::Part + Uint32 subscriberData; + // do not change the order here! + Uint32 errorCode; + // with SignalLength2 + union { + Uint32 subscriberRef; + Uint32 m_masterNodeId; + }; +}; + +struct SubStartConf { + /** + * Sender(s)/Reciver(s) + */ + friend struct Grep; + + friend bool printSUB_START_CONF(FILE *, const Uint32 *, Uint32, Uint16); + STATIC_CONST( SignalLength = 7 ); + STATIC_CONST( SignalLength2 = SignalLength+1 ); + + Uint32 senderRef; + Uint32 senderData; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 firstGCI; + Uint32 part; // SubscriptionData::Part + Uint32 subscriberData; + // with SignalLength2 + Uint32 subscriberRef; +}; + +struct SubStopReq { + /** + * Sender(s)/Reciver(s) + */ + friend struct Suma; + + friend bool printSUB_STOP_REQ(FILE *, const Uint32 *, Uint32, Uint16); + STATIC_CONST( SignalLength = 7 ); + Uint32 senderRef; + Uint32 senderData; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 part; // SubscriptionData::Part + Uint32 subscriberData; + Uint32 subscriberRef; +}; + +struct SubStopRef { + /** + * Sender(s)/Reciver(s) + */ + friend struct Suma; + + friend bool printSUB_STOP_REF(FILE *, const Uint32 *, Uint32, Uint16); + enum ErrorCode { + Undefined = 1, + NF_FakeErrorREF = 11, + Busy = 701, + NotMaster = 702 + }; + + STATIC_CONST( SignalLength = 8 ); + STATIC_CONST( SignalLength2 = SignalLength+1 ); + + Uint32 senderRef; + Uint32 senderData; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 part; // SubscriptionData::Part + Uint32 subscriberData; + Uint32 subscriberRef; + Uint32 errorCode; + // with SignalLength2 + Uint32 m_masterNodeId; +}; + +struct SubStopConf { + /** + * Sender(s)/Reciver(s) + */ + friend struct Grep; + + friend bool printSUB_STOP_CONF(FILE *, const Uint32 *, Uint32, Uint16); + STATIC_CONST( SignalLength = 7 ); + + Uint32 senderRef; + Uint32 senderData; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 part; // SubscriptionData::Part + Uint32 subscriberData; + Uint32 subscriberRef; +}; + +struct SubSyncReq { + /** + * Sender(s)/Reciver(s) + */ + friend struct Suma; + friend struct Grep; + + friend bool printSUB_SYNC_REQ(FILE *, const Uint32 *, Uint32, Uint16); + STATIC_CONST( SignalLength = 5 ); + + Uint32 senderRef; + Uint32 senderData; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 part; // SubscriptionData::Part + + SECTION( ATTRIBUTE_LIST = 0); // Used when doing SingelTableScan + SECTION( TABLE_LIST = 1 ); +}; + +struct SubSyncRef { + /** + * Sender(s)/Reciver(s) + */ + friend struct Suma; + friend struct Grep; + + friend bool printSUB_SYNC_REF(FILE *, const Uint32 *, Uint32, Uint16); + enum ErrorCode { + Undefined = 1 + }; + STATIC_CONST( SignalLength = 3 ); + + Uint32 senderRef; + Uint32 senderData; + Uint32 errorCode; +}; + +struct SubSyncConf { + + /** + * Sender(s)/Reciver(s) + */ + friend struct Suma; + friend struct Grep; + + friend bool printSUB_SYNC_CONF(FILE *, const Uint32 *, Uint32, Uint16); + STATIC_CONST( SignalLength = 2 ); + + Uint32 senderRef; + Uint32 senderData; +}; + +struct SubTableData { + /** + * Sender(s)/Reciver(s) + */ + friend struct SumaParticipant; + friend struct Grep; + + friend bool printSUB_TABLE_DATA(FILE *, const Uint32 *, Uint32, Uint16); + STATIC_CONST( SignalLength = 7 ); + SECTION( DICT_TAB_INFO = 0 ); + SECTION( ATTR_INFO = 0 ); + SECTION( AFTER_VALUES = 1 ); + SECTION( BEFORE_VALUES = 2 ); + + enum LogType { + SCAN = 1, + LOG = 2, + REMOVE_FLAGS = 0xff + }; + + Uint32 senderData; + Uint32 gci; + Uint32 tableId; + Uint32 requestInfo; + Uint32 logType; + Uint32 changeMask; + Uint32 totalLen; + + static void setOperation(Uint32& ri, Uint32 val) { + ri = (ri & 0xFFFFFF00) | val; + } + static void setReqNodeId(Uint32& ri, Uint32 val) { + ri = (ri & 0xFFFF00FF) | (val << 8); + } + static void setNdbdNodeId(Uint32& ri, Uint32 val) { + ri = (ri & 0xFF00FFFF) | (val << 16); + } + + static Uint32 getOperation(const Uint32 & ri){ + return (ri & 0xFF); + } + + static Uint32 getReqNodeId(const Uint32 & ri){ + return (ri >> 8) & 0xFF; + } + + static Uint32 getNdbdNodeId(const Uint32 & ri){ + return (ri >> 16) & 0xFF; + } +}; + +struct SubSyncContinueReq { + /** + * Sender(s)/Reciver(s) + */ + friend struct SumaParticipant; + friend struct Grep; + friend struct Trix; + + friend bool printSUB_SYNC_CONTINUE_REQ(FILE *, const Uint32 *, Uint32, Uint16); + STATIC_CONST( SignalLength = 2 ); + + Uint32 subscriberData; + Uint32 noOfRowsSent; +}; + +struct SubSyncContinueRef { + /** + * Sender(s)/Reciver(s) + */ + friend struct SumaParticipant; + friend struct Grep; + friend struct Trix; + + friend bool printSUB_SYNC_CONTINUE_REF(FILE *, const Uint32 *, Uint32, Uint16); + STATIC_CONST( SignalLength = 2 ); + + Uint32 subscriptionId; + Uint32 subscriptionKey; +}; + +struct SubSyncContinueConf { + /** + * Sender(s)/Reciver(s) + */ + friend struct SumaParticipant; + friend struct Grep; + friend struct Trix; + + friend bool printSUB_SYNC_CONTINUE_CONF(FILE *, const Uint32 *, Uint32, Uint16); + STATIC_CONST( SignalLength = 2 ); + + Uint32 subscriptionId; + Uint32 subscriptionKey; +}; + +struct SubGcpCompleteRep { + + /** + * Sender(s)/Reciver(s) + */ + friend struct Dbdih; + friend struct SumaParticipant; + friend struct Grep; + friend struct Trix; + + friend bool printSUB_GCP_COMPLETE_REP(FILE *, const Uint32 *, Uint32, Uint16); + STATIC_CONST( SignalLength = 3 ); + + Uint32 gci; + Uint32 senderRef; + Uint32 gcp_complete_rep_count; +}; + +struct SubGcpCompleteAck { + /** + * Sender(s)/Reciver(s) + */ + STATIC_CONST( SignalLength = SubGcpCompleteRep::SignalLength ); + + SubGcpCompleteRep rep; +}; + +struct SubRemoveReq { + /** + * Sender(s)/Reciver(s) + */ + friend struct Grep; + friend struct SumaParticipant; + + friend bool printSUB_REMOVE_REQ(FILE *, const Uint32 *, Uint32, Uint16); + STATIC_CONST( SignalLength = 4 ); + + Uint32 senderRef; + Uint32 senderData; + Uint32 subscriptionId; + Uint32 subscriptionKey; +}; + +struct SubRemoveRef { + /** + * Sender(s)/Reciver(s) + */ + friend struct Grep; + friend struct SumaParticipant; + + friend bool printSUB_REMOVE_REF(FILE *, const Uint32 *, Uint32, Uint16); + STATIC_CONST( SignalLength = 5 ); + enum ErrorCode { + Undefined = 1, + NF_FakeErrorREF = 11, + Busy = 701 + }; + + Uint32 senderRef; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 errorCode; + Uint32 senderData; +}; + +struct SubRemoveConf { + /** + * Sender(s)/Reciver(s) + */ + friend struct Grep; + friend struct SumaParticipant; + + friend bool printSUB_REMOVE_CONF(FILE *, const Uint32 *, Uint32, Uint16); + STATIC_CONST( SignalLength = 5 ); + + Uint32 senderRef; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 errorCode; + Uint32 senderData; +}; + + +struct CreateSubscriptionIdReq { + friend struct Grep; + friend struct SumaParticipant; + + friend bool printCREATE_SUBSCRIPTION_ID_REQ(FILE *, const Uint32 *, + Uint32, Uint16); + STATIC_CONST( SignalLength = 2 ); + + Uint32 senderRef; + Uint32 senderData; +}; + + +struct CreateSubscriptionIdConf { + friend struct Grep; + friend struct SumaParticipant; + + friend bool printCREATE_SUBSCRIPTION_ID_CONF(FILE *, const Uint32 *, + Uint32, Uint16); + STATIC_CONST( SignalLength = 4 ); + + Uint32 senderRef; + Uint32 senderData; + Uint32 subscriptionId; + Uint32 subscriptionKey; +}; + + +struct CreateSubscriptionIdRef { + friend struct Grep; + friend struct SumaParticipant; + + friend bool printCREATE_SUBSCRIPTION_ID_REF(FILE *, const Uint32 *, + Uint32, Uint16); + STATIC_CONST( SignalLength = 3 ); + + Uint32 senderRef; + Uint32 senderData; + Uint32 errorCode; +}; + +struct SumaStartMeReq { + STATIC_CONST( SignalLength = 1 ); + Uint32 unused; +}; + +struct SumaStartMeRef { + STATIC_CONST( SignalLength = 1 ); + Uint32 errorCode; + enum { + Busy = 0x1 + }; +}; + +struct SumaStartMeConf { + STATIC_CONST( SignalLength = 1 ); + Uint32 unused; +}; + +struct SumaHandoverReq { + STATIC_CONST( SignalLength = 3 ); + Uint32 gci; + Uint32 nodeId; + Uint32 theBucketMask[1]; +}; + +struct SumaHandoverConf { + STATIC_CONST( SignalLength = 3 ); + Uint32 gci; + Uint32 nodeId; + Uint32 theBucketMask[1]; +}; + +struct SumaContinueB +{ + enum + { + RESEND_BUCKET = 1 + ,RELEASE_GCI = 2 + ,OUT_OF_BUFFER_RELEASE = 3 + }; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/SystemError.hpp b/storage/ndb/include/kernel/signaldata/SystemError.hpp new file mode 100644 index 00000000000..ac4ea154198 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/SystemError.hpp @@ -0,0 +1,58 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef SYSTEM_ERROR_HPP +#define SYSTEM_ERROR_HPP + +#include "SignalData.hpp" + +class SystemError { + + /** + * Reciver(s) + */ + friend class Ndbcntr; + + /** + * Sender + */ + friend class Dbtc; + friend class Dbdih; + + /** + * For printing + */ + friend bool printSYSTEM_ERROR(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); + +public: + STATIC_CONST( SignalLength = 4 ); + + enum ErrorCode { + GCPStopDetected = 3, + CopyFragRefError = 5, + TestStopOnError = 6, + CopySubscriptionRef = 7, + CopySubscriberRef = 8, + StartFragRefError = 9 + }; + + Uint32 errorRef; + Uint32 errorCode; + Uint32 data1; + Uint32 data2; +}; + +#endif + diff --git a/storage/ndb/include/kernel/signaldata/TamperOrd.hpp b/storage/ndb/include/kernel/signaldata/TamperOrd.hpp new file mode 100644 index 00000000000..34831704166 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/TamperOrd.hpp @@ -0,0 +1,39 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TAMPERORD_H +#define TAMPERORD_H + +#include "SignalData.hpp" + +class TamperOrd { + /** + * Sender + */ + friend class MgmtSrvr; + + /** + * Receiver + */ + friend class Cmvmi; + +private: + STATIC_CONST( SignalLength = 1 ); + + UintR errorNo; +}; + +#endif // TAMPERORD_H + diff --git a/storage/ndb/include/kernel/signaldata/TcCommit.hpp b/storage/ndb/include/kernel/signaldata/TcCommit.hpp new file mode 100644 index 00000000000..f0234e22ccf --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/TcCommit.hpp @@ -0,0 +1,75 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TCCOMMITCONF_HPP +#define TCCOMMITCONF_HPP + +#include "SignalData.hpp" + +/** + * This is signal is sent from TC to API + * It means that the transaction was committed + */ +class TcCommitConf { + /** + * Sender(s) + */ + friend class Dbtc; + + /** + * Reciver(s) + */ + friend class Ndb; + friend class NdbTransaction; + +public: + STATIC_CONST( SignalLength = 4 ); +private: + + /** + * apiConnectPtr + * + * Bit 0 (lowest) is used as indicator + * if == 1 then tc expects a commit ack + */ + Uint32 apiConnectPtr; + + Uint32 transId1; + Uint32 transId2; + Uint32 gci; +}; + +class TcCommitRef { + /** + * Sender(s) + */ + friend class Dbtc; + + /** + * Reciver(s) + */ + friend class NdbTransaction; + +public: + STATIC_CONST( SignalLength = 4 ); +private: + + Uint32 apiConnectPtr; + Uint32 transId1; + Uint32 transId2; + Uint32 errorCode; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/TcContinueB.hpp b/storage/ndb/include/kernel/signaldata/TcContinueB.hpp new file mode 100644 index 00000000000..b21b4bb4e46 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/TcContinueB.hpp @@ -0,0 +1,51 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TC_CONTINUEB_H +#define TC_CONTINUEB_H + +#include "SignalData.hpp" + +class TcContinueB { + /** + * Sender(s)/Reciver(s) + */ + friend class Dbtc; +private: + enum { + ZRETURN_FROM_QUEUED_DELIVERY = 1, + ZCOMPLETE_TRANS_AT_TAKE_OVER = 2, + ZCONTINUE_TIME_OUT_CONTROL = 3, + ZNODE_TAKE_OVER_COMPLETED = 4, + ZINITIALISE_RECORDS = 5, + ZSEND_COMMIT_LOOP = 6, + ZSEND_COMPLETE_LOOP = 7, + ZHANDLE_FAILED_API_NODE = 8, + ZTRANS_EVENT_REP = 9, + ZABORT_BREAK = 10, + ZABORT_TIMEOUT_BREAK = 11, + ZCONTINUE_TIME_OUT_FRAG_CONTROL = 12, + ZHANDLE_FAILED_API_NODE_REMOVE_MARKERS = 13, + ZWAIT_ABORT_ALL = 14, + ZCHECK_SCAN_ACTIVE_FAILED_LQH = 15, + CHECK_WAIT_DROP_TAB_FAILED_LQH = 16, + TRIGGER_PENDING = 17, + + DelayTCKEYCONF = 18, + ZNF_CHECK_TRANSACTIONS = 19 + }; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/TcHbRep.hpp b/storage/ndb/include/kernel/signaldata/TcHbRep.hpp new file mode 100644 index 00000000000..da3b8d583d3 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/TcHbRep.hpp @@ -0,0 +1,63 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TC_HB_REP_H +#define TC_HB_REP_H + +#include "SignalData.hpp" + +/** + * @class TcHbRep + * @brief Order tc refresh(exetend) the timeout counters for this + * transaction + * + * - SENDER: API + * - RECEIVER: TC + */ +class TcHbRep { + /** + * Receiver(s) + */ + friend class Dbtc; // Receiver + + /** + * Sender(s) + */ + friend class NdbTransaction; + + /** + * For printing + */ + friend bool printTC_HBREP(FILE *, const Uint32 *, Uint32, Uint16); + +public: + /** + * Length of signal + */ + STATIC_CONST( SignalLength = 3 ); + +private: + + /** + * DATA VARIABLES + */ + + Uint32 apiConnectPtr; // DATA 0 + UintR transId1; // DATA 1 + UintR transId2; // DATA 2 +}; + + +#endif diff --git a/storage/ndb/include/kernel/signaldata/TcIndx.hpp b/storage/ndb/include/kernel/signaldata/TcIndx.hpp new file mode 100644 index 00000000000..4dc54e9b188 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/TcIndx.hpp @@ -0,0 +1,125 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TC_INDX_H +#define TC_INDX_H + +#include "SignalData.hpp" +#include "TcKeyReq.hpp" + +class TcIndxConf { + + /** + * Reciver(s) + */ + friend class Ndb; + friend class NdbTransaction; + + /** + * Sender(s) + */ + friend class Dbtc; + + /** + * For printing + */ + friend bool printTCINDXCONF(FILE *, const Uint32 *, Uint32, Uint16); + +public: + /** + * Length of signal + */ + STATIC_CONST( SignalLength = 5 ); + +private: + /** + * DATA VARIABLES + */ + //------------------------------------------------------------- + // Unconditional part. First 5 words + //------------------------------------------------------------- + + Uint32 apiConnectPtr; + Uint32 gci; + Uint32 confInfo; + Uint32 transId1; + Uint32 transId2; + + struct OperationConf { + Uint32 apiOperationPtr; + Uint32 attrInfoLen; + }; + //------------------------------------------------------------- + // Operations confirmations, + // No of actually sent = getNoOfOperations(confInfo) + //------------------------------------------------------------- + OperationConf operations[10]; + + /** + * Get:ers for confInfo + */ + static Uint32 getNoOfOperations(const Uint32 & confInfo); + static Uint32 getCommitFlag(const Uint32 & confInfo); + static bool getMarkerFlag(const Uint32 & confInfo); + + /** + * Set:ers for confInfo + */ + static void setCommitFlag(Uint32 & confInfo, Uint8 flag); + static void setNoOfOperations(Uint32 & confInfo, Uint32 noOfOps); + static void setMarkerFlag(Uint32 & confInfo, Uint32 flag); +}; + +inline +Uint32 +TcIndxConf::getNoOfOperations(const Uint32 & confInfo){ + return confInfo & 65535; +} + +inline +Uint32 +TcIndxConf::getCommitFlag(const Uint32 & confInfo){ + return ((confInfo >> 16) & 1); +} + +inline +bool +TcIndxConf::getMarkerFlag(const Uint32 & confInfo){ + const Uint32 bits = 3 << 16; // Marker only valid when doing commit + return (confInfo & bits) == bits; +} + +inline +void +TcIndxConf::setNoOfOperations(Uint32 & confInfo, Uint32 noOfOps){ + ASSERT_MAX(noOfOps, 65535, "TcIndxConf::setNoOfOperations"); + confInfo |= noOfOps; +} + +inline +void +TcIndxConf::setCommitFlag(Uint32 & confInfo, Uint8 flag){ + ASSERT_BOOL(flag, "TcIndxConf::setCommitFlag"); + confInfo |= (flag << 16); +} + +inline +void +TcIndxConf::setMarkerFlag(Uint32 & confInfo, Uint32 flag){ + ASSERT_BOOL(flag, "TcIndxConf::setMarkerFlag"); + confInfo |= (flag << 17); +} + +#endif diff --git a/storage/ndb/include/kernel/signaldata/TcKeyConf.hpp b/storage/ndb/include/kernel/signaldata/TcKeyConf.hpp new file mode 100644 index 00000000000..b8562875ef5 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/TcKeyConf.hpp @@ -0,0 +1,131 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TC_KEY_CONF_H +#define TC_KEY_CONF_H + +#include "SignalData.hpp" + +/** + * + */ +class TcKeyConf { + /** + * Reciver(s) + */ + friend class Ndb; + friend class NdbTransaction; + friend class Ndbcntr; + friend class DbUtil; + + /** + * Sender(s) + */ + friend class Dbtc; + + /** + * For printing + */ + friend bool printTCKEYCONF(FILE *, const Uint32 *, Uint32, Uint16); + +public: + /** + * Length of signal + */ + STATIC_CONST( StaticLength = 5 ); + STATIC_CONST( OperationLength = 2 ); + STATIC_CONST( SimpleReadBit = (((Uint32)1) << 31) ); + +private: + + /** + * DATA VARIABLES + */ + //------------------------------------------------------------- + // Unconditional part. First 5 words + //------------------------------------------------------------- + + Uint32 apiConnectPtr; + Uint32 gci; + Uint32 confInfo; + Uint32 transId1; + Uint32 transId2; + + struct OperationConf { + Uint32 apiOperationPtr; + Uint32 attrInfoLen; + }; + //------------------------------------------------------------- + // Operations confirmations, + // No of actually sent = getNoOfOperations(confInfo) + //------------------------------------------------------------- + OperationConf operations[10]; + + /** + * Get:ers for confInfo + */ + static Uint32 getNoOfOperations(const Uint32 & confInfo); + static Uint32 getCommitFlag(const Uint32 & confInfo); + static bool getMarkerFlag(const Uint32 & confInfo); + + /** + * Set:ers for confInfo + */ + static void setCommitFlag(Uint32 & confInfo, Uint8 flag); + static void setNoOfOperations(Uint32 & confInfo, Uint32 noOfOps); + static void setMarkerFlag(Uint32 & confInfo, Uint32 flag); +}; + +inline +Uint32 +TcKeyConf::getNoOfOperations(const Uint32 & confInfo){ + return confInfo & 65535; +} + +inline +Uint32 +TcKeyConf::getCommitFlag(const Uint32 & confInfo){ + return ((confInfo >> 16) & 1); +} + +inline +bool +TcKeyConf::getMarkerFlag(const Uint32 & confInfo){ + const Uint32 bits = 3 << 16; // Marker only valid when doing commit + return (confInfo & bits) == bits; +} + +inline +void +TcKeyConf::setNoOfOperations(Uint32 & confInfo, Uint32 noOfOps){ + ASSERT_MAX(noOfOps, 65535, "TcKeyConf::setNoOfOperations"); + confInfo = (confInfo & 0xFFFF0000) | noOfOps; +} + +inline +void +TcKeyConf::setCommitFlag(Uint32 & confInfo, Uint8 flag){ + ASSERT_BOOL(flag, "TcKeyConf::setCommitFlag"); + confInfo |= (flag << 16); +} + +inline +void +TcKeyConf::setMarkerFlag(Uint32 & confInfo, Uint32 flag){ + ASSERT_BOOL(flag, "TcKeyConf::setMarkerFlag"); + confInfo |= (flag << 17); +} + +#endif diff --git a/storage/ndb/include/kernel/signaldata/TcKeyFailConf.hpp b/storage/ndb/include/kernel/signaldata/TcKeyFailConf.hpp new file mode 100644 index 00000000000..076f4f22a51 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/TcKeyFailConf.hpp @@ -0,0 +1,52 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TCKEYFAILCONF_HPP +#define TCKEYFAILCONF_HPP + +#include <NodeBitmask.hpp> + +/** + * This is signal is sent from "Take-Over" TC after a node crash + * It means that the transaction was committed + */ +class TcKeyFailConf { + /** + * Sender(s) + */ + friend class Dbtc; + + /** + * Reciver(s) + */ + friend class Ndb; + friend class NdbTransaction; + +public: + STATIC_CONST( SignalLength = 3 ); +private: + + /** + * apiConnectPtr + * + * Bit 0 (lowest) is used as indicator + * if == 1 then tc expects a commit ack + */ + Uint32 apiConnectPtr; + Uint32 transId1; + Uint32 transId2; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/TcKeyRef.hpp b/storage/ndb/include/kernel/signaldata/TcKeyRef.hpp new file mode 100644 index 00000000000..2846ce3854f --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/TcKeyRef.hpp @@ -0,0 +1,51 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TCKEYREF_HPP +#define TCKEYREF_HPP + +#include "SignalData.hpp" + +class TcKeyRef { + + /** + * Receiver(s) + */ + friend class NdbOperation; + friend class Ndbcntr; + friend class DbUtil; + + /** + * Sender(s) / Receiver(s) + */ + friend class Dbtc; + + /** + * Sender(s) + */ + friend class Dblqh; + + friend bool printTCKEYREF(FILE *, const Uint32 *, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 4 ); + +private: + Uint32 connectPtr; + Uint32 transId[2]; + Uint32 errorCode; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/TcKeyReq.hpp b/storage/ndb/include/kernel/signaldata/TcKeyReq.hpp new file mode 100644 index 00000000000..ee65b4baebf --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/TcKeyReq.hpp @@ -0,0 +1,529 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TC_KEY_REQ_H +#define TC_KEY_REQ_H + +#include "SignalData.hpp" + +/** + * @class TcKeyReq + * @brief Contains KeyInfo and AttrInfo and is commonly followed by more signals + * + * - SENDER: API, NDBCNTR + * - RECEIVER: TC + */ +class TcKeyReq { + /** + * Receiver(s) + */ + friend class Dbtc; // Receiver + + /** + * Sender(s) + */ + friend class Ndbcntr; + friend class NdbOperation; + friend class NdbIndexOperation; + friend class NdbScanOperation; + friend class NdbBlob; + friend class DbUtil; + + /** + * For printing + */ + friend bool printTCKEYREQ(FILE *, const Uint32 *, Uint32, Uint16); + friend bool printTCINDXREQ(FILE *, const Uint32 *, Uint32, Uint16); + +public: + /** + * Length of signal + */ + STATIC_CONST( StaticLength = 8 ); + STATIC_CONST( SignalLength = 25 ); + STATIC_CONST( MaxKeyInfo = 8 ); + STATIC_CONST( MaxAttrInfo = 5 ); + STATIC_CONST( MaxTotalAttrInfo = 0xFFFF ); + +private: + + enum AbortOption { + CommitIfFailFree = 0, AbortOnError = 0, + CommitAsMuchAsPossible = 2, IgnoreError = 2 + }; + + typedef AbortOption CommitType; + + /** + * DATA VARIABLES + */ + + // ---------------------------------------------------------------------- + // Unconditional part = must be present in signal. First 8 words + // ---------------------------------------------------------------------- + Uint32 apiConnectPtr; // DATA 0 + union { + Uint32 senderData; + UintR apiOperationPtr; // DATA 1 + }; + /** + * ATTRIBUTE INFO (attrinfo) LENGTH + * This is the total length of all attribute info that is sent from + * the application as part of this operation. + * It includes all attribute info sent in possible attrinfo + * signals as well as the attribute info sent in TCKEYREQ. + */ + UintR attrLen; // DATA 2 (also stores API Version) + UintR tableId; // DATA 3 + UintR requestInfo; // DATA 4 Various transaction flags + UintR tableSchemaVersion; // DATA 5 + UintR transId1; // DATA 6 + UintR transId2; // DATA 7 + + // ---------------------------------------------------------------------- + // Conditional part = can be present in signal. + // These four words will be sent only if their indicator is set. + // ---------------------------------------------------------------------- + UintR scanInfo; // DATA 8 Various flags for scans + UintR distrGroupHashValue; // DATA 9 + UintR distributionKeySize; // DATA 10 + UintR storedProcId; // DATA 11 + + // ---------------------------------------------------------------------- + // Variable sized KEY and ATTRINFO part. + // These will be placed to pack the signal in an appropriate manner. + // ---------------------------------------------------------------------- + UintR keyInfo[MaxKeyInfo]; // DATA 12 - 19 + UintR attrInfo[MaxAttrInfo]; // DATA 20 - 24 + + /** + * Get:ers for attrLen + */ + + static Uint16 getAPIVersion(const UintR & attrLen); + static Uint16 getAttrinfoLen(const UintR & attrLen); + static void setAPIVersion(UintR & attrLen, Uint16 apiVersion); + static void setAttrinfoLen(UintR & attrLen, Uint16 aiLen); + + + /** + * Get:ers for requestInfo + */ + static Uint8 getCommitFlag(const UintR & requestInfo); + static Uint8 getAbortOption(const UintR & requestInfo); + static Uint8 getStartFlag(const UintR & requestInfo); + static Uint8 getSimpleFlag(const UintR & requestInfo); + static Uint8 getDirtyFlag(const UintR & requestInfo); + static Uint8 getInterpretedFlag(const UintR & requestInfo); + static Uint8 getDistributionKeyFlag(const UintR & requestInfo); + static Uint8 getScanIndFlag(const UintR & requestInfo); + static Uint8 getOperationType(const UintR & requestInfo); + static Uint8 getExecuteFlag(const UintR & requestInfo); + + static Uint16 getKeyLength(const UintR & requestInfo); + static Uint8 getAIInTcKeyReq(const UintR & requestInfo); + static Uint8 getExecutingTrigger(const UintR & requestInfo); + static UintR getNoDiskFlag(const UintR & requestInfo); + + /** + * Get:ers for scanInfo + */ + static Uint8 getTakeOverScanFlag(const UintR & scanInfo); + static Uint16 getTakeOverScanFragment(const UintR & scanInfo); + static Uint32 getTakeOverScanInfo(const UintR & scanInfo); + + + /** + * Set:ers for requestInfo + */ + static void clearRequestInfo(UintR & requestInfo); + static void setAbortOption(UintR & requestInfo, Uint32 type); + static void setCommitFlag(UintR & requestInfo, Uint32 flag); + static void setStartFlag(UintR & requestInfo, Uint32 flag); + static void setSimpleFlag(UintR & requestInfo, Uint32 flag); + static void setDirtyFlag(UintR & requestInfo, Uint32 flag); + static void setInterpretedFlag(UintR & requestInfo, Uint32 flag); + static void setDistributionKeyFlag(UintR & requestInfo, Uint32 flag); + static void setScanIndFlag(UintR & requestInfo, Uint32 flag); + static void setExecuteFlag(UintR & requestInfo, Uint32 flag); + static void setOperationType(UintR & requestInfo, Uint32 type); + + static void setKeyLength(UintR & requestInfo, Uint32 len); + static void setAIInTcKeyReq(UintR & requestInfo, Uint32 len); + static void setExecutingTrigger(UintR & requestInfo, Uint32 flag); + static void setNoDiskFlag(UintR & requestInfo, UintR val); + + /** + * Set:ers for scanInfo + */ + static void setTakeOverScanFlag(UintR & scanInfo, Uint8 flag); + static void setTakeOverScanFragment(UintR & scanInfo, Uint16 fragment); + static void setTakeOverScanInfo(UintR & scanInfo, Uint32 aScanInfo); +}; + +/** + * Request Info + * + a = Attr Info in TCKEYREQ - 3 Bits -> Max 7 (Bit 16-18) + b = Distribution Key Ind - 1 Bit 2 + c = Commit Indicator - 1 Bit 4 + d = Dirty Indicator - 1 Bit 0 + e = Scan Indicator - 1 Bit 14 + f = Execute fired trigger - 1 Bit 19 + i = Interpreted Indicator - 1 Bit 15 + k = Key length - 12 Bits -> Max 4095 (Bit 20 - 31) + o = Operation Type - 3 Bits -> Max 7 (Bit 5-7) + l = Execute - 1 Bit 10 + p = Simple Indicator - 1 Bit 8 + s = Start Indicator - 1 Bit 11 + y = Commit Type - 2 Bit 12-13 + n = No disk flag - 1 Bit 1 + + 1111111111222222222233 + 01234567890123456789012345678901 + dnb cooop lsyyeiaaafkkkkkkkkkkkk +*/ + +#define TCKEY_NODISK_SHIFT (1) +#define COMMIT_SHIFT (4) +#define START_SHIFT (11) +#define SIMPLE_SHIFT (8) +#define DIRTY_SHIFT (0) +#define EXECUTE_SHIFT (10) +#define INTERPRETED_SHIFT (15) +#define DISTR_KEY_SHIFT (2) +#define SCAN_SHIFT (14) + +#define OPERATION_SHIFT (5) +#define OPERATION_MASK (7) + +#define AINFO_SHIFT (16) +#define AINFO_MASK (7) + +#define KEY_LEN_SHIFT (20) +#define KEY_LEN_MASK (4095) + +#define COMMIT_TYPE_SHIFT (12) +#define COMMIT_TYPE_MASK (3) + +#define EXECUTING_TRIGGER_SHIFT (19) + +/** + * Scan Info + * + t = Scan take over indicator - 1 Bit + n = Take over node - 12 Bits -> max 65535 + p = Scan Info - 18 Bits -> max 4095 + + 1111111111222222222233 + 01234567890123456789012345678901 + tpppppppppppppppppp nnnnnnnnnnnn +*/ + +#define TAKE_OVER_SHIFT (0) + +#define TAKE_OVER_FRAG_SHIFT (20) +#define TAKE_OVER_FRAG_MASK (4095) + +#define SCAN_INFO_SHIFT (1) +#define SCAN_INFO_MASK (262143) + +/** + * Attr Len + * + n = Attrinfo length(words) - 16 Bits -> max 65535 + a = API version no - 16 Bits -> max 65535 + + 1111111111222222222233 + 01234567890123456789012345678901 + aaaaaaaaaaaaaaaannnnnnnnnnnnnnnn +*/ + +#define API_VER_NO_SHIFT (16) +#define API_VER_NO_MASK (65535) + +#define ATTRLEN_SHIFT (0) +#define ATTRLEN_MASK (65535) + +inline +Uint8 +TcKeyReq::getCommitFlag(const UintR & requestInfo){ + return (Uint8)((requestInfo >> COMMIT_SHIFT) & 1); +} + +inline +Uint8 +TcKeyReq::getAbortOption(const UintR & requestInfo){ + return (Uint8)((requestInfo >> COMMIT_TYPE_SHIFT) & COMMIT_TYPE_MASK); +} + +inline +Uint8 +TcKeyReq::getStartFlag(const UintR & requestInfo){ + return (Uint8)((requestInfo >> START_SHIFT) & 1); +} + +inline +Uint8 +TcKeyReq::getSimpleFlag(const UintR & requestInfo){ + return (Uint8)((requestInfo >> SIMPLE_SHIFT) & 1); +} + +inline +Uint8 +TcKeyReq::getExecuteFlag(const UintR & requestInfo){ + return (Uint8)((requestInfo >> EXECUTE_SHIFT) & 1); +} + +inline +Uint8 +TcKeyReq::getDirtyFlag(const UintR & requestInfo){ + return (Uint8)((requestInfo >> DIRTY_SHIFT) & 1); +} + +inline +Uint8 +TcKeyReq::getInterpretedFlag(const UintR & requestInfo){ + return (Uint8)((requestInfo >> INTERPRETED_SHIFT) & 1); +} + +inline +Uint8 +TcKeyReq::getDistributionKeyFlag(const UintR & requestInfo){ + return (Uint8)((requestInfo >> DISTR_KEY_SHIFT) & 1); +} + +inline +Uint8 +TcKeyReq::getScanIndFlag(const UintR & requestInfo){ + return (Uint8)((requestInfo >> SCAN_SHIFT) & 1); +} + +inline +Uint8 +TcKeyReq::getOperationType(const UintR & requestInfo){ + return (Uint8)((requestInfo >> OPERATION_SHIFT) & OPERATION_MASK); +} + +inline +Uint16 +TcKeyReq::getKeyLength(const UintR & requestInfo){ + return (Uint16)((requestInfo >> KEY_LEN_SHIFT) & KEY_LEN_MASK); +} + +inline +Uint8 +TcKeyReq::getAIInTcKeyReq(const UintR & requestInfo){ + return (Uint8)((requestInfo >> AINFO_SHIFT) & AINFO_MASK); +} + +inline +Uint8 +TcKeyReq::getExecutingTrigger(const UintR & requestInfo){ + return (Uint8)((requestInfo >> EXECUTING_TRIGGER_SHIFT) & 1); +} + +inline +void +TcKeyReq::clearRequestInfo(UintR & requestInfo){ + requestInfo = 0; +} + +inline +void +TcKeyReq::setAbortOption(UintR & requestInfo, Uint32 type){ + ASSERT_MAX(type, COMMIT_TYPE_MASK, "TcKeyReq::setAbortOption"); + requestInfo &= ~(COMMIT_TYPE_MASK << COMMIT_TYPE_SHIFT); + requestInfo |= (type << COMMIT_TYPE_SHIFT); +} + +inline +void +TcKeyReq::setCommitFlag(UintR & requestInfo, Uint32 flag){ + ASSERT_BOOL(flag, "TcKeyReq::setCommitFlag"); + requestInfo &= ~(1 << COMMIT_SHIFT); + requestInfo |= (flag << COMMIT_SHIFT); +} + +inline +void +TcKeyReq::setStartFlag(UintR & requestInfo, Uint32 flag){ + ASSERT_BOOL(flag, "TcKeyReq::setStartFlag"); + requestInfo &= ~(1 << START_SHIFT); + requestInfo |= (flag << START_SHIFT); +} + +inline +void +TcKeyReq::setSimpleFlag(UintR & requestInfo, Uint32 flag){ + ASSERT_BOOL(flag, "TcKeyReq::setSimpleFlag"); + requestInfo &= ~(1 << SIMPLE_SHIFT); + requestInfo |= (flag << SIMPLE_SHIFT); +} + +inline +void +TcKeyReq::setDirtyFlag(UintR & requestInfo, Uint32 flag){ + ASSERT_BOOL(flag, "TcKeyReq::setDirstFlag"); + requestInfo &= ~(1 << DIRTY_SHIFT); + requestInfo |= (flag << DIRTY_SHIFT); +} + +inline +void +TcKeyReq::setExecuteFlag(UintR & requestInfo, Uint32 flag){ + ASSERT_BOOL(flag, "TcKeyReq::setExecuteFlag"); + requestInfo &= ~(1 << EXECUTE_SHIFT); + requestInfo |= (flag << EXECUTE_SHIFT); +} + +inline +void +TcKeyReq::setInterpretedFlag(UintR & requestInfo, Uint32 flag){ + ASSERT_BOOL(flag, "TcKeyReq::setInterpretedFlag"); + requestInfo &= ~(1 << INTERPRETED_SHIFT); + requestInfo |= (flag << INTERPRETED_SHIFT); +} + +inline +void +TcKeyReq::setDistributionKeyFlag(UintR & requestInfo, Uint32 flag){ + ASSERT_BOOL(flag, "TcKeyReq::setDistributionKeyFlag"); + requestInfo &= ~(1 << DISTR_KEY_SHIFT); + requestInfo |= (flag << DISTR_KEY_SHIFT); +} + +inline +void +TcKeyReq::setScanIndFlag(UintR & requestInfo, Uint32 flag){ + ASSERT_BOOL(flag, "TcKeyReq::setScanIndFlag"); + requestInfo &= ~(1 << SCAN_SHIFT); + requestInfo |= (flag << SCAN_SHIFT); +} + +inline +void +TcKeyReq::setOperationType(UintR & requestInfo, Uint32 type){ + ASSERT_MAX(type, OPERATION_MASK, "TcKeyReq::setOperationType"); + requestInfo &= ~(OPERATION_MASK << OPERATION_SHIFT); + requestInfo |= (type << OPERATION_SHIFT); +} + +inline +void +TcKeyReq::setKeyLength(UintR & requestInfo, Uint32 len){ + ASSERT_MAX(len, KEY_LEN_MASK, "TcKeyReq::setKeyLength"); + requestInfo &= ~(KEY_LEN_MASK << KEY_LEN_SHIFT); + requestInfo |= (len << KEY_LEN_SHIFT); +} + +inline +void +TcKeyReq::setAIInTcKeyReq(UintR & requestInfo, Uint32 len){ + ASSERT_MAX(len, AINFO_MASK, "TcKeyReq::setAIInTcKeyReq"); + requestInfo &= ~(AINFO_MASK << AINFO_SHIFT); + requestInfo |= (len << AINFO_SHIFT); +} + +inline +void +TcKeyReq::setExecutingTrigger(UintR & requestInfo, Uint32 flag){ + ASSERT_BOOL(flag, "TcKeyReq::setExecutingTrigger"); + requestInfo &= ~(1 << EXECUTING_TRIGGER_SHIFT); + requestInfo |= (flag << EXECUTING_TRIGGER_SHIFT); +} + +inline +Uint8 +TcKeyReq::getTakeOverScanFlag(const UintR & scanInfo){ + return (Uint8)((scanInfo >> TAKE_OVER_SHIFT) & 1); +} + +inline +Uint16 +TcKeyReq::getTakeOverScanFragment(const UintR & scanInfo){ + return (Uint16)((scanInfo >> TAKE_OVER_FRAG_SHIFT) & TAKE_OVER_FRAG_MASK); +} + +inline +Uint32 +TcKeyReq::getTakeOverScanInfo(const UintR & scanInfo){ + return (Uint32)((scanInfo >> SCAN_INFO_SHIFT) & SCAN_INFO_MASK); +} + + +inline +void +TcKeyReq::setTakeOverScanFlag(UintR & scanInfo, Uint8 flag){ + ASSERT_BOOL(flag, "TcKeyReq::setTakeOverScanFlag"); + scanInfo |= (flag << TAKE_OVER_SHIFT); +} + +inline +void +TcKeyReq::setTakeOverScanFragment(UintR & scanInfo, Uint16 node){ +// ASSERT_MAX(node, TAKE_OVER_NODE_MASK, "TcKeyReq::setTakeOverScanNode"); + scanInfo |= (node << TAKE_OVER_FRAG_SHIFT); +} + +inline +void +TcKeyReq::setTakeOverScanInfo(UintR & scanInfo, Uint32 aScanInfo){ +// ASSERT_MAX(aScanInfo, SCAN_INFO_MASK, "TcKeyReq::setTakeOverScanInfo"); + scanInfo |= (aScanInfo << SCAN_INFO_SHIFT); +} + + +inline +Uint16 +TcKeyReq::getAPIVersion(const UintR & anAttrLen){ + return (Uint16)((anAttrLen >> API_VER_NO_SHIFT) & API_VER_NO_MASK); +} + +inline +void +TcKeyReq::setAPIVersion(UintR & anAttrLen, Uint16 apiVersion){ +// ASSERT_MAX(apiVersion, API_VER_NO_MASK, "TcKeyReq::setAPIVersion"); + anAttrLen |= (apiVersion << API_VER_NO_SHIFT); +} + +inline +Uint16 +TcKeyReq::getAttrinfoLen(const UintR & anAttrLen){ + return (Uint16)((anAttrLen) & ATTRLEN_MASK); +} + +inline +void +TcKeyReq::setAttrinfoLen(UintR & anAttrLen, Uint16 aiLen){ +// ASSERT_MAX(aiLen, ATTRLEN_MASK, "TcKeyReq::setAttrinfoLen"); + anAttrLen |= aiLen; +} + +inline +UintR +TcKeyReq::getNoDiskFlag(const UintR & requestInfo){ + return (requestInfo >> TCKEY_NODISK_SHIFT) & 1; +} + +inline +void +TcKeyReq::setNoDiskFlag(UintR & requestInfo, Uint32 flag){ + ASSERT_BOOL(flag, "TcKeyReq::setNoDiskFlag"); + requestInfo &= ~(1 << TCKEY_NODISK_SHIFT); + requestInfo |= (flag << TCKEY_NODISK_SHIFT); +} + +#endif diff --git a/storage/ndb/include/kernel/signaldata/TcRollbackRep.hpp b/storage/ndb/include/kernel/signaldata/TcRollbackRep.hpp new file mode 100644 index 00000000000..3b5e2f3d3cb --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/TcRollbackRep.hpp @@ -0,0 +1,49 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TCROLLBACKREP_HPP +#define TCROLLBACKREP_HPP + +#include "SignalData.hpp" + +class TcRollbackRep { + /** + * Sender(s) + */ + friend class NdbTransaction; + friend class DbUtil; + + /** + * Receiver(s) + */ + friend class Dbtup; + + /** + * Sender(s) / Receiver(s) + */ + friend class Dbtc; + + friend bool printTCROLBACKREP(FILE *, const Uint32 *, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 4 ); + +private: + Uint32 connectPtr; + Uint32 transId[2]; + Uint32 returnCode; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/TcSizeAltReq.hpp b/storage/ndb/include/kernel/signaldata/TcSizeAltReq.hpp new file mode 100644 index 00000000000..12bf9b3c72d --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/TcSizeAltReq.hpp @@ -0,0 +1,51 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TC_SIZE_ALT_REQ_H +#define TC_SIZE_ALT_REQ_H + + + +#include "SignalData.hpp" + +class TcSizeAltReq { + /** + * Sender(s) + */ + friend class ClusterConfiguration; + + /** + * Reciver(s) + */ + friend class Dbtc; +private: + /** + * Indexes in theData + */ + STATIC_CONST( IND_BLOCK_REF = 0 ); + STATIC_CONST( IND_API_CONNECT = 1 ); + STATIC_CONST( IND_TC_CONNECT = 2 ); + STATIC_CONST( IND_UNUSED = 3 ); + STATIC_CONST( IND_TABLE = 4 ); + STATIC_CONST( IND_TC_SCAN = 5 ); + STATIC_CONST( IND_LOCAL_SCAN = 6 ); + + /** + * Use the index definitions to use the signal data + */ + UintR theData[7]; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/TestOrd.hpp b/storage/ndb/include/kernel/signaldata/TestOrd.hpp new file mode 100644 index 00000000000..44368a213fe --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/TestOrd.hpp @@ -0,0 +1,228 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TEST_ORD_H +#define TEST_ORD_H + +#include "SignalData.hpp" + +/** + * Send by API to preform TEST ON / TEST OFF + * + * SENDER: API + * RECIVER: SimBlockCMCtrBlck + */ +class TestOrd { + friend class Ndb; + friend class Cmvmi; + friend class MgmtSrvr; +public: + + enum Command { + KeepUnchanged = 0, + On = 1, + Off = 2, + Toggle = 3, + COMMAND_MASK = 3 + }; + + enum SignalLoggerSpecification { + InputSignals = 1, + OutputSignals = 2, + InputOutputSignals = 3, + LOG_MASK = 3 + }; + + enum TraceSpecification { + TraceALL = 0, + TraceAPI = 1, + TraceGlobalCheckpoint = 2, + TraceLocalCheckpoint = 4, + TraceDisconnect = 8, + TRACE_MASK = 15 + }; + +private: + STATIC_CONST( SignalLength = 25 ); + + /** + * Clear Signal + */ + void clear(); + + /** + * Set/Get test command + */ + void setTestCommand(Command); + void getTestCommand(Command&) const; + + /** + * Set trace command + */ + void setTraceCommand(Command, TraceSpecification); + + /** + * Get trace command + */ + void getTraceCommand(Command&, TraceSpecification&) const; + + /** + * Return no of signal logger commands + * + * -1 Means apply command(0) to all blocks + * + */ + UintR getNoOfSignalLoggerCommands() const; + + /** + * Add a signal logger command to a specific block + */ + void addSignalLoggerCommand(BlockNumber, Command, SignalLoggerSpecification); + + /** + * Add a signal logger command to all blocks + * + * Note removes all previously added commands + * + */ + void addSignalLoggerCommand(Command, SignalLoggerSpecification); + + /** + * Get Signal logger command + */ + void getSignalLoggerCommand(int no, BlockNumber&, Command&, SignalLoggerSpecification&) const; + + UintR testCommand; // DATA 0 + UintR traceCommand; // DATA 1 + UintR noOfSignalLoggerCommands; // DATA 2 + UintR signalLoggerCommands[22]; // DATA 3 - 25 +}; + +#define COMMAND_SHIFT (0) +#define TRACE_SHIFT (2) +#define LOG_SHIFT (2) + +#define BLOCK_NO_SHIFT (16) +#define BLOCK_NO_MASK 65535 + +/** + * Clear Signal + */ +inline +void +TestOrd::clear(){ + setTestCommand(KeepUnchanged); + setTraceCommand(KeepUnchanged, TraceAPI); // + noOfSignalLoggerCommands = 0; +} + +/** + * Set/Get test command + */ +inline +void +TestOrd::setTestCommand(Command cmd){ + ASSERT_RANGE(cmd, 0, COMMAND_MASK, "TestOrd::setTestCommand"); + testCommand = cmd; +} + +inline +void +TestOrd::getTestCommand(Command & cmd) const{ + cmd = (Command)(testCommand >> COMMAND_SHIFT); +} + +/** + * Set trace command + */ +inline +void +TestOrd::setTraceCommand(Command cmd, TraceSpecification spec){ + ASSERT_RANGE(cmd, 0, COMMAND_MASK, "TestOrd::setTraceCommand"); + ASSERT_RANGE(spec, 0, TRACE_MASK, "TestOrd::setTraceCommand"); + traceCommand = (cmd << COMMAND_SHIFT) | (spec << TRACE_SHIFT); +} + +/** + * Get trace command + */ +inline +void +TestOrd::getTraceCommand(Command & cmd, TraceSpecification & spec) const{ + cmd = (Command)((traceCommand >> COMMAND_SHIFT) & COMMAND_MASK); + spec = (TraceSpecification)((traceCommand >> TRACE_SHIFT) & TRACE_MASK); +} + +/** + * Return no of signal logger commands + * + * -1 Means apply command(0) to all blocks + * + */ +inline +UintR +TestOrd::getNoOfSignalLoggerCommands() const{ + return noOfSignalLoggerCommands; +} + +/** + * Add a signal logger command to a specific block + */ +inline +void +TestOrd::addSignalLoggerCommand(BlockNumber bnr, + Command cmd, SignalLoggerSpecification spec){ + ASSERT_RANGE(cmd, 0, COMMAND_MASK, "TestOrd::addSignalLoggerCommand"); + ASSERT_RANGE(spec, 0, LOG_MASK, "TestOrd::addSignalLoggerCommand"); + //ASSERT_MAX(bnr, BLOCK_NO_MASK, "TestOrd::addSignalLoggerCommand"); + + signalLoggerCommands[noOfSignalLoggerCommands] = + (bnr << BLOCK_NO_SHIFT) | (cmd << COMMAND_SHIFT) | (spec << LOG_SHIFT); + noOfSignalLoggerCommands ++; +} + +/** + * Add a signal logger command to all blocks + * + * Note removes all previously added commands + * + */ +inline +void +TestOrd::addSignalLoggerCommand(Command cmd, SignalLoggerSpecification spec){ + ASSERT_RANGE(cmd, 0, COMMAND_MASK, "TestOrd::addSignalLoggerCommand"); + ASSERT_RANGE(spec, 0, LOG_MASK, "TestOrd::addSignalLoggerCommand"); + + noOfSignalLoggerCommands = ~0; + signalLoggerCommands[0] = (cmd << COMMAND_SHIFT) | (spec << LOG_SHIFT); +} + +/** + * Get Signal logger command + */ +inline +void +TestOrd::getSignalLoggerCommand(int no, BlockNumber & bnr, + Command & cmd, + SignalLoggerSpecification & spec) const{ + bnr = (BlockNumber)((signalLoggerCommands[no] >> BLOCK_NO_SHIFT) + & BLOCK_NO_MASK); + cmd = (Command)((signalLoggerCommands[no] >> COMMAND_SHIFT) + & COMMAND_MASK); + spec = (SignalLoggerSpecification)((signalLoggerCommands[no] >> LOG_SHIFT) + & LOG_MASK); +} + +#endif diff --git a/storage/ndb/include/kernel/signaldata/TransIdAI.hpp b/storage/ndb/include/kernel/signaldata/TransIdAI.hpp new file mode 100755 index 00000000000..a2af9ed89cc --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/TransIdAI.hpp @@ -0,0 +1,58 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TRANSID_AI_HPP +#define TRANSID_AI_HPP + +#include "SignalData.hpp" + +class TransIdAI { + /** + * Sender(s) + */ + friend class Dbtup; + + /** + * Receiver(s) + */ + friend class NdbTransaction; + friend class Dbtc; + friend class Dbutil; + friend class Dblqh; + friend class Suma; + + friend bool printTRANSID_AI(FILE *, const Uint32 *, Uint32, Uint16); + +public: + STATIC_CONST( HeaderLength = 3 ); + STATIC_CONST( DataLength = 22 ); + + // Public methods +public: + Uint32* getData() const; + +public: + Uint32 connectPtr; + Uint32 transId[2]; + Uint32 attrData[DataLength]; +}; + +inline +Uint32* TransIdAI::getData() const +{ + return (Uint32*)&attrData[0]; +} + +#endif diff --git a/storage/ndb/include/kernel/signaldata/TrigAttrInfo.hpp b/storage/ndb/include/kernel/signaldata/TrigAttrInfo.hpp new file mode 100644 index 00000000000..79371258b3d --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/TrigAttrInfo.hpp @@ -0,0 +1,137 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TRIG_ATTRINFO_HPP +#define TRIG_ATTRINFO_HPP + +#include "SignalData.hpp" +#include <NodeBitmask.hpp> +#include <trigger_definitions.h> +#include <string.h> + +/** + * TrigAttrInfo + * + * This signal is sent by TUP to signal + * that a trigger has fired + */ +class TrigAttrInfo { + /** + * Sender(s) + */ + // API + + /** + * Sender(s) / Reciver(s) + */ + friend class Dbtup; + + /** + * Reciver(s) + */ + friend class Dbtc; + friend class Backup; + friend class SumaParticipant; + + /** + * For printing + */ + friend bool printTRIG_ATTRINFO(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); + +public: +enum AttrInfoType { + PRIMARY_KEY = 0, + BEFORE_VALUES = 1, + AFTER_VALUES = 2 +}; + + STATIC_CONST( DataLength = 22 ); + STATIC_CONST( StaticLength = 3 ); + +private: + Uint32 m_connectionPtr; + Uint32 m_trigId; + Uint32 m_type; + Uint32 m_data[DataLength]; + + // Public methods +public: + Uint32 getConnectionPtr() const; + void setConnectionPtr(Uint32); + AttrInfoType getAttrInfoType() const; + void setAttrInfoType(AttrInfoType anAttrType); + Uint32 getTriggerId() const; + void setTriggerId(Uint32 aTriggerId); + Uint32 getTransactionId1() const; + void setTransactionId1(Uint32 aTransId); + Uint32 getTransactionId2() const; + void setTransactionId2(Uint32 aTransId); + Uint32* getData() const; + int setData(Uint32* aDataBuf, Uint32 aDataLen); +}; + +inline +Uint32 TrigAttrInfo::getConnectionPtr() const +{ + return m_connectionPtr; +} + +inline +void TrigAttrInfo::setConnectionPtr(Uint32 aConnectionPtr) +{ + m_connectionPtr = aConnectionPtr; +} + +inline +TrigAttrInfo::AttrInfoType TrigAttrInfo::getAttrInfoType() const +{ + return (TrigAttrInfo::AttrInfoType) m_type; +} + +inline +void TrigAttrInfo::setAttrInfoType(TrigAttrInfo::AttrInfoType anAttrType) +{ + m_type = (Uint32) anAttrType; +} + +inline +Uint32 TrigAttrInfo::getTriggerId() const +{ + return m_trigId; +} + +inline +void TrigAttrInfo::setTriggerId(Uint32 aTriggerId) +{ + m_trigId = aTriggerId; +} + +inline +Uint32* TrigAttrInfo::getData() const +{ + return (Uint32*)&m_data[0]; +} + +inline +int TrigAttrInfo::setData(Uint32* aDataBuf, Uint32 aDataLen) +{ + if (aDataLen > DataLength) + return -1; + memcpy(m_data, aDataBuf, aDataLen*sizeof(Uint32)); + + return 0; +} + +#endif diff --git a/storage/ndb/include/kernel/signaldata/TsmanContinueB.hpp b/storage/ndb/include/kernel/signaldata/TsmanContinueB.hpp new file mode 100644 index 00000000000..edfcf4ac5d1 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/TsmanContinueB.hpp @@ -0,0 +1,36 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TSMAN_CONTINUEB_H +#define TSMAN_CONTINUEB_H + +#include "SignalData.hpp" + +class TsmanContinueB { + /** + * Sender(s)/Reciver(s) + */ + friend class Tsman; +private: + enum { + LOAD_EXTENT_PAGES = 0, + SCAN_TABLESPACE_EXTENT_HEADERS = 1, + SCAN_DATAFILE_EXTENT_HEADERS = 2, + END_LCP = 3, + RELEASE_EXTENT_PAGES = 4 + }; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/TupCommit.hpp b/storage/ndb/include/kernel/signaldata/TupCommit.hpp new file mode 100644 index 00000000000..976aa590659 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/TupCommit.hpp @@ -0,0 +1,50 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TUP_COMMIT_H +#define TUP_COMMIT_H + +#include "SignalData.hpp" + +class TupCommitReq { + /** + * Reciver(s) + */ + friend class Dbtup; + + /** + * Sender(s) + */ + friend class Dblqh; + + /** + * For printing + */ + friend bool printTUPCOMMITREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); + +public: + STATIC_CONST( SignalLength = 3 ); + +private: + + /** + * DATA VARIABLES + */ + Uint32 opPtr; + Uint32 gci; + Uint32 hashValue; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/TupFrag.hpp b/storage/ndb/include/kernel/signaldata/TupFrag.hpp new file mode 100644 index 00000000000..cae548aa094 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/TupFrag.hpp @@ -0,0 +1,208 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TUP_FRAG_HPP +#define TUP_FRAG_HPP + +#include "SignalData.hpp" + +/* + * Add fragment and add attribute signals between LQH and TUP,TUX. + * NOTE: return signals from TUP,TUX to LQH must have same format. + */ + +// TUP: add fragment + +class TupFragReq { + friend class Dblqh; + friend class Dbtup; +public: + STATIC_CONST( SignalLength = 17 ); +private: + Uint32 userPtr; + Uint32 userRef; + Uint32 reqInfo; + Uint32 tableId; + Uint32 noOfAttr; + Uint32 fragId; + Uint32 maxRowsLow; + Uint32 maxRowsHigh; + Uint32 minRowsLow; + Uint32 minRowsHigh; + Uint32 noOfNullAttr; + Uint32 schemaVersion; + Uint32 noOfKeyAttr; + Uint32 noOfCharsets; + Uint32 checksumIndicator; + Uint32 globalCheckpointIdIndicator; + Uint32 tablespaceid; +}; + +class TupFragConf { + friend class Dblqh; + friend class Dbtup; +public: + STATIC_CONST( SignalLength = 4 ); +private: + Uint32 userPtr; + Uint32 tupConnectPtr; + Uint32 fragPtr; + Uint32 fragId; +}; + +class TupFragRef { + friend class Dblqh; + friend class Dbtup; +public: + STATIC_CONST( SignalLength = 2 ); +private: + Uint32 userPtr; + Uint32 errorCode; +}; + +// TUX: add fragment + +class TuxFragReq { + friend class Dblqh; + friend class Dbtux; +public: + STATIC_CONST( SignalLength = 14 ); +private: + Uint32 userPtr; + Uint32 userRef; + Uint32 reqInfo; + Uint32 tableId; + Uint32 noOfAttr; + Uint32 fragId; + Uint32 fragOff; + Uint32 tableType; + Uint32 primaryTableId; + Uint32 tupIndexFragPtrI; + Uint32 tupTableFragPtrI[2]; + Uint32 accTableFragPtrI[2]; +}; + +class TuxFragConf { + friend class Dblqh; + friend class Dbtux; +public: + STATIC_CONST( SignalLength = 4 ); +private: + Uint32 userPtr; + Uint32 tuxConnectPtr; + Uint32 fragPtr; + Uint32 fragId; +}; + +class TuxFragRef { + friend class Dblqh; + friend class Dbtux; +public: + STATIC_CONST( SignalLength = 2 ); + enum ErrorCode { + NoError = 0, + InvalidRequest = 903, + NoFreeFragment = 904, + NoFreeAttributes = 905 + }; +private: + Uint32 userPtr; + Uint32 errorCode; +}; + +// TUP: add attribute + +class TupAddAttrReq { + friend class Dblqh; + friend class Dbtux; +public: + STATIC_CONST( SignalLength = 5 ); +private: + Uint32 tupConnectPtr; + Uint32 notused1; + Uint32 attrId; + Uint32 attrDescriptor; + Uint32 extTypeInfo; +}; + +class TupAddAttrConf { + friend class Dblqh; + friend class Dbtup; +public: + STATIC_CONST( SignalLength = 2 ); +private: + Uint32 userPtr; + Uint32 lastAttr; // bool: got last attr and closed frag op +}; + +class TupAddAttrRef { + friend class Dblqh; + friend class Dbtup; +public: + STATIC_CONST( SignalLength = 2 ); + enum ErrorCode { + NoError = 0, + InvalidCharset = 743, + TooManyBitsUsed = 831, + UnsupportedType = 906 + }; +private: + Uint32 userPtr; + Uint32 errorCode; +}; + +// TUX: add attribute + +class TuxAddAttrReq { + friend class Dblqh; + friend class Dbtux; +public: + STATIC_CONST( SignalLength = 6 ); +private: + Uint32 tuxConnectPtr; + Uint32 notused1; + Uint32 attrId; + Uint32 attrDescriptor; + Uint32 extTypeInfo; + Uint32 primaryAttrId; +}; + +class TuxAddAttrConf { + friend class Dblqh; + friend class Dbtux; +public: + STATIC_CONST( SignalLength = 2 ); +private: + Uint32 userPtr; + Uint32 lastAttr; // bool: got last attr and closed frag op +}; + +class TuxAddAttrRef { + friend class Dblqh; + friend class Dbtux; +public: + STATIC_CONST( SignalLength = 2 ); + enum ErrorCode { + NoError = 0, + InvalidAttributeType = 906, + InvalidCharset = 907, + InvalidNodeSize = 908 + }; +private: + Uint32 userPtr; + Uint32 errorCode; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/TupKey.hpp b/storage/ndb/include/kernel/signaldata/TupKey.hpp new file mode 100644 index 00000000000..e77dbd471e7 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/TupKey.hpp @@ -0,0 +1,125 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TUP_KEY_H +#define TUP_KEY_H + +#include "SignalData.hpp" + +class TupKeyReq { + /** + * Reciver(s) + */ + friend class Dbtup; + + /** + * Sender(s) + */ + friend class Dblqh; + + /** + * For printing + */ + friend bool printTUPKEYREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); + +public: + STATIC_CONST( SignalLength = 18 ); + +private: + + /** + * DATA VARIABLES + */ + Uint32 connectPtr; + Uint32 request; + Uint32 keyRef1; + Uint32 keyRef2; + Uint32 attrBufLen; + Uint32 opRef; + Uint32 applRef; + Uint32 storedProcedure; + Uint32 transId1; + Uint32 transId2; + Uint32 fragPtr; + Uint32 primaryReplica; + Uint32 coordinatorTC; + Uint32 tcOpIndex; + Uint32 savePointId; + Uint32 disk_page; + Uint32 m_row_id_page_no; + Uint32 m_row_id_page_idx; +}; + +class TupKeyConf { + /** + * Reciver(s) + */ + friend class Dblqh; + + /** + * Sender(s) + */ + friend class Dbtup; + + /** + * For printing + */ + friend bool printTUPKEYCONF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); + +public: + STATIC_CONST( SignalLength = 6 ); + +private: + + /** + * DATA VARIABLES + */ + Uint32 userPtr; + Uint32 readLength; + Uint32 writeLength; + Uint32 noFiredTriggers; + Uint32 lastRow; + Uint32 rowid; +}; + +class TupKeyRef { + /** + * Reciver(s) + */ + friend class Dblqh; + + /** + * Sender(s) + */ + friend class Dbtup; + + /** + * For printing + */ + friend bool printTUPKEYREF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); + +public: + STATIC_CONST( SignalLength = 2 ); + +private: + + /** + * DATA VARIABLES + */ + Uint32 userRef; + Uint32 errorCode; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/TupSizeAltReq.hpp b/storage/ndb/include/kernel/signaldata/TupSizeAltReq.hpp new file mode 100644 index 00000000000..1fb4eae8f51 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/TupSizeAltReq.hpp @@ -0,0 +1,57 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TUP_SIZE_ALT_REQ_H +#define TUP_SIZE_ALT_REQ_H + + + +#include "SignalData.hpp" + +class TupSizeAltReq { + /** + * Sender(s) + */ + friend class ClusterConfiguration; + + /** + * Reciver(s) + */ + friend class Dbtup; +private: + /** + * Indexes in theData + */ + STATIC_CONST( IND_BLOCK_REF = 0 ); + STATIC_CONST( IND_DISK_PAGE_ARRAY = 1 ); + STATIC_CONST( IND_DISK_PAGE_REPRESENT = 2 ); + STATIC_CONST( IND_FRAG = 3 ); + STATIC_CONST( IND_PAGE_CLUSTER = 4 ); + STATIC_CONST( IND_LOGIC_PAGE = 5 ); + STATIC_CONST( IND_OP_RECS = 6 ); + STATIC_CONST( IND_PAGE = 7 ); + STATIC_CONST( IND_PAGE_RANGE = 8 ); + STATIC_CONST( IND_TABLE = 9 ); + STATIC_CONST( IND_TABLE_DESC = 10 ); + STATIC_CONST( IND_DELETED_BLOCKS = 11 ); + STATIC_CONST( IND_STORED_PROC = 12 ); + + /** + * Use the index definitions to use the signal data + */ + UintR theData[13]; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/TuxBound.hpp b/storage/ndb/include/kernel/signaldata/TuxBound.hpp new file mode 100644 index 00000000000..c0f8fd82038 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/TuxBound.hpp @@ -0,0 +1,58 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TUX_BOUND_HPP +#define TUX_BOUND_HPP + +#include "SignalData.hpp" + +class TuxBoundInfo { + friend class Dblqh; + friend class Dbtux; +public: + // must match API (0-4 and no changes expected) + enum BoundType { + BoundLE = 0, // bit 1 for less/greater + BoundLT = 1, // bit 0 for strict + BoundGE = 2, + BoundGT = 3, + BoundEQ = 4 + }; + enum ErrorCode { + InvalidAttrInfo = 4110, + InvalidBounds = 4259, + OutOfBuffers = 873, + InvalidCharFormat = 744, + TooMuchAttrInfo = 823 + }; + STATIC_CONST( SignalLength = 3 ); +private: + /* + * Error code set by TUX. Zero means no error. + */ + Uint32 errorCode; + /* + * Pointer (i-value) to scan operation in TUX. + */ + Uint32 tuxScanPtrI; + /* + * Number of words of bound info included after fixed signal data. + */ + Uint32 boundAiLength; + + Uint32 data[1]; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/TuxContinueB.hpp b/storage/ndb/include/kernel/signaldata/TuxContinueB.hpp new file mode 100644 index 00000000000..87ac4d89211 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/TuxContinueB.hpp @@ -0,0 +1,29 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TUX_CONTINUEB_H +#define TUX_CONTINUEB_H + +#include "SignalData.hpp" + +class TuxContinueB { + friend class Dbtux; +private: + enum { + DropIndex = 1 + }; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/TuxMaint.hpp b/storage/ndb/include/kernel/signaldata/TuxMaint.hpp new file mode 100644 index 00000000000..37237383e76 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/TuxMaint.hpp @@ -0,0 +1,69 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TUX_MAINT_HPP +#define TUX_MAINT_HPP + +#include "SignalData.hpp" + +/* + * Ordered index maintenance operation. + */ + +class TuxMaintReq { + friend class Dbtup; + friend class Dbtux; + friend bool printTUX_MAINT_REQ(FILE*, const Uint32*, Uint32, Uint16); +public: + enum OpCode { // first byte of opInfo + OpAdd = 1, + OpRemove = 2 + }; + enum OpFlag { // second byte of opInfo + }; + enum ErrorCode { + NoError = 0, // must be zero + SearchError = 901, // add + found or remove + not found + NoMemError = 902 + }; + STATIC_CONST( SignalLength = 8 ); + + /* + * Error code set by TUX. Zero means no error. + */ + Uint32 errorCode; + /* + * Table, index, fragment. + */ + Uint32 tableId; + Uint32 indexId; + Uint32 fragId; + /* + * Tuple version identified by physical address of "original" tuple + * and version number. + */ + Uint32 pageId; + Uint32 pageIndex; + Uint32 tupVersion; + /* + * Operation code and flags. + */ + Uint32 opInfo; + + Uint32 tupFragPtrI; + Uint32 fragPageId; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/TuxSizeAltReq.hpp b/storage/ndb/include/kernel/signaldata/TuxSizeAltReq.hpp new file mode 100644 index 00000000000..bf2314d7159 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/TuxSizeAltReq.hpp @@ -0,0 +1,47 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TUX_SIZE_ALT_REQ_H +#define TUX_SIZE_ALT_REQ_H + +#include "SignalData.hpp" + +class TuxSizeAltReq { + /** + * Sender(s) + */ + friend class ClusterConfiguration; + + /** + * Receiver(s) + */ + friend class Dbtux; +private: + /** + * Indexes in theData + */ + STATIC_CONST( IND_BLOCK_REF = 0 ); + STATIC_CONST( IND_INDEX = 1 ); + STATIC_CONST( IND_FRAGMENT = 2 ); + STATIC_CONST( IND_ATTRIBUTE = 3 ); + STATIC_CONST( IND_SCAN = 4 ); + + /** + * Use the index definitions to use the signal data + */ + UintR theData[4]; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/UpdateTo.hpp b/storage/ndb/include/kernel/signaldata/UpdateTo.hpp new file mode 100644 index 00000000000..e46fe1c1556 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/UpdateTo.hpp @@ -0,0 +1,58 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef UPDATE_TO_HPP +#define UPDATE_TO_HPP + +class UpdateToReq { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdih; + +public: + STATIC_CONST( SignalLength = 6 ); +private: + enum UpdateState { + TO_COPY_FRAG_COMPLETED = 0, + TO_COPY_COMPLETED = 1 + }; + Uint32 userPtr; + BlockReference userRef; + UpdateState updateState; + Uint32 startingNodeId; + + /** + * Only when TO_COPY_FRAG_COMPLETED + */ + Uint32 tableId; + Uint32 fragmentNo; +}; + +class UpdateToConf { + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdih; + +public: + STATIC_CONST( SignalLength = 3 ); +private: + + Uint32 userPtr; + Uint32 sendingNodeId; + Uint32 startingNodeId; +}; +#endif diff --git a/storage/ndb/include/kernel/signaldata/UpgradeStartup.hpp b/storage/ndb/include/kernel/signaldata/UpgradeStartup.hpp new file mode 100644 index 00000000000..80f6a161e05 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/UpgradeStartup.hpp @@ -0,0 +1,53 @@ +/* Copyright (C) 2004 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + +#ifndef NDB_UPGRADE_STARTUP +#define NDB_UPGRADE_STARTUP + +class Ndbcntr; + +struct UpgradeStartup { + + static void installEXEC(SimulatedBlock*); + + STATIC_CONST( GSN_CM_APPCHG = 131 ); + STATIC_CONST( GSN_CNTR_MASTERCONF = 148 ); + STATIC_CONST( GSN_CNTR_MASTERREF = 149 ); + STATIC_CONST( GSN_CNTR_MASTERREQ = 150 ); + + static void sendCmAppChg(Ndbcntr&, Signal *, Uint32 startLevel); + static void execCM_APPCHG(SimulatedBlock& block, Signal*); + static void sendCntrMasterReq(Ndbcntr& cntr, Signal* signal, Uint32 n); + static void execCNTR_MASTER_REPLY(SimulatedBlock & block, Signal* signal); + + struct CntrMasterReq { + STATIC_CONST( SignalLength = 4 + NdbNodeBitmask::Size ); + + Uint32 userBlockRef; + Uint32 userNodeId; + Uint32 typeOfStart; + Uint32 noRestartNodes; + Uint32 theNodes[NdbNodeBitmask::Size]; + }; + + struct CntrMasterConf { + STATIC_CONST( SignalLength = 1 + NdbNodeBitmask::Size ); + + Uint32 noStartNodes; + Uint32 theNodes[NdbNodeBitmask::Size]; + }; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/UtilDelete.hpp b/storage/ndb/include/kernel/signaldata/UtilDelete.hpp new file mode 100644 index 00000000000..fb5c0ece0fd --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/UtilDelete.hpp @@ -0,0 +1,120 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef UTIL_DELETE_HPP +#define UTIL_DELETE_HPP + +#include "SignalData.hpp" +#include <SimpleProperties.hpp> + +/** + * UTIL_DELETE_REQ, UTIL_DELETE_CONF, UTIL_DELETE_REF + */ + +/** + * @class UtilDeleteReq + * @brief Delete transaction in Util block + * + * Data format: + * - UTIL_DELETE_REQ <prepareId> <ListOfAttributeHeaderValuePairs> + */ + +class UtilDeleteReq { + /** Sender(s) / Receiver(s) */ + friend class DbUtil; + + /** For printing */ + friend bool printUTIL_DELETE_REQ(FILE * output, const Uint32 * theData, + Uint32 len, Uint16 receiverBlockNo); +public: + STATIC_CONST( DataLength = 22 ); + STATIC_CONST( HeaderLength = 3 ); + +private: + Uint32 senderData; + Uint32 prepareId; // Which prepared transaction to execute + Uint32 totalDataLen; // Total length of attrData (including AttributeHeaders + // and possibly spanning over multiple signals) + + /** + * Length in this = signal->length() - 3 + * Sender block ref = signal->senderBlockRef() + */ + + Uint32 attrData[DataLength]; +}; + + + +/** + * @class UtilDeleteConf + * + * Data format: + * - UTIL_PREPARE_CONF <UtilPrepareId> + */ + +class UtilDeleteConf { + /** + * Sender(s) / Receiver(s) + */ + friend class DbUtil; + + /** + * For printing + */ + friend bool printUTIL_DELETE_CONF(FILE * output, + const Uint32 * theData, + Uint32 len, + Uint16 receiverBlockNo); + + STATIC_CONST( SignalLength = 1 ); + +private: + Uint32 senderData; ///< The client data provided by the client sending + ///< UTIL_DELETE_REQ +}; + + +/** + * @class UtilDeleteRef + * + * Data format: + * - UTIL_PREPARE_REF + */ + +class UtilDeleteRef { + /** + * Sender(s) / Receiver(s) + */ + friend class DbUtil; + + /** + * For printing + */ + friend bool printUTIL_DELETE_REF(FILE * output, + const Uint32 * theData, + Uint32 len, + Uint16 receiverBlockNo); + + STATIC_CONST( SignalLength = 2 ); + +private: + Uint32 senderData; + Uint32 errorCode; ///< See UtilExecuteRef::errorCode + Uint32 TCErrorCode; +}; + + +#endif diff --git a/storage/ndb/include/kernel/signaldata/UtilExecute.hpp b/storage/ndb/include/kernel/signaldata/UtilExecute.hpp new file mode 100644 index 00000000000..24a3d5874d2 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/UtilExecute.hpp @@ -0,0 +1,134 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef UTIL_EXECUTE_HPP +#define UTIL_EXECUTE_HPP + +#include "SignalData.hpp" +#include <SimpleProperties.hpp> + +/** + * UTIL_EXECUTE_REQ, UTIL_EXECUTE_CONF, UTIL_EXECUTE_REF + */ + +/** + * @class UtilExecuteReq + * @brief Execute transaction in Util block + * + * Data format: + * - UTIL_EXECUTE_REQ <prepareId> <ListOfAttributeHeaderValuePairs> + */ + +class UtilExecuteReq { + /** Sender(s) / Receiver(s) */ + friend class DbUtil; + friend class Trix; + + /** For printing */ + friend bool printUTIL_EXECUTE_REQ(FILE * output, const Uint32 * theData, + Uint32 len, Uint16 receiverBlockNo); +public: + STATIC_CONST( SignalLength = 3 ); + STATIC_CONST( HEADER_SECTION = 0 ); + STATIC_CONST( DATA_SECTION = 1 ); + STATIC_CONST( NoOfSections = 2 ); + + GET_SET_SENDERREF + GET_SET_SENDERDATA + void setPrepareId(Uint32 pId) { prepareId = pId; }; // !! unsets release flag + Uint32 getPrepareId() const { return prepareId & 0xFF; }; + void setReleaseFlag() { prepareId |= 0x100; }; + bool getReleaseFlag() const { return (prepareId & 0x100) != 0; }; +private: + Uint32 senderData; // MUST be no 1! + Uint32 senderRef; + Uint32 prepareId; // Which prepared transaction to execute +}; + +/** + * @class UtilExecuteConf + * + * Data format: + * - UTIL_PREPARE_CONF <UtilPrepareId> + */ + +class UtilExecuteConf { + /** + * Sender(s) / Receiver(s) + */ + friend class DbUtil; + friend class Trix; + + /** + * For printing + */ + friend bool printUTIL_EXECUTE_CONF(FILE * output, + const Uint32 * theData, + Uint32 len, + Uint16 receiverBlockNo); +public: + STATIC_CONST( SignalLength = 1 ); + + GET_SET_SENDERDATA +private: + Uint32 senderData; // MUST be no 1! +}; + + +/** + * @class UtilExecuteRef + * + * Data format: + * - UTIL_PREPARE_REF + */ + +class UtilExecuteRef { + /** + * Sender(s) / Receiver(s) + */ + friend class DbUtil; + friend class Trix; + + /** + * For printing + */ + friend bool printUTIL_EXECUTE_REF(FILE * output, + const Uint32 * theData, + Uint32 len, + Uint16 receiverBlockNo); + +public: + STATIC_CONST( SignalLength = 3 ); + + enum ErrorCode { + IllegalKeyNumber = 1, + IllegalAttrNumber = 2, + TCError = 3, + AllocationError = 5, + MissingDataSection = 6, + MissingData = 7 + }; + + GET_SET_SENDERDATA + GET_SET_ERRORCODE + GET_SET_TCERRORCODE +private: + Uint32 senderData; // MUST be no 1! + Uint32 errorCode; + Uint32 TCErrorCode; +}; + + +#endif diff --git a/storage/ndb/include/kernel/signaldata/UtilLock.hpp b/storage/ndb/include/kernel/signaldata/UtilLock.hpp new file mode 100644 index 00000000000..75a697714f0 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/UtilLock.hpp @@ -0,0 +1,333 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef UTIL_LOCK_HPP +#define UTIL_LOCK_HPP + +#include "SignalData.hpp" + +class UtilLockReq { + + /** + * Receiver + */ + friend class DbUtil; + + /** + * Sender + */ + friend class Dbdih; + friend class MutexManager; + + friend bool printUTIL_LOCK_REQ(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 4 ); + + enum RequestInfo { + TryLock = 1 + }; +public: + Uint32 senderData; + Uint32 senderRef; + Uint32 lockId; + Uint32 requestInfo; +}; + +class UtilLockConf { + + /** + * Receiver + */ + friend class Dbdih; + friend class MutexManager; + + /** + * Sender + */ + friend class DbUtil; + + friend bool printUTIL_LOCK_CONF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 4 ); + +public: + Uint32 senderData; + Uint32 senderRef; + Uint32 lockId; + Uint32 lockKey; +}; + +class UtilLockRef { + + /** + * Reciver + */ + friend class Dbdih; + friend class MutexManager; + + /** + * Sender + */ + friend class DbUtil; + + friend bool printUTIL_LOCK_REF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 4 ); + + enum ErrorCode { + OK = 0, + NoSuchLock = 1, + OutOfLockRecords = 2, + DistributedLockNotSupported = 3, + LockAlreadyHeld = 4 + + }; +public: + Uint32 senderData; + Uint32 senderRef; + Uint32 lockId; + Uint32 errorCode; +}; + +class UtilUnlockReq { + + /** + * Receiver + */ + friend class DbUtil; + + /** + * Sender + */ + friend class Dbdih; + friend class MutexManager; + + friend bool printUTIL_UNLOCK_REQ(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 4 ); + +public: + Uint32 senderData; + Uint32 senderRef; + Uint32 lockId; + Uint32 lockKey; +}; + +class UtilUnlockConf { + + /** + * Receiver + */ + friend class Dbdih; + friend class MutexManager; + + /** + * Sender + */ + friend class DbUtil; + + friend bool printUTIL_UNLOCK_CONF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 3 ); + +public: + Uint32 senderData; + Uint32 senderRef; + Uint32 lockId; +}; + +class UtilUnlockRef { + + /** + * Reciver + */ + friend class Dbdih; + friend class MutexManager; + + /** + * Sender + */ + friend class DbUtil; + + friend bool printUTIL_UNLOCK_REF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 4 ); + + enum ErrorCode { + OK = 0, + NoSuchLock = 1, + NotLockOwner = 2 + }; +public: + Uint32 senderData; + Uint32 senderRef; + Uint32 lockId; + Uint32 errorCode; +}; + +/** + * Creating a lock + */ +class UtilCreateLockReq { + /** + * Receiver + */ + friend class DbUtil; + + /** + * Sender + */ + friend class MutexManager; + + friend bool printUTIL_CREATE_LOCK_REQ(FILE *, const Uint32*, Uint32, Uint16); +public: + enum LockType { + Mutex = 0 // Lock with only exclusive locks + }; + + STATIC_CONST( SignalLength = 4 ); + +public: + Uint32 senderData; + Uint32 senderRef; + Uint32 lockId; + Uint32 lockType; +}; + +class UtilCreateLockRef { + /** + * Sender + */ + friend class DbUtil; + + /** + * Receiver + */ + friend class MutexManager; + + friend bool printUTIL_CREATE_LOCK_REF(FILE *, const Uint32*, Uint32, Uint16); +public: + enum ErrorCode { + OK = 0, + OutOfLockQueueRecords = 1, + LockIdAlreadyUsed = 2, + UnsupportedLockType = 3 + }; + + STATIC_CONST( SignalLength = 4 ); + +public: + Uint32 senderData; + Uint32 senderRef; + Uint32 lockId; + Uint32 errorCode; +}; + +class UtilCreateLockConf { + /** + * Sender + */ + friend class DbUtil; + + /** + * Receiver + */ + friend class MutexManager; + + friend bool printUTIL_CREATE_LOCK_CONF(FILE*, const Uint32*, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 3 ); + +public: + Uint32 senderData; + Uint32 senderRef; + Uint32 lockId; +}; + +/** + * Creating a lock + */ +class UtilDestroyLockReq { + /** + * Receiver + */ + friend class DbUtil; + + /** + * Sender + */ + friend class MutexManager; + + friend bool printUTIL_DESTROY_LOCK_REQ(FILE *, const Uint32*, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 4 ); + +public: + Uint32 senderData; + Uint32 senderRef; + Uint32 lockId; + Uint32 lockKey; +}; + +class UtilDestroyLockRef { + /** + * Sender + */ + friend class DbUtil; + + /** + * Receiver + */ + friend class MutexManager; + + friend bool printUTIL_DESTROY_LOCK_REF(FILE *, const Uint32*, Uint32, Uint16); +public: + enum ErrorCode { + OK = 0, + NoSuchLock = 1, + NotLockOwner = 2 + }; + + STATIC_CONST( SignalLength = 4 ); + +public: + Uint32 senderData; + Uint32 senderRef; + Uint32 lockId; + Uint32 errorCode; +}; + +class UtilDestroyLockConf { + /** + * Sender + */ + friend class DbUtil; + + /** + * Receiver + */ + friend class MutexManager; + + friend bool printUTIL_DESTROY_LOCK_CONF(FILE*, const Uint32*, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 3 ); + +public: + Uint32 senderData; + Uint32 senderRef; + Uint32 lockId; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/UtilPrepare.hpp b/storage/ndb/include/kernel/signaldata/UtilPrepare.hpp new file mode 100644 index 00000000000..4de9e61f699 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/UtilPrepare.hpp @@ -0,0 +1,160 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef UTIL_PREPARE_REQ_HPP +#define UTIL_PREPARE_REQ_HPP + +#include "SignalData.hpp" +#include <SimpleProperties.hpp> + +#ifdef NDB_WIN32 +#ifdef NO_ERROR +#undef NO_ERROR +#endif +#endif + +/** + * UTIL_PREPARE_REQ, UTIL_PREPARE_CONF, UTIL_PREPARE_REF + */ + +/** + * @class UtilPrepareReq + * @brief Prepare transaction in Util block + * + * Data format: + * - UTIL_PREPARE_REQ <NoOfOps> (<OperationType> <TableName> <AttrName>+)+ + */ +class UtilPrepareReq { + /** + * Sender(s) / Receiver(s) + */ + friend class DbUtil; + friend class Trix; + + /** + * For printing + */ + friend bool printUTIL_PREPARE_REQ(FILE * output, + const Uint32 * theData, + Uint32 len, + Uint16 receiverBlockNo); + +public: + enum OperationTypeValue { + Read = 0, + Update = 1, + Insert = 2, + Delete = 3, + Write = 4 + + }; + + enum KeyValue { + NoOfOperations = 1, ///< No of operations in transaction + OperationType = 2, /// + TableName = 3, ///< String + AttributeName = 4, ///< String + TableId = 5, + AttributeId = 6 + }; + + // Signal constants + STATIC_CONST( SignalLength = 2 ); + STATIC_CONST( PROPERTIES_SECTION = 0 ); + STATIC_CONST( NoOfSections = 1 ); + + GET_SET_SENDERREF + GET_SET_SENDERDATA +private: + Uint32 senderData; // MUST be no 1! + Uint32 senderRef; +}; + +/** + * @class UtilPrepareConf + * + * Data format: + * - UTIL_PREPARE_CONF <UtilPrepareId> + */ + +class UtilPrepareConf { + /** + * Sender(s) / Receiver(s) + */ + friend class DbUtil; + friend class Trix; + + /** + * For printing + */ + friend bool printUTIL_PREPARE_CONF(FILE * output, + const Uint32 * theData, + Uint32 len, + Uint16 receiverBlockNo); + +public: + STATIC_CONST( SignalLength = 2 ); + + GET_SET_SENDERDATA + GET_SET_PREPAREID +private: + Uint32 senderData; // MUST be no 1! + Uint32 prepareId; +}; + + +/** + * @class UtilPrepareRef + * + * Data format: + * - UTIL_PREPARE_REF + */ + +class UtilPrepareRef { + /** + * Sender(s) / Receiver(s) + */ + friend class DbUtil; + friend class Trix; + + /** + * For printing + */ + friend bool printUTIL_PREPARE_REF(FILE * output, + const Uint32 * theData, + Uint32 len, + Uint16 receiverBlockNo); + +public: + enum ErrorCode { + NO_ERROR = 0, + PREPARE_SEIZE_ERROR = 1, + PREPARE_PAGES_SEIZE_ERROR = 2, + PREPARED_OPERATION_SEIZE_ERROR = 3, + DICT_TAB_INFO_ERROR = 4, + MISSING_PROPERTIES_SECTION = 5 + }; + + STATIC_CONST( SignalLength = 2 ); + + GET_SET_SENDERDATA + GET_SET_ERRORCODE +private: + Uint32 senderData; // MUST be no 1! + Uint32 errorCode; +}; + + +#endif diff --git a/storage/ndb/include/kernel/signaldata/UtilRelease.hpp b/storage/ndb/include/kernel/signaldata/UtilRelease.hpp new file mode 100644 index 00000000000..97623670399 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/UtilRelease.hpp @@ -0,0 +1,82 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef UTIL_RELEASE_HPP +#define UTIL_PREPARE_HPP + +#include "SignalData.hpp" + +/** + * @class UtilReleaseReq + * @brief Release Prepared transaction in Util block + * + * Data format: + * - UTIL_PREPARE_RELEASE_REQ <UtilPrepareId> + */ +class UtilReleaseReq { + friend class DbUtil; + friend class Trix; +public: + STATIC_CONST( SignalLength = 2 ); + +private: + Uint32 senderData; // MUST be no 1! + Uint32 prepareId; +}; + + +/** + * @class UtilReleaseConf + * + * Data format: + * - UTIL_PREPARE_CONF <UtilPrepareId> + */ + +class UtilReleaseConf { + friend class DbUtil; + friend class Trix; + + STATIC_CONST( SignalLength = 1 ); + +private: + Uint32 senderData; // MUST be no 1! +}; + + +/** + * @class UtilReleaseRef + * + * Data format: + * - UTIL_PREPARE_RELEASE_REF + */ + +class UtilReleaseRef { + friend class DbUtil; + friend class Trix; + + enum ErrorCode { + NO_ERROR = 0, + NO_SUCH_PREPARE_SEIZED = 1 + }; + + STATIC_CONST( SignalLength = 3 ); + +private: + Uint32 senderData; // MUST be no 1! + Uint32 prepareId; + Uint32 errorCode; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/UtilSequence.hpp b/storage/ndb/include/kernel/signaldata/UtilSequence.hpp new file mode 100644 index 00000000000..b24a6f83b7d --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/UtilSequence.hpp @@ -0,0 +1,100 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef UTIL_SEQUENCE_HPP +#define UTIL_SEQUENCE_HPP + +#include "SignalData.hpp" + +class UtilSequenceReq { + + /** + * Receiver + */ + friend class DbUtil; + + /** + * Sender + */ + friend class Backup; + friend class Suma; + + friend bool printUTIL_SEQUENCE_REQ(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 3 ); + + enum RequestType { + NextVal = 1, // Return uniq value + CurrVal = 2, // Read + Create = 3 // Create a sequence + }; +private: + Uint32 senderData; + Uint32 sequenceId; // Number of sequence variable + Uint32 requestType; +}; + +class UtilSequenceConf { + + /** + * Receiver + */ + friend class Backup; + friend class Suma; + /** + * Sender + */ + friend class DbUtil; + + friend bool printUTIL_SEQUENCE_CONF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 5 ); + +private: + Uint32 senderData; + Uint32 sequenceId; + Uint32 requestType; + Uint32 sequenceValue[2]; +}; + +class UtilSequenceRef { + + /** + * Reciver + */ + friend class Backup; + friend class Suma; + /** + * Sender + */ + friend class DbUtil; + + friend bool printUTIL_SEQUENCE_REF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 5 ); + + enum ErrorCode { + NoSuchSequence = 1, + TCError = 2 + }; +private: + Uint32 senderData; + Uint32 sequenceId; + Uint32 requestType; + Uint32 errorCode; + Uint32 TCErrorCode; +}; + +#endif diff --git a/storage/ndb/include/kernel/signaldata/WaitGCP.hpp b/storage/ndb/include/kernel/signaldata/WaitGCP.hpp new file mode 100644 index 00000000000..7e62debdf18 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/WaitGCP.hpp @@ -0,0 +1,111 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef WAIT_GCP_HPP +#define WAIT_GCP_HPP + +/** + * This signal is sent by anyone to local DIH + * + * If local DIH is not master, it forwards it to master DIH + * and start acting as a proxy + * + */ +class WaitGCPReq { + + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdih; + + /** + * Sender + */ + friend class Ndbcntr; + friend class Dbdict; + friend class Backup; + //friend class Grep::PSCoord; + +public: + STATIC_CONST( SignalLength = 3 ); +public: + enum RequestType { + Complete = 1, ///< Wait for a GCP to complete + CompleteForceStart = 2, ///< Wait for a GCP to complete start one if needed + CompleteIfRunning = 3, ///< Wait for ongoing GCP + CurrentGCI = 8, ///< Immediately return current GCI + BlockStartGcp = 9, + UnblockStartGcp = 10 + }; + + Uint32 senderRef; + Uint32 senderData; + Uint32 requestType; +}; + +class WaitGCPConf { + + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdih; + + /** + * Reciver(s) + */ + friend class Ndbcntr; + friend class Dbdict; + friend class Backup; + //friend class Grep::PSCoord; + +public: + STATIC_CONST( SignalLength = 3 ); + +public: + Uint32 senderData; + Uint32 gcp; + Uint32 blockStatus; +}; + +class WaitGCPRef { + + /** + * Sender(s) / Reciver(s) + */ + friend class Dbdih; + + /** + * Reciver(s) + */ + friend class Ndbcntr; + friend class Dbdict; + friend class Backup; + friend class Grep; + +public: + STATIC_CONST( SignalLength = 2 ); + + enum ErrorCode { + StopOK = 0, + NF_CausedAbortOfProcedure = 1, + NoWaitGCPRecords = 2 + }; + +private: + Uint32 errorCode; + Uint32 senderData; +}; + +#endif |