SumaInit.cpp 4.92 KB
Newer Older
1 2 3 4
/* Copyright (C) 2003 MySQL AB

   This program is free software; you can redistribute it and/or modify
   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 8 9 10 11 12 13 14 15 16 17 18 19 20

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */

#include "Suma.hpp"

#include <Properties.hpp>
#include <Configuration.hpp>

21 22
Suma::Suma(Block_context& ctx) :
  SimulatedBlock(SUMA, ctx),
23 24
  c_metaSubscribers(c_subscriberPool),
  c_removeDataSubscribers(c_subscriberPool),
unknown's avatar
unknown committed
25 26 27 28
  c_tables(c_tablePool),
  c_subscriptions(c_subscriptionPool),
  Restart(*this),
  c_gcp_list(c_gcp_pool)
29
{
unknown's avatar
unknown committed
30 31
  BLOCK_CONSTRUCTOR(Suma);

unknown's avatar
unknown committed
32
  // Add received signals
unknown's avatar
Merge  
unknown committed
33
  addRecSignal(GSN_READ_CONFIG_REQ, &Suma::execREAD_CONFIG_REQ);
unknown's avatar
unknown committed
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
  addRecSignal(GSN_STTOR, &Suma::execSTTOR);
  addRecSignal(GSN_NDB_STTOR, &Suma::execNDB_STTOR);
  addRecSignal(GSN_DUMP_STATE_ORD, &Suma::execDUMP_STATE_ORD);
  addRecSignal(GSN_READ_NODESCONF, &Suma::execREAD_NODESCONF);
  addRecSignal(GSN_API_START_REP, &Suma::execAPI_START_REP, true);
  addRecSignal(GSN_API_FAILREQ,  &Suma::execAPI_FAILREQ);
  addRecSignal(GSN_NODE_FAILREP, &Suma::execNODE_FAILREP);
  addRecSignal(GSN_INCL_NODEREQ, &Suma::execINCL_NODEREQ);
  addRecSignal(GSN_CONTINUEB, &Suma::execCONTINUEB);
  addRecSignal(GSN_SIGNAL_DROPPED_REP, &Suma::execSIGNAL_DROPPED_REP, true);
  addRecSignal(GSN_UTIL_SEQUENCE_CONF, &Suma::execUTIL_SEQUENCE_CONF);
  addRecSignal(GSN_UTIL_SEQUENCE_REF, &Suma::execUTIL_SEQUENCE_REF);
  addRecSignal(GSN_CREATE_SUBID_REQ, 
	       &Suma::execCREATE_SUBID_REQ);

  addRecSignal(GSN_SUB_CREATE_CONF, &Suma::execSUB_CREATE_CONF);
  addRecSignal(GSN_SUB_CREATE_REF, &Suma::execSUB_CREATE_REF);

  addRecSignal(GSN_SUB_START_CONF, &Suma::execSUB_START_CONF);
  addRecSignal(GSN_SUB_START_REF, &Suma::execSUB_START_REF);

  addRecSignal(GSN_SUMA_START_ME_REQ, &Suma::execSUMA_START_ME_REQ);
  addRecSignal(GSN_SUMA_START_ME_REF, &Suma::execSUMA_START_ME_REF);
  addRecSignal(GSN_SUMA_START_ME_CONF, &Suma::execSUMA_START_ME_CONF);
  addRecSignal(GSN_SUMA_HANDOVER_REQ, &Suma::execSUMA_HANDOVER_REQ);
  addRecSignal(GSN_SUMA_HANDOVER_REF, &Suma::execSUMA_HANDOVER_REF);
  addRecSignal(GSN_SUMA_HANDOVER_CONF, &Suma::execSUMA_HANDOVER_CONF);
  
  addRecSignal(GSN_SUB_GCP_COMPLETE_ACK, 
	       &Suma::execSUB_GCP_COMPLETE_ACK);
64 65 66 67
  
  /**
   * SUMA participant if
   */
unknown's avatar
unknown committed
68 69 70 71 72 73 74
  addRecSignal(GSN_SUB_CREATE_REQ, &Suma::execSUB_CREATE_REQ);
  addRecSignal(GSN_SUB_REMOVE_REQ, &Suma::execSUB_REMOVE_REQ);
  addRecSignal(GSN_SUB_START_REQ, &Suma::execSUB_START_REQ);
  addRecSignal(GSN_SUB_STOP_REQ, &Suma::execSUB_STOP_REQ);
  addRecSignal(GSN_SUB_STOP_REF, &Suma::execSUB_STOP_REF);
  addRecSignal(GSN_SUB_STOP_CONF, &Suma::execSUB_STOP_CONF);
  addRecSignal(GSN_SUB_SYNC_REQ, &Suma::execSUB_SYNC_REQ);
75 76 77 78

  /**
   * Dict interface
   */
unknown's avatar
unknown committed
79
  addRecSignal(GSN_DROP_TAB_CONF, &Suma::execDROP_TAB_CONF);
80
  addRecSignal(GSN_ALTER_TAB_REQ, &Suma::execALTER_TAB_REQ);
unknown's avatar
unknown committed
81 82 83 84 85 86 87
  addRecSignal(GSN_CREATE_TAB_CONF, &Suma::execCREATE_TAB_CONF);

#if 0
  addRecSignal(GSN_LIST_TABLES_CONF, &Suma::execLIST_TABLES_CONF);
#endif
  addRecSignal(GSN_GET_TABINFO_CONF, &Suma::execGET_TABINFO_CONF);
  addRecSignal(GSN_GET_TABINFOREF, &Suma::execGET_TABINFOREF);
88
#if 0
unknown's avatar
unknown committed
89 90
  addRecSignal(GSN_GET_TABLEID_CONF, &Suma::execGET_TABLEID_CONF);
  addRecSignal(GSN_GET_TABLEID_REF, &Suma::execGET_TABLEID_REF);
91
#endif
92 93 94
  /**
   * Dih interface
   */
unknown's avatar
unknown committed
95
  addRecSignal(GSN_DI_FCOUNTCONF, &Suma::execDI_FCOUNTCONF);
unknown's avatar
unknown committed
96
  addRecSignal(GSN_DI_FCOUNTREF, &Suma::execDI_FCOUNTREF);
unknown's avatar
unknown committed
97
  addRecSignal(GSN_DIGETPRIMCONF, &Suma::execDIGETPRIMCONF);
98 99 100 101

  /**
   * Scan interface
   */
unknown's avatar
unknown committed
102 103 104 105
  addRecSignal(GSN_SCAN_HBREP, &Suma::execSCAN_HBREP);
  addRecSignal(GSN_TRANSID_AI, &Suma::execTRANSID_AI);
  addRecSignal(GSN_SCAN_FRAGREF, &Suma::execSCAN_FRAGREF);
  addRecSignal(GSN_SCAN_FRAGCONF, &Suma::execSCAN_FRAGCONF);
106 107
#if 0
  addRecSignal(GSN_SUB_SYNC_CONTINUE_REF, 
unknown's avatar
unknown committed
108
	       &Suma::execSUB_SYNC_CONTINUE_REF);
109 110
#endif
  addRecSignal(GSN_SUB_SYNC_CONTINUE_CONF, 
unknown's avatar
unknown committed
111
	       &Suma::execSUB_SYNC_CONTINUE_CONF);
112 113 114 115
  
  /**
   * Trigger stuff
   */
unknown's avatar
unknown committed
116 117
  addRecSignal(GSN_TRIG_ATTRINFO, &Suma::execTRIG_ATTRINFO);
  addRecSignal(GSN_FIRE_TRIG_ORD, &Suma::execFIRE_TRIG_ORD);
118 119 120 121 122 123 124

  addRecSignal(GSN_CREATE_TRIG_REF, &Suma::execCREATE_TRIG_REF);
  addRecSignal(GSN_CREATE_TRIG_CONF, &Suma::execCREATE_TRIG_CONF);
  addRecSignal(GSN_DROP_TRIG_REF, &Suma::execDROP_TRIG_REF);
  addRecSignal(GSN_DROP_TRIG_CONF, &Suma::execDROP_TRIG_CONF);
  
  addRecSignal(GSN_SUB_GCP_COMPLETE_REP, 
unknown's avatar
unknown committed
125
	       &Suma::execSUB_GCP_COMPLETE_REP);
unknown's avatar
unknown committed
126 127

  c_startup.m_restart_server_node_id = RNIL; // Server for my NR
128 129 130 131 132 133
}

Suma::~Suma()
{
}

134
BLOCK_FUNCTIONS(Suma)
135