~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to storage/ndb/include/kernel/signaldata/CheckNodeGroups.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2003 MySQL AB
 
2
 
 
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.
 
6
 
 
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.
 
11
 
 
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 */
 
15
 
 
16
#ifndef CHECKNODEGROUPS_H
 
17
#define CHECKNODEGROUPS_H
 
18
 
 
19
#include <string.h>
 
20
#include <NodeBitmask.hpp>
 
21
#include "SignalData.hpp"
 
22
#include "SignalDataPrint.hpp"
 
23
 
 
24
/**
 
25
 * Ask DIH to check if a node set can survive i.e. if it
 
26
 * has at least one node in every node group.  Returns one
 
27
 * of Win, Lose, Partitioning.
 
28
 *
 
29
 * Same class is used for REQ and CONF.  The REQ can also
 
30
 * be executed as a direct signal.
 
31
 */
 
32
class CheckNodeGroups {
 
33
public:
 
34
  Uint32 blockRef;              // sender's node id
 
35
  union {
 
36
    Uint32 requestType;           // direct flag, output code
 
37
    Uint32 output;
 
38
  };
 
39
 
 
40
  Uint32 nodeId;             // nodeId input for GetNodeGroupMembers
 
41
  NodeBitmask mask;             /* set of NDB nodes, input for ArbitCheck,
 
42
                                   * output for GetNodeGroupMembers
 
43
                                   */
 
44
  enum RequestType {
 
45
    Direct              = 0x1,
 
46
    ArbitCheck          = 0x2,
 
47
    GetNodeGroup        = 0x4,
 
48
    GetNodeGroupMembers = 0x8
 
49
  };
 
50
 
 
51
  enum Output {
 
52
    Lose = 1,                   // we cannot survive
 
53
    Win = 2,                    // we and only we can survive
 
54
    Partitioning = 3            // possible network partitioning
 
55
  };
 
56
 
 
57
  STATIC_CONST( SignalLength = 3 + NodeBitmask::Size );
 
58
};
 
59
 
 
60
#endif