Skip to content

Commit 0838250

Browse files
committed
wl#9819 patch #7: Define new signal ProcessInfoRep
Define GSN Define signal data structure Define debugger print function
1 parent 980c69f commit 0838250

File tree

7 files changed

+89
-5
lines changed

7 files changed

+89
-5
lines changed

storage/ndb/include/kernel/GlobalSignalNumbers.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*
2525
* When adding a new signal, remember to update MAX_GSN and SignalNames.cpp
2626
*/
27-
const GlobalSignalNumber MAX_GSN = 782;
27+
const GlobalSignalNumber MAX_GSN = 783;
2828

2929
struct GsnName {
3030
GlobalSignalNumber gsn;
@@ -1108,4 +1108,7 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES;
11081108
#define GSN_SUMA_HANDOVER_COMPLETE_REP 780
11091109
#define GSN_END_TOREP 781
11101110
#define GSN_LOCAL_RECOVERY_COMP_REP 782
1111+
1112+
#define GSN_PROCESSINFO_REP 783
1113+
11111114
#endif
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
3+
4+
This program is free software; you can redistribute it and/or modify
5+
it under the terms of the GNU General Public License as published by
6+
the Free Software Foundation; version 2 of the License.
7+
8+
This program is distributed in the hope that it will be useful,
9+
but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
GNU General Public License for more details.
12+
13+
You should have received a copy of the GNU General Public License
14+
along with this program; if not, write to the Free Software
15+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16+
*/
17+
18+
#ifndef NDB_PROCESSINFO_REP_H
19+
#define NDB_PROCESSINFO_REP_H
20+
21+
#include "SignalData.hpp"
22+
23+
class ProcessInfoRep {
24+
friend class ClusterMgr; // Sender
25+
friend class Qmgr; // Receiver
26+
friend class ProcessInfo; // Stored format
27+
friend bool printPROCESSINFO_REP(FILE *, const Uint32 *, Uint32, Uint16);
28+
29+
public:
30+
STATIC_CONST( SignalLength = 16);
31+
STATIC_CONST( ConnNameSectionNum = 0);
32+
STATIC_CONST( HostAddrSectionNum = 1);
33+
34+
private:
35+
Uint8 process_name[48];
36+
Uint32 node_id;
37+
Uint32 process_id;
38+
Uint32 angel_process_id;
39+
Uint32 application_port;
40+
};
41+
42+
// connection_name and host_address, if set, are sent as separate sections
43+
44+
#endif

storage/ndb/include/kernel/signaldata/SignalData.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -341,6 +341,8 @@ GSN_PRINT_SIGNATURE(printDROP_FK_CONF);
341341

342342
GSN_PRINT_SIGNATURE(printISOLATE_ORD);
343343

344+
GSN_PRINT_SIGNATURE(printPROCESSINFO_REP);
345+
344346
#undef JAM_FILE_ID
345347

346348
#endif

storage/ndb/src/common/debugger/signaldata/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
22
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License as published by
@@ -46,4 +46,5 @@ ADD_CONVENIENCE_LIBRARY(ndbsignaldata
4646
LocalRouteOrd.cpp
4747
DbinfoScan.cpp NodePing.cpp
4848
IndexStatSignal.cpp GetConfig.cpp AllocNodeId.cpp
49-
CreateFK.cpp DropFK.cpp IsolateOrd.cpp)
49+
CreateFK.cpp DropFK.cpp IsolateOrd.cpp
50+
ProcessInfoRep.cpp)
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
Copyright (C) 2016, Oracle and/or its affiliates. All rights reserved.
3+
All rights reserved. Use is subject to license terms.
4+
5+
This program is free software; you can redistribute it and/or modify
6+
it under the terms of the GNU General Public License as published by
7+
the Free Software Foundation; version 2 of the License.
8+
9+
This program is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU General Public License for more details.
13+
14+
You should have received a copy of the GNU General Public License
15+
along with this program; if not, write to the Free Software
16+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17+
*/
18+
19+
#include <signaldata/ProcessInfoRep.hpp>
20+
21+
bool
22+
printPROCESSINFO_REP(FILE * out, const Uint32 * data, Uint32 len, Uint16 bno) {
23+
ProcessInfoRep * sig = (ProcessInfoRep *) data;
24+
25+
fprintf(out, " process_name: %s", (char *) sig->process_name);
26+
fprintf(out, " process_id: %d angel_process_id: %d application_port: %d",
27+
sig->process_id, sig->angel_process_id, sig->application_port);
28+
29+
// TODO: connection name
30+
31+
return true;
32+
}

storage/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -288,6 +288,7 @@ SignalDataPrintFunctions[] = {
288288
,{ GSN_DROP_FK_REQ, printDROP_FK_REQ }
289289
,{ GSN_DROP_FK_REF, printDROP_FK_REF }
290290
,{ GSN_DROP_FK_CONF, printDROP_FK_CONF }
291+
,{ GSN_PROCESSINFO_REP, printPROCESSINFO_REP }
291292

292293
,{ 0, 0 }
293294
};

storage/ndb/src/common/debugger/signaldata/SignalNames.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,5 +824,6 @@ const GsnName SignalNames [] = {
824824
,{ GSN_LOCAL_RECOVERY_COMP_REP, "LOCAL_RECOVERY_COMP_REP" }
825825
,{ GSN_CANCEL_SUBSCRIPTION_REQ, "CANCEL_SUBSCRIPTION_REQ" }
826826
,{ GSN_ISOLATE_ORD, "ISOLATE_ORD" }
827+
,{ GSN_PROCESSINFO_REP, "PROCESSINFO_REP" }
827828
};
828829
const unsigned short NO_OF_SIGNAL_NAMES = sizeof(SignalNames)/sizeof(GsnName);

0 commit comments

Comments
 (0)