diff options
author | unknown <magnus@neptunus.(none)> | 2004-04-14 10:53:21 +0200 |
---|---|---|
committer | unknown <magnus@neptunus.(none)> | 2004-04-14 10:53:21 +0200 |
commit | 6386c55cee50bad6a9979d1fab28e03bb8612ca7 (patch) | |
tree | 3fbbacf704304b69228474b9f03549ccd585a017 /ndb/include/kernel/signaldata | |
parent | 0ba6cb48d84f1ff951d09871a96be6cdef3f2c3c (diff) | |
download | mariadb-git-6386c55cee50bad6a9979d1fab28e03bb8612ca7.tar.gz |
Initial revision of NDB Cluster files
BitKeeper/etc/logging_ok:
Logging to logging@openlogging.org accepted
Diffstat (limited to 'ndb/include/kernel/signaldata')
152 files changed, 19864 insertions, 0 deletions
diff --git a/ndb/include/kernel/signaldata/AbortAll.hpp b/ndb/include/kernel/signaldata/AbortAll.hpp new file mode 100644 index 00000000000..a3d7f483953 --- /dev/null +++ b/ndb/include/kernel/signaldata/AbortAll.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/AccFrag.hpp b/ndb/include/kernel/signaldata/AccFrag.hpp new file mode 100644 index 00000000000..e28ab0d1ee6 --- /dev/null +++ b/ndb/include/kernel/signaldata/AccFrag.hpp @@ -0,0 +1,89 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/AccLock.hpp b/ndb/include/kernel/signaldata/AccLock.hpp new file mode 100644 index 00000000000..1a41b4c9334 --- /dev/null +++ b/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; either version 2 of the License, or + (at your option) any later version. + + 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 Dbtux; + friend class Dbacc; + 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/ndb/include/kernel/signaldata/AccScan.hpp b/ndb/include/kernel/signaldata/AccScan.hpp new file mode 100644 index 00000000000..eab1c3262fc --- /dev/null +++ b/ndb/include/kernel/signaldata/AccScan.hpp @@ -0,0 +1,164 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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; +public: + STATIC_CONST( SignalLength = 8 ); + +private: + Uint32 senderData; + Uint32 senderRef; + Uint32 tableId; + Uint32 fragmentNo; + Uint32 requestInfo; + Uint32 transId1; + Uint32 transId2; + Uint32 savePointId; + + /** + * Previously there where also a scan type + */ + static Uint32 getLockMode(const Uint32 & requestInfo); + static Uint32 getKeyinfoFlag(const Uint32 & requestInfo); + static Uint32 getReadCommittedFlag(const Uint32 & requestInfo); + + static void setLockMode(Uint32 & requestInfo, Uint32 lockMode); + static void setKeyinfoFlag(Uint32 & requestInfo, Uint32 keyinfo); + static void setReadCommittedFlag(Uint32 & requestInfo, Uint32 readCommitted); +}; + +/** + * Request Info + * + * l = Lock Mode - 1 Bit 2 + * k = Keyinfo - 1 Bit 4 + * h = Read Committed - 1 Bit 5 + * + * 1111111111222222222233 + * 01234567890123456789012345678901 + * l kh + */ +#define AS_LOCK_MODE_SHIFT (2) +#define AS_LOCK_MODE_MASK (1) + +#define AS_KEYINFO_SHIFT (4) +#define AS_READ_COMMITTED_SHIFT (5) + +inline +Uint32 +AccScanReq::getLockMode(const Uint32 & requestInfo){ + return (requestInfo >> AS_LOCK_MODE_SHIFT) & AS_LOCK_MODE_MASK; +} + +inline +Uint32 +AccScanReq::getKeyinfoFlag(const Uint32 & requestInfo){ + return (requestInfo >> AS_KEYINFO_SHIFT) & 1; +} + +inline +Uint32 +AccScanReq::getReadCommittedFlag(const Uint32 & requestInfo){ + return (requestInfo >> AS_READ_COMMITTED_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::setKeyinfoFlag(UintR & requestInfo, UintR val){ + ASSERT_BOOL(val, "AccScanReq::setKeyinfoFlag"); + requestInfo |= (val << AS_KEYINFO_SHIFT); +} + +inline +void +AccScanReq::setReadCommittedFlag(UintR & requestInfo, UintR val){ + ASSERT_BOOL(val, "AccScanReq::setReadCommittedFlag"); + requestInfo |= (val << AS_READ_COMMITTED_SHIFT); +} + +class AccScanConf { + /** + * Sender(s) + */ + friend class Dbacc; + friend class Dbtux; + + /** + * 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 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/ndb/include/kernel/signaldata/AccSizeAltReq.hpp b/ndb/include/kernel/signaldata/AccSizeAltReq.hpp new file mode 100644 index 00000000000..ac348444826 --- /dev/null +++ b/ndb/include/kernel/signaldata/AccSizeAltReq.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/AlterIndx.hpp b/ndb/include/kernel/signaldata/AlterIndx.hpp new file mode 100644 index 00000000000..1f464ded010 --- /dev/null +++ b/ndb/include/kernel/signaldata/AlterIndx.hpp @@ -0,0 +1,268 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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, + 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; + Uint32 m_errorNode; + +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/ndb/include/kernel/signaldata/AlterTab.hpp b/ndb/include/kernel/signaldata/AlterTab.hpp new file mode 100644 index 00000000000..02d4eb95d2e --- /dev/null +++ b/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; either version 2 of the License, or + (at your option) any later version. + + 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; + + /** + * 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/ndb/include/kernel/signaldata/AlterTable.hpp b/ndb/include/kernel/signaldata/AlterTable.hpp new file mode 100644 index 00000000000..30f8727551d --- /dev/null +++ b/ndb/include/kernel/signaldata/AlterTable.hpp @@ -0,0 +1,179 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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 NdbDictInterface; + friend class Dbdict; + + /** + * 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 + + 1111111111222222222233 + 01234567890123456789012345678901 + n------------------------------- +*/ +#define NAME_SHIFT (0) + + /** + * Getters and setters + */ + static Uint8 getNameFlag(const UintR & changeMask); + static void setNameFlag(UintR & changeMask, Uint32 nameFlg); +}; + +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); +} + + +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, + 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 + }; + +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; +}; + +#endif diff --git a/ndb/include/kernel/signaldata/AlterTrig.hpp b/ndb/include/kernel/signaldata/AlterTrig.hpp new file mode 100644 index 00000000000..a97c1fd0196 --- /dev/null +++ b/ndb/include/kernel/signaldata/AlterTrig.hpp @@ -0,0 +1,288 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/ApiRegSignalData.hpp b/ndb/include/kernel/signaldata/ApiRegSignalData.hpp new file mode 100644 index 00000000000..84dca8fb260 --- /dev/null +++ b/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; either version 2 of the License, or + (at your option) any later version. + + 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 = 3 + NodeState::DataLength ); +private: + + Uint32 qmgrRef; + Uint32 version; // Version of NDB node + Uint32 apiHeartbeatFrequency; + NodeState nodeState; +}; + +#endif diff --git a/ndb/include/kernel/signaldata/ApiVersion.hpp b/ndb/include/kernel/signaldata/ApiVersion.hpp new file mode 100644 index 00000000000..28281e7d186 --- /dev/null +++ b/ndb/include/kernel/signaldata/ApiVersion.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; either version 2 of the License, or + (at your option) any later version. + + 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 = 3 ); + Uint32 senderRef; + Uint32 nodeId; //api node id + Uint32 version; // Version of API node + + +}; + +#endif diff --git a/ndb/include/kernel/signaldata/ArbitSignalData.hpp b/ndb/include/kernel/signaldata/ArbitSignalData.hpp new file mode 100644 index 00000000000..271b9920cd0 --- /dev/null +++ b/ndb/include/kernel/signaldata/ArbitSignalData.hpp @@ -0,0 +1,154 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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: + 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 { + 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 + WinGroups = 42, // we win, no need for arbitration + LoseGroups = 43, // we lose, missing node group + Partitioning = 44, // possible network partitioning + WinChoose = 45, // positive reply + LoseChoose = 46, // negative reply + LoseNorun = 47, // arbitrator required but not running + LoseNocfg = 48, // 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: + snprintf(buf, buf_len, "invalid arbitrator-ticket"); + break; + case ErrToomany: + snprintf(buf, buf_len, "too many requests"); + break; + case ErrState: + snprintf(buf, buf_len, "invalid state"); + break; + case ErrTimeout: + snprintf(buf, buf_len, "timeout"); + break; + default: + 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 + + 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/ndb/include/kernel/signaldata/AttrInfo.hpp b/ndb/include/kernel/signaldata/AttrInfo.hpp new file mode 100644 index 00000000000..18bd9b22c40 --- /dev/null +++ b/ndb/include/kernel/signaldata/AttrInfo.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; either version 2 of the License, or + (at your option) any later version. + + 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 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/ndb/include/kernel/signaldata/BackupContinueB.hpp b/ndb/include/kernel/signaldata/BackupContinueB.hpp new file mode 100644 index 00000000000..d3d3f79f310 --- /dev/null +++ b/ndb/include/kernel/signaldata/BackupContinueB.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; either version 2 of the License, or + (at your option) any later version. + + 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 + }; +}; + +#endif diff --git a/ndb/include/kernel/signaldata/BackupImpl.hpp b/ndb/include/kernel/signaldata/BackupImpl.hpp new file mode 100644 index 00000000000..1872069daa7 --- /dev/null +++ b/ndb/include/kernel/signaldata/BackupImpl.hpp @@ -0,0 +1,366 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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 bool printDEFINE_BACKUP_REQ(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 8 + 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; +}; + +class DefineBackupRef { + /** + * Sender(s) + */ + friend class Backup; + + /** + * Reciver(s) + */ + friend class BackupMaster; + + friend bool printDEFINE_BACKUP_REF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 3 ); + + enum ErrorCode { + Undefined = 200, + FailedToAllocateBuffers = 202, + FailedToSetupFsBuffers = 203, + FailedToAllocateTables = 204, + FailedInsertFileHeader = 205, + FailedInsertTableList = 206, + FailedAllocateTableMem = 207, + FailedToAllocateFileRecord = 208, + FailedToAllocateAttributeRecord = 209 + }; +private: + Uint32 backupId; + Uint32 backupPtr; + Uint32 errorCode; +}; + +class DefineBackupConf { + /** + * Sender(s) + */ + friend class Backup; + + /** + * 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( MaxTableTriggers = 4 ); + STATIC_CONST( HeaderLength = 5 ); + STATIC_CONST( TableTriggerLength = 4); + +private: + Uint32 backupId; + Uint32 backupPtr; + Uint32 signalNo; + Uint32 noOfSignals; + Uint32 noOfTableTriggers; + + struct TableTriggers { + Uint32 tableId; + Uint32 triggerIds[3]; + } tableTriggers[MaxTableTriggers]; +}; + +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 signalNo; + Uint32 errorCode; +}; + +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 = 3 ); + +private: + Uint32 backupId; + Uint32 backupPtr; + Uint32 signalNo; +}; + +class BackupFragmentReq { + /** + * Sender(s) + */ + friend class BackupMaster; + + /** + * Reciver(s) + */ + friend class Backup; + + 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; + + /** + * 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 tableId; + Uint32 fragmentNo; + Uint32 errorCode; +}; + +class BackupFragmentConf { + /** + * Sender(s) + */ + friend class Backup; + + /** + * Reciver(s) + */ + friend class BackupMaster; + + friend bool printBACKUP_FRAGMENT_CONF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 6 ); + +private: + Uint32 backupId; + Uint32 backupPtr; + Uint32 tableId; + Uint32 fragmentNo; + Uint32 noOfRecords; + Uint32 noOfBytes; +}; + +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 = 3 ); + +private: + Uint32 backupId; + Uint32 backupPtr; + Uint32 errorCode; +}; + +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/ndb/include/kernel/signaldata/BackupSignalData.hpp b/ndb/include/kernel/signaldata/BackupSignalData.hpp new file mode 100644 index 00000000000..42eb8464d53 --- /dev/null +++ b/ndb/include/kernel/signaldata/BackupSignalData.hpp @@ -0,0 +1,252 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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 = 2 ); + +private: + Uint32 senderData; + Uint32 backupDataLen; +}; + +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 = 100, + IAmNotMaster = 101, + OutOfBackupRecord = 102, + OutOfResources = 103, + SequenceFailure = 104, + BackupDefinitionNotImplemented = 105 + }; + 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 = 8 + NdbNodeBitmask::Size ); +private: + Uint32 senderData; + Uint32 backupId; + Uint32 startGCP; + Uint32 stopGCP; + Uint32 noOfBytes; + Uint32 noOfRecords; + Uint32 noOfLogBytes; + Uint32 noOfLogRecords; + NdbNodeBitmask nodes; +}; + +/** + * 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 = 1, + BackupComplete = 2, + BackupFailure = 3, // General backup failure coordinator -> slave + LogBufferFull = 4, // slave -> coordinator + FileOrScanError = 5, // slave -> coordinator + BackupFailureDueToNodeFail = 6, // slave -> slave + OkToClean = 7 // master -> slave + }; +private: + Uint32 requestType; + Uint32 backupId; + union { + Uint32 backupPtr; + Uint32 senderData; + }; +}; + +#endif diff --git a/ndb/include/kernel/signaldata/BlockCommitOrd.hpp b/ndb/include/kernel/signaldata/BlockCommitOrd.hpp new file mode 100644 index 00000000000..3b33dceb758 --- /dev/null +++ b/ndb/include/kernel/signaldata/BlockCommitOrd.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/BuildIndx.hpp b/ndb/include/kernel/signaldata/BuildIndx.hpp new file mode 100644 index 00000000000..9cf1123cc61 --- /dev/null +++ b/ndb/include/kernel/signaldata/BuildIndx.hpp @@ -0,0 +1,308 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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 <NdbString.h> +#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, + BadRequestType = 4247, + InvalidPrimaryTable = 4249, + InvalidIndexType = 4250, + IndexNotUnique = 4251, + AllocationFailure = 4252, + InternalError = 4346 + }; + STATIC_CONST( SignalLength = BuildIndxConf::SignalLength + 1 ); + +private: + //Uint32 m_userRef; + //Uint32 m_connectionPtr; + //Uint32 m_requestInfo; + //Uint32 m_tableId; + //Uint32 m_indexType; + //Uint32 m_indexId; + BuildIndxConf m_conf; + Uint32 m_errorCode; + +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/ndb/include/kernel/signaldata/CheckNodeGroups.hpp b/ndb/include/kernel/signaldata/CheckNodeGroups.hpp new file mode 100644 index 00000000000..9b2f847e128 --- /dev/null +++ b/ndb/include/kernel/signaldata/CheckNodeGroups.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; either version 2 of the License, or + (at your option) any later version. + + 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; + }; + union { + 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 = 2 + NodeBitmask::Size ); +}; + +#endif diff --git a/ndb/include/kernel/signaldata/CloseComReqConf.hpp b/ndb/include/kernel/signaldata/CloseComReqConf.hpp new file mode 100644 index 00000000000..3d3dc54ba64 --- /dev/null +++ b/ndb/include/kernel/signaldata/CloseComReqConf.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/CmInit.hpp b/ndb/include/kernel/signaldata/CmInit.hpp new file mode 100644 index 00000000000..b59547b767b --- /dev/null +++ b/ndb/include/kernel/signaldata/CmInit.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/CmRegSignalData.hpp b/ndb/include/kernel/signaldata/CmRegSignalData.hpp new file mode 100644 index 00000000000..f33c991249f --- /dev/null +++ b/ndb/include/kernel/signaldata/CmRegSignalData.hpp @@ -0,0 +1,192 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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 = 3 ); +private: + + Uint32 blockRef; + Uint32 nodeId; + Uint32 version; // See ndb_version.h +}; + +/** + * 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 = 4 ); + + 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 + }; +private: + + Uint32 blockRef; + Uint32 nodeId; + Uint32 errorCode; + Uint32 presidentCandidate; +}; + +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/ndb/include/kernel/signaldata/CmvmiCfgConf.hpp b/ndb/include/kernel/signaldata/CmvmiCfgConf.hpp new file mode 100644 index 00000000000..12b785723d9 --- /dev/null +++ b/ndb/include/kernel/signaldata/CmvmiCfgConf.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/CntrMasterConf.hpp b/ndb/include/kernel/signaldata/CntrMasterConf.hpp new file mode 100644 index 00000000000..e6bf363ea68 --- /dev/null +++ b/ndb/include/kernel/signaldata/CntrMasterConf.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/CntrMasterReq.hpp b/ndb/include/kernel/signaldata/CntrMasterReq.hpp new file mode 100644 index 00000000000..caf9efb1243 --- /dev/null +++ b/ndb/include/kernel/signaldata/CntrMasterReq.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/ConfigParamId.hpp b/ndb/include/kernel/signaldata/ConfigParamId.hpp new file mode 100644 index 00000000000..9d9e04957ab --- /dev/null +++ b/ndb/include/kernel/signaldata/ConfigParamId.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/ContinueFragmented.hpp b/ndb/include/kernel/signaldata/ContinueFragmented.hpp new file mode 100644 index 00000000000..3d12b9e51eb --- /dev/null +++ b/ndb/include/kernel/signaldata/ContinueFragmented.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/CopyActive.hpp b/ndb/include/kernel/signaldata/CopyActive.hpp new file mode 100644 index 00000000000..19b05bda072 --- /dev/null +++ b/ndb/include/kernel/signaldata/CopyActive.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/CopyFrag.hpp b/ndb/include/kernel/signaldata/CopyFrag.hpp new file mode 100644 index 00000000000..67b935dda64 --- /dev/null +++ b/ndb/include/kernel/signaldata/CopyFrag.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; either version 2 of the License, or + (at your option) any later version. + + 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 = 7 ); + +private: + Uint32 userPtr; + Uint32 userRef; + Uint32 tableId; + Uint32 fragId; + Uint32 nodeId; + Uint32 schemaVersion; + Uint32 distributionKey; +}; + +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; +}; + +#endif diff --git a/ndb/include/kernel/signaldata/CopyGCIReq.hpp b/ndb/include/kernel/signaldata/CopyGCIReq.hpp new file mode 100644 index 00000000000..4b401654de3 --- /dev/null +++ b/ndb/include/kernel/signaldata/CopyGCIReq.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/CreateEvnt.hpp b/ndb/include/kernel/signaldata/CreateEvnt.hpp new file mode 100644 index 00000000000..7398fb6d8cc --- /dev/null +++ b/ndb/include/kernel/signaldata/CreateEvnt.hpp @@ -0,0 +1,488 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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 "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, + UndefinedTCError = 2, + NF_FakeErrorREF = 11, + Busy = 701, + NotMaster = 702, + SeizeError = 703, + EventNotFound = 4238, + EventNameTooLong = 4241, + TooManyEvents = 4242, + BadRequestType = 4247, + InvalidName = 4248, + InvalidPrimaryTable = 4249, + InvalidEventType = 4250, + NotUnique = 4251, + AllocationError = 4252, + CreateEventTableFailed = 4253, + InvalidAttributeOrder = 4255, + Temporary = 0x1 << 16 + }; + + STATIC_CONST( SignalLength = 5 ); + + 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; + + bool isTemporary() const + { return (errorCode & Temporary) > 0; } + + void setTemporary() + { errorCode |= Temporary; } + + ErrorCode setTemporary(ErrorCode ec) + { return (ErrorCode) (errorCode = ((Uint32) ec | (Uint32)Temporary)); } + + 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::ErrorCode getErrorCode() const { + return (DropEvntRef::ErrorCode)m_errorCode; + } + void setErrorCode(DropEvntRef::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; + } +}; + +/** + * 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 + }; + STATIC_CONST( SignalLengthGet = 3 ); + STATIC_CONST( SignalLengthCreate = 5+MAXNROFATTRIBUTESINWORDS ); + STATIC_CONST( SignalLength = 7+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 + AttributeMask::Data m_attrListBitmask; + Uint32 m_eventType; // from DictTabInfo::TableType + 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; + } + AttributeMask getAttrListBitmask() const { + AttributeMask tmp; + tmp.assign(m_attrListBitmask); + return tmp; + } + 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; + } +}; + +/** + * CreateEvntConf. + */ +class CreateEvntConf { + friend bool printCREATE_EVNT_CONF(FILE*, const Uint32*, Uint32, Uint16); + +public: + // STATIC_CONST( InternalLength = 3 ); + STATIC_CONST( SignalLength = 7+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; + 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; + } + 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 = 10 ); + enum ErrorCode { + NoError = 0, + Undefined = 1, + UndefinedTCError = 2, + NF_FakeErrorREF = 11, + Busy = 701, + NotMaster = 702, + SeizeError = 703, + EventNotFound = 4238, + EventExists = 4239, + EventNameTooLong = 4241, + TooManyEvents = 4242, + // EventExists = 4244, + AttributeNotStored = 4245, + AttributeNullable = 4246, + BadRequestType = 4247, + InvalidName = 4248, + InvalidPrimaryTable = 4249, + InvalidEventType = 4250, + NotUnique = 4251, + AllocationError = 4252, + CreateEventTableFailed = 4253, + InvalidAttributeOrder = 4255, + Temporary = 0x1 << 16 + }; + bool isTemporary() const; + void setTemporary(); + ErrorCode setTemporary(ErrorCode ec); + static ErrorCode makeTemporary(ErrorCode ec); + + 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_eventType; + Uint32 m_eventId; + Uint32 m_eventKey; + Uint32 errorCode; + Uint32 m_errorLine; + Uint32 m_errorNode; + +#if 0 + CreateEvntConf* getConf() { + return &m_conf; + } + const CreateEvntConf* getConf() const { + return &m_conf; + } +#endif + 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 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::ErrorCode getErrorCode() const { + return (CreateEvntRef::ErrorCode)errorCode; + } + void setErrorCode(CreateEvntRef::ErrorCode val) { + 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; + } +}; +inline bool CreateEvntRef::isTemporary() const +{ return (errorCode & CreateEvntRef::Temporary) > 0; }; +inline void CreateEvntRef::setTemporary() +{ errorCode |= CreateEvntRef::Temporary; }; +inline CreateEvntRef::ErrorCode CreateEvntRef::setTemporary(ErrorCode ec) +{ return (CreateEvntRef::ErrorCode) + (errorCode = ((Uint32) ec | (Uint32)CreateEvntRef::Temporary)); }; +inline CreateEvntRef::ErrorCode CreateEvntRef::makeTemporary(ErrorCode ec) +{ return (CreateEvntRef::ErrorCode) + ( (Uint32) ec | (Uint32)CreateEvntRef::Temporary ); }; + +#endif diff --git a/ndb/include/kernel/signaldata/CreateFrag.hpp b/ndb/include/kernel/signaldata/CreateFrag.hpp new file mode 100644 index 00000000000..a7b3f836353 --- /dev/null +++ b/ndb/include/kernel/signaldata/CreateFrag.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/CreateFragmentation.hpp b/ndb/include/kernel/signaldata/CreateFragmentation.hpp new file mode 100644 index 00000000000..a2f45a9580d --- /dev/null +++ b/ndb/include/kernel/signaldata/CreateFragmentation.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; either version 2 of the License, or + (at your option) any later version. + + 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 = 6 ); + +private: + Uint32 senderRef; + Uint32 senderData; + Uint32 fragmentationType; + Uint32 noOfFragments; + Uint32 fragmentNode; + 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 + ,InvalidFragmentationType = 1 + ,InvalidNodeId = 2 + ,InvalidNodeType = 3 + ,InvalidPrimaryTable = 4 + }; + +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 = 3 ); + SECTION( FRAGMENTS = 0 ); + +private: + Uint32 senderRef; + Uint32 senderData; + Uint32 noOfReplicas; + Uint32 noOfFragments; +}; + +#endif diff --git a/ndb/include/kernel/signaldata/CreateIndx.hpp b/ndb/include/kernel/signaldata/CreateIndx.hpp new file mode 100644 index 00000000000..3e277b38dea --- /dev/null +++ b/ndb/include/kernel/signaldata/CreateIndx.hpp @@ -0,0 +1,295 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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. + */ +class CreateIndxRef { + friend bool printCREATE_INDX_REF(FILE*, const Uint32*, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = CreateIndxReq::SignalLength + 3 ); + enum ErrorCode { + NoError = 0, + Busy = 701, + NotMaster = 702, + TriggerNotFound = 4238, + TriggerExists = 4239, + IndexNameTooLong = 4241, + TooManyIndexes = 4242, + IndexExists = 4244, + AttributeNotStored = 4245, + AttributeNullable = 4246, + BadRequestType = 4247, + InvalidName = 4248, + InvalidPrimaryTable = 4249, + InvalidIndexType = 4250, + NotUnique = 4251, + AllocationError = 4252, + CreateIndexTableFailed = 4253, + InvalidAttributeOrder = 4255 + }; + +private: + 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; + Uint32 m_errorNode; + +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/ndb/include/kernel/signaldata/CreateTab.hpp b/ndb/include/kernel/signaldata/CreateTab.hpp new file mode 100644 index 00000000000..b2ef52a6bf7 --- /dev/null +++ b/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; either version 2 of the License, or + (at your option) any later version. + + 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; + + /** + * 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/ndb/include/kernel/signaldata/CreateTable.hpp b/ndb/include/kernel/signaldata/CreateTable.hpp new file mode 100644 index 00000000000..424367f28d5 --- /dev/null +++ b/ndb/include/kernel/signaldata/CreateTable.hpp @@ -0,0 +1,140 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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, + NotMaster = 702, + InvalidFormat = 703, + AttributeNameTooLong = 704, + TableNameTooLong = 705, + Inconsistency = 706, + NoMoreTableRecords = 707, + NoMoreAttributeRecords = 708, + AttributeNameTwice = 720, + TableAlreadyExist = 721, + ArraySizeTooBig = 737, + RecordTooBig = 738, + InvalidPrimaryKeySize = 739, + NullablePrimaryKey = 740 + }; + +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/ndb/include/kernel/signaldata/CreateTrig.hpp b/ndb/include/kernel/signaldata/CreateTrig.hpp new file mode 100644 index 00000000000..a8de9e50dd4 --- /dev/null +++ b/ndb/include/kernel/signaldata/CreateTrig.hpp @@ -0,0 +1,414 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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); + } + 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, + 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; + Uint32 m_errorNode; + +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/ndb/include/kernel/signaldata/DiAddTab.hpp b/ndb/include/kernel/signaldata/DiAddTab.hpp new file mode 100644 index 00000000000..6b17515eb6f --- /dev/null +++ b/ndb/include/kernel/signaldata/DiAddTab.hpp @@ -0,0 +1,90 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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 = 9 ); + SECTION( FRAGMENTATION = 0 ); + +private: + Uint32 connectPtr; + Uint32 tableId; + Uint32 fragType; + Uint32 kValue; + Uint32 noOfReplicas; //Currently not used + Uint32 storedTable; + Uint32 tableType; + Uint32 schemaVersion; + Uint32 primaryTableId; +}; + +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/ndb/include/kernel/signaldata/DiGetNodes.hpp b/ndb/include/kernel/signaldata/DiGetNodes.hpp new file mode 100644 index 00000000000..05ab6bfebb3 --- /dev/null +++ b/ndb/include/kernel/signaldata/DiGetNodes.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/DictSchemaInfo.hpp b/ndb/include/kernel/signaldata/DictSchemaInfo.hpp new file mode 100644 index 00000000000..d7f82abc299 --- /dev/null +++ b/ndb/include/kernel/signaldata/DictSchemaInfo.hpp @@ -0,0 +1,45 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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 unsigned HeaderLength = 3; + static const unsigned 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/ndb/include/kernel/signaldata/DictSizeAltReq.hpp b/ndb/include/kernel/signaldata/DictSizeAltReq.hpp new file mode 100644 index 00000000000..b40f0c8c1af --- /dev/null +++ b/ndb/include/kernel/signaldata/DictSizeAltReq.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/DictStart.hpp b/ndb/include/kernel/signaldata/DictStart.hpp new file mode 100644 index 00000000000..59310601f48 --- /dev/null +++ b/ndb/include/kernel/signaldata/DictStart.hpp @@ -0,0 +1,54 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/DictTabInfo.hpp b/ndb/include/kernel/signaldata/DictTabInfo.hpp new file mode 100644 index 00000000000..791388d5df8 --- /dev/null +++ b/ndb/include/kernel/signaldata/DictTabInfo.hpp @@ -0,0 +1,483 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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 <trigger_definitions.h> +#include <NdbSqlUtil.hpp> + +#define DTIMAP(x, y, z) \ + { DictTabInfo::y, offsetof(x, z), SimpleProperties::Uint32Value, 0, (~0), 0 } + +#define DTIMAP2(x, y, z, u, v) \ + { DictTabInfo::y, offsetof(x, z), SimpleProperties::Uint32Value, u, v, 0 } + +#define DTIMAPS(x, y, z, u, v) \ + { DictTabInfo::y, offsetof(x, z), SimpleProperties::StringValue, u, v, 0 } + +#define DTIMAPB(x, y, z, u, v, l) \ + { DictTabInfo::y, offsetof(x, z), SimpleProperties::BinaryValue, u, v, \ + offsetof(x, l) } + +#define DTIBREAK(x) \ + { DictTabInfo::x, 0, SimpleProperties::InvalidValue, 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 Table; + 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 + TableStorageVal = 14, //Default StorageType::MainMemory + ScanOptimised = 15, //Default updateOptimised + FragmentKeyTypeVal = 16, //Default PrimaryKey + SecondTableId = 17, //Mandatory between DICT's otherwise not allowed + 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, + TableEnd = 999, + + AttributeName = 1000, // String, Mandatory + AttributeId = 1001, //Mandatory between DICT's otherwise not allowed + AttributeType = 1002, //Default UnSignedType + AttributeSize = 1003, //Default DictTabInfo::a32Bit + AttributeArraySize = 1005, //Default 1 + AttributeKeyFlag = 1006, //Default noKey + AttributeStorage = 1007, //Default MainMemory + AttributeNullableFlag = 1008, //Default NotNullable + AttributeDGroup = 1009, //Default NotDGroup + AttributeDKey = 1010, //Default NotDKey + AttributeStoredInd = 1011, //Default NotStored + AttributeGroup = 1012, //Default 0 + AttributeExtType = 1013, //Default 0 (undefined) + AttributeExtPrecision = 1014, //Default 0 + AttributeExtScale = 1015, //Default 0 + AttributeExtLength = 1016, //Default 0 + AttributeAutoIncrement = 1017, //Default false + AttributeDefaultValue = 1018, //Default value (printable string) + 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. + // ---------------------------------------------------------------------- + + // FragmentKeyType constants + enum FragmentKeyType { + PrimaryKey = 0, + DistributionKey = 1, + DistributionGroup = 2 + }; + + // FragmentType constants + enum FragmentType { + AllNodesSmallTable = 0, + AllNodesMediumTable = 1, + AllNodesLargeTable = 2, + SingleFragment = 3 + }; + + // TableStorage AND AttributeStorage constants + enum StorageType { + MainMemory = 0, + DiskMemory = 1 + }; + + // 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 = 10 + TriggerType::SECONDARY_INDEX, + SubscriptionTrigger = 10 + TriggerType::SUBSCRIPTION, + ReadOnlyConstraint = 10 + TriggerType::READ_ONLY_CONSTRAINT, + IndexTrigger = 10 + TriggerType::ORDERED_INDEX + }; + 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; + } + + // Object state for translating from/to API + enum ObjectState { + StateUndefined = 0, + StateOffline = 1, + StateBuilding = 2, + StateDropping = 3, + StateOnline = 4, + StateBroken = 9 + }; + + // Object store for translating from/to API + enum ObjectStore { + StoreUndefined = 0, + StoreTemporary = 1, + StorePermanent = 2 + }; + + // ScanOptimised constants + static const unsigned updateOptimised = 0; + static const unsigned scanOptimised = 1; + + // AttributeType constants + static const unsigned SignedType = 0; + static const unsigned UnSignedType = 1; + static const unsigned FloatingPointType = 2; + static const unsigned StringType = 3; + + // AttributeSize constants + static const unsigned an8Bit = 3; + static const unsigned a16Bit = 4; + static const unsigned a32Bit = 5; + static const unsigned a64Bit = 6; + static const unsigned a128Bit = 7; + + // AttributeDGroup constants + static const unsigned NotDGroup = 0; + static const unsigned DGroup = 1; + + // AttributeDKey constants + static const unsigned NotDKey = 0; + static const unsigned DKey = 1; + + // AttributeStoredInd constants + static const unsigned NotStored = 0; + static const unsigned Stored = 1; + + // Table data interpretation + struct Table { + char TableName[MAX_TAB_NAME_SIZE]; + Uint32 TableId; + Uint32 SecondTableId; + char PrimaryTable[MAX_TAB_NAME_SIZE]; // Only used when "index" + Uint32 PrimaryTableId; + Uint32 TableLoggedFlag; + Uint32 NoOfKeyAttr; + Uint32 NoOfAttributes; + Uint32 NoOfNullable; + Uint32 NoOfVariable; + Uint32 TableKValue; + Uint32 MinLoadFactor; + Uint32 MaxLoadFactor; + Uint32 KeyLength; + Uint32 FragmentType; + Uint32 TableStorage; + Uint32 ScanOptimised; + Uint32 FragmentKeyType; + Uint32 TableType; + Uint32 TableVersion; + Uint32 IndexState; + Uint32 InsertTriggerId; + Uint32 UpdateTriggerId; + Uint32 DeleteTriggerId; + Uint32 CustomTriggerId; + Uint32 FrmLen; + char FrmData[MAX_FRM_DATA_SIZE]; + + 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, + ExtDecimal = NdbSqlUtil::Type::Decimal, + ExtChar = NdbSqlUtil::Type::Char, + ExtVarchar = NdbSqlUtil::Type::Varchar, + ExtBinary = NdbSqlUtil::Type::Binary, + ExtVarbinary = NdbSqlUtil::Type::Varbinary, + ExtDatetime = NdbSqlUtil::Type::Datetime, + ExtTimespec = NdbSqlUtil::Type::Timespec + }; + + // Attribute data interpretation + struct Attribute { + char AttributeName[MAX_TAB_NAME_SIZE]; + Uint32 AttributeId; + Uint32 AttributeType; + Uint32 AttributeSize; + Uint32 AttributeArraySize; + Uint32 AttributeKeyFlag; + Uint32 AttributeStorage; + Uint32 AttributeNullableFlag; + Uint32 AttributeDGroup; + Uint32 AttributeDKey; + Uint32 AttributeStoredInd; + Uint32 AttributeGroup; + Uint32 AttributeExtType; + Uint32 AttributeExtPrecision; + Uint32 AttributeExtScale; + Uint32 AttributeExtLength; + Uint32 AttributeAutoIncrement; + char AttributeDefaultValue[MAX_ATTR_DEFAULT_VALUE_SIZE]; + + void init(); + + inline + Uint32 sizeInWords() + { + return ((1 << AttributeSize) * AttributeArraySize + 31) >> 5; + } + + // translate to old kernel types and sizes + inline bool + translateExtType() { + switch (AttributeExtType) { + case DictTabInfo::ExtUndefined: + break; + case DictTabInfo::ExtTinyint: + AttributeType = DictTabInfo::SignedType; + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = AttributeExtLength; + return true; + case DictTabInfo::ExtTinyunsigned: + AttributeType = DictTabInfo::UnSignedType; + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = AttributeExtLength; + return true; + case DictTabInfo::ExtSmallint: + AttributeType = DictTabInfo::SignedType; + AttributeSize = DictTabInfo::a16Bit; + AttributeArraySize = AttributeExtLength; + return true; + case DictTabInfo::ExtSmallunsigned: + AttributeType = DictTabInfo::UnSignedType; + AttributeSize = DictTabInfo::a16Bit; + AttributeArraySize = AttributeExtLength; + return true; + case DictTabInfo::ExtMediumint: + AttributeType = DictTabInfo::SignedType; + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = 3 * AttributeExtLength; + return true; + case DictTabInfo::ExtMediumunsigned: + AttributeType = DictTabInfo::UnSignedType; + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = 3 * AttributeExtLength; + return true; + case DictTabInfo::ExtInt: + AttributeType = DictTabInfo::SignedType; + AttributeSize = DictTabInfo::a32Bit; + AttributeArraySize = AttributeExtLength; + return true; + case DictTabInfo::ExtUnsigned: + AttributeType = DictTabInfo::UnSignedType; + AttributeSize = DictTabInfo::a32Bit; + AttributeArraySize = AttributeExtLength; + return true; + case DictTabInfo::ExtBigint: + AttributeType = DictTabInfo::SignedType; + AttributeSize = DictTabInfo::a64Bit; + AttributeArraySize = AttributeExtLength; + return true; + case DictTabInfo::ExtBigunsigned: + AttributeType = DictTabInfo::UnSignedType; + AttributeSize = DictTabInfo::a64Bit; + AttributeArraySize = AttributeExtLength; + return true; + case DictTabInfo::ExtFloat: + AttributeType = DictTabInfo::FloatingPointType; + AttributeSize = DictTabInfo::a32Bit; + AttributeArraySize = AttributeExtLength; + return true; + case DictTabInfo::ExtDouble: + AttributeType = DictTabInfo::FloatingPointType; + AttributeSize = DictTabInfo::a64Bit; + AttributeArraySize = AttributeExtLength; + return true; + case DictTabInfo::ExtDecimal: + // not yet implemented anywhere + break; + case DictTabInfo::ExtChar: + case DictTabInfo::ExtBinary: + AttributeType = DictTabInfo::StringType; + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = AttributeExtLength; + return true; + case DictTabInfo::ExtVarchar: + case DictTabInfo::ExtVarbinary: + AttributeType = DictTabInfo::StringType; + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = AttributeExtLength + 2; + return true; + case DictTabInfo::ExtDatetime: + AttributeType = DictTabInfo::StringType; + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = 8 * AttributeExtLength; + return true; + case DictTabInfo::ExtTimespec: + AttributeType = DictTabInfo::StringType; + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = 12 * AttributeExtLength; + return true; + }; + return false; + } + + 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, "AttributeKeyFlag = %d\n", AttributeKeyFlag); + fprintf(out, "AttributeStorage = %d\n", AttributeStorage); + fprintf(out, "AttributeNullableFlag = %d\n", AttributeNullableFlag); + fprintf(out, "AttributeDGroup = %d\n", AttributeDGroup); + fprintf(out, "AttributeDKey = %d\n", AttributeDKey); + fprintf(out, "AttributeStoredInd = %d\n", AttributeStoredInd); + 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]; +}; + +#endif diff --git a/ndb/include/kernel/signaldata/DihAddFrag.hpp b/ndb/include/kernel/signaldata/DihAddFrag.hpp new file mode 100644 index 00000000000..6e5a24ee413 --- /dev/null +++ b/ndb/include/kernel/signaldata/DihAddFrag.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/DihContinueB.hpp b/ndb/include/kernel/signaldata/DihContinueB.hpp new file mode 100644 index 00000000000..e683b55351c --- /dev/null +++ b/ndb/include/kernel/signaldata/DihContinueB.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; either version 2 of the License, or + (at your option) any later version. + + 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); +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 + }; +}; + +#endif diff --git a/ndb/include/kernel/signaldata/DihSizeAltReq.hpp b/ndb/include/kernel/signaldata/DihSizeAltReq.hpp new file mode 100644 index 00000000000..73279447859 --- /dev/null +++ b/ndb/include/kernel/signaldata/DihSizeAltReq.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/DihStartTab.hpp b/ndb/include/kernel/signaldata/DihStartTab.hpp new file mode 100644 index 00000000000..75443e6070e --- /dev/null +++ b/ndb/include/kernel/signaldata/DihStartTab.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/DihSwitchReplica.hpp b/ndb/include/kernel/signaldata/DihSwitchReplica.hpp new file mode 100644 index 00000000000..d4212f510f3 --- /dev/null +++ b/ndb/include/kernel/signaldata/DihSwitchReplica.hpp @@ -0,0 +1,72 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/DisconnectRep.hpp b/ndb/include/kernel/signaldata/DisconnectRep.hpp new file mode 100644 index 00000000000..d7fcdc4fb35 --- /dev/null +++ b/ndb/include/kernel/signaldata/DisconnectRep.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/DropIndx.hpp b/ndb/include/kernel/signaldata/DropIndx.hpp new file mode 100644 index 00000000000..0c0cf31aec8 --- /dev/null +++ b/ndb/include/kernel/signaldata/DropIndx.hpp @@ -0,0 +1,253 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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. + */ +class DropIndxRef { + friend bool printDROP_INDX_REF(FILE*, const Uint32*, Uint32, Uint16); + +public: + enum ErrorCode { + NoError = 0, + InvalidIndexVersion = 241, + Busy = 701, + IndexNotFound = 4243, + BadRequestType = 4247, + InvalidName = 4248, + NotAnIndex = 4254 + }; + STATIC_CONST( SignalLength = DropIndxConf::SignalLength + 3 ); + +private: + 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; + Uint32 m_errorNode; + +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/ndb/include/kernel/signaldata/DropTab.hpp b/ndb/include/kernel/signaldata/DropTab.hpp new file mode 100644 index 00000000000..906f952d852 --- /dev/null +++ b/ndb/include/kernel/signaldata/DropTab.hpp @@ -0,0 +1,114 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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; + + /** + * 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 + }; + +private: + Uint32 senderRef; + Uint32 senderData; + Uint32 tableId; + Uint32 errorCode; +}; + +#endif diff --git a/ndb/include/kernel/signaldata/DropTabFile.hpp b/ndb/include/kernel/signaldata/DropTabFile.hpp new file mode 100644 index 00000000000..9ae4dae41c1 --- /dev/null +++ b/ndb/include/kernel/signaldata/DropTabFile.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/DropTable.hpp b/ndb/include/kernel/signaldata/DropTable.hpp new file mode 100644 index 00000000000..7a5b96e4cd1 --- /dev/null +++ b/ndb/include/kernel/signaldata/DropTable.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; either version 2 of the License, or + (at your option) any later version. + + 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, + NotMaster = 702, + NoSuchTable = 709, + InvalidTableVersion = 241, + DropInProgress = 283, + NoDropTableRecordAvailable = 1229 + }; +}; + +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/ndb/include/kernel/signaldata/DropTrig.hpp b/ndb/include/kernel/signaldata/DropTrig.hpp new file mode 100644 index 00000000000..7c5049f3de8 --- /dev/null +++ b/ndb/include/kernel/signaldata/DropTrig.hpp @@ -0,0 +1,300 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/DumpStateOrd.hpp b/ndb/include/kernel/signaldata/DumpStateOrd.hpp new file mode 100644 index 00000000000..6403a52926f --- /dev/null +++ b/ndb/include/kernel/signaldata/DumpStateOrd.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; either version 2 of the License, or + (at your option) any later version. + + 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, + // 100-105 TUP and ACC + // 200-240 UTIL + // 300-305 TRIX + NdbfsDumpFileStat = 400, + NdbfsDumpAllFiles = 401, + NdbfsDumpOpenFiles = 402, + NdbfsDumpIdleFiles = 403, + // 1222-1225 DICT + LqhDumpAllDefinedTabs = 1332, + LqhDumpNoLogPages = 1333, + LqhDumpOneScanRec = 2300, + LqhDumpAllScanRec = 2301, + LqhDumpAllActiveScanRec = 2302, + LqhDumpLcpState = 2303, + 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, + CmvmiDumpConnections = 2600, + CmvmiDumpLongSignalMemory = 2601, + CmvmiSetRestartOnErrorInsert = 2602, + CmvmiTestLongSigWithDelay = 2603, + // 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, + EnableUndoDelayDataWrite = 7080, // DIH+ACC+TUP + DihStartLcpImmediately = 7099, + // 8000 Suma + // 12000 Tux + TuxLogToFile = 12001, + TuxSetLogFlags = 12002, + TuxMetaDataJunk = 12009 + }; +public: + + Uint32 args[25]; // Generic argument +}; + +#endif diff --git a/ndb/include/kernel/signaldata/EmptyLcp.hpp b/ndb/include/kernel/signaldata/EmptyLcp.hpp new file mode 100644 index 00000000000..32ea6c13231 --- /dev/null +++ b/ndb/include/kernel/signaldata/EmptyLcp.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/EndTo.hpp b/ndb/include/kernel/signaldata/EndTo.hpp new file mode 100644 index 00000000000..944cca3ca98 --- /dev/null +++ b/ndb/include/kernel/signaldata/EndTo.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/EventReport.hpp b/ndb/include/kernel/signaldata/EventReport.hpp new file mode 100644 index 00000000000..b6106bb0ca4 --- /dev/null +++ b/ndb/include/kernel/signaldata/EventReport.hpp @@ -0,0 +1,159 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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 "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() + + */ + enum EventType { + // CONNECTION + Connected = 0, + Disconnected = 1, + CommunicationClosed = 2, + CommunicationOpened = 3, + ConnectedApiVersion = 51, + // CHECKPOINT + GlobalCheckpointStarted = 4, + GlobalCheckpointCompleted = 5, + LocalCheckpointStarted = 6, + LocalCheckpointCompleted = 7, + LCPStoppedInCalcKeepGci = 8, + LCPFragmentCompleted = 9, + // STARTUP + NDBStartStarted = 10, + NDBStartCompleted = 11, + STTORRYRecieved = 12, + StartPhaseCompleted = 13, + CM_REGCONF = 14, + CM_REGREF = 15, + FIND_NEIGHBOURS = 16, + NDBStopStarted = 17, + NDBStopAborted = 18, + StartREDOLog = 19, + StartLog = 20, + UNDORecordsExecuted = 21, + + // NODERESTART + NR_CopyDict = 22, + NR_CopyDistr = 23, + NR_CopyFragsStarted = 24, + NR_CopyFragDone = 25, + NR_CopyFragsCompleted = 26, + + // NODEFAIL + NodeFailCompleted = 27, + NODE_FAILREP = 28, + ArbitState = 29, + ArbitResult = 30, + GCP_TakeoverStarted = 31, + GCP_TakeoverCompleted = 32, + LCP_TakeoverStarted = 33, + LCP_TakeoverCompleted = 34, + + // STATISTIC + TransReportCounters = 35, + OperationReportCounters = 36, + TableCreated = 37, + UndoLogBlocked = 38, + JobStatistic = 39, + SendBytesStatistic = 40, + ReceiveBytesStatistic = 41, + MemoryUsage = 50, + + // ERROR + TransporterError = 42, + TransporterWarning = 43, + MissedHeartbeat = 44, + DeadDueToHeartbeat = 45, + WarningEvent = 46, + // INFO + SentHeartbeat = 47, + CreateLogBytes = 48, + InfoEvent = 49, + + //GREP + GrepSubscriptionInfo = 52, + GrepSubscriptionAlert = 53 + }; + + void setEventType(EventType type); + EventType getEventType() const; +private: + UintR eventType; // DATA 0 +}; + +inline +void +EventReport::setEventType(EventType type){ + eventType = (UintR) type; +} + +inline +EventReport::EventType +EventReport::getEventType() const { + return (EventType)eventType; +} + +#endif diff --git a/ndb/include/kernel/signaldata/EventSubscribeReq.hpp b/ndb/include/kernel/signaldata/EventSubscribeReq.hpp new file mode 100644 index 00000000000..2ac62be19a3 --- /dev/null +++ b/ndb/include/kernel/signaldata/EventSubscribeReq.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; either version 2 of the License, or + (at your option) any later version. + + 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 + */ + +class EventSubscribeReq { + /** + * Receiver(s) + */ + friend class Cmvmi; + + /** + * Sender(s) + */ + friend class MgmtSrvr; + +public: + STATIC_CONST( SignalLength = 14 ); +private: + /** + * 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 theCategories[6]; + Uint32 theLevels[6]; +}; + +#endif diff --git a/ndb/include/kernel/signaldata/ExecFragReq.hpp b/ndb/include/kernel/signaldata/ExecFragReq.hpp new file mode 100644 index 00000000000..e40213d6e29 --- /dev/null +++ b/ndb/include/kernel/signaldata/ExecFragReq.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/FailRep.hpp b/ndb/include/kernel/signaldata/FailRep.hpp new file mode 100644 index 00000000000..44577f07fdc --- /dev/null +++ b/ndb/include/kernel/signaldata/FailRep.hpp @@ -0,0 +1,56 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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" + +/** + * + */ +class FailRep { + /** + * Sender(s) & Reciver(s) + */ + friend class Qmgr; + + /** + * For printing + */ + friend bool printFAIL_REP(FILE *, const Uint32 *, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 2 ); + + 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 + }; + +private: + + Uint32 failNodeId; + Uint32 failCause; +}; + + +#endif diff --git a/ndb/include/kernel/signaldata/FireTrigOrd.hpp b/ndb/include/kernel/signaldata/FireTrigOrd.hpp new file mode 100644 index 00000000000..20a0a863094 --- /dev/null +++ b/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; either version 2 of the License, or + (at your option) any later version. + + 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 = 7 ); + STATIC_CONST( SignalWithGCILength = 8 ); + STATIC_CONST( SignalWithHashValueLength = 9 ); + +private: + Uint32 m_connectionPtr; + Uint32 m_userRef; + Uint32 m_triggerId; + TriggerEvent::Value m_triggerEvent; + Uint32 m_noPrimKeyWords; + Uint32 m_noBeforeValueWords; + Uint32 m_noAfterValueWords; + 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/ndb/include/kernel/signaldata/FsAppendReq.hpp b/ndb/include/kernel/signaldata/FsAppendReq.hpp new file mode 100644 index 00000000000..e2fd61f8a11 --- /dev/null +++ b/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; either version 2 of the License, or + (at your option) any later version. + + 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 = 6 ); + +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 +}; + +#endif diff --git a/ndb/include/kernel/signaldata/FsCloseReq.hpp b/ndb/include/kernel/signaldata/FsCloseReq.hpp new file mode 100644 index 00000000000..8ff47145f87 --- /dev/null +++ b/ndb/include/kernel/signaldata/FsCloseReq.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; either version 2 of the License, or + (at your option) any later version. + + 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; + + /** + * Sender(s) + */ + friend class Backup; + friend class Dbdict; + + /** + * 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 == true) + fileflag = 1; + else + fileflag = 0; +} + + +#endif diff --git a/ndb/include/kernel/signaldata/FsConf.hpp b/ndb/include/kernel/signaldata/FsConf.hpp new file mode 100644 index 00000000000..f66d9feea49 --- /dev/null +++ b/ndb/include/kernel/signaldata/FsConf.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; either version 2 of the License, or + (at your option) any later version. + + 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; + + /** + * 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 + + /** + * Only used if FSOPENCONF + */ + UintR filePointer; // DATA 1 +}; + + + +#endif diff --git a/ndb/include/kernel/signaldata/FsOpenReq.hpp b/ndb/include/kernel/signaldata/FsOpenReq.hpp new file mode 100644 index 00000000000..b84d78ba9dd --- /dev/null +++ b/ndb/include/kernel/signaldata/FsOpenReq.hpp @@ -0,0 +1,266 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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... + + /** + * For printing + */ + friend bool printFSOPENREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); + +public: + /** + * Length of signal + */ + STATIC_CONST( SignalLength = 7 ); + +private: + + /** + * DATA VARIABLES + */ + + UintR userReference; // DATA 0 + UintR userPointer; // DATA 1 + UintR fileNumber[4]; // DATA 2 - 5 + UintR fileFlags; // DATA 6 + + 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 ); + + 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); +}; + +/** + * 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 + * ppppppppddddddddssssssssvvvvvvvv + * + */ +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; +} + + +#endif + diff --git a/ndb/include/kernel/signaldata/FsReadWriteReq.hpp b/ndb/include/kernel/signaldata/FsReadWriteReq.hpp new file mode 100644 index 00000000000..6e4fa4d260e --- /dev/null +++ b/ndb/include/kernel/signaldata/FsReadWriteReq.hpp @@ -0,0 +1,152 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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; + + /** + * Sender(s) + */ + friend class Dbdict; + + + /** + * 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, + fsFormatMax + }; + + /** + * Length of signal + */ + +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); + +}; + +/** + * 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) + + +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; +} + + + + + +#endif diff --git a/ndb/include/kernel/signaldata/FsRef.hpp b/ndb/include/kernel/signaldata/FsRef.hpp new file mode 100644 index 00000000000..650f6520fb5 --- /dev/null +++ b/ndb/include/kernel/signaldata/FsRef.hpp @@ -0,0 +1,116 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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 "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: + */ +class FsRef { + /** + * Reciver(s) + */ + friend class Dbdict; + friend class Backup; + + /** + * Sender(s) + */ + friend class Ndbfs; + friend class VoidFs; + + /** + * For printing + */ + friend bool printFSREF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); + +public: + /** + * Enum type for errorCode + */ + enum NdbfsErrorCodeType { + fsErrNone=0, + fsErrHardwareFailed=1, + fsErrUserError=2, + fsErrEnvironmentError=3, + fsErrTemporaryNotAccessible=4, + fsErrNoSpaceLeftOnDevice=5, + fsErrPermissionDenied=6, + fsErrInvalidParameters=7, + fsErrUnknown=8, + fsErrNoMoreResources=9, + fsErrFileDoesNotExist=10, + fsErrReadUnderflow = 11, + fsErrMax + }; + /** + * Length of signal + */ + STATIC_CONST( SignalLength = 4 ); + +private: + + /** + * 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/ndb/include/kernel/signaldata/FsRemoveReq.hpp b/ndb/include/kernel/signaldata/FsRemoveReq.hpp new file mode 100644 index 00000000000..efb566d883a --- /dev/null +++ b/ndb/include/kernel/signaldata/FsRemoveReq.hpp @@ -0,0 +1,78 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/GCPSave.hpp b/ndb/include/kernel/signaldata/GCPSave.hpp new file mode 100644 index 00000000000..2b4a25e6bb2 --- /dev/null +++ b/ndb/include/kernel/signaldata/GCPSave.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/GetTabInfo.hpp b/ndb/include/kernel/signaldata/GetTabInfo.hpp new file mode 100644 index 00000000000..cb6e38872d3 --- /dev/null +++ b/ndb/include/kernel/signaldata/GetTabInfo.hpp @@ -0,0 +1,126 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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 ); + // STATIC_CONST( MaxTableNameLengthInWords = 20 ); +public: + Uint32 senderData; + Uint32 senderRef; + + /** + * 0 = request by id, 1 = request by name + */ + Uint32 requestType; + + union { + Uint32 tableId; + Uint32 tableNameLen; + }; + Uint32 unused; // This is located here so that Req & Ref have the same format + // Uint32 tableName[MaxTableNameLengthInWords]; + + 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; // 0 = request by id, 1 = request by name + union { + Uint32 tableId; + Uint32 tableNameLen; + }; + Uint32 errorCode; + + enum ErrorCode { + InvalidTableId = 709, + TableNotDefined = 723, + TableNameTooLong = 702, + 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 = 4 ); + + SECTION( DICT_TAB_INFO = 0 ); +public: + Uint32 senderData; + Uint32 tableId; + Uint32 gci; // For table + Uint32 totalLen; // In words +}; + +#endif diff --git a/ndb/include/kernel/signaldata/GetTableId.hpp b/ndb/include/kernel/signaldata/GetTableId.hpp new file mode 100644 index 00000000000..fb91c2e10d7 --- /dev/null +++ b/ndb/include/kernel/signaldata/GetTableId.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/GrepImpl.hpp b/ndb/include/kernel/signaldata/GrepImpl.hpp new file mode 100644 index 00000000000..95b93df0a58 --- /dev/null +++ b/ndb/include/kernel/signaldata/GrepImpl.hpp @@ -0,0 +1,891 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/HotSpareRep.hpp b/ndb/include/kernel/signaldata/HotSpareRep.hpp new file mode 100644 index 00000000000..fb9d338be1b --- /dev/null +++ b/ndb/include/kernel/signaldata/HotSpareRep.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/IndxAttrInfo.hpp b/ndb/include/kernel/signaldata/IndxAttrInfo.hpp new file mode 100755 index 00000000000..ec5790d84f3 --- /dev/null +++ b/ndb/include/kernel/signaldata/IndxAttrInfo.hpp @@ -0,0 +1,56 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/IndxKeyInfo.hpp b/ndb/include/kernel/signaldata/IndxKeyInfo.hpp new file mode 100755 index 00000000000..7cd7795ec71 --- /dev/null +++ b/ndb/include/kernel/signaldata/IndxKeyInfo.hpp @@ -0,0 +1,56 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/InvalidateNodeLCPConf.hpp b/ndb/include/kernel/signaldata/InvalidateNodeLCPConf.hpp new file mode 100644 index 00000000000..2497af354ce --- /dev/null +++ b/ndb/include/kernel/signaldata/InvalidateNodeLCPConf.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/InvalidateNodeLCPReq.hpp b/ndb/include/kernel/signaldata/InvalidateNodeLCPReq.hpp new file mode 100644 index 00000000000..e55a58710b4 --- /dev/null +++ b/ndb/include/kernel/signaldata/InvalidateNodeLCPReq.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/KeyInfo.hpp b/ndb/include/kernel/signaldata/KeyInfo.hpp new file mode 100644 index 00000000000..b839a2c2035 --- /dev/null +++ b/ndb/include/kernel/signaldata/KeyInfo.hpp @@ -0,0 +1,45 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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; + + /** + * 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/ndb/include/kernel/signaldata/LCP.hpp b/ndb/include/kernel/signaldata/LCP.hpp new file mode 100644 index 00000000000..7d3fb71ae7e --- /dev/null +++ b/ndb/include/kernel/signaldata/LCP.hpp @@ -0,0 +1,154 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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; + + /** + * 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; +}; + +#endif diff --git a/ndb/include/kernel/signaldata/ListTables.hpp b/ndb/include/kernel/signaldata/ListTables.hpp new file mode 100644 index 00000000000..7fbfab1294c --- /dev/null +++ b/ndb/include/kernel/signaldata/ListTables.hpp @@ -0,0 +1,166 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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, 4); + } + static void setTableStore(Uint32& data, Uint32 val) { + BitmaskImpl::setField(1, &data, 20, 4, 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); + } +}; + +#endif diff --git a/ndb/include/kernel/signaldata/LqhFrag.hpp b/ndb/include/kernel/signaldata/LqhFrag.hpp new file mode 100644 index 00000000000..116e9c01ca0 --- /dev/null +++ b/ndb/include/kernel/signaldata/LqhFrag.hpp @@ -0,0 +1,252 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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 = 9 ); + + 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; +}; + +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 = 25 ); + + enum RequestInfo { + CreateInRunning = 0x8000000, + TemporaryTable = 0x00000010 + }; + +private: + Uint32 senderData; + Uint32 senderRef; + Uint32 fragmentId; + Uint32 requestInfo; + Uint32 tableId; + Uint32 localKeyLength; + Uint32 maxLoadFactor; + Uint32 minLoadFactor; + Uint32 kValue; + Uint32 lh3DistrBits; + Uint32 lh3PageBits; + Uint32 noOfAttributes; + Uint32 noOfNullAttributes; + Uint32 noOfPagesToPreAllocate; + Uint32 schemaVersion; + Uint32 keyLength; + Uint32 nextLCP; + Uint32 noOfKeyAttr; + Uint32 noOfNewAttr; + Uint32 checksumIndicator; + Uint32 noOfAttributeGroups; + Uint32 GCPIndicator; + Uint32 startGci; + Uint32 tableType; // DictTabInfo::TableType + Uint32 primaryTableId; // table of index or RNIL +}; + +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/ndb/include/kernel/signaldata/LqhKey.hpp b/ndb/include/kernel/signaldata/LqhKey.hpp new file mode 100644 index 00000000000..e937180e3f7 --- /dev/null +++ b/ndb/include/kernel/signaldata/LqhKey.hpp @@ -0,0 +1,534 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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; + + /** + * 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); + + /** + * 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); +}; + +/** + * Request Info + * + * k = Key len - 10 Bits (0-9) max 1023 + * l = Last Replica No - 2 Bits -> Max 3 (10-11) + * 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) + * - = Unused - 2 Bits (30-31) + * + * 1111111111222222222233 + * 01234567890123456789012345678901 + * kkkkkkkkkklltttpdisooorraaacum-- + */ + +#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) + +/** + * 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; +} + +class LqhKeyConf { + /** + * Reciver(s) + */ + friend class Dbtc; + + /** + * 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/ndb/include/kernel/signaldata/LqhSizeAltReq.hpp b/ndb/include/kernel/signaldata/LqhSizeAltReq.hpp new file mode 100644 index 00000000000..e47ce39897a --- /dev/null +++ b/ndb/include/kernel/signaldata/LqhSizeAltReq.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/LqhTransConf.hpp b/ndb/include/kernel/signaldata/LqhTransConf.hpp new file mode 100644 index 00000000000..f62dfd07f51 --- /dev/null +++ b/ndb/include/kernel/signaldata/LqhTransConf.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/ManagementServer.hpp b/ndb/include/kernel/signaldata/ManagementServer.hpp new file mode 100644 index 00000000000..ce14e30c81d --- /dev/null +++ b/ndb/include/kernel/signaldata/ManagementServer.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/MasterGCP.hpp b/ndb/include/kernel/signaldata/MasterGCP.hpp new file mode 100644 index 00000000000..ebe6857a107 --- /dev/null +++ b/ndb/include/kernel/signaldata/MasterGCP.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/MasterLCP.hpp b/ndb/include/kernel/signaldata/MasterLCP.hpp new file mode 100644 index 00000000000..bf84ac73309 --- /dev/null +++ b/ndb/include/kernel/signaldata/MasterLCP.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/NFCompleteRep.hpp b/ndb/include/kernel/signaldata/NFCompleteRep.hpp new file mode 100644 index 00000000000..c8bde705a86 --- /dev/null +++ b/ndb/include/kernel/signaldata/NFCompleteRep.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; either version 2 of the License, or + (at your option) any later version. + + 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 + * + */ +class NFCompleteRep { + /** + * Sender(s) + */ + friend class Dbdict; + friend class Dblqh; + friend class Dbtc; + friend class Qmgr; + + /** + * Sender/Reciver + */ + friend class Dbdih; + friend class ClusterMgr; + + friend bool printNF_COMPLETE_REP(FILE *, const Uint32 *, Uint32, Uint16); + +public: + STATIC_CONST( SignalLength = 5 ); + +private: + + /** + * 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/ndb/include/kernel/signaldata/NdbSttor.hpp b/ndb/include/kernel/signaldata/NdbSttor.hpp new file mode 100644 index 00000000000..edd93ef96a8 --- /dev/null +++ b/ndb/include/kernel/signaldata/NdbSttor.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/NdbfsContinueB.hpp b/ndb/include/kernel/signaldata/NdbfsContinueB.hpp new file mode 100644 index 00000000000..2d569be721f --- /dev/null +++ b/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; either version 2 of the License, or + (at your option) any later version. + + 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); +private: + enum { + ZSCAN_MEMORYCHANNEL_10MS_DELAY = 0, + ZSCAN_MEMORYCHANNEL_NO_DELAY = 1 + }; +}; + +#endif diff --git a/ndb/include/kernel/signaldata/NextScan.hpp b/ndb/include/kernel/signaldata/NextScan.hpp new file mode 100644 index 00000000000..3a1882f94e8 --- /dev/null +++ b/ndb/include/kernel/signaldata/NextScan.hpp @@ -0,0 +1,67 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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; +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 + }; + enum CopyFlag { + todo_ZCOPY_NEXT = 1, + todo_ZCOPY_NEXT_COMMIT = 2, + todo_ZCOPY_COMMIT = 3, + todo_ZCOPY_REPEAT = 4, + todo_ZCOPY_ABORT = 5, + todo_ZCOPY_CLOSE = 6 + }; + 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 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 keyLength; + Uint32 key[4]; +}; + +#endif diff --git a/ndb/include/kernel/signaldata/NodeFailRep.hpp b/ndb/include/kernel/signaldata/NodeFailRep.hpp new file mode 100644 index 00000000000..060acd6a3e2 --- /dev/null +++ b/ndb/include/kernel/signaldata/NodeFailRep.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; either version 2 of the License, or + (at your option) any later version. + + 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 + */ +class NodeFailRep { + /** + * Sender(s) + */ + friend class Qmgr; + + /** + * Sender(s) / Reciver(s) + */ + friend class Ndbcntr; + friend class Dbdict; + + /** + * Reciver(s) + */ + 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 class SafeCounterManager; + +public: + STATIC_CONST( SignalLength = 3 + NodeBitmask::Size ); +private: + + 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/ndb/include/kernel/signaldata/NodeStateSignalData.hpp b/ndb/include/kernel/signaldata/NodeStateSignalData.hpp new file mode 100644 index 00000000000..391d8f89566 --- /dev/null +++ b/ndb/include/kernel/signaldata/NodeStateSignalData.hpp @@ -0,0 +1,94 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/PackedSignal.hpp b/ndb/include/kernel/signaldata/PackedSignal.hpp new file mode 100644 index 00000000000..057bb39b25a --- /dev/null +++ b/ndb/include/kernel/signaldata/PackedSignal.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/PrepDropTab.hpp b/ndb/include/kernel/signaldata/PrepDropTab.hpp new file mode 100644 index 00000000000..e9cc28fed0c --- /dev/null +++ b/ndb/include/kernel/signaldata/PrepDropTab.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; either version 2 of the License, or + (at your option) any later version. + + 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 + }; + +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 + }; + + 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/ndb/include/kernel/signaldata/PrepFailReqRef.hpp b/ndb/include/kernel/signaldata/PrepFailReqRef.hpp new file mode 100644 index 00000000000..90b568237b8 --- /dev/null +++ b/ndb/include/kernel/signaldata/PrepFailReqRef.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/ReadNodesConf.hpp b/ndb/include/kernel/signaldata/ReadNodesConf.hpp new file mode 100644 index 00000000000..f3176cbf0e8 --- /dev/null +++ b/ndb/include/kernel/signaldata/ReadNodesConf.hpp @@ -0,0 +1,109 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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; + +public: + STATIC_CONST( SignalLength = 2 + 6*NodeBitmask::Size ); +private: + + Uint32 noOfNodes; + + /** + * + * NOTE Not valid when send from Qmgr + */ + Uint32 masterNodeId; + + /** + * This array defines all the ndb nodes in the system + */ + Uint32 allNodes[NodeBitmask::Size]; + + /** + * This array describes wheather the nodes are currently active + * + * NOTE Not valid when send from Qmgr + */ + Uint32 inactiveNodes[NodeBitmask::Size]; + + /** + * This array describes the version id of the nodes + * The version id is a 4 bit number + * + * NOTE Not valid when send from Qmgr + */ + Uint32 theVersionIds[4*NodeBitmask::Size]; + + static void setVersionId(NodeId, Uint8 versionId, Uint32 theVersionIds[]); + static Uint8 getVersionId(NodeId, const Uint32 theVersionIds[]); +}; + +inline +void +ReadNodesConf::setVersionId(NodeId nodeId, Uint8 versionId, + Uint32 theVersionIds[]){ + const int word = nodeId >> 3; + const int shift = (nodeId & 7) << 2; + + const Uint32 mask = ~(((Uint32)15) << shift); + const Uint32 tmp = theVersionIds[word]; + + theVersionIds[word] = (tmp & mask) | ((((Uint32)versionId) & 15) << shift); +} + +inline +Uint8 +ReadNodesConf::getVersionId(NodeId nodeId, const Uint32 theVersionIds[]){ + const int word = nodeId >> 3; + const int shift = (nodeId & 7) << 2; + + return (theVersionIds[word] >> shift) & 15; +} + +#endif diff --git a/ndb/include/kernel/signaldata/RelTabMem.hpp b/ndb/include/kernel/signaldata/RelTabMem.hpp new file mode 100644 index 00000000000..9cf1787bba4 --- /dev/null +++ b/ndb/include/kernel/signaldata/RelTabMem.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/RepImpl.hpp b/ndb/include/kernel/signaldata/RepImpl.hpp new file mode 100644 index 00000000000..affffe46f9c --- /dev/null +++ b/ndb/include/kernel/signaldata/RepImpl.hpp @@ -0,0 +1,500 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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::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::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::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::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::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::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/ndb/include/kernel/signaldata/ResumeReq.hpp b/ndb/include/kernel/signaldata/ResumeReq.hpp new file mode 100644 index 00000000000..a4880474ca8 --- /dev/null +++ b/ndb/include/kernel/signaldata/ResumeReq.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/ScanFrag.hpp b/ndb/include/kernel/signaldata/ScanFrag.hpp new file mode 100644 index 00000000000..65ab6f7e411 --- /dev/null +++ b/ndb/include/kernel/signaldata/ScanFrag.hpp @@ -0,0 +1,325 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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 = 25 ); + +public: + Uint32 senderData; + Uint32 resultRef; // Where to send the result + Uint32 savePointId; + Uint32 requestInfo; + Uint32 tableId; + Uint32 fragmentNo; + Uint32 schemaVersion; + Uint32 transId1; + Uint32 transId2; + Uint32 clientOpPtr[MAX_PARALLEL_OP_PER_SCAN]; + + static Uint32 getConcurrency(const Uint32 & requestInfo); + 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 getAttrLen(const Uint32 & requestInfo); + + static void setConcurrency(Uint32 & requestInfo, Uint32 concurrency); + 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 setAttrLen(Uint32 & requestInfo, Uint32 attrLen); +}; + +class KeyInfo20 { + /** + * Sender(s) + */ + friend class Dblqh; + + /** + * Reciver(s) + */ + friend class Backup; + friend class NdbOperation; + friend class NdbScanReceiver; +public: + //STATIC_CONST( SignalLength = 21 ); + 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 = 21 ); + +public: + Uint32 senderData; + Uint32 completedOps; + Uint32 fragmentCompleted; + Uint32 opReturnDataLen[16]; + Uint32 transId1; + Uint32 transId2; +}; + +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, + 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 = 4 ); + +public: + Uint32 senderData; + Uint32 closeFlag; + Uint32 transId1; + Uint32 transId2; +}; + +/** + * Request Info + * + * a = Length of attrinfo - 16 Bits (16-31) + * c = Concurrency - 5 Bits (0-4) -> Max 31 + * 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 + * + * 1111111111222222222233 + * 01234567890123456789012345678901 + * ccccclxhkr aaaaaaaaaaaaaaaa + */ +#define SF_CONCURRENCY_SHIFT (0) +#define SF_CONCURRENCY_MASK (31) + +#define SF_LOCK_MODE_SHIFT (5) +#define SF_LOCK_MODE_MASK (1) + +#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_ATTR_LEN_SHIFT (16) +#define SF_ATTR_LEN_MASK (65535) + +inline +Uint32 +ScanFragReq::getConcurrency(const Uint32 & requestInfo){ + return (requestInfo >> SF_CONCURRENCY_SHIFT) & SF_CONCURRENCY_MASK; +} + +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::getReadCommittedFlag(const Uint32 & requestInfo){ + return (requestInfo >> SF_READ_COMMITTED_SHIFT) & 1; +} + +inline +Uint32 +ScanFragReq::getRangeScanFlag(const Uint32 & requestInfo){ + return (requestInfo >> SF_RANGE_SCAN_SHIFT) & 1; +} + +inline +Uint32 +ScanFragReq::getAttrLen(const Uint32 & requestInfo){ + return (requestInfo >> SF_ATTR_LEN_SHIFT) & SF_ATTR_LEN_MASK; +} + +inline +void +ScanFragReq::setConcurrency(UintR & requestInfo, UintR val){ + ASSERT_MAX(val, SF_CONCURRENCY_MASK, "ScanFragReq::setConcurrency"); + requestInfo |= (val << SF_CONCURRENCY_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::setAttrLen(UintR & requestInfo, UintR val){ + ASSERT_MAX(val, SF_ATTR_LEN_MASK, "ScanFragReq::setAttrLen"); + requestInfo |= (val << SF_ATTR_LEN_SHIFT); +} + +inline +Uint32 +KeyInfo20::setScanInfo(Uint32 opNo, Uint32 scanNo){ + ASSERT_MAX(opNo, 15, "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) & 0xF; +} + +#endif diff --git a/ndb/include/kernel/signaldata/ScanTab.hpp b/ndb/include/kernel/signaldata/ScanTab.hpp new file mode 100644 index 00000000000..efd8a4918ab --- /dev/null +++ b/ndb/include/kernel/signaldata/ScanTab.hpp @@ -0,0 +1,453 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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 NdbOperation; + friend class NdbConnection; + + /** + * For printing + */ + friend bool printSCANTABREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); + +public: + /** + * Length of signal + */ + STATIC_CONST( SignalLength = 25 ); + +private: + + // Type definitions + + /** + * DATA VARIABLES + */ + UintR apiConnectPtr; // DATA 0 + UintR attrLen; // 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 apiOperationPtr[16]; // DATA 9-25 + + /** + * 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); + + /** + * 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); + +}; + +/** + * 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 + x = Range Scan (TUX) - 1 Bit 15 + + 1111111111222222222233 + 01234567890123456789012345678901 + ppppppppl hc x +*/ + +#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 READ_COMMITTED_SHIFT (11) +#define READ_COMMITTED_MASK (1) + +#define RANGE_SCAN_SHIFT (15) +#define RANGE_SCAN_MASK (1) + +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 +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); +} + + +/** + * + * SENDER: Dbtc + * RECIVER: API + */ +class ScanTabConf { + /** + * Reciver(s) + */ + friend class NdbConnection; // 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 ); + +private: + + // Type definitions + + /** + * DATA VARIABLES + */ + UintR apiConnectPtr; // DATA 0 + UintR requestInfo; // DATA 1 + UintR transId1; // DATA 2 + UintR transId2; // DATA 3 +#if 0 + UintR operLenAndIdx[16]; // DATA 4-19 + + /** + * Get:ers for operLenAndIdx + */ + static Uint32 getLen(const UintR & operLenAndIdx); + static Uint8 getIdx(const UintR & operLenAndIdx); +#endif + + /** + * Get:ers for requestInfo + */ + static Uint8 getOperations(const UintR & reqInfo); + static Uint8 getScanStatus(const UintR & reqInfo); + + /** + * Set:ers for requestInfo + */ + static void setOperations(UintR & reqInfo, Uint32 ops); + static void setScanStatus(UintR & reqInfo, Uint32 stat); + + +}; + +/** + * 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) + +inline +Uint8 +ScanTabConf::getOperations(const UintR & reqInfo){ + return (Uint8)((reqInfo >> OPERATIONS_SHIFT) & OPERATIONS_MASK); +} + +inline +void +ScanTabConf::setOperations(UintR & requestInfo, Uint32 ops){ + ASSERT_MAX(ops, OPERATIONS_MASK, "ScanTabConf::setOperations"); + requestInfo |= (ops << OPERATIONS_SHIFT); +} + +inline +Uint8 +ScanTabConf::getScanStatus(const UintR & reqInfo){ + return (Uint8)((reqInfo >> STATUS_SHIFT) & STATUS_MASK); +} + +inline +void +ScanTabConf::setScanStatus(UintR & requestInfo, Uint32 stat){ + ASSERT_MAX(stat, STATUS_MASK, "ScanTabConf::setScanStatus"); + requestInfo |= (stat << STATUS_SHIFT); +} + + +/** + * + * SENDER: Dbtc, API + * RECIVER: API, Dbtc + */ +class ScanTabInfo { + /** + * Reciver(s) and Sender(s) + */ + friend class NdbConnection; + friend class Dbtc; + + /** + * For printing + */ + friend bool printSCANTABINFO(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); + +public: + /** + * Length of signal + */ + STATIC_CONST( SignalLength = 17 ); + +private: + + // Type definitions + + /** + * DATA VARIABLES + */ + UintR apiConnectPtr; // DATA 0 + UintR operLenAndIdx[16]; // DATA 1-16 + + /** + * Get:ers for operLenAndIdx + */ + static Uint32 getLen(const UintR & operLenAndIdx); + static Uint8 getIdx(const UintR & operLenAndIdx); + +}; + + +/** + * Operation length and index + * + l = Length of operation - 24 Bits -> Max 16777215 (Bit 0-24) + i = Index of operation - 7 Bits -> Max 255 (Bit 25-32) + + 1111111111222222222233 + 01234567890123456789012345678901 + llllllllllllllllllllllllliiiiiii +*/ + +#define LENGTH_SHIFT (0) +#define LENGTH_MASK (0xFFFFFF) + +#define INDEX_SHIFT (24) +#define INDEX_MASK (0xFF) + +inline +Uint32 +ScanTabInfo::getLen(const UintR & operLenAndIdx){ + return (Uint32)((operLenAndIdx >> LENGTH_SHIFT) & LENGTH_MASK); +} + +inline +Uint8 +ScanTabInfo::getIdx(const UintR & operLenAndIdx){ + return (Uint8)((operLenAndIdx >> INDEX_SHIFT) & INDEX_MASK); +} + +/** + * + * SENDER: Dbtc + * RECIVER: API + */ +class ScanTabRef { + /** + * Reciver(s) + */ + friend class NdbConnection; // 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 = 4 ); + +private: + + // Type definitions + + /** + * DATA VARIABLES + */ + UintR apiConnectPtr; // DATA 0 + UintR transId1; // DATA 1 + UintR transId2; // DATA 2 + UintR errorCode; // DATA 3 + // UintR sendScanNextReqWithClose; // 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/ndb/include/kernel/signaldata/SetLogLevelOrd.hpp b/ndb/include/kernel/signaldata/SetLogLevelOrd.hpp new file mode 100644 index 00000000000..680e9b25a49 --- /dev/null +++ b/ndb/include/kernel/signaldata/SetLogLevelOrd.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; either version 2 of the License, or + (at your option) any later version. + + 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> + +/** + * + */ +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 = 25 ); + + Uint32 noOfEntries; + Uint32 theCategories[12]; + Uint32 theLevels[12]; + + void clear(); + + /** + * Note level is valid as 0-15 + */ + void setLogLevel(LogLevel::EventCategory ec, int level = 7); +}; + +inline +void +SetLogLevelOrd::clear(){ + noOfEntries = 0; +} + +inline +void +SetLogLevelOrd::setLogLevel(LogLevel::EventCategory ec, int level){ + assert(noOfEntries < 12); + theCategories[noOfEntries] = ec; + theLevels[noOfEntries] = level; + noOfEntries++; +} + +#endif diff --git a/ndb/include/kernel/signaldata/SetVarReq.hpp b/ndb/include/kernel/signaldata/SetVarReq.hpp new file mode 100644 index 00000000000..8cb3e78be8b --- /dev/null +++ b/ndb/include/kernel/signaldata/SetVarReq.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/SignalData.hpp b/ndb/include/kernel/signaldata/SignalData.hpp new file mode 100644 index 00000000000..071bd9b9104 --- /dev/null +++ b/ndb/include/kernel/signaldata/SignalData.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; either version 2 of the License, or + (at your option) any later version. + + 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_limits.h> +#include <kernel_types.h> +#include <NdbStdio.h> +#include <NdbConstant.hpp> +#include <stdlib.h> + +#ifndef NDB_ASSERT +#ifdef VM_TRACE +#define NDB_ASSERT(test, message) { if(!(test)) { printf(message); exit(-1); }} +#else +#define NDB_ASSERT(test, message) +#endif +#endif + +// Useful ASSERT macros... +#define ASSERT_BOOL(flag, message) NDB_ASSERT( (flag<=1), (message) ) +#define ASSERT_RANGE(value, min, max, message) \ + NDB_ASSERT((value) >= (min) && (value) <= (max), (message)) +#define ASSERT_MAX(value, max, message) \ + NDB_ASSERT((value) <= (max), (message)) + +#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; }; + +#endif diff --git a/ndb/include/kernel/signaldata/SignalDataPrint.hpp b/ndb/include/kernel/signaldata/SignalDataPrint.hpp new file mode 100644 index 00000000000..588e2893214 --- /dev/null +++ b/ndb/include/kernel/signaldata/SignalDataPrint.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; either version 2 of the License, or + (at your option) any later version. + + 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 <kernel_types.h> +#include <NdbStdio.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/ndb/include/kernel/signaldata/SignalDroppedRep.hpp b/ndb/include/kernel/signaldata/SignalDroppedRep.hpp new file mode 100644 index 00000000000..20863524358 --- /dev/null +++ b/ndb/include/kernel/signaldata/SignalDroppedRep.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/SrFragidConf.hpp b/ndb/include/kernel/signaldata/SrFragidConf.hpp new file mode 100644 index 00000000000..9a6088ad57f --- /dev/null +++ b/ndb/include/kernel/signaldata/SrFragidConf.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/StartFragReq.hpp b/ndb/include/kernel/signaldata/StartFragReq.hpp new file mode 100644 index 00000000000..ec05c1ee366 --- /dev/null +++ b/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; either version 2 of the License, or + (at your option) any later version. + + 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 ); + +private: + 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/ndb/include/kernel/signaldata/StartInfo.hpp b/ndb/include/kernel/signaldata/StartInfo.hpp new file mode 100644 index 00000000000..da032adba8a --- /dev/null +++ b/ndb/include/kernel/signaldata/StartInfo.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; either version 2 of the License, or + (at your option) any later version. + + 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 = 2 ); +}; + +#endif diff --git a/ndb/include/kernel/signaldata/StartMe.hpp b/ndb/include/kernel/signaldata/StartMe.hpp new file mode 100644 index 00000000000..6593a9e9741 --- /dev/null +++ b/ndb/include/kernel/signaldata/StartMe.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/StartOrd.hpp b/ndb/include/kernel/signaldata/StartOrd.hpp new file mode 100644 index 00000000000..43a48f70ba9 --- /dev/null +++ b/ndb/include/kernel/signaldata/StartOrd.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/StartPerm.hpp b/ndb/include/kernel/signaldata/StartPerm.hpp new file mode 100644 index 00000000000..38be72835a3 --- /dev/null +++ b/ndb/include/kernel/signaldata/StartPerm.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; either version 2 of the License, or + (at your option) any later version. + + 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; +}; +#endif diff --git a/ndb/include/kernel/signaldata/StartRec.hpp b/ndb/include/kernel/signaldata/StartRec.hpp new file mode 100644 index 00000000000..f8a4e01a094 --- /dev/null +++ b/ndb/include/kernel/signaldata/StartRec.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/StartTo.hpp b/ndb/include/kernel/signaldata/StartTo.hpp new file mode 100644 index 00000000000..5aecef6275d --- /dev/null +++ b/ndb/include/kernel/signaldata/StartTo.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/StopMe.hpp b/ndb/include/kernel/signaldata/StopMe.hpp new file mode 100644 index 00000000000..51d944a3b96 --- /dev/null +++ b/ndb/include/kernel/signaldata/StopMe.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/StopPerm.hpp b/ndb/include/kernel/signaldata/StopPerm.hpp new file mode 100644 index 00000000000..95fb82c8cde --- /dev/null +++ b/ndb/include/kernel/signaldata/StopPerm.hpp @@ -0,0 +1,96 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/StopReq.hpp b/ndb/include/kernel/signaldata/StopReq.hpp new file mode 100644 index 00000000000..ea453ae115d --- /dev/null +++ b/ndb/include/kernel/signaldata/StopReq.hpp @@ -0,0 +1,202 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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 ); + +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 + + 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); + static void setEscalateOnNodeFail(Uint32 & requestInfo, bool value); + /** + * Don't perform "graceful" shutdown/restart... + */ + static void setStopAbort(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 getEscalateOnNodeFail(const Uint32 & requestInfo); + static bool getStopAbort(const Uint32 & requestInfo); +}; + +class StopRef +{ + /** + * 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; +}; + +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::getEscalateOnNodeFail(const Uint32 & requestInfo) +{ + return requestInfo & 16; +} + +inline +bool +StopReq::getStopAbort(const Uint32 & requestInfo) +{ + return requestInfo & 32; +} + + +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::setEscalateOnNodeFail(Uint32 & requestInfo, bool value) +{ + if(value) + requestInfo |= 16; + else + requestInfo &= ~16; +} + +inline +void +StopReq::setStopAbort(Uint32 & requestInfo, bool value) +{ + if(value) + requestInfo |= 32; + else + requestInfo &= ~32; +} + + +#endif + diff --git a/ndb/include/kernel/signaldata/SumaImpl.hpp b/ndb/include/kernel/signaldata/SumaImpl.hpp new file mode 100644 index 00000000000..089132cd9aa --- /dev/null +++ b/ndb/include/kernel/signaldata/SumaImpl.hpp @@ -0,0 +1,619 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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> + + +class SubCreateReq { + /** + * Sender(s)/Reciver(s) + */ + friend class Grep; + friend class SumaParticipant; + + friend bool printSUB_CREATE_REQ(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 5 ); + + 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 + }; + + Uint32 subscriberRef; + Uint32 subscriberData; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 subscriptionType; + union { + Uint32 tableId; // Used when doing SingelTableScan + }; + SECTION( ATTRIBUTE_LIST = 0); // Used when doing SingelTableScan + SECTION( TABLE_LIST = 1 ); + +}; + +class SubCreateRef { + /** + * Sender(s)/Reciver(s) + */ + friend class Grep; + friend class SumaParticipant; + + friend bool printSUB_CREATE_REF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 6 ); + + Uint32 subscriberRef; + Uint32 subscriberData; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 subscriptionType; + Uint32 err; + + SECTION( ATTRIBUTE_LIST = 0); // Used when doing SingelTableScan + union { + Uint32 tableId; // Used when doing SingelTableScan + }; +}; + +class SubCreateConf { + /** + * Sender(s)/Reciver(s) + */ + friend class Grep; + friend class SumaParticipant; + + friend bool printSUB_CREATE_CONF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 3 ); + + Uint32 subscriberData; + Uint32 subscriptionId; + Uint32 subscriptionKey; +}; + +class SubscriptionData { +public: + enum Part { + MetaData = 1, + TableData = 2 + }; +}; + +class SubStartReq { + /** + * Sender(s)/Reciver(s) + */ + friend class Suma; + + friend bool printSUB_START_REQ(FILE *, const Uint32 *, Uint32, Uint16); +public: + 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; +}; + +class SubStartRef { + /** + * Sender(s)/Reciver(s) + */ + friend class Suma; + + friend bool printSUB_START_REF(FILE *, const Uint32 *, Uint32, Uint16); +public: + enum ErrorCode { + Undefined = 0, + NF_FakeErrorREF = 11, + Busy = 701, + Temporary = 0x1 << 16 + }; + bool isTemporary() const; + void setTemporary(); + ErrorCode setTemporary(ErrorCode ec); + + STATIC_CONST( SignalLength = 7 ); + STATIC_CONST( SignalLength2 = SignalLength+1 ); + + Uint32 senderRef; + Uint32 senderData; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 part; // SubscriptionData::Part + Uint32 subscriberData; + union { // do not change the order here! + Uint32 err; + Uint32 errorCode; + }; + // with SignalLength2 + Uint32 subscriberRef; +}; +inline bool SubStartRef::isTemporary() const +{ return (errorCode & SubStartRef::Temporary) > 0; }; +inline void SubStartRef::setTemporary() +{ errorCode |= SubStartRef::Temporary; }; +inline SubStartRef::ErrorCode SubStartRef::setTemporary(ErrorCode ec) +{ return (SubStartRef::ErrorCode) + (errorCode = ((Uint32) ec | (Uint32)SubStartRef::Temporary)); }; + +class SubStartConf { + /** + * Sender(s)/Reciver(s) + */ + friend class Grep; + + friend bool printSUB_START_CONF(FILE *, const Uint32 *, Uint32, Uint16); +public: + 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; +}; + +class SubStopReq { + /** + * Sender(s)/Reciver(s) + */ + friend class Suma; + + friend bool printSUB_STOP_REQ(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 7 ); + Uint32 senderRef; + Uint32 senderData; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 part; // SubscriptionData::Part + Uint32 subscriberData; + Uint32 subscriberRef; +}; + +class SubStopRef { + /** + * Sender(s)/Reciver(s) + */ + friend class Suma; + + friend bool printSUB_STOP_REF(FILE *, const Uint32 *, Uint32, Uint16); +public: + enum ErrorCode { + Undefined = 0, + NF_FakeErrorREF = 11, + Busy = 701, + Temporary = 0x1 << 16 + }; + bool isTemporary() const; + void setTemporary(); + ErrorCode setTemporary(ErrorCode ec); + + STATIC_CONST( SignalLength = 8 ); + + Uint32 senderRef; + Uint32 senderData; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 part; // SubscriptionData::Part + Uint32 subscriberData; + Uint32 subscriberRef; + union { + Uint32 err; + Uint32 errorCode; + }; +}; +inline bool SubStopRef::isTemporary() const +{ return (errorCode & SubStopRef::Temporary) > 0; }; +inline void SubStopRef::setTemporary() +{ errorCode |= SubStopRef::Temporary; }; +inline SubStopRef::ErrorCode SubStopRef::setTemporary(ErrorCode ec) +{ return (SubStopRef::ErrorCode) + (errorCode = ((Uint32) ec | (Uint32)SubStopRef::Temporary)); }; + +class SubStopConf { + /** + * Sender(s)/Reciver(s) + */ + friend class Grep; + + friend bool printSUB_STOP_CONF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 7 ); + + Uint32 senderRef; + Uint32 senderData; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 part; // SubscriptionData::Part + Uint32 subscriberData; + Uint32 subscriberRef; +}; + +class SubSyncReq { + /** + * Sender(s)/Reciver(s) + */ + friend class Suma; + friend class Grep; + + friend bool printSUB_SYNC_REQ(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 4 ); + +public: + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 subscriberData; + Uint32 part; // SubscriptionData::Part +}; + +class SubSyncRef { + /** + * Sender(s)/Reciver(s) + */ + friend class Suma; + friend class Grep; + + friend bool printSUB_SYNC_REF(FILE *, const Uint32 *, Uint32, Uint16); +public: + enum ErrorCode { + Undefined = 0, + Temporary = 0x1 << 16 + }; + STATIC_CONST( SignalLength = 5 ); + + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 part; // SubscriptionData::Part + Uint32 subscriberData; + union { + Uint32 errorCode; + Uint32 err; + }; +}; + +class SubSyncConf { + + /** + * Sender(s)/Reciver(s) + */ + friend class Suma; + friend class Grep; + + friend bool printSUB_SYNC_CONF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 4 ); + + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 part; // SubscriptionData::Part + Uint32 subscriberData; +}; + +class SubMetaData { + /** + * Sender(s)/Reciver(s) + */ + friend class SumaParticipant; + friend class Grep; + + friend bool printSUB_META_DATA(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 3 ); + SECTION( DICT_TAB_INFO = 0 ); + + Uint32 gci; + union { // Haven't decide what to call it + Uint32 senderData; + Uint32 subscriberData; + }; + union { + Uint32 tableId; + }; +}; + +class SubTableData { + /** + * Sender(s)/Reciver(s) + */ + friend class SumaParticipant; + friend class Grep; + + friend bool printSUB_TABLE_DATA(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 7 ); + + enum LogType { + SCAN = 1, + LOG = 2, + REMOVE_FLAGS = 0xff, + GCINOTCONSISTENT = 0x1 << 16 + }; + + void setGCINotConsistent() { logType |= (Uint32)GCINOTCONSISTENT; }; + bool isGCIConsistent() + { return (logType & (Uint32)GCINOTCONSISTENT) == 0 ? true : false; }; + + union { // Haven't decide what to call it + Uint32 senderData; + Uint32 subscriberData; + }; + Uint32 gci; + Uint32 tableId; + Uint32 operation; + Uint32 noOfAttributes; + Uint32 dataSize; + Uint32 logType; +}; + +class SubSyncContinueReq { + /** + * Sender(s)/Reciver(s) + */ + friend class SumaParticipant; + friend class Grep; + friend class Trix; + + friend bool printSUB_SYNC_CONTINUE_REQ(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 2 ); + + union { // Haven't decide what to call it + Uint32 senderData; + Uint32 subscriberData; + }; + Uint32 noOfRowsSent; +}; + +class SubSyncContinueRef { + /** + * Sender(s)/Reciver(s) + */ + friend class SumaParticipant; + friend class Grep; + friend class Trix; + + friend bool printSUB_SYNC_CONTINUE_REF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 2 ); + + Uint32 subscriptionId; + Uint32 subscriptionKey; +}; + +class SubSyncContinueConf { + /** + * Sender(s)/Reciver(s) + */ + friend class SumaParticipant; + friend class Grep; + friend class Trix; + + friend bool printSUB_SYNC_CONTINUE_CONF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 2 ); + + Uint32 subscriptionId; + Uint32 subscriptionKey; +}; + +class SubGcpCompleteRep { + + /** + * Sender(s)/Reciver(s) + */ + friend class Dbdih; + friend class SumaParticipant; + friend class Grep; + friend class Trix; + + friend bool printSUB_GCP_COMPLETE_REP(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 3 ); + + Uint32 gci; + Uint32 senderRef; + union { // Haven't decide what to call it + Uint32 senderData; + Uint32 subscriberData; + }; +}; + +class SubGcpCompleteAcc { + /** + * Sender(s)/Reciver(s) + */ +public: + STATIC_CONST( SignalLength = SubGcpCompleteRep::SignalLength ); + + SubGcpCompleteRep rep; +}; + +class SubRemoveReq { + /** + * Sender(s)/Reciver(s) + */ + friend class Grep; + friend class SumaParticipant; + + friend bool printSUB_REMOVE_REQ(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 4 ); + + Uint32 senderRef; + Uint32 senderData; + Uint32 subscriptionId; + Uint32 subscriptionKey; +}; + +class SubRemoveRef { + /** + * Sender(s)/Reciver(s) + */ + friend class Grep; + friend class SumaParticipant; + + friend bool printSUB_REMOVE_REF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 5 ); + enum ErrorCode { + Undefined = 0, + NF_FakeErrorREF = 11, + Busy = 701, + Temporary = 0x1 << 16 + }; + bool isTemporary() const; + void setTemporary(); + ErrorCode setTemporary(ErrorCode ec); + + Uint32 senderRef; + Uint32 subscriptionId; + Uint32 subscriptionKey; + union { + Uint32 err; + Uint32 errorCode; + }; + union { // Haven't decide what to call it + Uint32 senderData; + Uint32 subscriberData; + }; +}; +inline bool SubRemoveRef::isTemporary() const +{ return (err & SubRemoveRef::Temporary) > 0; }; +inline void SubRemoveRef::setTemporary() +{ err |= SubRemoveRef::Temporary; }; +inline SubRemoveRef::ErrorCode SubRemoveRef::setTemporary(ErrorCode ec) +{ return (SubRemoveRef::ErrorCode) + (errorCode = ((Uint32) ec | (Uint32)SubRemoveRef::Temporary)); }; + +class SubRemoveConf { + /** + * Sender(s)/Reciver(s) + */ + friend class Grep; + friend class SumaParticipant; + + friend bool printSUB_REMOVE_CONF(FILE *, const Uint32 *, Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 5 ); + + Uint32 senderRef; + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 err; + union { // Haven't decide what to call it + Uint32 senderData; + Uint32 subscriberData; + }; + +}; + + +class CreateSubscriptionIdReq { + friend class Grep; + friend class SumaParticipant; + + friend bool printCREATE_SUBSCRIPTION_ID_REQ(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 CreateSubscriptionIdConf { + friend class Grep; + friend class SumaParticipant; + + friend bool printCREATE_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 CreateSubscriptionIdRef { + friend class Grep; + friend class SumaParticipant; + + friend bool printCREATE_SUBSCRIPTION_ID_REF(FILE *, const Uint32 *, + Uint32, Uint16); +public: + STATIC_CONST( SignalLength = 4 ); + + Uint32 subscriptionId; + Uint32 subscriptionKey; + Uint32 err; + union { // Haven't decide what to call it + Uint32 senderData; + Uint32 subscriberData; + }; +}; + +class SumaStartMe { +public: + STATIC_CONST( SignalLength = 1 ); + Uint32 unused; +}; + +class SumaHandoverReq { +public: + STATIC_CONST( SignalLength = 1 ); + Uint32 gci; +}; + +class SumaHandoverConf { +public: + STATIC_CONST( SignalLength = 1 ); + Uint32 gci; +}; +#endif diff --git a/ndb/include/kernel/signaldata/SystemError.hpp b/ndb/include/kernel/signaldata/SystemError.hpp new file mode 100644 index 00000000000..7b4d47c5c2e --- /dev/null +++ b/ndb/include/kernel/signaldata/SystemError.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; either version 2 of the License, or + (at your option) any later version. + + 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 { + ScanfragStateError = 1, + ScanfragTimeout = 2, + GCPStopDetected = 3, + StartInProgressError = 4, + CopyFragRefError = 5, + TestStopOnError = 6 + }; + +private: + Uint32 errorRef; + Uint32 errorCode; + Uint32 data1; + Uint32 data2; +}; + +#endif + diff --git a/ndb/include/kernel/signaldata/TamperOrd.hpp b/ndb/include/kernel/signaldata/TamperOrd.hpp new file mode 100644 index 00000000000..eb6cd47b093 --- /dev/null +++ b/ndb/include/kernel/signaldata/TamperOrd.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/TcCommit.hpp b/ndb/include/kernel/signaldata/TcCommit.hpp new file mode 100644 index 00000000000..43eb7be1c39 --- /dev/null +++ b/ndb/include/kernel/signaldata/TcCommit.hpp @@ -0,0 +1,74 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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; + +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; +}; + +class TcCommitRef { + /** + * Sender(s) + */ + friend class Dbtc; + + /** + * Reciver(s) + */ + friend class NdbConnection; + +public: + STATIC_CONST( SignalLength = 4 ); +private: + + Uint32 apiConnectPtr; + Uint32 transId1; + Uint32 transId2; + Uint32 errorCode; +}; + +#endif diff --git a/ndb/include/kernel/signaldata/TcContinueB.hpp b/ndb/include/kernel/signaldata/TcContinueB.hpp new file mode 100644 index 00000000000..7a093b457e8 --- /dev/null +++ b/ndb/include/kernel/signaldata/TcContinueB.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; either version 2 of the License, or + (at your option) any later version. + + 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 + }; +}; + +#endif diff --git a/ndb/include/kernel/signaldata/TcHbRep.hpp b/ndb/include/kernel/signaldata/TcHbRep.hpp new file mode 100644 index 00000000000..58ab015917a --- /dev/null +++ b/ndb/include/kernel/signaldata/TcHbRep.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; either version 2 of the License, or + (at your option) any later version. + + 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 NdbConnection; + + /** + * 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/ndb/include/kernel/signaldata/TcIndx.hpp b/ndb/include/kernel/signaldata/TcIndx.hpp new file mode 100644 index 00000000000..764d4e9fcd7 --- /dev/null +++ b/ndb/include/kernel/signaldata/TcIndx.hpp @@ -0,0 +1,528 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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" + +class TcIndxReq { + /** + * Reciver(s) + */ + friend class Dbtc; // Reciver + + /** + * Sender(s) + */ + friend class NdbIndexOperation; + + /** + * For printing + */ + 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 ); + +private: + + enum CommitType { + CommitIfFailFree = 0, + TryCommit = 1, + CommitAsMuchAsPossible = 2 + }; + + /** + * DATA VARIABLES + */ +//------------------------------------------------------------- +// Unconditional part. First 8 words +//------------------------------------------------------------- + UintR apiConnectPtr; // DATA 0 + UintR senderData; // DATA 1 + UintR attrLen; // DATA 2 (including API Version) + UintR indexId; // DATA 3 + UintR requestInfo; // DATA 4 + UintR indexSchemaVersion; // DATA 5 + UintR transId1; // DATA 6 + UintR transId2; // DATA 7 +//------------------------------------------------------------- +// Conditional part. Those four words will be sent only if their +// indicator is set. +//------------------------------------------------------------- + UintR scanInfo; // DATA 8 + UintR distrGroupHashValue; // DATA 9 + UintR distributionKeySize; // DATA 10 + UintR storedProcId; // DATA 11 + +//------------------------------------------------------------- +// Variable sized key and attrinfo part. Those will be placed to +// pack the signal in an appropriate manner. +//------------------------------------------------------------- + UintR keyInfo[MaxKeyInfo]; // DATA 12 - 19 + UintR attrInfo[MaxAttrInfo]; // DATA 20 - 24 + + static Uint8 getAPIVersion(const UintR & attrLen); + + /** + * Get:ers for requestInfo + */ + static Uint8 getCommitFlag(const UintR & requestInfo); + static Uint8 getCommitType(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 getDistributionGroupFlag(const UintR & requestInfo); + static Uint8 getDistributionGroupTypeFlag(const UintR & requestInfo); + static Uint8 getDistributionKeyFlag(const UintR & requestInfo); + static Uint8 getScanIndFlag(const UintR & requestInfo); + + static Uint8 getOperationType(const UintR & requestInfo); + + static Uint16 getIndexLength(const UintR & requestInfo); + static Uint8 getAIInTcIndxReq(const UintR & requestInfo); + + /** + * Get:ers for scanInfo + */ + + static void setAPIVersion(UintR & attrLen, Uint16 apiVersion); + + /** + * Set:ers for requestInfo + */ + static void clearRequestInfo(UintR & requestInfo); + static void setCommitType(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 setDistributionGroupFlag(UintR & requestInfo, Uint32 flag); + static void setDistributionGroupTypeFlag(UintR & requestInfo, Uint32 flag); + static void setDistributionKeyFlag(UintR & requestInfo, Uint32 flag); + static void setScanIndFlag(UintR & requestInfo, Uint32 flag); + + static void setOperationType(UintR & requestInfo, Uint32 type); + + static void setIndexLength(UintR & requestInfo, Uint32 len); + static void setAIInTcIndxReq(UintR & requestInfo, Uint32 len); + + /** + * Set:ers for scanInfo + */ + +}; + +#define API_VER_NO_SHIFT (16) +#define API_VER_NO_MASK (65535) + +/** + * Request Info + * + a = Attr Info in TCINDXREQ - 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 + g = Distribution Group Ind - 1 Bit 1 + i = Interpreted Indicator - 1 Bit 15 + k = Index lengt - 12 Bits -> Max 4095 (Bit 20 - 31) + o = Operation Type - 3 Bits -> Max 7 (Bit 5-7) + p = Simple Indicator - 1 Bit 8 + s = Start Indicator - 1 Bit 11 + t = Distribution GroupType - 1 Bit 3 + y = Commit Type - 2 Bit 12-13 + x = Last Op in execute - 1 Bit 19 + + 1111111111222222222233 + 01234567890123456789012345678901 + dgbtcooop syyeiaaa-kkkkkkkkkkkk +*/ + +#define COMMIT_SHIFT (4) +#define START_SHIFT (11) +#define SIMPLE_SHIFT (8) +#define DIRTY_SHIFT (0) +#define INTERPRETED_SHIFT (15) +#define DISTR_GROUP_SHIFT (1) +#define DISTR_GROUP_TYPE_SHIFT (3) +#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 INDEX_LEN_SHIFT (20) +#define INDEX_LEN_MASK (4095) + +#define COMMIT_TYPE_SHIFT (12) +#define COMMIT_TYPE_MASK (3) + +#define LAST_OP_IN_EXEC_SHIFT (19) + +/** + * Scan Info + * + + + 1111111111222222222233 + 01234567890123456789012345678901 + +*/ + +inline +Uint8 +TcIndxReq::getCommitFlag(const UintR & requestInfo){ + return (Uint8)((requestInfo >> COMMIT_SHIFT) & 1); +} + +inline +Uint8 +TcIndxReq::getCommitType(const UintR & requestInfo){ + return (Uint8)((requestInfo >> COMMIT_TYPE_SHIFT) & COMMIT_TYPE_MASK); +} + +inline +Uint8 +TcIndxReq::getStartFlag(const UintR & requestInfo){ + return (Uint8)((requestInfo >> START_SHIFT) & 1); +} + +inline +Uint8 +TcIndxReq::getSimpleFlag(const UintR & requestInfo){ + return (Uint8)((requestInfo >> SIMPLE_SHIFT) & 1); +} + +inline +Uint8 +TcIndxReq::getDirtyFlag(const UintR & requestInfo){ + return (Uint8)((requestInfo >> DIRTY_SHIFT) & 1); +} + +inline +Uint8 +TcIndxReq::getInterpretedFlag(const UintR & requestInfo){ + return (Uint8)((requestInfo >> INTERPRETED_SHIFT) & 1); +} + +inline +Uint8 +TcIndxReq::getDistributionGroupFlag(const UintR & requestInfo){ + return (Uint8)((requestInfo >> DISTR_GROUP_SHIFT) & 1); +} + +inline +Uint8 +TcIndxReq::getDistributionGroupTypeFlag(const UintR & requestInfo){ + return (Uint8)((requestInfo >> DISTR_GROUP_TYPE_SHIFT) & 1); +} + +inline +Uint8 +TcIndxReq::getDistributionKeyFlag(const UintR & requestInfo){ + return (Uint8)((requestInfo >> DISTR_KEY_SHIFT) & 1); +} + +inline +Uint8 +TcIndxReq::getScanIndFlag(const UintR & requestInfo){ + return (Uint8)((requestInfo >> SCAN_SHIFT) & 1); +} + +inline +Uint8 +TcIndxReq::getOperationType(const UintR & requestInfo){ + return (Uint8)((requestInfo >> OPERATION_SHIFT) & OPERATION_MASK); +} + +inline +Uint16 +TcIndxReq::getIndexLength(const UintR & requestInfo){ + return (Uint16)((requestInfo >> INDEX_LEN_SHIFT) & INDEX_LEN_MASK); +} + +inline +Uint8 +TcIndxReq::getAIInTcIndxReq(const UintR & requestInfo){ + return (Uint8)((requestInfo >> AINFO_SHIFT) & AINFO_MASK); +} + +inline +void +TcIndxReq::clearRequestInfo(UintR & requestInfo){ + requestInfo = 0; +} + +inline +void +TcIndxReq::setCommitType(UintR & requestInfo, Uint32 type){ + ASSERT_MAX(type, COMMIT_TYPE_MASK, "TcIndxReq::setCommitType"); + requestInfo |= (type << COMMIT_TYPE_SHIFT); +} + +inline +void +TcIndxReq::setCommitFlag(UintR & requestInfo, Uint32 flag){ + ASSERT_BOOL(flag, "TcIndxReq::setCommitFlag"); + requestInfo &= ~(1 << COMMIT_SHIFT); + requestInfo |= (flag << COMMIT_SHIFT); +} + +inline +void +TcIndxReq::setStartFlag(UintR & requestInfo, Uint32 flag){ + ASSERT_BOOL(flag, "TcIndxReq::setStartFlag"); + requestInfo &= ~(1 << START_SHIFT); + requestInfo |= (flag << START_SHIFT); +} + +inline +void +TcIndxReq::setSimpleFlag(UintR & requestInfo, Uint32 flag){ + ASSERT_BOOL(flag, "TcIndxReq::setSimpleFlag"); + requestInfo &= ~(1 << SIMPLE_SHIFT); + requestInfo |= (flag << SIMPLE_SHIFT); +} + +inline +void +TcIndxReq::setDirtyFlag(UintR & requestInfo, Uint32 flag){ + ASSERT_BOOL(flag, "TcIndxReq::setDirtyFlag"); + requestInfo &= ~(1 << DIRTY_SHIFT); + requestInfo |= (flag << DIRTY_SHIFT); +} + +inline +void +TcIndxReq::setInterpretedFlag(UintR & requestInfo, Uint32 flag){ + ASSERT_BOOL(flag, "TcIndxReq::setInterpretedFlag"); + requestInfo &= ~(1 << INTERPRETED_SHIFT); + requestInfo |= (flag << INTERPRETED_SHIFT); +} + +inline +void +TcIndxReq::setDistributionGroupTypeFlag(UintR & requestInfo, Uint32 flag){ + ASSERT_BOOL(flag, "TcIndxReq::setDistributionGroupTypeFlag"); + requestInfo &= ~(1 << DISTR_GROUP_TYPE_SHIFT); + requestInfo |= (flag << DISTR_GROUP_TYPE_SHIFT); +} + +inline +void +TcIndxReq::setDistributionGroupFlag(UintR & requestInfo, Uint32 flag){ + ASSERT_BOOL(flag, "TcIndxReq::setDistributionGroupFlag"); + requestInfo &= ~(1 << DISTR_GROUP_SHIFT); + requestInfo |= (flag << DISTR_GROUP_SHIFT); +} + +inline +void +TcIndxReq::setDistributionKeyFlag(UintR & requestInfo, Uint32 flag){ + ASSERT_BOOL(flag, "TcIndxReq::setDistributionKeyFlag"); + requestInfo &= ~(1 << DISTR_KEY_SHIFT); + requestInfo |= (flag << DISTR_KEY_SHIFT); +} + +inline +void +TcIndxReq::setScanIndFlag(UintR & requestInfo, Uint32 flag){ + ASSERT_BOOL(flag, "TcIndxReq::setScanIndFlag"); + requestInfo &= ~(1 << SCAN_SHIFT); + requestInfo |= (flag << SCAN_SHIFT); +} + +inline +void +TcIndxReq::setOperationType(UintR & requestInfo, Uint32 type){ + ASSERT_MAX(type, OPERATION_MASK, "TcIndxReq::setOperationType"); + requestInfo |= (type << OPERATION_SHIFT); +} + +inline +void +TcIndxReq::setIndexLength(UintR & requestInfo, Uint32 len){ + ASSERT_MAX(len, INDEX_LEN_MASK, "TcIndxReq::setKeyLength"); + requestInfo |= (len << INDEX_LEN_SHIFT); +} + +inline +void +TcIndxReq::setAIInTcIndxReq(UintR & requestInfo, Uint32 len){ + ASSERT_MAX(len, AINFO_MASK, "TcIndxReq::setAIInTcIndxReq"); + requestInfo |= (len << AINFO_SHIFT); +} + +inline +Uint8 +TcIndxReq::getAPIVersion(const UintR & anAttrLen){ + return (Uint16)((anAttrLen >> API_VER_NO_SHIFT) & API_VER_NO_MASK); +} + +inline +void +TcIndxReq::setAPIVersion(UintR & anAttrLen, Uint16 apiVersion){ +// ASSERT_MAX(apiVersion, API_VER_NO_MASK, "TcIndxReq::setAPIVersion"); + anAttrLen |= (apiVersion << API_VER_NO_SHIFT); +} + +class TcIndxConf { + + /** + * Reciver(s) + */ + friend class Ndb; + friend class NdbConnection; + + /** + * 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); +} + +class TcIndxRef { + + /** + * Reciver(s) + */ + friend class NdbIndexOperation; + + /** + * Sender(s) + */ + friend class Dbtc; + + /** + * For printing + */ + friend bool printTCINDXREF(FILE *, const Uint32 *, Uint32, Uint16); + +public: + /** + * Length of signal + */ +public: + STATIC_CONST( SignalLength = 4 ); + +private: + Uint32 connectPtr; + Uint32 transId[2]; + Uint32 errorCode; +}; + +#endif diff --git a/ndb/include/kernel/signaldata/TcKeyConf.hpp b/ndb/include/kernel/signaldata/TcKeyConf.hpp new file mode 100644 index 00000000000..bfd684b4af4 --- /dev/null +++ b/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; either version 2 of the License, or + (at your option) any later version. + + 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 NdbConnection; + 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 ); + +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 |= 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/ndb/include/kernel/signaldata/TcKeyFailConf.hpp b/ndb/include/kernel/signaldata/TcKeyFailConf.hpp new file mode 100644 index 00000000000..d8207b63262 --- /dev/null +++ b/ndb/include/kernel/signaldata/TcKeyFailConf.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; either version 2 of the License, or + (at your option) any later version. + + 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 NdbConnection; + +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/ndb/include/kernel/signaldata/TcKeyRef.hpp b/ndb/include/kernel/signaldata/TcKeyRef.hpp new file mode 100644 index 00000000000..c773920713a --- /dev/null +++ b/ndb/include/kernel/signaldata/TcKeyRef.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/TcKeyReq.hpp b/ndb/include/kernel/signaldata/TcKeyReq.hpp new file mode 100644 index 00000000000..df0a00da3e0 --- /dev/null +++ b/ndb/include/kernel/signaldata/TcKeyReq.hpp @@ -0,0 +1,547 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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 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 getDistributionGroupFlag(const UintR & requestInfo); + static Uint8 getDistributionGroupTypeFlag(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); + + /** + * Get:ers for scanInfo + */ + static Uint8 getTakeOverScanFlag(const UintR & scanInfo); + static Uint16 getTakeOverScanNode(const UintR & scanInfo); + static Uint16 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 setDistributionGroupFlag(UintR & requestInfo, Uint32 flag); + static void setDistributionGroupTypeFlag(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); + + /** + * Set:ers for scanInfo + */ + static void setTakeOverScanFlag(UintR & scanInfo, Uint8 flag); + static void setTakeOverScanNode(UintR & scanInfo, Uint16 node); + static void setTakeOverScanInfo(UintR & scanInfo, Uint16 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 + g = Distribution Group Ind- 1 Bit 1 + 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 + t = Distribution GroupType- 1 Bit 3 + y = Commit Type - 2 Bit 12-13 + + 1111111111222222222233 + 01234567890123456789012345678901 + dgbtcooop lsyyeiaaafkkkkkkkkkkkk +*/ + +#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_GROUP_SHIFT (1) +#define DISTR_GROUP_TYPE_SHIFT (3) +#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 - 16 Bits -> max 65535 + p = Scan Info - 12 Bits -> max 4095 + + 1111111111222222222233 + 01234567890123456789012345678901 + tpppppppppppp nnnnnnnnnnnnnnnn +*/ + +#define TAKE_OVER_SHIFT (0) + +#define TAKE_OVER_NODE_SHIFT (16) +#define TAKE_OVER_NODE_MASK (65535) + +#define SCAN_INFO_SHIFT (1) +#define SCAN_INFO_MASK (4095) + +/** + * 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::getDistributionGroupFlag(const UintR & requestInfo){ + return (Uint8)((requestInfo >> DISTR_GROUP_SHIFT) & 1); +} + +inline +Uint8 +TcKeyReq::getDistributionGroupTypeFlag(const UintR & requestInfo){ + return (Uint8)((requestInfo >> DISTR_GROUP_TYPE_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::setDistributionGroupTypeFlag(UintR & requestInfo, Uint32 flag){ + ASSERT_BOOL(flag, "TcKeyReq::setDistributionGroupTypeFlag"); + requestInfo &= ~(1 << DISTR_GROUP_TYPE_SHIFT); + requestInfo |= (flag << DISTR_GROUP_TYPE_SHIFT); +} + +inline +void +TcKeyReq::setDistributionGroupFlag(UintR & requestInfo, Uint32 flag){ + ASSERT_BOOL(flag, "TcKeyReq::setDistributionGroupFlag"); + requestInfo &= ~(1 << DISTR_GROUP_SHIFT); + requestInfo |= (flag << DISTR_GROUP_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::getTakeOverScanNode(const UintR & scanInfo){ + return (Uint16)((scanInfo >> TAKE_OVER_NODE_SHIFT) & TAKE_OVER_NODE_MASK); +} + +inline +Uint16 +TcKeyReq::getTakeOverScanInfo(const UintR & scanInfo){ + return (Uint16)((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::setTakeOverScanNode(UintR & scanInfo, Uint16 node){ +// ASSERT_MAX(node, TAKE_OVER_NODE_MASK, "TcKeyReq::setTakeOverScanNode"); + scanInfo |= (node << TAKE_OVER_NODE_SHIFT); +} + +inline +void +TcKeyReq::setTakeOverScanInfo(UintR & scanInfo, Uint16 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; +} + + +#endif diff --git a/ndb/include/kernel/signaldata/TcRollbackRep.hpp b/ndb/include/kernel/signaldata/TcRollbackRep.hpp new file mode 100644 index 00000000000..b00731a04a6 --- /dev/null +++ b/ndb/include/kernel/signaldata/TcRollbackRep.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; either version 2 of the License, or + (at your option) any later version. + + 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 NdbConnection; + 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/ndb/include/kernel/signaldata/TcSizeAltReq.hpp b/ndb/include/kernel/signaldata/TcSizeAltReq.hpp new file mode 100644 index 00000000000..34eacfe5a93 --- /dev/null +++ b/ndb/include/kernel/signaldata/TcSizeAltReq.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/TestOrd.hpp b/ndb/include/kernel/signaldata/TestOrd.hpp new file mode 100644 index 00000000000..1600df08884 --- /dev/null +++ b/ndb/include/kernel/signaldata/TestOrd.hpp @@ -0,0 +1,229 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/TransIdAI.hpp b/ndb/include/kernel/signaldata/TransIdAI.hpp new file mode 100755 index 00000000000..4df7bf2a126 --- /dev/null +++ b/ndb/include/kernel/signaldata/TransIdAI.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; either version 2 of the License, or + (at your option) any later version. + + 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 NdbConnection; + 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/ndb/include/kernel/signaldata/TrigAttrInfo.hpp b/ndb/include/kernel/signaldata/TrigAttrInfo.hpp new file mode 100644 index 00000000000..e2c029b9033 --- /dev/null +++ b/ndb/include/kernel/signaldata/TrigAttrInfo.hpp @@ -0,0 +1,138 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/TupAccess.hpp b/ndb/include/kernel/signaldata/TupAccess.hpp new file mode 100644 index 00000000000..5cfb8c0d153 --- /dev/null +++ b/ndb/include/kernel/signaldata/TupAccess.hpp @@ -0,0 +1,172 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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_ACCESS_HPP +#define TUP_ACCESS_HPP + +#include "SignalData.hpp" + +/* + * Direct signals used by ACC and TUX to access the TUP block in the + * same thread. + * + * NOTE: Caller must set errorCode to RNIL. Signal printer uses this to + * distinguish between input and output (no better way exists). + */ + +/* + * Read attributes from any table. + */ +class TupReadAttrs { + friend class Dbtup; + friend class Dbacc; + friend class Dbtux; + friend bool printTUP_READ_ATTRS(FILE*, const Uint32*, Uint32, Uint16); +public: + enum Flag { + /* + * Read primary key attributes. No input attribute ids are + * specified. Instead TUP fills in both input and output sections. + * Tuple version is not used. + */ + ReadKeys = (1 << 0) + }; + STATIC_CONST( SignalLength = 10 ); +private: + /* + * Error code set by TUP. Zero means no error. + */ + Uint32 errorCode; + /* + * Request info contains flags (see Flags above). + */ + Uint32 requestInfo; + /* + * Table i-value. + */ + Uint32 tableId; + /* + * Fragment is given by logical id within the table or by direct + * i-value (faster). Unknown values are given as RNIL. On return TUP + * fills in both values. + */ + Uint32 fragId; + Uint32 fragPtrI; + /* + * Logical address ("local key") of "original" tuple (the latest + * version) consisting of logical fragment page id and tuple index + * within the page (shifted left by 1). + */ + Uint32 tupAddr; + /* + * Version of the tuple to read. Not used if ReadKeys. + */ + Uint32 tupVersion; + /* + * Real page id and offset of the "original" tuple. Unknown page is + * given as RNIL. On return TUP fills in these. + */ + Uint32 pageId; + Uint32 pageOffset; + /* + * Shared buffer id. Currently must be 0 which means to use rest of + * signal data. + */ + Uint32 bufferId; + /* + * Shared buffer 0 starts after signal class. Input is number of + * attributes and list of attribute ids in AttributeHeader format. + * Output is placed after the input and consists of a list of entries + * where each entry has an AttributeHeader followed by words of data. + */ +}; + +/* + * Query status of tuple version. Used by TUX to decide if a tuple + * version found in index tree is visible to the transaction. + */ +class TupQueryTh { + friend class Dbtup; + friend class Dbtux; + friend bool printTUP_QUERY_TH(FILE*, const Uint32*, Uint32, Uint16); +public: + enum Flag { + }; + STATIC_CONST( SignalLength = 7 ); +private: + /* + TUX wants to check if tuple is visible to the scan query. + Input data is tuple address (tableId, fragId, tupAddr, tupVersion), + and transaction data so that TUP knows how to deduct if tuple is + visible (transId1, transId2, savePointId). + returnCode is set in return signal to indicate whether tuple is visible. + */ + union { + Uint32 returnCode; // 1 if tuple visible + Uint32 tableId; + }; + Uint32 fragId; + Uint32 tupAddr; + Uint32 tupVersion; + Uint32 transId1; + Uint32 transId2; + Uint32 savePointId; +}; + +/* + * Operate on entire tuple. Used by TUX where the table has a single + * Uint32 array attribute representing an index tree node. + */ +class TupStoreTh { + friend class Dbtup; + friend class Dbtux; + friend bool printTUP_STORE_TH(FILE*, const Uint32*, Uint32, Uint16); +public: + enum OpCode { + OpUndefined = 0, + OpRead = 1, + OpInsert = 2, + OpUpdate = 3, + OpDelete = 4 + }; + STATIC_CONST( SignalLength = 12 ); +private: + /* + * These are as in TupReadAttrs (except opCode). Version must be + * zero. Ordered index tuple (tree node) has only current version. + */ + Uint32 errorCode; + Uint32 opCode; + Uint32 tableId; + Uint32 fragId; + Uint32 fragPtrI; + Uint32 tupAddr; + Uint32 tupVersion; + Uint32 pageId; + Uint32 pageOffset; + Uint32 bufferId; + /* + * Data offset and size in words. Applies to both the buffer and the + * tuple. Used e.g. to read only node header. + */ + Uint32 dataOffset; + Uint32 dataSize; + /* + * Shared buffer 0 starts after signal class. + */ +}; + +#endif diff --git a/ndb/include/kernel/signaldata/TupCommit.hpp b/ndb/include/kernel/signaldata/TupCommit.hpp new file mode 100644 index 00000000000..7c5a7931e6c --- /dev/null +++ b/ndb/include/kernel/signaldata/TupCommit.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/TupFrag.hpp b/ndb/include/kernel/signaldata/TupFrag.hpp new file mode 100644 index 00000000000..ffde2217893 --- /dev/null +++ b/ndb/include/kernel/signaldata/TupFrag.hpp @@ -0,0 +1,188 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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 = 14 ); +private: + Uint32 userPtr; + Uint32 userRef; + Uint32 reqInfo; + Uint32 tableId; + Uint32 noOfAttr; + Uint32 fragId; + Uint32 todo[8]; +}; + +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 = 9 ); +private: + Uint32 userPtr; + Uint32 userRef; + Uint32 reqInfo; + Uint32 tableId; + Uint32 noOfAttr; + Uint32 fragId; + Uint32 fragOff; + Uint32 tableType; + Uint32 primaryTableId; +}; + +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 = 800, + NoFreeFragmentOper = 830, + NoFreeIndexFragment = 852, + NoFreeFragment = 604, + NoFreeAttributes = 827 + }; +private: + Uint32 userPtr; + Uint32 errorCode; +}; + +// TUP: add attribute + +class TupAddAttrReq { + friend class Dblqh; + friend class Dbtux; +public: + STATIC_CONST( SignalLength = 4 ); +private: + Uint32 tupConnectPtr; + Uint32 notused1; + Uint32 attrId; + Uint32 attrDescriptor; +}; + +class TupAddAttrConf { + friend class Dblqh; + friend class Dbtup; +public: + STATIC_CONST( SignalLength = 1 ); +private: + Uint32 userPtr; +}; + +class TupAddAttrRef { + friend class Dblqh; + friend class Dbtup; +public: + STATIC_CONST( SignalLength = 2 ); +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 = 1 ); +private: + Uint32 userPtr; +}; + +class TuxAddAttrRef { + friend class Dblqh; + friend class Dbtux; +public: + STATIC_CONST( SignalLength = 2 ); + enum ErrorCode { + NoError = 0, + InvalidAttributeType = 831, + InvalidNodeSize = 832 + }; +private: + Uint32 userPtr; + Uint32 errorCode; +}; + +#endif diff --git a/ndb/include/kernel/signaldata/TupKey.hpp b/ndb/include/kernel/signaldata/TupKey.hpp new file mode 100644 index 00000000000..304bebbec88 --- /dev/null +++ b/ndb/include/kernel/signaldata/TupKey.hpp @@ -0,0 +1,126 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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 tableRef; + Uint32 fragId; + Uint32 keyRef1; + Uint32 keyRef2; + Uint32 attrBufLen; + Uint32 opRef; + Uint32 applRef; + Uint32 schemaVersion; + Uint32 storedProcedure; + Uint32 transId1; + Uint32 transId2; + Uint32 fragPtr; + Uint32 primaryReplica; + Uint32 coordinatorTC; + Uint32 tcOpIndex; + Uint32 savePointId; +}; + +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 pageId; + Uint32 pageIndex; + Uint32 readLength; + Uint32 writeLength; + Uint32 noFiredTriggers; +}; + +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/ndb/include/kernel/signaldata/TupSizeAltReq.hpp b/ndb/include/kernel/signaldata/TupSizeAltReq.hpp new file mode 100644 index 00000000000..215493bc188 --- /dev/null +++ b/ndb/include/kernel/signaldata/TupSizeAltReq.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/TuxBound.hpp b/ndb/include/kernel/signaldata/TuxBound.hpp new file mode 100644 index 00000000000..1f256150573 --- /dev/null +++ b/ndb/include/kernel/signaldata/TuxBound.hpp @@ -0,0 +1,56 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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 + }; + 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. + * Starts with 5 unused words (word 0 is length used by LQH). + */ + Uint32 boundAiLength; +}; + +#endif diff --git a/ndb/include/kernel/signaldata/TuxContinueB.hpp b/ndb/include/kernel/signaldata/TuxContinueB.hpp new file mode 100644 index 00000000000..385d85715e2 --- /dev/null +++ b/ndb/include/kernel/signaldata/TuxContinueB.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/TuxMaint.hpp b/ndb/include/kernel/signaldata/TuxMaint.hpp new file mode 100644 index 00000000000..44deb33be80 --- /dev/null +++ b/ndb/include/kernel/signaldata/TuxMaint.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; either version 2 of the License, or + (at your option) any later version. + + 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 = 895, // add + found or remove + not found + NoMemError = 827 + }; + STATIC_CONST( SignalLength = 7 ); +private: + /* + * Error code set by TUX. Zero means no error. + */ + Uint32 errorCode; + /* + * Table, index, fragment. + */ + Uint32 tableId; + Uint32 indexId; + Uint32 fragId; + /* + * Tuple version identified by logical address of "original" tuple and + * version number. + */ + Uint32 tupAddr; + Uint32 tupVersion; + /* + * Operation code and flags. + */ + Uint32 opInfo; +}; + +#endif diff --git a/ndb/include/kernel/signaldata/TuxSizeAltReq.hpp b/ndb/include/kernel/signaldata/TuxSizeAltReq.hpp new file mode 100644 index 00000000000..5d5a0e102ba --- /dev/null +++ b/ndb/include/kernel/signaldata/TuxSizeAltReq.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/UpdateTo.hpp b/ndb/include/kernel/signaldata/UpdateTo.hpp new file mode 100644 index 00000000000..0fa5f31b6b4 --- /dev/null +++ b/ndb/include/kernel/signaldata/UpdateTo.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/UtilDelete.hpp b/ndb/include/kernel/signaldata/UtilDelete.hpp new file mode 100644 index 00000000000..67c13b8c2d5 --- /dev/null +++ b/ndb/include/kernel/signaldata/UtilDelete.hpp @@ -0,0 +1,121 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/UtilExecute.hpp b/ndb/include/kernel/signaldata/UtilExecute.hpp new file mode 100644 index 00000000000..551fb172cac --- /dev/null +++ b/ndb/include/kernel/signaldata/UtilExecute.hpp @@ -0,0 +1,136 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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() { return prepareId & 0xFF; }; + void setReleaseFlag() { prepareId |= 0x100; }; + bool getReleaseFlag() { 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, + IllegalPrepareId = 4, + 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/ndb/include/kernel/signaldata/UtilLock.hpp b/ndb/include/kernel/signaldata/UtilLock.hpp new file mode 100644 index 00000000000..1cac467daa0 --- /dev/null +++ b/ndb/include/kernel/signaldata/UtilLock.hpp @@ -0,0 +1,334 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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 + }; +private: + 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 ); + +private: + 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 + + }; +private: + 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 ); + +private: + 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 ); + +private: + 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 + }; +private: + 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 ); + +private: + 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 ); + +private: + 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 ); + +private: + 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 ); + +private: + 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 ); + +private: + 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 ); + +private: + Uint32 senderData; + Uint32 senderRef; + Uint32 lockId; +}; + +#endif diff --git a/ndb/include/kernel/signaldata/UtilPrepare.hpp b/ndb/include/kernel/signaldata/UtilPrepare.hpp new file mode 100644 index 00000000000..8508487ce15 --- /dev/null +++ b/ndb/include/kernel/signaldata/UtilPrepare.hpp @@ -0,0 +1,161 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/UtilRelease.hpp b/ndb/include/kernel/signaldata/UtilRelease.hpp new file mode 100644 index 00000000000..d2864f02f47 --- /dev/null +++ b/ndb/include/kernel/signaldata/UtilRelease.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/UtilSequence.hpp b/ndb/include/kernel/signaldata/UtilSequence.hpp new file mode 100644 index 00000000000..50e5d673e99 --- /dev/null +++ b/ndb/include/kernel/signaldata/UtilSequence.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; either version 2 of the License, or + (at your option) any later version. + + 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/ndb/include/kernel/signaldata/WaitGCP.hpp b/ndb/include/kernel/signaldata/WaitGCP.hpp new file mode 100644 index 00000000000..ebed28714d2 --- /dev/null +++ b/ndb/include/kernel/signaldata/WaitGCP.hpp @@ -0,0 +1,109 @@ +/* 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; either version 2 of the License, or + (at your option) any later version. + + 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 + }; + + 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 = 2 ); + +public: + Uint32 senderData; + Uint32 gcp; +}; + +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 |