1
/* Copyright (C) 2003 MySQL AB
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
19
#include <ndb_global.h>
20
#include <ndb_limits.h>
21
#include <kernel_types.h>
23
#include <ErrorReporter.hpp>
24
#include <NodeBitmask.hpp>
26
#include <RefConvert.hpp>
27
#include <TransporterDefinitions.hpp>
30
* Struct used when sending to multiple blocks
32
struct NodeReceiverGroup {
34
NodeReceiverGroup(Uint32 blockRef);
35
NodeReceiverGroup(Uint32 blockNo, const NodeBitmask &);
36
NodeReceiverGroup(Uint32 blockNo, const class SignalCounter &);
38
NodeReceiverGroup& operator=(BlockReference ref);
44
template <unsigned T> struct SignalT
47
SegmentedSectionPtr m_sectionPtr[3];
55
* class used for passing argumentes to blocks
58
friend class SimulatedBlock;
59
friend class APZJobBuffer;
60
friend class FastScheduler;
64
Uint32 getLength() const;
65
Uint32 getTrace() const;
66
Uint32 getSendersBlockRef() const;
68
const Uint32* getDataPtr() const ;
69
Uint32* getDataPtrSend() ;
71
void setTrace(Uint32);
73
Uint32 getNoOfSections() const;
74
bool getSection(SegmentedSectionPtr & ptr, Uint32 sectionNo);
75
void setSection(SegmentedSectionPtr ptr, Uint32 sectionNo);
78
* Old depricated methods...
80
Uint32 length() const { return getLength();}
81
BlockReference senderBlockRef() const { return getSendersBlockRef();}
84
void setLength(Uint32);
87
#define VMS_DATA_SIZE \
88
(MAX_ATTRIBUTES_IN_TABLE + MAX_TUPLE_SIZE_IN_WORDS + MAX_KEY_SIZE_IN_WORDS)
90
#if VMS_DATA_SIZE > 8192
91
#error "VMSignal buffer is too small"
94
SignalHeader header; // 28 bytes
95
SegmentedSectionPtr m_sectionPtr[3];
97
Uint32 theData[8192]; // 8192 32-bit words -> 32K Bytes
100
void garbage_register();
105
Signal::getLength() const {
106
return header.theLength;
111
Signal::getTrace() const {
112
return header.theTrace;
117
Signal::getSendersBlockRef() const {
118
return header.theSendersBlockRef;
123
Signal::getDataPtr() const {
129
Signal::getDataPtrSend() {
135
Signal::setLength(Uint32 len){
136
header.theLength = len;
141
Signal::setTrace(Uint32 t){
147
Signal::getNoOfSections() const {
148
return header.m_noOfSections;
153
Signal::getSection(SegmentedSectionPtr & ptr, Uint32 section){
154
if(section < header.m_noOfSections){
155
ptr = m_sectionPtr[section];
164
Signal::setSection(SegmentedSectionPtr ptr, Uint32 sectionNo){
165
if(sectionNo != header.m_noOfSections || sectionNo > 2){
168
m_sectionPtr[sectionNo] = ptr;
169
header.m_noOfSections++;
173
NodeReceiverGroup::NodeReceiverGroup() : m_block(0){
178
NodeReceiverGroup::NodeReceiverGroup(Uint32 blockRef){
180
m_block = refToBlock(blockRef);
181
m_nodes.set(refToNode(blockRef));
185
NodeReceiverGroup::NodeReceiverGroup(Uint32 blockNo, const NodeBitmask & nodes){
190
#include "SignalCounter.hpp"
193
NodeReceiverGroup::NodeReceiverGroup(Uint32 blockNo, const SignalCounter & nodes){
195
m_nodes = nodes.m_nodes;
200
NodeReceiverGroup::operator=(BlockReference blockRef){
202
m_block = refToBlock(blockRef);
203
m_nodes.set(refToNode(blockRef));