~vadim-tk/percona-server/flushing-algo

« back to all changes in this revision

Viewing changes to storage/ndb/src/kernel/vm/Emulator.hpp

  • Committer: root
  • Date: 2011-10-29 01:34:40 UTC
  • Revision ID: root@hppro1.office.percona.com-20111029013440-qhnf4jk8kdjcf4e0
Initial import

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 EMULATOR_H
 
17
#define EMULATOR_H
 
18
 
 
19
//===========================================================================
 
20
//
 
21
// .DESCRIPTION
 
22
//      This is the main fuction for the AXE VM emulator.
 
23
//      It contains some global objects and a run method.
 
24
//
 
25
//===========================================================================
 
26
#include <kernel_types.h>
 
27
#include <TransporterRegistry.hpp>
 
28
 
 
29
extern class  JobTable            globalJobTable;
 
30
extern class  TimeQueue           globalTimeQueue;
 
31
extern class  FastScheduler       globalScheduler;
 
32
extern class  TransporterRegistry globalTransporterRegistry;
 
33
extern struct GlobalData          globalData;
 
34
 
 
35
#ifdef VM_TRACE
 
36
extern class SignalLoggerManager globalSignalLoggers;
 
37
#endif
 
38
 
 
39
#ifndef NO_EMULATED_JAM
 
40
  #define EMULATED_JAM_SIZE 1024
 
41
  #define JAM_MASK ((EMULATED_JAM_SIZE * 4) - 1)
 
42
 
 
43
  extern Uint8 theEmulatedJam[];
 
44
  extern Uint32 theEmulatedJamIndex;
 
45
  // last block entry, used in dumpJam() if jam contains no block entries
 
46
  extern Uint32 theEmulatedJamBlockNumber;
 
47
#else
 
48
  const Uint8 theEmulatedJam[]=0;
 
49
  const Uint32 theEmulatedJamIndex=0;
 
50
#endif
 
51
 
 
52
struct EmulatorData {
 
53
  class Configuration * theConfiguration;
 
54
  class WatchDog      * theWatchDog;
 
55
  class ThreadConfig  * theThreadConfig;
 
56
  class SimBlockList  * theSimBlockList;
 
57
  class SocketServer  * m_socket_server;
 
58
  class Ndbd_mem_manager * m_mem_manager;
 
59
 
 
60
  /**
 
61
   * Constructor
 
62
   *
 
63
   *  Sets all the pointers to NULL
 
64
   */
 
65
  EmulatorData();
 
66
  
 
67
  /**
 
68
   * Create all the objects
 
69
   */
 
70
  void create();
 
71
  
 
72
  /**
 
73
   * Destroys all the objects
 
74
   */
 
75
  void destroy();
 
76
};
 
77
 
 
78
extern struct EmulatorData globalEmulatorData;
 
79
 
 
80
enum NdbShutdownType {
 
81
  NST_Normal,
 
82
  NST_Watchdog,
 
83
  NST_ErrorHandler,
 
84
  NST_ErrorHandlerSignal,
 
85
  NST_Restart,
 
86
  NST_ErrorInsert,
 
87
  NST_ErrorHandlerStartup
 
88
};
 
89
 
 
90
enum NdbRestartType {
 
91
  NRT_Default               = 0,
 
92
  NRT_NoStart_Restart       = 1, // -n
 
93
  NRT_DoStart_Restart       = 2, //
 
94
  NRT_NoStart_InitialStart  = 3, // -n -i
 
95
  NRT_DoStart_InitialStart  = 4  // -i
 
96
};
 
97
 
 
98
/**
 
99
 * Shutdown/restart Ndb
 
100
 *
 
101
 * @param type        - Type of shutdown/restart
 
102
 * @param restartType - Type of restart (only valid if type == NST_Restart)
 
103
 */
 
104
void 
 
105
NdbShutdown(NdbShutdownType type, 
 
106
            NdbRestartType restartType = NRT_Default);
 
107
 
 
108
#endif