You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by su...@apache.org on 2017/05/31 18:47:02 UTC
[01/50] [abbrv] incubator-trafodion git commit: Merge pull request #9
from zcorrea/amanda
Repository: incubator-trafodion
Updated Branches:
refs/heads/master c9ff84394 -> 7643e58b4
Merge pull request #9 from zcorrea/amanda
HA support
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/71cbf8e3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/71cbf8e3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/71cbf8e3
Branch: refs/heads/master
Commit: 71cbf8e393235d666bf7cda6f55611ea64d98a37
Parents: c9e350e 61d9365
Author: Amanda <am...@esgyn.com>
Authored: Wed Aug 10 15:29:01 2016 -0700
Committer: GitHub <no...@github.com>
Committed: Wed Aug 10 15:29:01 2016 -0700
----------------------------------------------------------------------
install/installer/addNode_step1 | 30 ++++++++++++++++++++++++++++++
install/installer/addNode_step2 | 23 +++++++++++++++++++++++
2 files changed, 53 insertions(+)
----------------------------------------------------------------------
[17/50] [abbrv] incubator-trafodion git commit: Merge remote branch
'origin/master' into TRAFODION-2001
Posted by su...@apache.org.
Merge remote branch 'origin/master' into TRAFODION-2001
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/7c9abd4f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/7c9abd4f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/7c9abd4f
Branch: refs/heads/master
Commit: 7c9abd4f2b27dbd35d66aceee191eaa43dd71ffd
Parents: b350399 3756e10
Author: Zalo Correa <za...@esgyn.com>
Authored: Mon Sep 26 13:07:35 2016 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Mon Sep 26 13:07:35 2016 -0700
----------------------------------------------------------------------
core/conn/odbc/src/odbc/nsksrvr/SrvrConnect.cpp | 118 +-
core/conn/odbc/src/odbc/nsksrvrcore/Makefile | 2 +-
core/dbsecurity/auth/Makefile | 24 +-
core/dbsecurity/auth/depend.mk | 8 +-
core/dbsecurity/auth/inc/authEvents.h | 107 +
core/dbsecurity/auth/inc/dbUserAuth.h | 2 +
core/dbsecurity/auth/inc/ld_globals.h | 48 -
core/dbsecurity/auth/inc/ldapconfignode.h | 46 +-
core/dbsecurity/auth/src/authEvents.cpp | 176 +
core/dbsecurity/auth/src/dbUserAuth.cpp | 319 +-
core/dbsecurity/auth/src/ld_port.cpp | 201 -
core/dbsecurity/auth/src/ldapcheck.cpp | 465 +-
core/dbsecurity/auth/src/ldapconfignode.cpp | 403 +-
core/dbsecurity/macros.gmk | 8 +-
core/sqf/conf/log4cxx.trafodion.auth.config | 49 +
core/sqf/conf/log4j.hdfs.config | 2 +
.../export/include/common/evl_sqlog_eventnum.h | 3 +-
core/sqf/sqenvcom.sh | 3 +-
core/sqf/sql/scripts/build_apidocs.sh | 117 +
core/sqf/sql/scripts/cleanZKNodes | 33 +
core/sqf/sql/scripts/install_local_hadoop | 8 +
core/sqf/sql/scripts/sqnodes.pm | 4 +-
core/sqf/sql/scripts/sqstart | 2 +
.../hbase/client/transactional/RMInterface.java | 104 +-
.../transactional/SsccTransactionalTable.java | 262 +-
.../transactional/TransactionalTable.java | 340 +-
.../transactional/TransactionalTableClient.java | 48 +-
.../transactional/SsccRegionEndpoint.java.tmpl | 759 +-
.../transactional/TrxRegionEndpoint.java.tmpl | 857 +-
.../generated/SsccRegionProtos.java | 14820 +++++++++++++----
.../generated/TrxRegionProtos.java | 13843 +++++++++++----
.../transactional/SsccTransactionState.java | 15 +-
.../transactional/TransactionState.java | 16 +-
.../transactional/TrxTransactionState.java.tmpl | 16 +-
.../src/main/protobuf/SsccRegion.proto | 76 +
.../hbase-trx/src/main/protobuf/TrxRegion.proto | 69 +-
.../tm/hbasetmlib2/javaobjectinterfacetm.cpp | 74 +-
.../tm/hbasetmlib2/javaobjectinterfacetm.h | 2 +
core/sqf/src/tm/tm.cpp | 2 +-
core/sqf/src/tm/tmddlrequests.cpp | 27 +-
core/sqf/src/tm/tmddlrequests.h | 8 +-
core/sqf/src/tm/tminfo.cpp | 2 -
core/sqf/src/tm/tmlogging.cpp | 15 +-
core/sqf/src/tm/tmtransaction.cpp | 18 +-
core/sql/SqlCompilerDebugger/TDBTreeView.cpp | 10 +-
core/sql/bin/SqlciErrors.txt | 18 +-
core/sql/cli/Cli.cpp | 4 +-
core/sql/cli/Context.cpp | 7 -
core/sql/cli/Context.h | 2 -
core/sql/comexe/ComTdbHbaseAccess.h | 7 +-
core/sql/common/CharType.h | 3 +-
core/sql/common/ComResWords.cpp | 4 -
core/sql/common/ComSmallDefs.h | 1 +
core/sql/common/ComSysUtils.cpp | 42 +
core/sql/common/ComSysUtils.h | 1 +
core/sql/common/DateTimeType.cpp | 27 +-
core/sql/common/ExprNode.cpp | 30 +
core/sql/common/NAString.cpp | 12 +-
core/sql/common/NAType.h | 13 +-
core/sql/common/NumericType.cpp | 10 +-
core/sql/common/NumericType.h | 2 +
core/sql/common/OperTypeEnum.h | 12 +
core/sql/common/str.cpp | 310 +-
core/sql/common/str.h | 10 +
core/sql/executor/ExExeUtilCli.cpp | 8 +-
core/sql/executor/ExExeUtilExplain.cpp | 19 +
core/sql/executor/ExExeUtilLoad.cpp | 4 +-
core/sql/executor/ExExeUtilMisc.cpp | 12 +-
core/sql/executor/ExExplain.cpp | 11 +-
core/sql/executor/ExFastTransport.cpp | 16 +-
core/sql/executor/ExFastTransport.h | 2 +-
core/sql/executor/ExHbaseIUD.cpp | 19 +-
core/sql/executor/ExHdfsScan.cpp | 20 +-
core/sql/executor/ExSequence.cpp | 17 +-
core/sql/executor/ExSequence.h | 4 +-
core/sql/executor/HBaseClient_JNI.cpp | 114 +-
core/sql/executor/HBaseClient_JNI.h | 35 +-
core/sql/executor/JavaObjectInterface.cpp | 32 +-
core/sql/executor/JavaObjectInterface.h | 2 +
core/sql/exp/ExpAtp.cpp | 1 -
core/sql/exp/ExpHbaseInterface.cpp | 91 +-
core/sql/exp/ExpHbaseInterface.h | 63 +-
core/sql/exp/ExpLOBaccess.cpp | 41 +-
core/sql/exp/ExpLOBaccess.h | 7 +-
core/sql/exp/ExpLOBinterface.cpp | 12 +-
core/sql/exp/ExpLOBinterface.h | 4 +-
core/sql/exp/ExpPCodeOptsNativeExpr.cpp | 1 -
core/sql/exp/ExpPackDefs.cpp | 14 +
core/sql/exp/ExpSequenceFunction.cpp | 18 +-
core/sql/exp/ExpSequenceFunction.h | 2 +
core/sql/exp/ExpSqlTupp.h | 3 +-
core/sql/exp/exp_clause.cpp | 21 +
core/sql/exp/exp_clause.h | 19 +-
core/sql/exp/exp_conv.cpp | 13 +-
core/sql/exp/exp_datetime.cpp | 197 +-
core/sql/exp/exp_function.cpp | 366 +
core/sql/exp/exp_function.h | 93 +
core/sql/exp/exp_math_func.cpp | 12 +
core/sql/generator/GenExplain.cpp | 21 +-
core/sql/generator/GenFastTransport.cpp | 2 +-
core/sql/generator/GenItemFunc.cpp | 27 +
core/sql/generator/GenPreCode.cpp | 138 +-
core/sql/generator/GenRelScan.cpp | 2 +
core/sql/generator/GenRelSequence.cpp | 54 +-
core/sql/generator/GenRelUpdate.cpp | 49 +-
core/sql/generator/GenSequenceFunction.cpp | 102 +
core/sql/generator/GenShape.cpp | 15 +
core/sql/langman/LmRoutineJavaObj.cpp | 1 +
core/sql/optimizer/BindItemExpr.cpp | 615 +-
core/sql/optimizer/BindRelExpr.cpp | 72 +-
core/sql/optimizer/BindWA.h | 5 +
core/sql/optimizer/ControlDB.cpp | 35 +
core/sql/optimizer/EncodedValue.cpp | 5 +-
core/sql/optimizer/ImplRule.cpp | 7 +-
core/sql/optimizer/ImplRule.h | 3 +-
core/sql/optimizer/ItemExpr.cpp | 87 +
core/sql/optimizer/ItemFunc.h | 88 +-
core/sql/optimizer/NormItemExpr.cpp | 32 +
core/sql/optimizer/OptimizerSimulator.cpp | 13 -
core/sql/optimizer/QRDescGenerator.cpp | 3 +-
core/sql/optimizer/RelExeUtil.cpp | 80 +-
core/sql/optimizer/RelExpr.cpp | 3 +
core/sql/optimizer/RelExpr.h | 3 +-
core/sql/optimizer/RelRoutine.cpp | 6 -
core/sql/optimizer/RelRoutine.h | 2 -
core/sql/optimizer/RelScan.h | 5 +
core/sql/optimizer/RelSequence.cpp | 8 +
core/sql/optimizer/RelSequence.h | 4 +
core/sql/optimizer/RelUpdate.h | 6 +
core/sql/optimizer/SynthType.cpp | 382 +-
core/sql/optimizer/ValueDesc.cpp | 40 +
core/sql/optimizer/ValueDesc.h | 16 +-
core/sql/parser/ParKeyWords.cpp | 7 +
core/sql/parser/SqlParserAux.cpp | 3 +-
core/sql/parser/StmtDDLAlterTableRename.h | 15 +-
core/sql/parser/sqlparser.y | 237 +-
core/sql/parser/ulexer.cpp | 109 +-
core/sql/regress/charsets/EXPECTED002 | 11 +-
core/sql/regress/charsets/EXPECTED003 | 3 +-
core/sql/regress/charsets/EXPECTED012 | 4 +-
core/sql/regress/charsets/EXPECTED310 | 4 +-
core/sql/regress/charsets/EXPECTED311 | 4 +-
core/sql/regress/charsets/TEST002 | 3 +-
core/sql/regress/charsets/TEST310 | 4 +-
core/sql/regress/charsets/TEST311 | 4 +-
core/sql/regress/charsets/cidefs | 125 -
core/sql/regress/compGeneral/DIFF042.KNOWN | 88 +
core/sql/regress/compGeneral/EXPECTED006.SB | 757 +-
core/sql/regress/compGeneral/EXPECTED013.SB | 11 +-
core/sql/regress/compGeneral/EXPECTED023 | 112 +-
core/sql/regress/compGeneral/EXPECTED042 | 27 +-
core/sql/regress/compGeneral/EXPECTED071 | 8 +-
core/sql/regress/compGeneral/TEST006 | 256 +-
core/sql/regress/compGeneral/TEST011 | 1 +
core/sql/regress/compGeneral/TEST023 | 32 +-
core/sql/regress/compGeneral/TEST071 | 2 +
core/sql/regress/compGeneral/cidefs | 128 -
core/sql/regress/core/EXPECTED029.SB | 105 +-
core/sql/regress/core/EXPECTED037.SB | 878 +-
core/sql/regress/core/EXPECTED038.LINUX | 2 +-
core/sql/regress/core/EXPECTED056.SB | 37 +-
core/sql/regress/core/EXPECTED061.SB | 12 +-
core/sql/regress/core/EXPECTED116 | 632 +-
core/sql/regress/core/EXPECTEDRTS | 1362 +-
core/sql/regress/core/TEST056 | 28 +-
core/sql/regress/core/TEST061 | 4 +-
core/sql/regress/core/TEST116 | 198 +
core/sql/regress/core/cidefs | 135 -
core/sql/regress/executor/EXPECTED001 | 31 +-
core/sql/regress/executor/EXPECTED013.SB | 72 +-
core/sql/regress/executor/EXPECTED014.SB | 24 +-
core/sql/regress/executor/EXPECTED015.SB | 16 +
core/sql/regress/executor/EXPECTED016.SB | 14 +-
core/sql/regress/executor/EXPECTED020 | 3 +
core/sql/regress/executor/EXPECTED022.SB | 152 +-
core/sql/regress/executor/EXPECTED050 | 9 +-
core/sql/regress/executor/EXPECTED122 | 25 +-
core/sql/regress/executor/EXPECTED131 | 24 +-
core/sql/regress/executor/EXPECTED140 | 322 +-
core/sql/regress/executor/TEST013 | 2 +
core/sql/regress/executor/TEST015 | 4 +
core/sql/regress/executor/TEST020 | 1 +
core/sql/regress/executor/TEST140 | 2 +
core/sql/regress/executor/cidefs | 119 -
core/sql/regress/fullstack2/EXPECTED062 | 51 -
core/sql/regress/fullstack2/EXPECTED062.RELEASE | 51 -
core/sql/regress/fullstack2/cidefs | 121 -
core/sql/regress/hive/DIFF003.KNOWN | 10 +
core/sql/regress/hive/EXPECTED003 | 15 +-
core/sql/regress/hive/EXPECTED005 | 56 +-
core/sql/regress/hive/EXPECTED018 | 186 +-
core/sql/regress/hive/TEST003 | 5 +-
core/sql/regress/privs1/EXPECTED132 | 177 +-
core/sql/regress/privs1/TEST132 | 39 +
core/sql/regress/privs2/EXPECTED139 | 155 +
core/sql/regress/privs2/TEST139 | 34 +
core/sql/regress/qat/cidefs | 32 -
core/sql/regress/qat/eqatddl01 | 3 +
core/sql/regress/qat/qatddl01 | 1 +
core/sql/regress/seabase/DIFF032.KNOWN | 4 +
core/sql/regress/seabase/EXPECTED003 | 124 +-
core/sql/regress/seabase/EXPECTED010 | 611 +-
core/sql/regress/seabase/EXPECTED011 | 22 +-
core/sql/regress/seabase/EXPECTED012 | 5 +-
core/sql/regress/seabase/EXPECTED016 | 56 +-
core/sql/regress/seabase/EXPECTED020 | 56 +-
core/sql/regress/seabase/EXPECTED025 | 36 +-
core/sql/regress/seabase/EXPECTED027 | 85 +-
core/sql/regress/seabase/EXPECTED030 | 69 +-
core/sql/regress/seabase/EXPECTED031 | 53 +-
core/sql/regress/seabase/EXPECTED032 | 415 +
core/sql/regress/seabase/EXPECTED040 | 11 +
core/sql/regress/seabase/FILTER032 | 27 +
core/sql/regress/seabase/TEST003 | 3 +
core/sql/regress/seabase/TEST010 | 3 +
core/sql/regress/seabase/TEST011 | 1 +
core/sql/regress/seabase/TEST027 | 1 +
core/sql/regress/seabase/TEST030 | 8 +
core/sql/regress/seabase/TEST031 | 12 +
core/sql/regress/seabase/TEST032 | 118 +
core/sql/regress/tools/regress-filter-linux | 3 +
core/sql/regress/tools/runallsb | 21 +-
core/sql/regress/tools/runregr | 30 +-
core/sql/regress/tools/runregr_charsets.ksh | 4 +-
core/sql/regress/tools/runregr_compGeneral.ksh | 25 +-
core/sql/regress/tools/runregr_core.ksh | 25 +-
core/sql/regress/tools/runregr_executor.ksh | 21 +-
core/sql/regress/tools/runregr_fullstack2.ksh | 19 +-
core/sql/regress/tools/runregr_hive.ksh | 12 +-
core/sql/regress/tools/runregr_qat.ksh | 9 +-
core/sql/regress/tools/runregr_seabase.ksh | 12 +-
core/sql/regress/tools/runregr_udr.ksh | 4 +-
core/sql/regress/tools/sbdefs | 10 +-
core/sql/regress/udr/EXPECTED001 | 12 +
core/sql/regress/udr/EXPECTED103 | 10 +-
core/sql/regress/udr/EXPECTED108 | 18 +-
core/sql/regress/udr/EXPECTED163.SB | 4 +-
core/sql/regress/udr/TEST001 | 4 +
core/sql/regress/udr/TEST108 | 16 +-
core/sql/regress/udr/cidefs | 69 -
core/sql/sqlcat/TrafDDLdesc.h | 4 +
core/sql/sqlci/SqlCmd.cpp | 6 +-
core/sql/sqlcomp/CmpDescribe.cpp | 9 +-
core/sql/sqlcomp/CmpSeabaseDDL.h | 3 +
core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp | 160 +-
core/sql/sqlcomp/CmpSeabaseDDLindex.cpp | 3 +-
core/sql/sqlcomp/CmpSeabaseDDLmd.h | 24 +
core/sql/sqlcomp/CmpSeabaseDDLrepos.cpp | 131 +-
core/sql/sqlcomp/CmpSeabaseDDLrepos.h | 6 +-
core/sql/sqlcomp/CmpSeabaseDDLschema.cpp | 12 +-
core/sql/sqlcomp/CmpSeabaseDDLtable.cpp | 41 +-
core/sql/sqlcomp/CmpSeabaseDDLupgrade.cpp | 3 -
core/sql/sqlcomp/DefaultConstants.h | 31 +-
core/sql/sqlcomp/PrivMgrMDDefs.h | 32 +-
core/sql/sqlcomp/PrivMgrPrivileges.cpp | 8 +-
core/sql/sqlcomp/nadefaults.cpp | 131 +-
core/sql/sqlcomp/parser.cpp | 1 -
core/sql/sqlcomp/parser.h | 3 -
core/sql/sqludr/doxygen_tmudr.1.6.config | 9 +-
.../java/org/trafodion/sql/HBaseClient.java | 158 +-
.../java/org/trafodion/sql/HTableClient.java | 264 +-
core/sql/ustat/hs_cli.cpp | 53 +-
core/sql/ustat/hs_const.h | 6 +-
core/sql/ustat/hs_globals.cpp | 102 +-
core/sql/ustat/hs_yacc.y | 48 +-
dcs/src/test/pytests/test-requirements.txt | 2 +-
.../src/asciidoc/_chapters/about.adoc | 4 +-
.../src/asciidoc/_chapters/sort_msgs.adoc | 211 +-
.../asciidoc/_chapters/update_stats_msgs.adoc | 497 +
docs/messages_guide/src/asciidoc/index.adoc | 1 +
docs/shared/revisions.txt | 1 +
.../src/asciidoc/_chapters/about.adoc | 15 +-
.../src/asciidoc/_chapters/sql_statements.adoc | 4 +
.../src/asciidoc/_chapters/sql_utilities.adoc | 86 +-
install/installer/addNode_step2 | 22 +-
install/installer/bashrc_default | 2 +-
install/installer/tools/ambari_setup | 2 +-
install/installer/traf_add_sudoAccess | 4 +-
install/installer/traf_cloudera_mods | 6 +-
install/installer/traf_config_check | 160 +-
install/installer/trafodion_install | 65 +-
install/traf_tools_setup.sh | 21 +
tests/phx/pom.xml.template | 4 +-
283 files changed, 34577 insertions(+), 14200 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/7c9abd4f/core/sqf/export/include/common/evl_sqlog_eventnum.h
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/7c9abd4f/core/sqf/sql/scripts/sqnodes.pm
----------------------------------------------------------------------
diff --cc core/sqf/sql/scripts/sqnodes.pm
index 73cabc7,d3149ce..36d8f0c
mode 100644,100755..100644
--- a/core/sqf/sql/scripts/sqnodes.pm
+++ b/core/sqf/sql/scripts/sqnodes.pm
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/7c9abd4f/core/sqf/sql/scripts/sqstart
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/7c9abd4f/install/installer/addNode_step2
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/7c9abd4f/install/installer/traf_cloudera_mods
----------------------------------------------------------------------
[35/50] [abbrv] incubator-trafodion git commit: Trafodion
configuration API changes
Posted by su...@apache.org.
Trafodion configuration API changes
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/04040d30
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/04040d30
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/04040d30
Branch: refs/heads/master
Commit: 04040d30eeb8cdd807757edab122852bb77e3589
Parents: cd7862c
Author: Zalo Correa <za...@esgyn.com>
Authored: Fri Feb 24 17:12:17 2017 -0800
Committer: Zalo Correa <za...@esgyn.com>
Committed: Fri Feb 24 17:12:17 2017 -0800
----------------------------------------------------------------------
.../export/include/common/evl_sqlog_eventnum.h | 121 +-
core/sqf/monitor/linux/clusterconf.cxx | 1641 ++++--------------
core/sqf/monitor/linux/clusterconf.h | 114 +-
core/sqf/monitor/linux/config.cxx | 801 +++------
core/sqf/monitor/linux/config.h | 4 +-
core/sqf/monitor/linux/gentrap.cxx | 2 +-
core/sqf/monitor/linux/lnodeconfig.cxx | 49 +-
core/sqf/monitor/linux/lnodeconfig.h | 37 +-
core/sqf/monitor/linux/makefile | 108 +-
core/sqf/monitor/linux/monitor.cxx | 3 -
core/sqf/monitor/linux/monlogging.cxx | 74 +-
core/sqf/monitor/linux/monlogging.h | 5 -
core/sqf/monitor/linux/montrace.cxx | 1 +
core/sqf/monitor/linux/montrace.h | 3 +-
core/sqf/monitor/linux/persistconfig.cxx | 65 +-
core/sqf/monitor/linux/persistconfig.h | 63 +-
core/sqf/monitor/linux/pnodeconfig.cxx | 48 +-
core/sqf/monitor/linux/pnodeconfig.h | 37 +-
core/sqf/monitor/linux/pstartd.cxx | 392 ++---
core/sqf/monitor/linux/pstartd.h | 8 +-
core/sqf/monitor/linux/reqget.cxx | 8 +-
core/sqf/monitor/linux/reqnodeadd.cxx | 44 +-
core/sqf/monitor/linux/shell.cxx | 6 +-
core/sqf/monitor/linux/trafconf.cxx | 26 +-
core/sqf/monitor/linux/watchdog.cxx | 2 -
core/sqf/monitor/linux/zclient.cxx | 1 -
core/sqf/monitor/linux/zootest.cxx | 1 -
27 files changed, 1054 insertions(+), 2610 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/04040d30/core/sqf/export/include/common/evl_sqlog_eventnum.h
----------------------------------------------------------------------
diff --git a/core/sqf/export/include/common/evl_sqlog_eventnum.h b/core/sqf/export/include/common/evl_sqlog_eventnum.h
index 32cb3db..f028ae5 100644
--- a/core/sqf/export/include/common/evl_sqlog_eventnum.h
+++ b/core/sqf/export/include/common/evl_sqlog_eventnum.h
@@ -374,9 +374,22 @@
/* Module: config.cxx = 05 */
-#define MON_CONFIGGROUP_SENDCHANGENOTICE 101050101
-#define MON_CONFIGCONT_REPCOMPLETED 101050201
-#define MON_DATABASE_ERROR 101050301
+#define MON_CONFIGGROUP_SENDCHANGENOTICE_1 101050101
+#define MON_CONFIGCONT_REPCOMPLETED_1 101050201
+#define MON_CONFIGCONT_ADDUNIQUESTRING_1 101050301
+#define MON_CONFIGCONT_INIT_1 101050401
+#define MON_CONFIGCONT_INIT_2 101050402
+#define MON_CONFIGCONT_INIT_3 101050403
+#define MON_CONFIGCONT_INIT_4 101050404
+#define MON_CONFIGCONT_INIT_5 101050405
+#define MON_CONFIGCONT_INIT_6 101050406
+#define MON_CONFIGCONT_ADDKEYNAME_1 101050501
+#define MON_CONFIGCONT_ADDPROCNAME_1 101050601
+#define MON_CONFIGCONT_ADDCLUSTERDATA_1 101050701
+#define MON_CONFIGCONT_ADDPROCDATA_1 101050801
+#define MON_CONFIGCONT_FINDUNIQUESTRING_1 101050901
+#define MON_CONFIGCONT_GETUNIQUESTRIDMAX_1 101051001
+#define MON_CONFIGCONT_STRINGIDTPSTRING_1 101051101
/* Module: tmsync.cxx = 06 */
@@ -421,39 +434,36 @@
#define MON_CLUSTERCONF_INIT_1 101090101
#define MON_CLUSTERCONF_INIT_2 101090102
#define MON_CLUSTERCONF_INIT_3 101090103
-#define MON_CLUSTERCONF_LOAD_1 101090201
-#define MON_CLUSTERCONF_LOAD_2 101090202
-#define MON_CLUSTERCONF_LOAD_3 101090203
-#define MON_CLUSTERCONF_LOAD_4 101090204
-#define MON_CLUSTERCONF_LOAD_5 101090205
-#define MON_CLUSTERCONF_LOAD_6 101090206
-#define MON_CLUSTERCONF_LOAD_7 101090207
-#define MON_CLUSTERCONF_LOAD_8 101090208
-#define MON_CLUSTERCONF_LOAD_9 101090209
-#define MON_CLUSTERCONF_PROCESS_SNODE_1 101090301
-#define MON_CLUSTERCONF_PROCESS_SNODE_2 101090302
-#define MON_CLUSTERCONF_PROCESS_SNODE_3 101090303
-#define MON_CLUSTERCONF_PROCESSPERSIST_1 101090401
-#define MON_CLUSTERCONF_PROCESSPERSIST_2 101090402
-#define MON_CLUSTERCONF_PROCESSPERSIST_3 101090403
-#define MON_CLUSTERCONF_PROCESSPERSIST_4 101090404
-#define MON_CLUSTERCONF_PROCESSPERSIST_5 101090405
-#define MON_CLUSTERCONF_DELETENODE_1 101090501
-#define MON_CLUSTERCONF_DELETEDBNODE_1 101090601
-#define MON_CLUSTERCONF_DELETEDBNODE_2 101090602
-#define MON_CLUSTERCONF_DELETEDBNODE_3 101090603
-#define MON_CLUSTERCONF_DELETEDBNODE_4 101090604
-#define MON_CLUSTERCONF_SAVENODE_1 101090701
-#define MON_CLUSTERCONF_SAVELNODE_1 101090801
-#define MON_CLUSTERCONF_SAVELNODE_2 101090802
-#define MON_CLUSTERCONF_SAVEPNODE_1 101090901
-#define MON_CLUSTERCONF_SAVEPNODE_2 101090902
-#define MON_CLUSTERCONF_CLEAR_1 101091001
-#define MON_CLUSTERCONF_UPDATEPNODECFG_1 101091101
-#define MON_CLUSTERCONF_UPDATEDBPNODE_1 101091201
-#define MON_CLUSTERCONF_UPDATEDBPNODE_2 101091202
-#define MON_CLUSTERCONF_DELETEDBUSTRING_1 101091301
-#define MON_CLUSTERCONF_DELETEDBUSTRING_2 101091302
+#define MON_CLUSTERCONF_LOADNODE_1 101090201
+#define MON_CLUSTERCONF_LOADNODE_2 101090202
+#define MON_CLUSTERCONF_LOADPERSIST_1 101090301
+#define MON_CLUSTERCONF_LOADPERSIST_2 101090302
+#define MON_CLUSTERCONF_LOADPERSIST_3 101090303
+#define MON_CLUSTERCONF_LOADPERSIST_4 101090304
+#define MON_CLUSTERCONF_PROCESS_SNODE_1 101090401
+#define MON_CLUSTERCONF_PROCESS_SNODE_2 101090402
+#define MON_CLUSTERCONF_PROCESS_SNODE_3 101090403
+#define MON_CLUSTERCONF_PROCESSPERSIST_1 101090501
+#define MON_CLUSTERCONF_PROCESSPERSIST_2 101090502
+#define MON_CLUSTERCONF_PROCESSPERSIST_3 101090503
+#define MON_CLUSTERCONF_PROCESSPERSIST_4 101090504
+#define MON_CLUSTERCONF_PROCESSPERSIST_5 101090505
+#define MON_CLUSTERCONF_DELETENODE_1 101090601
+#define MON_CLUSTERCONF_DELETEDBNODE_1 101090701
+#define MON_CLUSTERCONF_DELETEDBNODE_2 101090702
+#define MON_CLUSTERCONF_DELETEDBNODE_3 101090703
+#define MON_CLUSTERCONF_DELETEDBNODE_4 101090704
+#define MON_CLUSTERCONF_SAVENODE_1 101090801
+#define MON_CLUSTERCONF_SAVELNODE_1 101090901
+#define MON_CLUSTERCONF_SAVELNODE_2 101090902
+#define MON_CLUSTERCONF_SAVEPNODE_1 101091001
+#define MON_CLUSTERCONF_SAVEPNODE_2 101091002
+#define MON_CLUSTERCONF_CLEAR_1 101091101
+#define MON_CLUSTERCONF_UPDATEPNODECFG_1 101091201
+#define MON_CLUSTERCONF_UPDATEDBPNODE_1 101091301
+#define MON_CLUSTERCONF_UPDATEDBPNODE_2 101091302
+#define MON_CLUSTERCONF_DELETEDBUSTRING_1 101091401
+#define MON_CLUSTERCONF_DELETEDBUSTRING_2 101091402
/* Module: lock.cxx = 10 */
@@ -736,12 +746,33 @@
#define MON_LOG_ERROR_3 101290103
/* Module pstartd.cxx = 30 */
-#define PSTARTD_ACQUIRE_ERROR 101300101
-#define PSTARTD_UNEXP_NOTICE 101300102
-#define PSTARTD_MONCALL_ERROR 101300103
-#define PSTARTD_DATABASE_ERROR 101300104
-#define PSTARTD_BAD_EVENT 101300105
-#define PSTARTD_INFO 101300106
+#define LIO_NOTICE_CALLBACK_1 101300101
+#define LIO_NOTICE_CALLBACK_2 101300102
+#define LIO_EVENT_CALLBACK_1 101300201
+#define LIO_EVENT_CALLBACK_2 101300203
+#define MONUTIL_REQUEST_GET_1 101300301
+#define MONUTIL_REQUEST_GET_2 101300303
+#define MONUTIL_REQUEST_EXIT_1 101300401
+#define MONUTIL_REQUEST_EXIT_2 101300402
+#define MONUTIL_REQUEST_EXIT_3 101300403
+#define MONUTIL_REQUEST_EXIT_4 101300404
+#define MONUTIL_REQUEST_NEWPROC_1 101300501
+#define MONUTIL_REQUEST_NEWPROC_2 101300502
+#define MONUTIL_REQUEST_NEWPROC_3 101300503
+#define MONUTIL_REQUEST_NEWPROC_4 101300504
+#define MONUTIL_REQUEST_PROCINFO_1 101300601
+#define MONUTIL_REQUEST_PROCINFO_2 101300602
+#define MONUTIL_REQUEST_PROCINFO_3 101300603
+#define MONUTIL_REQUEST_PROCINFO_4 101300604
+#define MONUTIL_REQUEST_STARTUP_1 101300701
+#define MONUTIL_PERFORM_REQUEST_1 101300801
+#define PSTARTD_PSTARTD_1 101300901
+#define PSTARTD_START_PROCESS_1 101300901
+#define PSTARTD_STARTPROCS_1 101301001
+#define PSTARTD_STARTPROCS_2 101301002
+#define PSTARTD_STARTPROCS_3 101301003
+#define PSTARTD_MAIN_1 101301101
+
/* Module robsem.cxx = 31 */
#define MON_ROBSEM_1 101310101
@@ -775,9 +806,6 @@
/* Module: gentrap.cxx = 34 */
#define MON_GEN_SNMP_TRAP 101340101
-/* Module: pstartd.cxx = 35 */
-#define MON_PSTARTD_MAIN_1 101350101
-
/* Module: persistconfig.cxx = 36 */
#define MON_PERSISTCONFIG_ADDCONFIG_1 101360101
@@ -815,6 +843,9 @@
#define MON_ZCLIENT_ISZNODEEXPIRED_1 101371801
#define MON_ZCLIENT_ISZNODEEXPIRED_2 101371802
+/* Module: sqliteconfig.cxx = 90 */
+#define MON_DATABASE_ERROR 101900101
+
/**********************************************/
/*********** Seabed ***********/
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/04040d30/core/sqf/monitor/linux/clusterconf.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/clusterconf.cxx b/core/sqf/monitor/linux/clusterconf.cxx
index 1c9fde9..74dd69d 100644
--- a/core/sqf/monitor/linux/clusterconf.cxx
+++ b/core/sqf/monitor/linux/clusterconf.cxx
@@ -43,6 +43,7 @@ using namespace std;
#include "monlogging.h"
#include "config.h"
#include "pnode.h"
+#include "trafconfig.h"
#include "clusterconf.h"
extern CNodeContainer *Nodes;
@@ -55,55 +56,16 @@ extern CConfigContainer *Config;
CClusterConfig::CClusterConfig( void )
: CPNodeConfigContainer(MAX_NODES)
, CLNodeConfigContainer(MAX_LNODES)
- , configReady_(false)
- , excludedCores_(false)
+ , nodeReady_(false)
+ , persistReady_(false)
, newPNodeConfig_(true)
- , newLNodeConfig_(false)
- , currNid_(0)
- , currPNid_(0)
- , currSPNid_(0)
- , currFirstCore_(0)
- , currLastCore_(0)
- , currProcessor_(0)
- , currZoneType_(ZoneType_Undefined)
- , currPNodeConfig_(NULL)
- , prevNid_(-1)
- , prevPNid_(-1)
- , prevSPNid_(-1)
- , prevFirstCore_(0)
- , prevLastCore_(0)
- , prevProcessor_(0)
- , prevZoneType_(ZoneType_Undefined)
+ , trafConfigInitialized_(false)
, prevPNodeConfig_(NULL)
- , spareIndex_(0)
- , lnodeConfig_(NULL)
- , processType_(ProcessType_Undefined)
- , requiresDTM_(false)
- , persistRetries_(0)
- , persistWindow_(0)
- , persistConfig_(NULL)
- , db_(NULL)
+ , prevLNodeConfig_(NULL)
{
const char method_name[] = "CClusterConfig::CClusterConfig";
TRACE_ENTRY;
- currNodename_[0] = '\0';
- prevNodename_[0] = '\0';
- persistPrefix_[0] = '\0';
- processNamePrefix_[0] = '\0';
- processNameFormat_[0] = '\0';
- stdoutPrefix_[0] = '\0';
- stdoutFormat_[0] = '\0';
- programName_[0] = '\0';
- zoneFormat_[0] = '\0';
-
- memset( sparePNid_, 0, sizeof(sparePNid_) );
-
- CPU_ZERO( &currExcludedCoreMask_ );
- CPU_ZERO( &currCoreMask_ );
- CPU_ZERO( &prevExcludedCoreMask_ );
- CPU_ZERO( &prevCoreMask_ );
-
TRACE_EXIT;
}
@@ -125,130 +87,80 @@ void CClusterConfig::Clear( void )
CLNodeConfigContainer::Clear();
CPersistConfigContainer::Clear();
- configReady_ = false;
- excludedCores_ = false;
+ nodeReady_ = false;
+ persistReady_ = false;
newPNodeConfig_ = true;
- newLNodeConfig_ = false;
- currNid_ = 0;
- currPNid_ = 0;
- currSPNid_ = 0;
- currFirstCore_ = 0;
- currLastCore_ = 0;
- currProcessor_ = 0;
- currZoneType_ = ZoneType_Undefined;
- currPNodeConfig_ = NULL;
- prevNid_ = -1;
- prevPNid_ = -1;
- prevSPNid_ = -1;
- prevFirstCore_ = 0;
- prevLastCore_ = 0;
- prevProcessor_ = 0;
- prevZoneType_ = ZoneType_Undefined;
prevPNodeConfig_ = NULL;
- spareIndex_ = 0;
- lnodeConfig_ = NULL;
- processType_ = ProcessType_Undefined;
- requiresDTM_ = false;
- persistRetries_ = 0;
- persistWindow_ = 0;
- persistConfig_ = NULL;
-
- currNodename_[0] = '\0';
- prevNodename_[0] = '\0';
- persistPrefix_[0] = '\0';
- processNamePrefix_[0] = '\0';
- processNameFormat_[0] = '\0';
- stdoutPrefix_[0] = '\0';
- stdoutFormat_[0] = '\0';
- programName_[0] = '\0';
- zoneFormat_[0] = '\0';
-
- memset( sparePNid_, 0, sizeof(sparePNid_) );
-
- CPU_ZERO( &currExcludedCoreMask_ );
- CPU_ZERO( &currCoreMask_ );
- CPU_ZERO( &prevExcludedCoreMask_ );
- CPU_ZERO( &prevCoreMask_ );
-
- //int rc = sqlite3_close_v2( db_ );
- int rc = sqlite3_close( db_ );
- if ( rc == SQLITE_OK)
- {
- db_ = NULL;
- }
- else
+
+ if ( trafConfigInitialized_ )
{
- char la_buf[MON_STRING_BUF_SIZE];
- snprintf( la_buf, sizeof(la_buf)
- , "[%s], Can't close configuration database, %s\n"
- , method_name, sqlite3_errmsg(db_) );
- mon_log_write( MON_CLUSTERCONF_CLEAR_1, SQ_LOG_CRIT, la_buf );
+ int rc = tc_close();
+ if ( rc )
+ {
+ char la_buf[MON_STRING_BUF_SIZE];
+ snprintf( la_buf, sizeof(la_buf)
+ , "[%s], Can't close configuration!\n"
+ , method_name );
+ mon_log_write( MON_CLUSTERCONF_CLEAR_1, SQ_LOG_CRIT, la_buf );
+ }
+
+ trafConfigInitialized_ = false;
}
TRACE_EXIT;
}
-void CClusterConfig::AddNodeConfiguration( bool spareNode )
+void CClusterConfig::AddNodeConfiguration( pnodeConfigInfo_t &pnodeConfigInfo
+ , lnodeConfigInfo_t &lnodeConfigInfo )
{
const char method_name[] = "CClusterConfig::AddNodeConfiguration";
TRACE_ENTRY;
if ( trace_settings & TRACE_INIT )
{
- trace_printf( "%s@%d currNid=%d, currPNid=%d, currNodename=%s, "
- "prevNid=%d, prevPNid=%d, prevNodename=%s\n"
+ trace_printf( "%s@%d nid=%d, pnid=%d, nodename=%s\n"
, method_name, __LINE__
- , currNid_
- , currPNid_
- , currNodename_
- , prevNid_
- , prevPNid_
- , prevNodename_ );
+ , lnodeConfigInfo.nid
+ , pnodeConfigInfo.pnid
+ , pnodeConfigInfo.nodename );
}
if ( newPNodeConfig_ )
{
- strncpy( prevNodename_, currNodename_, sizeof(prevNodename_) );
- prevPNid_ = currPNid_;
- prevExcludedCoreMask_ = currExcludedCoreMask_;
- prevExcludedFirstCore_ = currExcludedFirstCore_;
- prevExcludedLastCore_ = currExcludedLastCore_ ;
-
- prevPNodeConfig_ = AddPNodeConfig( prevPNid_
- , prevNodename_
- , prevExcludedFirstCore_
- , prevExcludedLastCore_
- , spareNode );
- prevPNodeConfig_->SetExcludedCoreMask( prevExcludedCoreMask_ );
- if ( spareNode )
- {
- prevPNodeConfig_->SetSpareList( sparePNid_, spareIndex_ );
- }
+ prevPNodeConfig_ = CPNodeConfigContainer::AddPNodeConfig( pnodeConfigInfo );
newPNodeConfig_ = false;
}
- if ( newLNodeConfig_ )
+ prevLNodeConfig_ = CLNodeConfigContainer::AddLNodeConfig( prevPNodeConfig_
+ , lnodeConfigInfo );
+
+ TRACE_EXIT;
+}
+
+void CClusterConfig::AddSNodeConfiguration( pnodeConfigInfo_t &pnodeConfigInfo )
+{
+ const char method_name[] = "CClusterConfig::AddSNodeConfiguration";
+ TRACE_ENTRY;
+
+ if ( trace_settings & TRACE_INIT )
+ {
+ trace_printf( "%s@%d pnid=%d, nodename=%s\n"
+ , method_name, __LINE__
+ , pnodeConfigInfo.pnid
+ , pnodeConfigInfo.nodename );
+ }
+
+ if ( newPNodeConfig_ )
{
- prevNid_ = currNid_;
- prevCoreMask_ = currCoreMask_;
- prevFirstCore_ = currFirstCore_;
- prevLastCore_ = currLastCore_ ;
- prevProcessor_ = currProcessor_;
- prevZoneType_ = currZoneType_;
-
- lnodeConfig_ = AddLNodeConfig( prevPNodeConfig_
- , prevNid_
- , prevCoreMask_
- , prevFirstCore_
- , prevLastCore_
- , prevProcessor_
- , prevZoneType_ );
- newLNodeConfig_ = false;
+ prevPNodeConfig_ = CPNodeConfigContainer::AddPNodeConfig( pnodeConfigInfo );
+ prevPNodeConfig_->SetSpareList( pnodeConfigInfo.sparePNid
+ , pnodeConfigInfo.spareCount );
+ newPNodeConfig_ = false;
}
TRACE_EXIT;
}
-void CClusterConfig::AddPersistConfiguration( void )
+void CClusterConfig::AddPersistConfiguration( persistConfigInfo_t &persistConfigInfo )
{
const char method_name[] = "CClusterConfig::AddPersistConfiguration";
TRACE_ENTRY;
@@ -257,20 +169,10 @@ void CClusterConfig::AddPersistConfiguration( void )
{
trace_printf( "%s@%d persistkey=%s\n"
, method_name, __LINE__
- , persistPrefix_ );
+ , persistConfigInfo.persistPrefix );
}
- persistConfig_ = AddPersistConfig( persistPrefix_
- , processNamePrefix_
- , processNameFormat_
- , stdoutPrefix_
- , stdoutFormat_
- , programName_
- , zoneFormat_
- , processType_
- , requiresDTM_
- , persistRetries_
- , persistWindow_ );
+ prevPersistConfig_ = CPersistConfigContainer::AddPersistConfig( persistConfigInfo );
TRACE_EXIT;
}
@@ -281,6 +183,7 @@ bool CClusterConfig::DeleteNodeConfig( int pnid )
TRACE_ENTRY;
bool rs = true;
+ int rc;
if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
{
@@ -292,7 +195,9 @@ bool CClusterConfig::DeleteNodeConfig( int pnid )
}
// Delete logical and physical nodes from the configuration database
- if (DeleteDbNodeData( pnid ))
+
+ rc = tc_delete_node( pnid, NULL );
+ if ( rc == 0 )
{
// Delete logical and physical nodes from configuration objects
CPNodeConfig *pnodeConfig = GetPNodeConfig( pnid );
@@ -303,7 +208,8 @@ bool CClusterConfig::DeleteNodeConfig( int pnid )
while ( lnodeConfig )
{
// Delete logical nodes unique strings from the configuration database
- if (!DeleteDbUniqueString( lnodeConfig->GetNid() ))
+ rc = tc_delete_unique_strings( lnodeConfig->GetNid() );
+ if ( rc )
{
rs = false;
break;
@@ -340,192 +246,6 @@ bool CClusterConfig::DeleteNodeConfig( int pnid )
return( rs );
}
-bool CClusterConfig::DeleteDbNodeData( int pnid )
-{
- const char method_name[] = "CClusterConfig::DeleteDbNodeData";
- TRACE_ENTRY;
-
- bool rs = true;
-
- if ( db_ == NULL)
- {
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf("%s@%d cannot use database since database open"
- " failed.\n", method_name, __LINE__);
- }
-
- TRACE_EXIT;
- return( false );
- }
-
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf( "%s@%d delete from lnode, pnode values (pNid=%d)\n"
- , method_name, __LINE__
- , pnid );
- }
-
- int rc;
-
- const char *sqlStmt1;
- sqlStmt1 = "delete from lnode where lnode.pNid = ?";
-
- sqlite3_stmt *prepStmt1 = NULL;
- rc = sqlite3_prepare_v2( db_, sqlStmt1, strlen(sqlStmt1)+1, &prepStmt1, NULL);
- if ( rc != SQLITE_OK )
- {
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf("%s@%d prepare failed, error=%s (%d)\n",
- method_name, __LINE__, sqlite3_errmsg(db_), rc);
- }
-
- rs = false;
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] prepare failed, error=%s (%d)\n",
- method_name, sqlite3_errmsg(db_), rc );
- mon_log_write( MON_CLUSTERCONF_DELETEDBNODE_1, SQ_LOG_ERR, buf );
- }
- else
- {
- sqlite3_bind_int( prepStmt1, 1, pnid );
-
- rc = sqlite3_step( prepStmt1 );
- if (( rc != SQLITE_DONE ) && ( rc != SQLITE_ROW )
- && ( rc != SQLITE_CONSTRAINT ) )
- {
- rs = false;
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] delete from lnode "
- "value (pNid=%d) failed, error=%s (%d)\n"
- , method_name
- , pnid
- , sqlite3_errmsg(db_), rc );
- mon_log_write( MON_CLUSTERCONF_DELETEDBNODE_2, SQ_LOG_ERR, buf );
- }
- }
-
- const char *sqlStmt2;
- sqlStmt2 = "delete from pnode where pnode.pNid = ?";
-
- sqlite3_stmt *prepStmt2 = NULL;
- rc = sqlite3_prepare_v2( db_, sqlStmt2, strlen(sqlStmt2)+1, &prepStmt2, NULL);
- if ( rc != SQLITE_OK )
- {
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf("%s@%d prepare failed, error=%s (%d)\n",
- method_name, __LINE__, sqlite3_errmsg(db_), rc);
- }
-
- rs = false;
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] prepare failed, error=%s (%d)\n",
- method_name, sqlite3_errmsg(db_), rc );
- mon_log_write( MON_CLUSTERCONF_DELETEDBNODE_3, SQ_LOG_ERR, buf );
- }
- else
- {
- sqlite3_bind_int( prepStmt2, 1, pnid );
-
- rc = sqlite3_step( prepStmt2 );
- if (( rc != SQLITE_DONE ) && ( rc != SQLITE_ROW )
- && ( rc != SQLITE_CONSTRAINT ) )
- {
- rs = false;
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] delete from pnode "
- "value (pNid=%d) failed, error=%s (%d)\n"
- , method_name
- , pnid
- , sqlite3_errmsg(db_), rc );
- mon_log_write( MON_CLUSTERCONF_DELETEDBNODE_4, SQ_LOG_ERR, buf );
- }
- }
-
- if ( prepStmt1 != NULL )
- sqlite3_finalize( prepStmt1 );
- if ( prepStmt2 != NULL )
- sqlite3_finalize( prepStmt2 );
-
- TRACE_EXIT;
- return( rs );
-}
-
-bool CClusterConfig::DeleteDbUniqueString( int nid )
-{
- const char method_name[] = "CClusterConfig::DeleteDbUniqueString";
- TRACE_ENTRY;
-
- bool rs = true;
-
- if ( db_ == NULL)
- {
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf("%s@%d cannot use database since database open"
- " failed.\n", method_name, __LINE__);
- }
-
- TRACE_EXIT;
- return( false );
- }
-
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf( "%s@%d delete from monRegUniqueStrings values (nid=%d)\n"
- , method_name, __LINE__
- , nid );
- }
-
- int rc;
-
- const char *sqlStmtA;
- sqlStmtA = "delete from monRegUniqueStrings where monRegUniqueStrings.nid = ?";
-
- sqlite3_stmt *prepStmtA = NULL;
- rc = sqlite3_prepare_v2( db_, sqlStmtA, strlen(sqlStmtA)+1, &prepStmtA, NULL);
- if ( rc != SQLITE_OK )
- {
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf("%s@%d prepare failed, error=%s (%d)\n",
- method_name, __LINE__, sqlite3_errmsg(db_), rc);
- }
-
- rs = false;
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] prepare failed, error=%s (%d)\n",
- method_name, sqlite3_errmsg(db_), rc );
- mon_log_write( MON_CLUSTERCONF_DELETEDBUSTRING_1, SQ_LOG_ERR, buf );
- }
- else
- {
- sqlite3_bind_int( prepStmtA, 1, nid );
-
- rc = sqlite3_step( prepStmtA );
- if (( rc != SQLITE_DONE ) && ( rc != SQLITE_ROW )
- && ( rc != SQLITE_CONSTRAINT ) )
- {
- rs = false;
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] delete from monRegUniqueStrings "
- "value (nid=%d) failed, error=%s (%d)\n"
- , method_name
- , nid
- , sqlite3_errmsg(db_), rc );
- mon_log_write( MON_CLUSTERCONF_DELETEDBUSTRING_2, SQ_LOG_ERR, buf );
- }
- }
-
- if ( prepStmtA != NULL )
- sqlite3_finalize( prepStmtA );
-
- TRACE_EXIT;
- return( rs );
-}
-
// The following method maps the 'sqconfig' text file persist section's
// <persist-key>_PROCESS_TYPE string value to the internal
// PROCESSTYPE enum value
@@ -580,806 +300,392 @@ bool CClusterConfig::Initialize( void )
const char method_name[] = "CClusterConfig::Initialize";
TRACE_ENTRY;
- if ( db_ != NULL )
+ if ( trafConfigInitialized_ )
{
// Already initialized
return( true );
}
- char dbase[MAX_PROCESS_PATH];
-
- // Open the configuration database file
- char *configenv = getenv("SQ_CONFIGDB");
- if (configenv != NULL)
- {
- snprintf( dbase, sizeof(dbase), "%s", configenv);
- }
- else
- {
- snprintf( dbase, sizeof(dbase)
- , "%s/sql/scripts/sqconfig.db", getenv("MY_SQROOT"));
- }
- int rc = sqlite3_open_v2( dbase, &db_
- , SQLITE_OPEN_READWRITE | SQLITE_OPEN_FULLMUTEX
- , NULL);
+ bool trafConfigTrace = (trace_settings & TRACE_TRAFCONFIG);
+ int rc = tc_initialize( trafConfigTrace );
if ( rc )
{
- db_ = NULL;
-
- // See if database is in current directory
- int rc2 = sqlite3_open_v2( "sqconfig.db", &db_
- , SQLITE_OPEN_READWRITE | SQLITE_OPEN_FULLMUTEX
- , NULL);
- if ( rc2 )
- {
- char la_buf[MON_STRING_BUF_SIZE];
- snprintf( la_buf, sizeof(la_buf)
- , "[%s], Can't open configuration database %s, %s\n"
- , method_name, dbase, sqlite3_errmsg(db_) );
- mon_log_write( MON_CLUSTERCONF_INIT_1, SQ_LOG_CRIT, la_buf );
- }
+ char la_buf[MON_STRING_BUF_SIZE];
+ snprintf( la_buf, sizeof(la_buf)
+ , "[%s], Can't initialize configuration!\n"
+ , method_name );
+ mon_log_write( MON_CLUSTERCONF_INIT_1, SQ_LOG_CRIT, la_buf );
+ return( false );
}
- if ( db_ != NULL )
- {
- rc = sqlite3_busy_timeout(db_, 1000);
- if ( rc )
- {
- char la_buf[MON_STRING_BUF_SIZE];
- snprintf( la_buf, sizeof(la_buf)
- , "[%s] Can't set busy timeout for database %s, %s\n"
- , method_name, dbase, sqlite3_errmsg(db_) );
- mon_log_write( MON_CLUSTERCONF_INIT_2, SQ_LOG_ERR, la_buf );
- }
-
- char *sErrMsg = NULL;
- sqlite3_exec(db_, "PRAGMA synchronous = OFF", NULL, NULL, &sErrMsg);
- if (sErrMsg != NULL)
- {
- char la_buf[MON_STRING_BUF_SIZE];
- snprintf( la_buf, sizeof(la_buf)
- , "[%s] Can't set PRAGMA synchronous for database %s, %s\n"
- , method_name, dbase, sErrMsg );
- mon_log_write( MON_CLUSTERCONF_INIT_3, SQ_LOG_ERR, la_buf );
- }
- }
+ trafConfigInitialized_ = true;
TRACE_EXIT;
return( true );
}
+void CClusterConfig::InitCoreMask( cpu_set_t &coreMask )
+{
+ CPU_ZERO( &coreMask );
+}
+
bool CClusterConfig::LoadConfig( void )
{
const char method_name[] = "CClusterConfig::LoadConfig";
TRACE_ENTRY;
- int firstcore;
- int lastcore;
- int excfirstcore;
- int exclastcore;
- int nid;
- int pnid;
- int spnid;
- int processors;
- int rc;
- const char *nodename;
- const char *persistKeysValue;
- const char *selLnodeStmt;
- sqlite3_stmt *prepLnodeStmt = NULL;
- const char *selSnodeStmt;
- sqlite3_stmt *prepSnodeStmt = NULL;
- const char *selPersistKeysStmt;
- sqlite3_stmt *prepPersistKeysStmt = NULL;
- ZoneType roles;
-
- // Prepare select logical nodes
- selLnodeStmt = "select p.pNid, l.lNid, p.nodeName, l.firstCore, l.lastCore,"
- " p.excFirstCore, p.excLastCore, l.processors, l.roles"
- " from pnode p, lnode l where p.pNid = l.pNid";
-
- rc = sqlite3_prepare_v2( db_
- , selLnodeStmt
- , strlen(selLnodeStmt)+1
- , &prepLnodeStmt
- , NULL);
- if ( rc != SQLITE_OK )
+ if ( LoadNodeConfig() )
{
- char la_buf[MON_STRING_BUF_SIZE];
- snprintf( la_buf, sizeof(la_buf)
- , "[%s] prepare logical nodes failed, %s\n"
- , method_name, sqlite3_errmsg(db_) );
- mon_log_write(MON_CLUSTERCONF_LOAD_1, SQ_LOG_CRIT, la_buf);
- return( false );
+ LoadPersistConfig();
}
- // Prepare select spare nodes
- selSnodeStmt = "select p.pNid, p.nodeName, p.excFirstCore, p.excLastCore,"
- " s.spNid "
- " from pnode p, snode s where p.pNid = s.pNid";
-
- rc = sqlite3_prepare_v2( db_
- , selSnodeStmt
- , strlen(selSnodeStmt)+1
- , &prepSnodeStmt
- , NULL);
- if ( rc != SQLITE_OK )
+ TRACE_EXIT;
+ return( nodeReady_ && persistReady_ );
+}
+
+bool CClusterConfig::LoadNodeConfig( void )
+{
+ const char method_name[] = "CClusterConfig::LoadNodeConfig";
+ TRACE_ENTRY;
+
+ int rc;
+ int nodeCount = 0;
+ int snodeCount = 0;
+ node_configuration_t nodeConfigData[TC_NODES_MAX];
+ physical_node_configuration_t spareNodeConfigData[TC_SPARE_NODES_MAX];
+ pnodeConfigInfo_t pnodeConfigInfo;
+ lnodeConfigInfo_t lnodeConfigInfo;
+
+ rc = tc_get_nodes( &nodeCount
+ , TC_NODES_MAX
+ , nodeConfigData );
+ if ( rc )
{
char la_buf[MON_STRING_BUF_SIZE];
snprintf( la_buf, sizeof(la_buf)
- , "[%s] prepare spare nodes failed, %s\n"
- , method_name, sqlite3_errmsg(db_) );
- mon_log_write(MON_CLUSTERCONF_LOAD_2, SQ_LOG_CRIT, la_buf);
+ , "[%s] Node configuration access failed!\n"
+ , method_name );
+ mon_log_write(MON_CLUSTERCONF_LOADNODE_1, SQ_LOG_CRIT, la_buf);
return( false );
}
- // Prepare select persistent process keys
- selPersistKeysStmt = "select p.valueName"
- " from monRegPersistData p"
- " where p.keyName = 'PERSIST_PROCESS_KEYS'";
-
- rc = sqlite3_prepare_v2( db_
- , selPersistKeysStmt
- , strlen(selPersistKeysStmt)+1
- , &prepPersistKeysStmt
- , NULL);
- if ( rc != SQLITE_OK )
+ // Process logical nodes
+ for (int i =0; i < nodeCount; i++ )
+ {
+ ProcessLNode( nodeConfigData[i], pnodeConfigInfo, lnodeConfigInfo );
+ AddNodeConfiguration( pnodeConfigInfo, lnodeConfigInfo );
+ }
+
+ rc = tc_get_snodes( &snodeCount
+ , TC_NODES_MAX
+ , spareNodeConfigData );
+ if ( rc )
{
char la_buf[MON_STRING_BUF_SIZE];
snprintf( la_buf, sizeof(la_buf)
- , "[%s] prepare persistent keys failed, %s\n"
- , method_name, sqlite3_errmsg(db_) );
- mon_log_write(MON_CLUSTERCONF_LOAD_3, SQ_LOG_CRIT, la_buf);
+ , "[%s] Node configuration access failed!\n"
+ , method_name );
+ mon_log_write(MON_CLUSTERCONF_LOADNODE_2, SQ_LOG_CRIT, la_buf);
return( false );
}
- // Process logical nodes
- while ( 1 )
+ // Process spare nodes
+ for (int i =0; i < snodeCount; i++ )
{
- rc = sqlite3_step( prepLnodeStmt );
- if ( rc == SQLITE_ROW )
- { // Process row
- int colCount = sqlite3_column_count(prepLnodeStmt);
- if ( trace_settings & TRACE_INIT )
- {
- trace_printf("%s@%d sqlite3_column_count=%d\n",
- method_name, __LINE__, colCount);
- for (int i=0; i<colCount; ++i)
- {
- trace_printf("%s@%d column %d is %s\n",
- method_name, __LINE__, i,
- sqlite3_column_name(prepLnodeStmt, i));
- }
- }
-
- pnid = sqlite3_column_int(prepLnodeStmt, 0);
- nid = sqlite3_column_int(prepLnodeStmt, 1);
- nodename = (const char *) sqlite3_column_text(prepLnodeStmt, 2);
- firstcore = sqlite3_column_int(prepLnodeStmt, 3);
- lastcore = sqlite3_column_int(prepLnodeStmt, 4);
- excfirstcore = sqlite3_column_int(prepLnodeStmt, 5);
- exclastcore = sqlite3_column_int(prepLnodeStmt, 6);
- processors = sqlite3_column_int(prepLnodeStmt, 7);
- roles = (ZoneType) sqlite3_column_int(prepLnodeStmt, 8);
- ProcessLNode( nid
- , pnid
- , nodename
- , excfirstcore
- , exclastcore
- , firstcore
- , lastcore
- , processors
- , roles );
- }
- else if ( rc == SQLITE_DONE )
- {
- // Destroy prepared statement object
- if ( prepLnodeStmt != NULL )
- {
- sqlite3_finalize(prepLnodeStmt);
- }
+ ProcessSNode( spareNodeConfigData[i], pnodeConfigInfo );
+ AddSNodeConfiguration( pnodeConfigInfo );
+ }
- if ( trace_settings & TRACE_INIT )
- {
- trace_printf("%s@%d Finished processing logical nodes.\n",
- method_name, __LINE__);
- }
+ nodeReady_ = true;
- break;
- }
+ if ( trace_settings & TRACE_INIT )
+ {
+ if ( nodeReady_ )
+ trace_printf("%s@%d - Successfully loaded node configuration\n", method_name, __LINE__);
else
- {
- char la_buf[MON_STRING_BUF_SIZE];
- snprintf( la_buf, sizeof(la_buf)
- , "[%s] Configuration database select node failed, %s\n"
- , method_name, sqlite3_errmsg(db_));
- mon_log_write(MON_CLUSTERCONF_LOAD_5, SQ_LOG_CRIT, la_buf);
- return( false );
- }
-
- AddNodeConfiguration( false );
+ trace_printf("%s@%d - Failed to load node configuration\n", method_name, __LINE__);
}
- nid = -1;
- firstcore = -1;
- lastcore = -1;
+ TRACE_EXIT;
+ return( nodeReady_ );
+}
- // Process spare nodes
- while ( 1 )
- {
- rc = sqlite3_step( prepSnodeStmt );
- if ( rc == SQLITE_ROW )
- { // Process row
- int colCount = sqlite3_column_count(prepSnodeStmt);
- if ( trace_settings & TRACE_INIT )
- {
- trace_printf("%s@%d sqlite3_column_count=%d\n",
- method_name, __LINE__, colCount);
- for (int i=0; i<colCount; ++i)
- {
- trace_printf("%s@%d column %d is %s\n",
- method_name, __LINE__, i,
- sqlite3_column_name(prepSnodeStmt, i));
- }
- }
+bool CClusterConfig::LoadPersistConfig( void )
+{
+ const char method_name[] = "CClusterConfig::LoadPersistConfig";
+ TRACE_ENTRY;
- pnid = sqlite3_column_int(prepSnodeStmt, 0);
- nodename = (const char *) sqlite3_column_text(prepSnodeStmt, 1);
- excfirstcore = sqlite3_column_int(prepSnodeStmt, 2);
- exclastcore = sqlite3_column_int(prepSnodeStmt, 3);
- spnid = sqlite3_column_int(prepSnodeStmt, 4);
- if ( ! ProcessSNode( pnid
- , nodename
- , excfirstcore
- , exclastcore
- , spnid ) )
- {
- char la_buf[MON_STRING_BUF_SIZE];
- snprintf( la_buf, sizeof(la_buf)
- , "[%s], Error: Invalid node configuration\n"
- , method_name);
- mon_log_write(MON_CLUSTERCONF_LOAD_6, SQ_LOG_CRIT, la_buf);
- return( false );
- }
- }
- else if ( rc == SQLITE_DONE )
- {
- // Destroy prepared statement object
- if ( prepSnodeStmt != NULL )
- {
- sqlite3_finalize(prepSnodeStmt);
- }
+ int rc;
- if ( trace_settings & TRACE_INIT )
- {
- trace_printf("%s@%d Finished processing spare nodes.\n",
- method_name, __LINE__);
- }
+ // Get persistent process keys
+ char persistProcessKeys[TC_PERSIST_KEYS_VALUE_MAX];
+ rc = tc_get_persist_keys( persistProcessKeys );
+ if ( rc )
+ {
+ char la_buf[MON_STRING_BUF_SIZE];
+ snprintf( la_buf, sizeof(la_buf)
+ , "[%s] Persist keys configuration access failed!\n"
+ , method_name );
+ mon_log_write(MON_CLUSTERCONF_LOADPERSIST_1, SQ_LOG_CRIT, la_buf);
+ return( false );
+ }
- break;
- }
- else
- {
- char la_buf[MON_STRING_BUF_SIZE];
- snprintf( la_buf, sizeof(la_buf)
- , "[%s] Configuration database select node failed, %s\n"
- , method_name, sqlite3_errmsg(db_) );
- mon_log_write(MON_CLUSTERCONF_LOAD_7, SQ_LOG_CRIT, la_buf);
- return( false );
- }
+ persist_configuration_t persistConfig;
+ persistConfigInfo_t persistConfigInfo;
+ pkeysVector_t pkeysVector; // vector of persist prefix strings
- AddNodeConfiguration( true );
+ // Initialize vector of persistent keys
+ CPersistConfigContainer::InitializePersistKeys( persistProcessKeys
+ , pkeysVector );
+ if ( CPersistConfigContainer::GetPersistKeysCount() == 0 )
+ {
+ char la_buf[MON_STRING_BUF_SIZE];
+ snprintf( la_buf, sizeof(la_buf)
+ , "[%s] Invalid PERSIST_PROCESS_KEYS value, %s\n"
+ , method_name, persistProcessKeys );
+ mon_log_write(MON_CLUSTERCONF_LOADPERSIST_2, SQ_LOG_CRIT, la_buf);
+ return( false );
}
- // Process persistent process keys
- rc = sqlite3_step( prepPersistKeysStmt );
- if ( rc == SQLITE_ROW )
- { // Process row
- int colCount = sqlite3_column_count(prepPersistKeysStmt);
- if ( trace_settings & TRACE_INIT )
- {
- trace_printf("%s@%d sqlite3_column_count=%d\n",
- method_name, __LINE__, colCount);
- for (int i=0; i<colCount; ++i)
- {
- trace_printf("%s@%d column %d is %s\n",
- method_name, __LINE__, i,
- sqlite3_column_name(prepPersistKeysStmt, i));
- }
- }
-
- persistKeysValue = (const char *) sqlite3_column_text(prepPersistKeysStmt, 0);
- // Initialize vector of persistent keys
- InitializePersistKeys( (char *)persistKeysValue );
- if ( GetPersistKeysCount() == 0 )
+ pkeysVector_t::iterator pkit;
+
+ // Process each prefix in the vector
+ for (pkit = pkeysVector.begin(); pkit < pkeysVector.end(); pkit++ )
+ {
+ memset( &persistConfig, 0, sizeof(persist_configuration_t) );
+ strncpy( persistConfig.persist_prefix
+ , pkit->c_str()
+ , sizeof(persistConfig.persist_prefix));
+ rc = tc_get_persist_process( pkit->c_str(), &persistConfig );
+ if ( rc )
{
char la_buf[MON_STRING_BUF_SIZE];
snprintf( la_buf, sizeof(la_buf)
- , "[%s] Invalid PERSIST_PROCESS_KEYS value, %s\n"
- , method_name, persistKeysValue );
- mon_log_write(MON_CLUSTERCONF_LOAD_8, SQ_LOG_CRIT, la_buf);
+ , "[%s] Persist process info for prefix key %s does not exist!\n"
+ , method_name, pkit->c_str() );
+ mon_log_write(MON_CLUSTERCONF_LOADPERSIST_3, SQ_LOG_CRIT, la_buf);
return( false );
}
- vector<string>::iterator pkit;
-
- // Process each key in the vector
- for (pkit = pkeysVector_.begin(); pkit < pkeysVector_.end(); pkit++ )
- {
- strncpy(persistPrefix_, pkit->c_str(), sizeof(persistPrefix_));
- processNamePrefix_[0] = '\0';
- processNameFormat_[0] = '\0';
- stdoutPrefix_[0] = '\0';
- stdoutFormat_[0] = '\0';
- programName_[0] = '\0';
- zoneFormat_[0] = '\0';
- processType_ = ProcessType_Undefined;
- requiresDTM_ = false;
- persistRetries_ = 0;
- persistWindow_ = 0;
- if ( ! ProcessPersist() )
- {
- char la_buf[MON_STRING_BUF_SIZE];
- snprintf( la_buf, sizeof(la_buf)
- , "[%s], Invalid persistent process configuration!\n"
- , method_name);
- mon_log_write(MON_CLUSTERCONF_LOAD_9, SQ_LOG_CRIT, la_buf);
- }
-
- AddPersistConfiguration();
- }
- // Destroy prepared statement object
- if ( prepPersistKeysStmt != NULL )
- {
- sqlite3_finalize(prepPersistKeysStmt);
- }
- }
- else if ( rc != SQLITE_DONE )
- {
- char la_buf[MON_STRING_BUF_SIZE];
- snprintf( la_buf, sizeof(la_buf)
- , "[%s] Configuration database select persist keys failed, %s (rc=%d)\n"
- , method_name, sqlite3_errmsg(db_), rc );
- mon_log_write(MON_CLUSTERCONF_LOAD_9, SQ_LOG_CRIT, la_buf);
+ ProcessPersistInfo( persistConfig, persistConfigInfo );
+ AddPersistConfiguration( persistConfigInfo );
}
- configReady_ = true;
+ persistReady_ = true;
if ( trace_settings & TRACE_INIT )
{
- if ( configReady_ )
- trace_printf("%s@%d - Successfully loaded 'sqconfig.db'" "\n", method_name, __LINE__);
+ if ( persistReady_ )
+ trace_printf("%s@%d - Successfully loaded persist configuration\n", method_name, __LINE__);
else
- trace_printf("%s@%d - Failed to load 'sqconfig.db'" "\n", method_name, __LINE__);
+ trace_printf("%s@%d - Failed to load persist configuration\n", method_name, __LINE__);
}
TRACE_EXIT;
- return( configReady_ );
+ return( persistReady_ );
}
-void CClusterConfig::ProcessLNode( int nid
- , int pnid
- , const char *nodename
- , int excfirstcore
- , int exclastcore
- , int firstcore
- , int lastcore
- , int processors
- , int roles )
+void CClusterConfig::ProcessLNode( node_configuration_t &nodeConfigData
+ , pnodeConfigInfo_t &pnodeConfigInfo
+ , lnodeConfigInfo_t &lnodeConfigInfo )
{
const char method_name[] = "CClusterConfig::ProcessLNode";
TRACE_ENTRY;
+ bool excludedCores = false;
+
if ( trace_settings & TRACE_INIT )
{
trace_printf( "%s@%d nid=%d, pnid=%d, name=%s, excluded cores=(%d:%d),"
" cores=(%d:%d), processors=%d, roles=%d\n"
, method_name, __LINE__
- , nid
- , pnid
- , nodename
- , excfirstcore
- , exclastcore
- , firstcore
- , lastcore
- , processors
- , roles );
- }
-
- currPNid_ = pnid;
- newPNodeConfig_ = (currPNid_ != prevPNid_) ? true : false;
+ , nodeConfigData.nid
+ , nodeConfigData.pnid
+ , nodeConfigData.node_name
+ , nodeConfigData.excluded_first_core
+ , nodeConfigData.excluded_last_core
+ , nodeConfigData.first_core
+ , nodeConfigData.last_core
+ , nodeConfigData.processors
+ , nodeConfigData.roles );
+ }
+
+ newPNodeConfig_ = ((prevPNodeConfig_ == NULL) ||
+ (nodeConfigData.pnid != prevPNodeConfig_->GetPNid()))
+ ? true : false;
if ( newPNodeConfig_ )
{
- strncpy( currNodename_, nodename, sizeof(currNodename_) );
- excludedCores_ = (excfirstcore != -1 || exclastcore != -1)?true:false;
- if ( excludedCores_ )
+ memset( &pnodeConfigInfo, 0, sizeof(pnodeConfigInfo) );
+ pnodeConfigInfo.pnid = nodeConfigData.pnid;
+ strncpy( pnodeConfigInfo.nodename
+ , nodeConfigData.node_name
+ , sizeof(pnodeConfigInfo.nodename) );
+ pnodeConfigInfo.excludedFirstCore = nodeConfigData.excluded_first_core;
+ pnodeConfigInfo.excludedLastCore = nodeConfigData.excluded_last_core;
+ excludedCores = (nodeConfigData.excluded_first_core != -1 ||
+ nodeConfigData.excluded_last_core != -1)
+ ? true : false;
+ if ( excludedCores )
+ {
+ SetCoreMask( nodeConfigData.excluded_first_core
+ , nodeConfigData.excluded_last_core
+ , pnodeConfigInfo.excludedCoreMask );
+ }
+ else
{
- SetCoreMask( excfirstcore, exclastcore, currExcludedCoreMask_ );
+ InitCoreMask( pnodeConfigInfo.excludedCoreMask );
}
}
- currNid_ = nid;
- newLNodeConfig_ = (currNid_ != prevNid_) ? true : false;
- if ( newLNodeConfig_ )
- {
- SetCoreMask( firstcore, lastcore, currCoreMask_ );
- currFirstCore_ = firstcore;
- currLastCore_ = lastcore;
- currProcessor_ = processors;
- currZoneType_ = (ZoneType)roles;
- }
+ lnodeConfigInfo.nid = nodeConfigData.nid;
+ lnodeConfigInfo.pnid = nodeConfigData.pnid;
+ strncpy( lnodeConfigInfo.nodename
+ , nodeConfigData.node_name
+ , sizeof(lnodeConfigInfo.nodename) );
+ lnodeConfigInfo.firstCore = nodeConfigData.first_core;
+ lnodeConfigInfo.lastCore = nodeConfigData.last_core;
+ SetCoreMask( nodeConfigData.first_core
+ , nodeConfigData.last_core
+ , lnodeConfigInfo.coreMask );
+ lnodeConfigInfo.processor = nodeConfigData.processors;
+ lnodeConfigInfo.zoneType = (ZoneType)nodeConfigData.roles;
TRACE_EXIT;
}
-bool CClusterConfig::ProcessSNode( int pnid
- , const char *nodename
- , int excfirstcore
- , int exclastcore
- , int spnid )
+void CClusterConfig::ProcessSNode( physical_node_configuration_t &pnodeConfig
+ , pnodeConfigInfo_t &pnodeConfigInfo )
{
const char method_name[] = "CClusterConfig::ProcessSNode";
TRACE_ENTRY;
- int rc;
- const char *selSnodeStmt;
- sqlite3_stmt *prepSnodeStmt = NULL;
-
if ( trace_settings & TRACE_INIT )
{
- trace_printf( "%s@%d pnid=%d, name=%s, excluded cores=(%d:%d),"
- " spared pnid=%d\n"
+ trace_printf( "%s@%d pnid=%d, name=%s, excluded cores=(%d:%d), "
+ "spareCount=%d\n"
, method_name, __LINE__
- , pnid
- , nodename
- , excfirstcore
- , exclastcore
- , spnid );
+ , pnodeConfig.pnid
+ , pnodeConfig.node_name
+ , pnodeConfig.excluded_first_core
+ , pnodeConfig.excluded_last_core
+ , pnodeConfig.spare_count
+ );
}
- currPNid_ = pnid;
- newPNodeConfig_ = (currPNid_ != prevPNid_) ? true : false;
+ newPNodeConfig_ = (pnodeConfig.pnid != prevPNodeConfig_->GetPNid())
+ ? true : false;
if ( newPNodeConfig_ )
{
- strncpy( currNodename_, nodename, sizeof(currNodename_) );
- excludedCores_ = (excfirstcore != -1 || exclastcore != -1)?true:false;
- if ( excludedCores_ )
- {
- SetCoreMask( excfirstcore, exclastcore, currExcludedCoreMask_ );
- }
- spareIndex_ = 0;
- memset( sparePNid_, 0, sizeof(sparePNid_) );
-
- // Select all spared nodes configured for this spare node
- selSnodeStmt = "select p.pNid, s.spNid"
- " from pnode p, snode s"
- " where p.pNid = s.pNid and p.pNid = ?";
-
- rc = sqlite3_prepare_v2( db_
- , selSnodeStmt
- , strlen(selSnodeStmt)+1
- , &prepSnodeStmt
- , NULL);
- if ( rc != SQLITE_OK )
- {
- char la_buf[MON_STRING_BUF_SIZE];
- snprintf( la_buf, sizeof(la_buf)
- , "[%s] prepare failed, %s\n"
- , method_name, sqlite3_errmsg(db_) );
- mon_log_write(MON_CLUSTERCONF_PROCESS_SNODE_1, SQ_LOG_CRIT, la_buf);
- abort();
- }
- else
- { // Set pnid in prepared statement
- rc = sqlite3_bind_int(prepSnodeStmt, 1, currPNid_ );
- if ( rc != SQLITE_OK )
- {
- char la_buf[MON_STRING_BUF_SIZE];
- snprintf( la_buf, sizeof(la_buf),
- "[%s] sqlite3_bind_int failed: %s\n",
- method_name, sqlite3_errmsg(db_) );
- mon_log_write( MON_CLUSTERCONF_PROCESS_SNODE_2, SQ_LOG_CRIT, la_buf );
- abort();
- }
- }
+ strncpy( pnodeConfigInfo.nodename
+ , pnodeConfig.node_name
+ , sizeof(pnodeConfigInfo.nodename) );
- int pnid;
- int sparedpnid;
-
- // Process spare nodes
- while ( 1 )
+ bool excludedCores = (pnodeConfig.excluded_first_core != -1 ||
+ pnodeConfig.excluded_last_core != -1)
+ ? true : false;
+ if ( excludedCores )
{
- rc = sqlite3_step( prepSnodeStmt );
- if ( rc == SQLITE_ROW )
- { // Process row
- int colCount = sqlite3_column_count(prepSnodeStmt);
- if ( trace_settings & TRACE_INIT )
- {
- trace_printf("%s@%d sqlite3_column_count=%d\n",
- method_name, __LINE__, colCount);
- for (int i=0; i<colCount; ++i)
- {
- trace_printf("%s@%d column %d is %s\n",
- method_name, __LINE__, i,
- sqlite3_column_name(prepSnodeStmt, i));
- }
- }
-
- pnid = sqlite3_column_int(prepSnodeStmt, 0);
- sparedpnid = sqlite3_column_int(prepSnodeStmt, 1);
- sparePNid_[spareIndex_] = sparedpnid;
- spareIndex_++;
- }
- else if ( rc == SQLITE_DONE )
- {
- // Destroy prepared statement object
- if ( prepSnodeStmt != NULL )
- {
- sqlite3_finalize(prepSnodeStmt);
- }
-
- if ( trace_settings & TRACE_INIT )
- {
- trace_printf("%s@%d Finished processing spared node set.\n",
- method_name, __LINE__);
- }
-
- break;
- }
- else
- {
- char la_buf[MON_STRING_BUF_SIZE];
- snprintf( la_buf, sizeof(la_buf)
- , "[%s] Configuration database select node failed, %s\n"
- , method_name, sqlite3_errmsg(db_) );
- mon_log_write(MON_CLUSTERCONF_PROCESS_SNODE_3, SQ_LOG_CRIT, la_buf);
- abort();
- }
+ SetCoreMask( pnodeConfig.excluded_first_core
+ , pnodeConfig.excluded_last_core
+ , pnodeConfigInfo.excludedCoreMask );
}
- }
-
- TRACE_EXIT;
- return( true );
-}
-
-bool CClusterConfig::ProcessPersist( void )
-{
- const char method_name[] = "CClusterConfig::ProcessPersist";
- TRACE_ENTRY;
- int rc;
- char param[MAX_PERSIST_KEY_STR];
- const char *persistKey;
- const char *persistValue;
- const char *selPersistStmt;
- sqlite3_stmt *prepPersistStmt = NULL;
+ memset( pnodeConfigInfo.sparePNid, 255, sizeof(pnodeConfigInfo.sparePNid) );
- if ( trace_settings & TRACE_INIT )
- {
- trace_printf( "%s@%d processkey=%s\n"
- , method_name, __LINE__
- , persistPrefix_ );
- }
-
- snprintf( param, sizeof(param), "%s_%%", persistPrefix_ );
-
- // Prepare select persistent process for the key
- selPersistStmt = "select p.keyName, p.valueName"
- " from monRegPersistData p"
- " where p.keyName like ?";
-
- rc = sqlite3_prepare_v2( db_
- , selPersistStmt
- , strlen(selPersistStmt)+1
- , &prepPersistStmt
- , NULL);
- if ( rc != SQLITE_OK )
- {
- char la_buf[MON_STRING_BUF_SIZE];
- snprintf( la_buf, sizeof(la_buf)
- , "[%s] prepare persistent process failed, %s\n"
- , method_name, sqlite3_errmsg(db_) );
- mon_log_write( MON_CLUSTERCONF_PROCESSPERSIST_1, SQ_LOG_CRIT, la_buf );
- abort();
- }
- else
- { // Set key in prepared statement
- rc = sqlite3_bind_text( prepPersistStmt, 1, param, -1, SQLITE_STATIC );
- if ( rc != SQLITE_OK )
+ pnodeConfigInfo.spareCount = pnodeConfig.spare_count;
+ for (int i = 0; i < pnodeConfigInfo.spareCount ; i++ )
{
- char la_buf[MON_STRING_BUF_SIZE];
- snprintf( la_buf, sizeof(la_buf)
- , "[%s] sqlite3_bind_text persistent processkey (%s) failed: %s\n"
- , method_name, param, sqlite3_errmsg(db_) );
- mon_log_write( MON_CLUSTERCONF_PROCESSPERSIST_2, SQ_LOG_CRIT, la_buf );
- abort();
- }
- }
-
- // Process each persist key value pair
- while ( 1 )
- {
- rc = sqlite3_step( prepPersistStmt );
- if ( rc == SQLITE_ROW )
- { // Process row
- int colCount = sqlite3_column_count(prepPersistStmt);
- if ( trace_settings & TRACE_INIT )
- {
- trace_printf("%s@%d sqlite3_column_count=%d\n",
- method_name, __LINE__, colCount);
- for (int i=0; i<colCount; ++i)
- {
- trace_printf("%s@%d column %d is %s\n",
- method_name, __LINE__, i,
- sqlite3_column_name(prepPersistStmt, i));
- }
- }
-
- persistKey = (const char *) sqlite3_column_text(prepPersistStmt, 0);
- persistValue = (const char *) sqlite3_column_text(prepPersistStmt, 1);
-
- // Parse the value based on the key
- if ( ! ProcessPersistData( persistKey, persistValue ) )
- {
- char la_buf[MON_STRING_BUF_SIZE];
- snprintf( la_buf, sizeof(la_buf)
- , "[%s], Error: Invalid persist key value in "
- "configuration, key=%s, value=%s\n"
- , method_name, persistKey, persistValue );
- mon_log_write(MON_CLUSTERCONF_PROCESSPERSIST_3, SQ_LOG_CRIT, la_buf);
- abort();
- }
- }
- else if ( rc == SQLITE_DONE )
- {
- // Destroy prepared statement object
- if ( prepPersistStmt != NULL )
- {
- sqlite3_finalize(prepPersistStmt);
- }
-
- if ( trace_settings & TRACE_INIT )
- {
- trace_printf( "%s@%d Finished processing persistent process configuration.\n"
- , method_name, __LINE__);
- }
-
- break;
- }
- else
- {
- char la_buf[MON_STRING_BUF_SIZE];
- snprintf( la_buf, sizeof(la_buf)
- , "[%s] Configuration database select persistent process failed, %s\n"
- , method_name, sqlite3_errmsg(db_) );
- mon_log_write(MON_CLUSTERCONF_PROCESSPERSIST_4, SQ_LOG_CRIT, la_buf);
- abort();
+ pnodeConfigInfo.sparePNid[i] = pnodeConfig.spare_pnid[i];
}
}
TRACE_EXIT;
- return( true );
}
-bool CClusterConfig::ProcessPersistData( const char *persistkey
- , const char *persistvalue )
+void CClusterConfig::ProcessPersistInfo( persist_configuration_t &persistConfig
+ , persistConfigInfo_t &persistConfigInfo )
{
- const char method_name[] = "CClusterConfig::ProcessPersistData";
+ const char method_name[] = "CClusterConfig::ProcessPersistInfo";
TRACE_ENTRY;
- char workValue[MAX_PERSIST_KEY_STR];
- char *pch;
+ char workValue[TC_PERSIST_VALUE_MAX];
char *token1;
char *token2;
- static const char *delimNone = "\0";
- static const char *delimComma = ",";
static const char *delimPercent = "%";
static int chPercent = '%';
if ( trace_settings & TRACE_INIT )
{
- trace_printf( "%s@%d persistKey=%s, persistValue=%s\n"
+ trace_printf( "%s@%d Processing persist info for persistKey=%s\n"
, method_name, __LINE__
- , persistkey, persistvalue );
+ , persistConfig.persist_prefix );
}
- strncpy( workValue, persistvalue, sizeof(workValue) );
-
- pch = (char *) strstr( persistkey, PERSIST_PROCESS_NAME_KEY );
- if (pch != NULL)
+ strncpy( persistConfigInfo.persistPrefix
+ , persistConfig.persist_prefix
+ , sizeof(persistConfigInfo.persistPrefix) );
+
+ strncpy( workValue, persistConfig.process_name, sizeof(workValue) );
+ if (strlen(workValue))
{
// Extract name prefix
token1 = strtok( workValue, delimPercent );
if (token1)
{
- strncpy( processNamePrefix_, token1, sizeof(processNamePrefix_) );
+ strncpy( persistConfigInfo.processNamePrefix
+ , token1
+ , sizeof(persistConfigInfo.processNamePrefix) );
}
// Extract nid format
- strncpy( workValue, persistvalue, sizeof(workValue) );
+ strncpy( workValue, persistConfig.process_name, sizeof(workValue) );
token2 = strchr( workValue, chPercent );
if (token2)
{
- strncpy( processNameFormat_, token2, sizeof(processNameFormat_) );
+ strncpy( persistConfigInfo.processNameFormat
+ , token2
+ , sizeof(persistConfigInfo.processNameFormat) );
}
- goto done;
- }
- pch = (char *) strstr( persistkey, PERSIST_PROCESS_TYPE_KEY );
- if (pch != NULL)
- {
- // Set process type
- processType_ = GetProcessType( workValue );
- goto done;
- }
- pch = (char *) strstr( persistkey, PERSIST_PROGRAM_NAME_KEY );
- if (pch != NULL)
- {
- // Save program name
- strncpy( programName_, workValue, sizeof(programName_) );
- goto done;
- }
- pch = (char *) strstr( persistkey, PERSIST_REQUIRES_DTM );
- if (pch != NULL)
- {
- // Set flag
- requiresDTM_ = (strcasecmp(workValue,"Y") == 0) ? true : false;
- goto done;
}
- pch = (char *) strstr( persistkey, PERSIST_STDOUT_KEY );
- if (pch != NULL)
+
+ persistConfigInfo.processType = GetProcessType( persistConfig.process_type );
+
+ strncpy( persistConfigInfo.programName
+ , persistConfig.program_name
+ , sizeof(persistConfigInfo.programName) );
+
+ persistConfigInfo.requiresDTM = persistConfig.requires_DTM;
+
+ strncpy( workValue, persistConfig.std_out, sizeof(workValue) );
+ if (strlen(workValue))
{
// Extract name prefix
token1 = strtok( workValue, delimPercent );
if (token1)
{
- strncpy( stdoutPrefix_, token1, sizeof(stdoutPrefix_) );
+ strncpy( persistConfigInfo.stdoutPrefix
+ , token1
+ , sizeof(persistConfigInfo.stdoutPrefix) );
}
// Extract nid format
- strncpy( workValue, persistvalue, sizeof(workValue) );
+ strncpy( workValue, persistConfig.std_out, sizeof(workValue) );
token2 = strchr( workValue, chPercent );
if (token2)
{
- strncpy( stdoutFormat_, token2, sizeof(stdoutFormat_) );
+ strncpy( persistConfigInfo.stdoutFormat
+ , token2
+ , sizeof(persistConfigInfo.stdoutFormat) );
}
- goto done;
- }
- pch = (char *) strstr( persistkey, PERSIST_RETRIES_KEY );
- if (pch != NULL)
- {
- // Set retries
- token1 = strtok( workValue, delimComma );
- if (token1)
- {
- persistRetries_ = atoi(token1);
- }
- // Set time window
- token2 = strtok( NULL, delimNone );
- if (token2)
- {
- persistWindow_ = atoi(token2);
- }
- goto done;
- }
- pch = (char *) strstr( persistkey, PERSIST_ZONES_KEY );
- if (pch != NULL)
- {
- // Extract zid format
- strncpy( zoneFormat_, workValue, sizeof(zoneFormat_) );
- goto done;
- }
- else
- {
- TRACE_EXIT;
- return( false );
}
+
+ persistConfigInfo.persistRetries = persistConfig.persist_retries;
-done:
+ persistConfigInfo.persistWindow = persistConfig.persist_window;
- if ( trace_settings & TRACE_INIT )
- {
- trace_printf( "%s@%d pch=%s\n", method_name, __LINE__, pch);
- }
+ strncpy( persistConfigInfo.zoneFormat
+ , persistConfig.persist_zones
+ , sizeof(persistConfigInfo.zoneFormat) );
TRACE_EXIT;
- return( true );
}
bool CClusterConfig::SaveNodeConfig( const char *name
@@ -1396,6 +702,10 @@ bool CClusterConfig::SaveNodeConfig( const char *name
TRACE_ENTRY;
bool rs = true;
+ int rc;
+ node_configuration_t nodeConfig;
+ pnodeConfigInfo_t pnodeConfigInfo;
+ lnodeConfigInfo_t lnodeConfigInfo;
if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
{
@@ -1411,48 +721,30 @@ bool CClusterConfig::SaveNodeConfig( const char *name
, excludedFirstCore
, excludedLastCore );
}
-
- prevNid_ = -1;
- prevPNid_ = -1;
-
+
+ nodeConfig.nid = nid;
+ nodeConfig.pnid = pnid;
+ strncpy( nodeConfig.node_name, name, sizeof(nodeConfig.node_name) );
+ nodeConfig.excluded_first_core = excludedFirstCore;
+ nodeConfig.excluded_last_core = excludedLastCore;
+ nodeConfig.first_core = firstCore;
+ nodeConfig.last_core = lastCore;
+ nodeConfig.processors = processors;
+ nodeConfig.roles = roles;
+
// Insert data into pnode and lnode tables
- if (SaveDbPNodeData( name
- , pnid
- , excludedFirstCore
- , excludedLastCore ))
+ rc = tc_put_node( &nodeConfig );
+ if ( rc == 0 )
{
- if (SaveDbLNodeData( nid
- , pnid
- , firstCore
- , lastCore
- , processors
- , roles ))
-
- {
- // Pre-process the Node configuration attributes
- ProcessLNode( nid
- , pnid
- , name
- , excludedFirstCore
- , excludedLastCore
- , firstCore
- , lastCore
- , processors
- , roles );
-
- // Add new logical and physical nodes to configuration objects
- AddNodeConfiguration( false );
- }
- else
- {
- rs = false;
- }
+ ProcessLNode( nodeConfig, pnodeConfigInfo, lnodeConfigInfo );
+ // Add new logical and physical nodes to configuration objects
+ AddNodeConfiguration( pnodeConfigInfo, lnodeConfigInfo );
}
else
{
rs = false;
char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] Node delete failed, pnid=%d\n",
+ snprintf( buf, sizeof(buf), "[%s] Node add failed, pnid=%d\n",
method_name, pnid );
mon_log_write( MON_CLUSTERCONF_SAVENODE_1, SQ_LOG_ERR, buf );
}
@@ -1461,187 +753,6 @@ bool CClusterConfig::SaveNodeConfig( const char *name
return( rs );
}
-bool CClusterConfig::SaveDbLNodeData( int nid
- , int pnid
- , int firstCore
- , int lastCore
- , int processors
- , int roles )
-{
- const char method_name[] = "CClusterConfig::SaveDbLNodeData";
- TRACE_ENTRY;
-
- bool rs = true;
-
- if ( db_ == NULL)
- {
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf("%s@%d cannot use database since database open"
- " failed.\n", method_name, __LINE__);
- }
-
- TRACE_EXIT;
- return( false );
- }
-
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf( "%s@%d inserting into lnode values (lNid=%d, pNid=%d, "
- "processors=%d, roles=%d, firstCore=%d, lastCore=%d)\n"
- , method_name, __LINE__
- , nid
- , pnid
- , processors
- , roles
- , firstCore
- , lastCore );
- }
-
- int rc;
- const char *sqlStmt;
- sqlStmt = "insert into lnode values (?, ?, ?, ?, ?, ?)";
-
- sqlite3_stmt *prepStmt = NULL;
- rc = sqlite3_prepare_v2( db_, sqlStmt, strlen(sqlStmt)+1, &prepStmt, NULL);
- if ( rc != SQLITE_OK )
- {
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf("%s@%d prepare failed, error=%s (%d)\n",
- method_name, __LINE__, sqlite3_errmsg(db_), rc);
- }
-
- rs = false;
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] prepare failed, error=%s (%d)\n",
- method_name, sqlite3_errmsg(db_), rc );
- mon_log_write( MON_CLUSTERCONF_SAVELNODE_1, SQ_LOG_ERR, buf );
- }
- else
- {
- sqlite3_bind_int( prepStmt, 1, nid );
- sqlite3_bind_int( prepStmt, 2, pnid );
- sqlite3_bind_int( prepStmt, 3, processors );
- sqlite3_bind_int( prepStmt, 4, roles );
- sqlite3_bind_int( prepStmt, 5, firstCore );
- sqlite3_bind_int( prepStmt, 6, lastCore );
-
- rc = sqlite3_step( prepStmt );
- if (( rc != SQLITE_DONE ) && ( rc != SQLITE_ROW )
- && ( rc != SQLITE_CONSTRAINT ) )
- {
- rs = false;
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] inserting into lnode values "
- "(lNid=%d, pNid=%d, processors=%d, roles=%d, "
- "firstCore=%d, lastCore=%d) "
- "failed, error=%s (%d)\n"
- , method_name
- , nid
- , pnid
- , processors
- , roles
- , firstCore
- , lastCore
- , sqlite3_errmsg(db_), rc );
- mon_log_write( MON_CLUSTERCONF_SAVELNODE_2, SQ_LOG_ERR, buf );
- }
- }
-
- if ( prepStmt != NULL )
- sqlite3_finalize( prepStmt );
-
- TRACE_EXIT;
- return( rs );
-}
-
-bool CClusterConfig::SaveDbPNodeData( const char *name
- , int pnid
- , int excludedFirstCore
- , int excludedLastCore )
-{
- const char method_name[] = "CClusterConfig::SaveDbPNodeData";
- TRACE_ENTRY;
-
- bool rs = true;
-
- if ( db_ == NULL)
- {
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf("%s@%d cannot use database since database open"
- " failed.\n", method_name, __LINE__);
- }
-
- TRACE_EXIT;
- return( false );
- }
-
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf( "%s@%d inserting into pnode values (pNid=%d, "
- "nodeName=%s, excFirstCore=%d, excLastCore=%d)\n"
- , method_name, __LINE__
- , pnid
- , name
- , excludedFirstCore
- , excludedLastCore );
- }
-
- int rc;
- const char *sqlStmt;
- sqlStmt = "insert into pnode values (?, ?, ?, ?)";
-
- sqlite3_stmt *prepStmt = NULL;
- rc = sqlite3_prepare_v2( db_, sqlStmt, strlen(sqlStmt)+1, &prepStmt, NULL);
- if ( rc != SQLITE_OK )
- {
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf("%s@%d prepare failed, error=%s (%d)\n",
- method_name, __LINE__, sqlite3_errmsg(db_), rc);
- }
-
- rs = false;
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] prepare failed, error=%s (%d)\n",
- method_name, sqlite3_errmsg(db_), rc );
- mon_log_write( MON_CLUSTERCONF_SAVEPNODE_1, SQ_LOG_ERR, buf );
- }
- else
- {
- sqlite3_bind_int( prepStmt, 1, pnid );
- sqlite3_bind_text( prepStmt, 2, name, -1, SQLITE_STATIC );
- sqlite3_bind_int( prepStmt, 3, excludedFirstCore );
- sqlite3_bind_int( prepStmt, 4, excludedLastCore );
-
- rc = sqlite3_step( prepStmt );
- if (( rc != SQLITE_DONE ) && ( rc != SQLITE_ROW )
- && ( rc != SQLITE_CONSTRAINT ) )
- {
- rs = false;
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] inserting into "
- "pnode (pNid=%d, nodeName=%s, excFirstCore=%d, excLastCore=%d) "
- "failed, error=%s (%d)\n"
- , method_name
- , pnid
- , name
- , excludedFirstCore
- , excludedLastCore
- , sqlite3_errmsg(db_), rc );
- mon_log_write( MON_CLUSTERCONF_SAVEPNODE_2, SQ_LOG_ERR, buf );
- }
- }
-
- if ( prepStmt != NULL )
- sqlite3_finalize( prepStmt );
-
- TRACE_EXIT;
- return( rs );
-}
-
void CClusterConfig::SetCoreMask( int firstCore
, int lastCore
, cpu_set_t &coreMask )
@@ -1662,6 +773,8 @@ bool CClusterConfig::UpdatePNodeConfig( int pnid
TRACE_ENTRY;
bool rs = true;
+ int rc;
+ physical_node_configuration_t pnodeConfig;
if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
{
@@ -1675,11 +788,15 @@ bool CClusterConfig::UpdatePNodeConfig( int pnid
, excludedLastCore );
}
+ memset( &pnodeConfig, 0, sizeof(physical_node_configuration_t) );
+ pnodeConfig.pnid = pnid;
+ strncpy( pnodeConfig.node_name, name, sizeof(pnodeConfig.node_name) );
+ pnodeConfig.excluded_first_core = excludedFirstCore;
+ pnodeConfig.excluded_last_core = excludedLastCore;
+
// Update pnode table
- if (UpdateDbPNodeData( pnid
- , name
- , excludedFirstCore
- , excludedLastCore ))
+ rc = tc_put_pnode( &pnodeConfig );
+ if ( rc == 0 )
{
// Update physical node to configuration object
UpdatePNodeConfiguration( pnid
@@ -1701,104 +818,6 @@ bool CClusterConfig::UpdatePNodeConfig( int pnid
return( rs );
}
-bool CClusterConfig::UpdateDbPNodeData( int pnid
- , const char *name
- , int excludedFirstCore
- , int excludedLastCore )
-{
- const char method_name[] = "CClusterConfig::UpdateDbPNodeData";
- TRACE_ENTRY;
-
- bool rs = true;
-
- if ( db_ == NULL)
- {
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf("%s@%d cannot use database since database open"
- " failed.\n", method_name, __LINE__);
- }
-
- TRACE_EXIT;
- return( false );
- }
-
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf( "%s@%d update pnode "
- "nodeName=%s, excFirstCore=%d, excLastCore=%d\n"
- "where pnid=%d)\n"
- , method_name, __LINE__
- , name
- , excludedFirstCore
- , excludedLastCore
- , pnid );
- }
-
- int rc;
- const char *sqlStmt;
- sqlStmt = "update or replace pnode "
- " set nodeName = ?, excFirstCore = ?, excLastCore = ?"
- " where pnode.pNid = :pNid";
-
- sqlite3_stmt *prepStmt = NULL;
- rc = sqlite3_prepare_v2( db_, sqlStmt, strlen(sqlStmt)+1, &prepStmt, NULL);
- if ( rc != SQLITE_OK )
- {
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf("%s@%d prepare failed, error=%s (%d)\n",
- method_name, __LINE__, sqlite3_errmsg(db_), rc);
- }
-
- rs = false;
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] prepare failed, error=%s (%d)\n",
- method_name, sqlite3_errmsg(db_), rc );
- mon_log_write( MON_CLUSTERCONF_UPDATEDBPNODE_1, SQ_LOG_ERR, buf );
- }
- else
- {
- sqlite3_bind_text( prepStmt,
- 1,
- name, -1, SQLITE_STATIC );
- sqlite3_bind_int( prepStmt,
- 2,
- excludedFirstCore );
- sqlite3_bind_int( prepStmt,
- 3,
- excludedLastCore );
- sqlite3_bind_int( prepStmt,
- sqlite3_bind_parameter_index( prepStmt, ":pNid" ),
- pnid );
-
- rc = sqlite3_step( prepStmt );
- if (( rc != SQLITE_DONE ) && ( rc != SQLITE_ROW )
- && ( rc != SQLITE_CONSTRAINT ) )
- {
- rs = false;
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] update pnode"
- " (nodeName=%s, excFirstCore=%d, excLastCore=%d) "
- " where pNid=%d "
- "failed, error=%s (%d)\n"
- , method_name
- , name
- , excludedFirstCore
- , excludedLastCore
- , pnid
- , sqlite3_errmsg(db_), rc );
- mon_log_write( MON_CLUSTERCONF_UPDATEDBPNODE_2, SQ_LOG_ERR, buf );
- }
- }
-
- if ( prepStmt != NULL )
- sqlite3_finalize( prepStmt );
-
- TRACE_EXIT;
- return( rs );
-}
-
void CClusterConfig::UpdatePNodeConfiguration( int pnid
, const char *name
, int excludedFirstCore
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/04040d30/core/sqf/monitor/linux/clusterconf.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/clusterconf.h b/core/sqf/monitor/linux/clusterconf.h
index 4ecfc6e..00ace06 100644
--- a/core/sqf/monitor/linux/clusterconf.h
+++ b/core/sqf/monitor/linux/clusterconf.h
@@ -27,22 +27,11 @@
#define CLUSTERCONF_H_
#include <stdlib.h>
-#include <sqlite3.h>
#include "lnodeconfig.h"
#include "pnodeconfig.h"
#include "persistconfig.h"
-#define MAX_TOKEN 132
-#define PERSIST_PROCESS_KEYS "PERSIST_PROCESS_KEYS"
-#define PERSIST_PROCESS_NAME_KEY "PROCESS_NAME"
-#define PERSIST_PROCESS_TYPE_KEY "PROCESS_TYPE"
-#define PERSIST_PROGRAM_NAME_KEY "PROGRAM_NAME"
-#define PERSIST_REQUIRES_DTM "REQUIRES_DTM"
-#define PERSIST_STDOUT_KEY "STDOUT"
-#define PERSIST_RETRIES_KEY "PERSIST_RETRIES"
-#define PERSIST_ZONES_KEY "PERSIST_ZONES"
-
class CClusterConfig : public CPNodeConfigContainer
, public CLNodeConfigContainer
, public CPersistConfigContainer
@@ -54,10 +43,14 @@ public:
void Clear( void );
bool DeleteNodeConfig( int pnid );
- inline sqlite3 *GetConfigDb( void ){ return ( db_ ); }
bool Initialize( void );
- inline bool IsConfigReady( void ) { return ( configReady_ ); }
+ void InitCoreMask( cpu_set_t &coreMask );
+ inline bool IsConfigReady( void ) { return( nodeReady_ && persistReady_ ); }
+ inline bool IsNodeReady( void ) { return( nodeReady_ ); }
+ inline bool IsPersistReady( void ) { return( persistReady_ ); }
bool LoadConfig( void );
+ bool LoadNodeConfig( void );
+ bool LoadPersistConfig( void );
bool SaveNodeConfig( const char *name
, int nid
, int pnid
@@ -78,7 +71,14 @@ public:
protected:
private:
- bool configReady_; // true when configuration loaded
+ bool nodeReady_; // true when node configuration loaded
+ bool persistReady_; // true when persist configuration loaded
+ bool newPNodeConfig_;
+ bool trafConfigInitialized_;
+ CPNodeConfig *prevPNodeConfig_;
+ CLNodeConfig *prevLNodeConfig_;
+ CPersistConfig *prevPersistConfig_;
+#if 0
bool excludedCores_;
bool newPNodeConfig_;
bool newLNodeConfig_;
@@ -107,65 +107,55 @@ private:
int prevLastCore_;
int prevProcessor_;
ZoneType prevZoneType_;
- CPNodeConfig *prevPNodeConfig_;
int sparePNid_[MAX_NODES];
int spareIndex_;
+ CPNodeConfig *prevPNodeConfig_;
CLNodeConfig *lnodeConfig_;
- char persistPrefix_[MAX_PERSIST_KEY_STR];
- char processNamePrefix_[MAX_PERSIST_VALUE_STR];
- char processNameFormat_[MAX_PERSIST_VALUE_STR];
- char stdoutPrefix_[MAX_PERSIST_VALUE_STR];
- char stdoutFormat_[MAX_PERSIST_VALUE_STR];
- char programName_[MAX_PERSIST_VALUE_STR];
- char zoneFormat_[MAX_PERSIST_VALUE_STR];
+ char persistPrefix_[PERSIST_KEY_MAX];
+ char processNamePrefix_[PERSIST_VALUE_MAX];
+ char processNameFormat_[PERSIST_VALUE_MAX];
+ char stdoutPrefix_[PERSIST_VALUE_MAX];
+ char stdoutFormat_[PERSIST_VALUE_MAX];
+ char programName_[PERSIST_VALUE_MAX];
+ char zoneFormat_[PERSIST_VALUE_MAX];
PROCESSTYPE processType_;
bool requiresDTM_;
int persistRetries_;
int persistWindow_;
CPersistConfig *persistConfig_;
+#endif
- sqlite3 *db_;
-
- void AddNodeConfiguration( bool spareNode );
- void AddPersistConfiguration( void );
+ void AddNodeConfiguration( pnodeConfigInfo_t &pnodeConfigInfo
+ , lnodeConfigInfo_t &lnodeConfigInfo );
+ void AddSNodeConfiguration( pnodeConfigInfo_t &pnodeConfigInfo );
+ void AddPersistConfiguration( persistConfigInfo_t &persistConfigInfo );
bool DeleteDbNodeData( int pnid );
- bool DeleteDbUniqueString( int nid );
PROCESSTYPE GetProcessType( const char *processtype );
- void ProcessLNode( int nid
- , int pnid
- , const char *nodename
- , int excfirstcore
- , int exclastcore
- , int firstcore
- , int lastcore
- , int processors
- , int roles );
- bool ProcessSNode( int pnid
- , const char *nodename
- , int excfirstcore
- , int exclastcore
- , int spnid );
- bool ProcessPersist( void );
- bool ProcessPersistData( const char *persistkey
- , const char *persistvalue );
- bool SaveDbLNodeData( int nid
- , int pnid
- , int firstCore
- , int lastCore
- , int processors
- , int roles );
- bool SaveDbPNodeData( const char *name
- , int pnid
- , int excludedFirstCore
- , int excludedLastCore );
- bool UpdateDbPNodeData( int pnid
- , const char *name
- , int excludedFirstCore
- , int excludedLastCore );
- void UpdatePNodeConfiguration( int pnid
- , const char *name
- , int excludedFirstCore
- , int excludedLastCore );
+ void ProcessLNode( node_configuration_t &nodeConfig
+ , pnodeConfigInfo_t &pnodeConfigInfo
+ , lnodeConfigInfo_t &lnodeConfigInfo );
+ void ProcessSNode( physical_node_configuration_t &pnodeConfig
+ , pnodeConfigInfo_t &pnodeConfigInfo );
+ void ProcessPersistInfo( persist_configuration_t &persistConfigData
+ , persistConfigInfo_t &persistConfigInfo );
+ bool SaveDbLNodeData( int nid
+ , int pnid
+ , int firstCore
+ , int lastCore
+ , int processors
+ , int roles );
+ bool SaveDbPNodeData( const char *name
+ , int pnid
+ , int excludedFirstCore
+ , int excludedLastCore );
+ bool UpdateDbPNodeData( int pnid
+ , const char *name
+ , int excludedFirstCore
+ , int excludedLastCore );
+ void UpdatePNodeConfiguration( int pnid
+ , const char *name
+ , int excludedFirstCore
+ , int excludedLastCore );
};
#endif /* CLUSTERCONF_H_ */
[06/50] [abbrv] incubator-trafodion git commit: addNode_step1 can be
run more than once now
Posted by su...@apache.org.
addNode_step1 can be run more than once now
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/4363341a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/4363341a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/4363341a
Branch: refs/heads/master
Commit: 4363341afff11ef2152eef62b9aa57b25bcbcd4e
Parents: 61d9365
Author: Amanda Moran <am...@apache.com>
Authored: Thu Aug 11 22:07:20 2016 +0000
Committer: Amanda Moran <am...@apache.com>
Committed: Thu Aug 11 22:07:20 2016 +0000
----------------------------------------------------------------------
install/installer/addNode_step1 | 22 ++++++++++++----------
install/installer/addNode_step2 | 4 ++--
2 files changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/4363341a/install/installer/addNode_step1
----------------------------------------------------------------------
diff --git a/install/installer/addNode_step1 b/install/installer/addNode_step1
index 475b52c..58fe80d 100755
--- a/install/installer/addNode_step1
+++ b/install/installer/addNode_step1
@@ -140,16 +140,18 @@ source $TRAF_CONFIG
for node in $NEW_NODES
do
- NODE_LIST="$NODE_LIST $node"
- MY_NODES="$MY_NODES -w $node"
- ALL_NODE_LIST="$ALL_NODE_LIST $node"
- ALL_NODES="$ALL_NODES -w $node"
- HADOOP_NODES="$HADOOP_NODES $node"
- MY_HADOOP_NODES="$MY_HADOOP_NODES -w $node"
- HDFS_NODES="$HDFS_NODES $node"
- MY_HDFS_NODES="$MY_HDFS_NODES -w $node"
- HBASE_NODES="$HBASE_NODES $node"
- MY_HBASE_NODES="$MY_HBASE_NODES -w $node"
+ if [[ ! $NODE_LIST =~ .*$node.* ]]; then
+ NODE_LIST="$NODE_LIST $node"
+ MY_NODES="$MY_NODES -w $node"
+ ALL_NODE_LIST="$ALL_NODE_LIST $node"
+ ALL_NODES="$ALL_NODES -w $node"
+ HADOOP_NODES="$HADOOP_NODES $node"
+ MY_HADOOP_NODES="$MY_HADOOP_NODES -w $node"
+ HDFS_NODES="$HDFS_NODES $node"
+ MY_HDFS_NODES="$MY_HDFS_NODES -w $node"
+ HBASE_NODES="$HBASE_NODES $node"
+ MY_HBASE_NODES="$MY_HBASE_NODES -w $node"
+ fi
done
hadoop_node_count=$(echo $HADOOP_NODES | wc -w)
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/4363341a/install/installer/addNode_step2
----------------------------------------------------------------------
diff --git a/install/installer/addNode_step2 b/install/installer/addNode_step2
index 0b4db3b..2eeba96 100755
--- a/install/installer/addNode_step2
+++ b/install/installer/addNode_step2
@@ -236,7 +236,7 @@ function copyAll {
source $TRAF_CONFIG
echo
echo "***IMPORTANT: Copying files to $NEW_NODES"
-echo "***IMPORTANT: This will take some time, it's alot of file. Please wait...."
+echo "***IMPORTANT: This will take some time, it's a lot of file. Please wait...."
echo
sudo mkdir -p $HOME/tmpTraf/
$TRAF_NEW_PDSH sudo rm -rf $HOME_DIR/$TRAF_USER/.ssh
@@ -385,7 +385,7 @@ copyTrafbashrc
copyAll
trafAcceptKeys
editDCSServers
-if [[ "$ENABLE_HA" == "true"]]; then
+if [[ "$ENABLE_HA" == "true" ]]; then
editDCSBackUp
fi
addTraftoHBase
[05/50] [abbrv] incubator-trafodion git commit: Uncommented creation
of process registry tables.
Posted by su...@apache.org.
Uncommented creation of process registry tables.
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/3f37b56a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/3f37b56a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/3f37b56a
Branch: refs/heads/master
Commit: 3f37b56a8eed6588188242af2c7d988c3d69cdd5
Parents: 3677b73
Author: Zalo Correa <za...@esgyn.com>
Authored: Thu Aug 11 09:43:38 2016 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Thu Aug 11 09:43:38 2016 -0700
----------------------------------------------------------------------
core/sqf/sql/scripts/createConfigDb | 14 +++---
core/sqf/sql/scripts/showConfigDb | 84 ++++++++++++++++----------------
2 files changed, 49 insertions(+), 49 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/3f37b56a/core/sqf/sql/scripts/createConfigDb
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/createConfigDb b/core/sqf/sql/scripts/createConfigDb
index 4e32594..748f95e 100755
--- a/core/sqf/sql/scripts/createConfigDb
+++ b/core/sqf/sql/scripts/createConfigDb
@@ -78,13 +78,13 @@ create table monRegKeyName
);
-- Process Scope registry entry (monitor gensq.pl)
---create table monRegProcData
---(
--- procId integer,
--- keyId integer,
--- dataValue varchar (4096),
--- primary key (procId, keyId)
---);
+create table monRegProcData
+(
+ procId integer,
+ keyId integer,
+ dataValue varchar (4096),
+ primary key (procId, keyId)
+);
-- Cluster registry entries (monitor gensq.pl)
create table monRegClusterData
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/3f37b56a/core/sqf/sql/scripts/showConfigDb
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/showConfigDb b/core/sqf/sql/scripts/showConfigDb
index 57d5795..a2c59d0 100755
--- a/core/sqf/sql/scripts/showConfigDb
+++ b/core/sqf/sql/scripts/showConfigDb
@@ -33,7 +33,7 @@ function Usage
echo "-h Displays this help message"
echo "-l[<nid>] Displays all [or specific] logical node configuration values"
echo "-n[<name>] Displays all [or specific] node configuration values"
-# echo "-p[<proc>] Displays specific process registry values"
+ echo "-p[<proc>] Displays specific process registry values"
echo "-s[<name>] Displays all [or specific] spare node specific configuration values"
echo "-u Displays unique strings"
echo "-x[<name>] Displays all [or specific] physical node configuration values"
@@ -255,34 +255,34 @@ EOF
}
-#function monRegSpecificProcData
-#{
-#
-## Monitor registry: process keys and values for a specific process
-#
-#sqlite3 sqconfig.db <<EOF
-#.separator ""
-#.headers on
-#.mode list
-#select p.procName, ": ", k.keyName, "=", d.dataValue from monRegProcName p, monRegKeyName k, monRegProcData d where p.procId = d.procId and k.keyId = d.keyId and p.procName = "$1";
-#.quit
-#EOF
-#
-#}
-#
-#function monRegProcData
-#{
-#
-## Monitor registry: process keys and values
-#sqlite3 sqconfig.db <<EOF
-#.separator ""
-#.headers on
-#.mode list
-#select p.procName, ": ", k.keyName, "=", d.dataValue from monRegProcName p, monRegKeyName k, monRegProcData d where p.procId = d.procId and k.keyId = d.keyId;
-#.quit
-#EOF
-#
-#}
+function monRegSpecificProcData
+{
+
+# Monitor registry: process keys and values for a specific process
+
+sqlite3 sqconfig.db <<EOF
+.separator ""
+.headers on
+.mode list
+select p.procName, ": ", k.keyName, "=", d.dataValue from monRegProcName p, monRegKeyName k, monRegProcData d where p.procId = d.procId and k.keyId = d.keyId and p.procName = "$1";
+.quit
+EOF
+
+}
+
+function monRegProcData
+{
+
+# Monitor registry: process keys and values
+sqlite3 sqconfig.db <<EOF
+.separator ""
+.headers on
+.mode list
+select p.procName, ": ", k.keyName, "=", d.dataValue from monRegProcName p, monRegKeyName k, monRegProcData d where p.procId = d.procId and k.keyId = d.keyId;
+.quit
+EOF
+
+}
function persistentData
{
@@ -347,11 +347,11 @@ do
echo "Registry - cluster"
echo "******************"
monRegClusterData
-# echo
-# echo "***********************"
-# echo "Registry - process data"
-# echo "***********************"
-# monRegProcData
+ echo
+ echo "***********************"
+ echo "Registry - process data"
+ echo "***********************"
+ monRegProcData
echo
echo "*************************"
echo "Registry - unique strings"
@@ -389,14 +389,14 @@ do
fi
;;
-# -p)
-# if [[ -n "$2" ]];
-# then
-# monRegSpecificProcData $2
-# else
-# monRegProcData
-# fi
-# ;;
+ -p)
+ if [[ -n "$2" ]];
+ then
+ monRegSpecificProcData $2
+ else
+ monRegProcData
+ fi
+ ;;
-s)
if [[ -n "$2" ]];
[47/50] [abbrv] incubator-trafodion git commit: Merge remote branch
'origin/master' into TRAFODION-2001
Posted by su...@apache.org.
Merge remote branch 'origin/master' into TRAFODION-2001
Conflicts:
core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/TrxTransactionState.java.tmpl
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/f7f69521
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/f7f69521
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/f7f69521
Branch: refs/heads/master
Commit: f7f69521f89ba92b7a0041d5ccd5a2f6757bf657
Parents: 363df1f 113c4de
Author: Zalo Correa <za...@esgyn.com>
Authored: Tue May 16 18:03:06 2017 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Tue May 16 18:03:06 2017 -0700
----------------------------------------------------------------------
NOTICE | 2 +-
core/conn/jdbcT4/pom.xml | 93 +
.../native/ResStatisticsStatement.cpp | 72 +-
.../jdbc_type2/native/ResStatisticsStatement.h | 9 +
.../odbc/nsksrvrcore/ResStatisticsStatement.cpp | 88 +-
.../odbc/nsksrvrcore/ResStatisticsStatement.h | 7 +
.../odbc/odbcclient/unixcli/cli/sqltocconv.cpp | 4 +
core/sqf/build-scripts/build.branch | 4 +-
.../run_full_trafodion_backup.sh | 2 +-
core/sqf/sqenvcom.sh | 32 +-
.../sql/scripts/install_hadoop_regr_test_env | 109 +-
core/sqf/sql/scripts/install_local_hadoop | 15 +-
core/sqf/src/seabed/src/ms.cpp | 2 +
core/sqf/src/seatrans/.gitignore | 1 +
.../NonPendingTransactionException.java | 47 +
.../hbase/client/transactional/RMInterface.java | 296 +-
.../hbase/client/transactional/TmDDL.java | 28 +-
.../hbase/client/transactional/TransState.java | 6 +-
.../transactional/TransactionManager.java | 355 +-
.../TransactionRegionLocation.java | 137 +-
.../client/transactional/TransactionState.java | 157 +-
.../TransactionalAggregationClient.java | 83 +-
.../TransactionalScanner.java.tmpl | 30 +-
.../transactional/TransactionalTable.java | 162 +-
.../transactional/SplitBalanceHelper.java | 3 +-
.../transactional/TrxRegionEndpoint.java.tmpl | 3439 +++++----
.../transactional/TrxRegionObserver.java.tmpl | 34 +-
.../generated/SsccRegionProtos.java | 42 +-
.../generated/TrxRegionProtos.java | 6849 ++++++++++--------
.../transactional/SsccTransactionState.java | 4 +-
.../transactional/TransactionState.java | 108 +-
.../TransactionalRegionScannerHolder.java | 63 -
.../TransactionalRegionScannerHolder.java.tmpl | 79 +
.../transactional/TrxTransactionState.java.tmpl | 327 +-
.../hbase-trx/src/main/protobuf/TrxRegion.proto | 175 +-
.../trafodion/dtm/HBaseAuditControlPoint.java | 431 +-
.../java/org/trafodion/dtm/HBaseTxClient.java | 344 +-
.../java/org/trafodion/dtm/TmAuditTlog.java | 1712 +++--
core/sql/bin/SqlciErrors.txt | 2 +-
core/sql/bin/clitest.cpp | 2 +-
core/sql/cli/CliExtern.cpp | 23 +-
core/sql/cli/sqlcli.h | 2 +
core/sql/clitest/blobtest.cpp | 4 +-
core/sql/comexe/ComTdbExeUtil.h | 1 +
core/sql/comexe/ComTdbHashGrby.h | 2 +
core/sql/common/ComMisc.cpp | 42 +
core/sql/common/ComMisc.h | 20 +
core/sql/common/ComObjectName.h | 18 +
core/sql/common/ComSmallDefs.h | 4 +
core/sql/common/OperTypeEnum.h | 2 +-
core/sql/executor/ExExeUtil.h | 8 +-
core/sql/executor/ExExeUtilGet.cpp | 34 +
core/sql/executor/ExExeUtilGetStats.cpp | 444 +-
core/sql/executor/ExExeUtilLoad.cpp | 2 +-
core/sql/executor/ExStats.cpp | 311 +-
core/sql/executor/ExStats.h | 30 +-
core/sql/executor/ex_hash_grby.cpp | 21 +-
core/sql/executor/ex_hash_grby.h | 11 +
core/sql/executor/ex_hashj.cpp | 26 +-
core/sql/executor/ex_hashj.h | 18 +-
core/sql/executor/ex_sort.cpp | 321 +-
core/sql/executor/ex_sort.h | 46 +-
core/sql/exp/ExpLOB.cpp | 103 +-
core/sql/exp/ExpLOB.h | 21 +-
core/sql/exp/ExpLOBaccess.cpp | 213 +-
core/sql/exp/ExpLOBaccess.h | 22 +-
core/sql/exp/ExpLOBenums.h | 17 +-
core/sql/exp/ExpLOBinterface.cpp | 75 +-
core/sql/exp/ExpLOBinterface.h | 34 +-
core/sql/exp/exp_datetime.h | 6 +-
core/sql/generator/GenExplain.cpp | 5 +
core/sql/generator/GenItemFunc.cpp | 7 +-
core/sql/generator/GenPreCode.cpp | 53 +-
core/sql/generator/GenRelExeUtil.cpp | 21 +-
core/sql/generator/GenRelScan.cpp | 17 +-
core/sql/optimizer/BindRelExpr.cpp | 35 +-
core/sql/optimizer/ItemFunc.h | 2 +-
core/sql/optimizer/NATable.cpp | 24 +-
core/sql/optimizer/ObjectNames.cpp | 7 +-
core/sql/optimizer/ObjectNames.h | 6 +-
core/sql/optimizer/OptimizerSimulator.cpp | 2 +-
core/sql/optimizer/RelExeUtil.cpp | 16 +-
core/sql/optimizer/RelExeUtil.h | 7 +-
core/sql/parser/AllStmtDDL.h | 1 -
core/sql/parser/BindStmtDDL.cpp | 73 +-
core/sql/parser/ElemDDLNode.cpp | 10 +-
core/sql/parser/ElemDDLNode.h | 6 +-
core/sql/parser/ParKeyWords.cpp | 2 -
core/sql/parser/StmtDDLCleanupObjects.h | 1 +
core/sql/parser/StmtDDLGrant.h | 9 +
core/sql/parser/StmtDDLMisc.cpp | 1 +
core/sql/parser/StmtDDLNode.cpp | 198 +-
core/sql/parser/StmtDDLPublish.h | 269 -
core/sql/parser/StmtDDLRegOrUnregHive.cpp | 46 +-
core/sql/parser/StmtDDLRegOrUnregHive.h | 53 +-
core/sql/parser/StmtDDLRevoke.h | 9 +
core/sql/parser/sqlparser.y | 157 +-
core/sql/regress/core/EXPECTEDRTS | 1903 ++---
core/sql/regress/core/FILTERRTS | 18 +-
core/sql/regress/executor/DIFF140.KNOWN | 4 +
core/sql/regress/executor/EXPECTED130 | 583 +-
core/sql/regress/executor/TEST130 | 125 +-
core/sql/regress/hive/EXPECTED003 | 6 +-
core/sql/regress/hive/EXPECTED005 | 104 +-
core/sql/regress/hive/EXPECTED007 | 28 +-
core/sql/regress/hive/EXPECTED009 | 103 +-
core/sql/regress/hive/EXPECTED018 | 717 +-
core/sql/regress/hive/FILTER005 | 4 +-
core/sql/regress/hive/FILTER007 | 1 +
core/sql/regress/hive/FILTER009 | 1 +
core/sql/regress/hive/TEST003 | 52 +-
.../hive/TEST003_create_hive_tables.hive | 24 +-
core/sql/regress/hive/TEST005 | 48 +-
core/sql/regress/hive/TEST005_a.hive.sql | 16 +-
core/sql/regress/hive/TEST007 | 2 +-
core/sql/regress/hive/TEST009 | 26 +-
core/sql/regress/hive/TEST009_a.hive.sql | 4 +-
core/sql/regress/hive/TEST009_b.hive.sql | 2 +-
core/sql/regress/hive/TEST018 | 148 +-
.../hive/TEST018_create_hive_tables.hive | 14 +-
core/sql/regress/seabase/EXPECTED022 | 505 +-
core/sql/regress/seabase/EXPECTED024 | 6 +-
core/sql/regress/seabase/EXPECTED030 | 4 +-
core/sql/regress/seabase/EXPECTED031 | 23 +-
core/sql/regress/seabase/FILTER022 | 39 +
core/sql/regress/seabase/TEST022 | 94 +-
core/sql/regress/seabase/TEST024 | 2 -
core/sql/regress/seabase/TEST030 | 4 +-
core/sql/sort/Qsort.cpp | 9 +-
core/sql/sort/Qsort.h | 3 +-
core/sql/sort/SortAlgo.cpp | 3 +-
core/sql/sort/SortAlgo.h | 3 +-
core/sql/sort/SortTopN.cpp | 9 +-
core/sql/sort/SortTopN.h | 3 +-
core/sql/sort/SortUtil.cpp | 106 +-
core/sql/sort/SortUtil.h | 6 +-
core/sql/sort/TourTree.cpp | 8 +-
core/sql/sort/TourTree.h | 1 +
core/sql/sqlci/sqlci_lex.ll | 2 -
core/sql/sqlci/sqlci_yacc.y | 4 -
core/sql/sqlcomp/CmpDescribe.cpp | 55 +-
core/sql/sqlcomp/CmpSeabaseDDL.h | 24 +-
core/sql/sqlcomp/CmpSeabaseDDLcleanup.cpp | 41 +
core/sql/sqlcomp/CmpSeabaseDDLcleanup.h | 5 +-
core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp | 84 +-
core/sql/sqlcomp/CmpSeabaseDDLmd.h | 4 +-
core/sql/sqlcomp/CmpSeabaseDDLtable.cpp | 381 +-
core/sql/sqlcomp/CmpSeabaseDDLview.cpp | 38 +-
core/sql/sqlcomp/PrivMgrComponentPrivileges.cpp | 9 +
core/sql/sqlcomp/nadefaults.cpp | 16 +-
.../java/org/trafodion/sql/HBaseClient.java | 3 +-
.../java/org/trafodion/sql/HTableClient.java | 47 +-
core/sql/ustat/hs_la.cpp | 38 +-
.../src/asciidoc/_chapters/ambari_install.adoc | 51 +-
docs/provisioning_guide/src/images/amb1.PNG | Bin 0 -> 46318 bytes
docs/provisioning_guide/src/images/amb2.PNG | Bin 0 -> 12063 bytes
docs/provisioning_guide/src/images/amb3.PNG | Bin 0 -> 13764 bytes
docs/provisioning_guide/src/images/amb4.PNG | Bin 0 -> 44413 bytes
docs/provisioning_guide/src/images/amb5.PNG | Bin 0 -> 10552 bytes
.../src/asciidoc/_chapters/olap_functions.adoc | 2 +-
.../sql_functions_and_expressions.adoc | 4 +-
.../src/asciidoc/_chapters/sql_statements.adoc | 2 +-
.../src/asciidoc/_chapters/sql_utilities.adoc | 333 +-
docs/src/site/markdown/documentation.md | 23 +-
docs/src/site/markdown/download.md | 48 +-
docs/src/site/markdown/index.md | 4 +-
docs/src/site/markdown/release-notes-2-1-0.md | 164 +
docs/src/site/markdown/release-notes.md | 1 +
install/ambari-installer/Makefile | 11 +-
.../2.1/configuration/traf-cluster-env.xml | 1 +
.../2.1/configuration/trafodion-env.xml | 4 +
.../TRAFODION/2.1/package/scripts/params.py | 2 +
.../2.1/package/scripts/trafodionmaster.py | 3 +-
install/python-installer/db_install.py | 11 +-
install/python-installer/scripts/traf_check.py | 5 +
licenses/lic-pyinstall-src | 4 +-
win-odbc64/odbcclient/drvr35/sqltocconv.cpp | 6 +
177 files changed, 14415 insertions(+), 10049 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f7f69521/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/TrxTransactionState.java.tmpl
----------------------------------------------------------------------
[32/50] [abbrv] incubator-trafodion git commit: Merge remote branch
'origin/master' into TRAFODION-2001
Posted by su...@apache.org.
Merge remote branch 'origin/master' into TRAFODION-2001
Conflicts:
core/sqf/monitor/linux/config.cxx
core/sqf/monitor/linux/pnodeconfig.cxx
core/sqf/monitor/linux/pnodeconfig.h
core/sqf/monitor/linux/reqqueue.cxx
core/sqf/monitor/linux/shell.cxx
core/sqf/sql/scripts/gensq.pl
core/sqf/sql/scripts/sqconfig
core/sqf/sql/scripts/sqconfig.sample
core/sqf/sql/scripts/sqgen
core/sqf/sql/scripts/sqnodestatus
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/9523fd2b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/9523fd2b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/9523fd2b
Branch: refs/heads/master
Commit: 9523fd2b365885e4e631453d694c75af388fbc01
Parents: cd7862c b5e7300
Author: Zalo Correa <za...@esgyn.com>
Authored: Fri Feb 24 14:27:10 2017 -0800
Committer: Zalo Correa <za...@esgyn.com>
Committed: Fri Feb 24 14:27:10 2017 -0800
----------------------------------------------------------------------
.rat-excludes | 13 +-
RAT_README | 39 +-
core/Makefile | 8 +-
core/bldenvchk.sh | 6 +-
core/conn/Makefile | 4 +-
core/conn/jdbcT4/Makefile | 6 +-
.../trafodion/jdbc/t4/InterfaceUtilities.java | 3 +-
core/conn/jdbc_type2/Makefile | 8 +-
core/conn/jdbc_type2/build.xml | 8 +-
.../native/ResStatisticsStatement.cpp | 123 +-
core/conn/jdbc_type2/samples/README | 4 +-
core/conn/odb/Makefile | 6 +-
core/conn/odbc/src/odbc/Common/QSData.cpp | 24 +
core/conn/odbc/src/odbc/Common/QSData.h | 45 +
core/conn/odbc/src/odbc/Makefile | 12 +-
core/conn/odbc/src/odbc/macros.gmk | 2 +-
core/conn/odbc/src/odbc/nsksrvr/Makefile | 8 +-
core/conn/odbc/src/odbc/nsksrvr/SrvrConnect.cpp | 5 +-
core/conn/odbc/src/odbc/nsksrvrcore/Makefile | 8 +-
.../odbc/nsksrvrcore/ResStatisticsStatement.cpp | 125 +-
core/conn/trafci/.gitignore | 6 +
core/conn/trafci/Makefile | 41 +
core/conn/trafci/build.xml | 10 +-
core/conn/trafci/install/Installer.java | 3389 --------------
core/conn/trafci/install/Installer.java-tmpl | 3368 ++++++++++++++
core/conn/trafci/installer_pom.xml | 119 +
core/conn/trafci/manualtests/README | 2 +-
core/conn/trafci/pom.xml | 140 +
.../org/trafodion/ci/AWTExceptionHandler.java | 36 +
.../main/java/org/trafodion/ci/CSVDisplay.java | 90 +
.../src/main/java/org/trafodion/ci/Column.java | 131 +
.../java/org/trafodion/ci/ConditionalQuery.java | 435 ++
.../trafodion/ci/ConditionalQueryException.java | 43 +
.../trafodion/ci/ConditionalSyntaxError.java | 123 +
.../java/org/trafodion/ci/ConsoleReader.java | 231 +
.../java/org/trafodion/ci/ConsoleWriter.java | 130 +
.../java/org/trafodion/ci/DatabaseQuery.java | 1819 ++++++++
.../src/main/java/org/trafodion/ci/Display.java | 68 +
.../trafodion/ci/DuplicateParamException.java | 40 +
.../main/java/org/trafodion/ci/ErrorObject.java | 103 +
.../src/main/java/org/trafodion/ci/FCQuery.java | 334 ++
.../main/java/org/trafodion/ci/FileReader.java | 176 +
.../main/java/org/trafodion/ci/FileWriter.java | 80 +
.../main/java/org/trafodion/ci/HTMLDisplay.java | 80 +
.../main/java/org/trafodion/ci/HTMLObject.java | 628 +++
.../main/java/org/trafodion/ci/HelpIndexer.java | 134 +
.../src/main/java/org/trafodion/ci/Helper.java | 225 +
.../main/java/org/trafodion/ci/HostQuery.java | 289 ++
.../main/java/org/trafodion/ci/IDisplay.java | 28 +
.../main/java/org/trafodion/ci/IndexStruct.java | 55 +
.../java/org/trafodion/ci/InterfaceQuery.java | 4380 ++++++++++++++++++
.../trafodion/ci/InterfaceQueryException.java | 35 +
.../org/trafodion/ci/InterfaceSyntaxError.java | 83 +
.../trafodion/ci/InvalidNumberOfArguments.java | 35 +
.../main/java/org/trafodion/ci/JDBCVproc.java | 38 +
.../java/org/trafodion/ci/LFProperties.java | 130 +
.../java/org/trafodion/ci/MaskingThread.java | 73 +
.../java/org/trafodion/ci/MultiByteUtils.java | 56 +
.../org/trafodion/ci/NullKeyWordException.java | 35 +
.../org/trafodion/ci/OutputColumnAttribute.java | 47 +
.../java/org/trafodion/ci/OutputContents.java | 144 +
.../main/java/org/trafodion/ci/ParallelRun.java | 1320 ++++++
.../org/trafodion/ci/ParamStringObject.java | 256 +
.../java/org/trafodion/ci/ParseArguments.java | 660 +++
.../src/main/java/org/trafodion/ci/Parser.java | 1195 +++++
.../ci/ParserMissingParamException.java | 42 +
.../trafciDefaultLookAndFeel.properties | 60 +
.../main/java/org/trafodion/ci/PrunSummary.java | 119 +
.../org/trafodion/ci/PrunUserInterruption.java | 34 +
.../java/org/trafodion/ci/PythonInterface.java | 180 +
.../src/main/java/org/trafodion/ci/Query.java | 188 +
.../main/java/org/trafodion/ci/QueryUtils.java | 37 +
.../java/org/trafodion/ci/QueryWrapper.java | 700 +++
.../main/java/org/trafodion/ci/RawDisplay.java | 189 +
.../src/main/java/org/trafodion/ci/Reader.java | 286 ++
.../java/org/trafodion/ci/RepObjInterface.java | 27 +
.../java/org/trafodion/ci/ReplacementObj.java | 39 +
.../org/trafodion/ci/ScriptSectionNotFound.java | 34 +
.../java/org/trafodion/ci/ScriptsInterface.java | 153 +
.../src/main/java/org/trafodion/ci/Session.java | 1919 ++++++++
.../java/org/trafodion/ci/SessionDefaults.java | 342 ++
.../java/org/trafodion/ci/SessionError.java | 181 +
.../java/org/trafodion/ci/SessionInterface.java | 1487 ++++++
.../org/trafodion/ci/SessionTimeoutTask.java | 93 +
.../src/main/java/org/trafodion/ci/SqlEnum.java | 83 +
.../java/org/trafodion/ci/StatusThread.java | 100 +
.../org/trafodion/ci/TerminalProcessBridge.java | 246 +
.../trafodion/ci/UnKnownInterfaceCommand.java | 34 +
.../java/org/trafodion/ci/UserInterface.java | 421 ++
.../java/org/trafodion/ci/UserInterruption.java | 36 +
.../src/main/java/org/trafodion/ci/Utils.java | 381 ++
.../java/org/trafodion/ci/ValidateQuery.java | 412 ++
.../org/trafodion/ci/ValidationException.java | 39 +
.../main/java/org/trafodion/ci/Vproc.java-tmpl | 36 +
.../main/java/org/trafodion/ci/WCIUtils.java | 122 +
.../src/main/java/org/trafodion/ci/Writer.java | 418 ++
.../main/java/org/trafodion/ci/XMLDisplay.java | 75 +
.../main/java/org/trafodion/ci/XMLObject.java | 607 +++
.../org/trafodion/ci/help/common_common.help | 457 ++
.../java/org/trafodion/ci/help/help_file.idx | 30 +
.../java/org/trafodion/ci/help/sql_common.help | 376 ++
.../org/trafodion/ci/pwdencrypt/ArgMap.java | 61 +
.../org/trafodion/ci/pwdencrypt/ArgsDef.java | 74 +
.../trafodion/ci/pwdencrypt/EncryptUtil.java | 249 +
.../java/org/trafodion/ci/pwdencrypt/JCE.java | 414 ++
.../trafodion/ci/pwdencrypt/PasswordOpts.java | 292 ++
.../org/trafodion/ci/pwdencrypt/RefLookup.java | 127 +
.../org/trafodion/ci/pwdencrypt/WorkTypes.java | 55 +
.../trafci/src/main/resources/install_jar.xml | 71 +
.../trafci/src/main/resources/install_tar.xml | 45 +
.../trafci/src/main/resources/trafci.properties | 5 +
.../org/trafodion/ci/AWTExceptionHandler.java | 36 -
.../trafci/src/org/trafodion/ci/CSVDisplay.java | 90 -
.../trafci/src/org/trafodion/ci/Column.java | 131 -
.../src/org/trafodion/ci/ConditionalQuery.java | 435 --
.../trafodion/ci/ConditionalQueryException.java | 43 -
.../trafodion/ci/ConditionalSyntaxError.java | 123 -
.../src/org/trafodion/ci/ConsoleReader.java | 218 -
.../src/org/trafodion/ci/ConsoleWriter.java | 130 -
.../src/org/trafodion/ci/DatabaseQuery.java | 1804 --------
.../trafci/src/org/trafodion/ci/Display.java | 68 -
.../trafodion/ci/DuplicateParamException.java | 40 -
.../src/org/trafodion/ci/ErrorObject.java | 103 -
.../trafci/src/org/trafodion/ci/FCQuery.java | 334 --
.../trafci/src/org/trafodion/ci/FileReader.java | 176 -
.../trafci/src/org/trafodion/ci/FileWriter.java | 80 -
.../src/org/trafodion/ci/HTMLDisplay.java | 80 -
.../trafci/src/org/trafodion/ci/HTMLObject.java | 628 ---
.../src/org/trafodion/ci/HelpIndexer.java | 134 -
.../trafci/src/org/trafodion/ci/Helper.java | 225 -
.../trafci/src/org/trafodion/ci/HostQuery.java | 289 --
.../trafci/src/org/trafodion/ci/IDisplay.java | 28 -
.../src/org/trafodion/ci/IndexStruct.java | 55 -
.../src/org/trafodion/ci/InterfaceQuery.java | 4378 -----------------
.../trafodion/ci/InterfaceQueryException.java | 35 -
.../org/trafodion/ci/InterfaceSyntaxError.java | 83 -
.../trafodion/ci/InvalidNumberOfArguments.java | 35 -
.../trafci/src/org/trafodion/ci/JDBCVproc.java | 38 -
.../src/org/trafodion/ci/LFProperties.java | 130 -
.../src/org/trafodion/ci/MaskingThread.java | 73 -
.../src/org/trafodion/ci/MultiByteUtils.java | 56 -
.../org/trafodion/ci/NullKeyWordException.java | 35 -
.../org/trafodion/ci/OutputColumnAttribute.java | 47 -
.../src/org/trafodion/ci/OutputContents.java | 144 -
.../src/org/trafodion/ci/ParallelRun.java | 1320 ------
.../src/org/trafodion/ci/ParamStringObject.java | 256 -
.../src/org/trafodion/ci/ParseArguments.java | 660 ---
.../trafci/src/org/trafodion/ci/Parser.java | 1195 -----
.../ci/ParserMissingParamException.java | 42 -
.../trafciDefaultLookAndFeel.properties | 60 -
.../src/org/trafodion/ci/PrunSummary.java | 119 -
.../org/trafodion/ci/PrunUserInterruption.java | 34 -
.../src/org/trafodion/ci/PythonInterface.java | 180 -
.../conn/trafci/src/org/trafodion/ci/Query.java | 188 -
.../trafci/src/org/trafodion/ci/QueryUtils.java | 37 -
.../src/org/trafodion/ci/QueryWrapper.java | 700 ---
.../trafci/src/org/trafodion/ci/RawDisplay.java | 189 -
.../trafci/src/org/trafodion/ci/Reader.java | 286 --
.../src/org/trafodion/ci/RepObjInterface.java | 27 -
.../src/org/trafodion/ci/ReplacementObj.java | 39 -
.../org/trafodion/ci/ScriptSectionNotFound.java | 34 -
.../src/org/trafodion/ci/ScriptsInterface.java | 153 -
.../trafci/src/org/trafodion/ci/Session.java | 1908 --------
.../src/org/trafodion/ci/SessionDefaults.java | 342 --
.../src/org/trafodion/ci/SessionError.java | 181 -
.../src/org/trafodion/ci/SessionInterface.java | 1487 ------
.../org/trafodion/ci/SessionTimeoutTask.java | 93 -
.../trafci/src/org/trafodion/ci/SqlEnum.java | 83 -
.../src/org/trafodion/ci/StatusThread.java | 100 -
.../org/trafodion/ci/TerminalProcessBridge.java | 246 -
.../trafodion/ci/UnKnownInterfaceCommand.java | 34 -
.../src/org/trafodion/ci/UserInterface.java | 421 --
.../src/org/trafodion/ci/UserInterruption.java | 36 -
.../conn/trafci/src/org/trafodion/ci/Utils.java | 381 --
.../src/org/trafodion/ci/ValidateQuery.java | 412 --
.../org/trafodion/ci/ValidationException.java | 39 -
.../conn/trafci/src/org/trafodion/ci/Vproc.java | 36 -
.../trafci/src/org/trafodion/ci/WCIUtils.java | 122 -
.../trafci/src/org/trafodion/ci/Writer.java | 418 --
.../trafci/src/org/trafodion/ci/XMLDisplay.java | 75 -
.../trafci/src/org/trafodion/ci/XMLObject.java | 607 ---
.../org/trafodion/ci/help/common_common.help | 457 --
.../src/org/trafodion/ci/help/help_file.idx | 30 -
.../src/org/trafodion/ci/help/sql_common.help | 376 --
.../src/org/trafodion/ci/pwdencrypt/ArgMap.java | 61 -
.../org/trafodion/ci/pwdencrypt/ArgsDef.java | 74 -
.../trafodion/ci/pwdencrypt/EncryptUtil.java | 249 -
.../src/org/trafodion/ci/pwdencrypt/JCE.java | 414 --
.../trafodion/ci/pwdencrypt/PasswordOpts.java | 292 --
.../org/trafodion/ci/pwdencrypt/RefLookup.java | 127 -
.../org/trafodion/ci/pwdencrypt/WorkTypes.java | 55 -
.../org/trafodion/ci/UserInterfaceTest.java | 116 +
core/conn/trafci/utils/ciencr.sh | 8 +-
core/conn/trafci/utils/trafci | 16 +-
core/conn/trafci/utils/trafci.cmd-tmpl | 2 +-
core/conn/trafci/utils/trafci_install.sh | 8 +-
.../odbc/odbcclient/unixcli/cli/cdesc.cpp | 17 +-
.../odbc/odbcclient/unixcli/cli/cdesc.h | 6 +-
.../odbc/odbcclient/unixcli/cli/cdiag.cpp | 10 +-
.../odbc/odbcclient/unixcli/cli/charsetconv.cpp | 4 +-
.../odbc/odbcclient/unixcli/cli/ctosqlconv.cpp | 49 +-
.../odbc/odbcclient/unixcli/cli/ctosqlconv.h | 2 +-
.../odbc/odbcclient/unixcli/cli/sqltocconv.cpp | 403 +-
.../odbc/odbcclient/unixcli/makefile.lnx | 4 +-
.../odbc/odbcclient/unixcli/package/mklnxpkg.sh | 2 +-
.../unixcli/package/runconnect_test.sh | 2 +-
core/dbsecurity/Makefile | 12 +-
core/dbsecurity/auth/Makefile | 16 +-
core/dbsecurity/auth/src/authEvents.cpp | 4 +-
core/dbsecurity/auth/src/ldapconfigfile.cpp | 18 +-
core/dbsecurity/auth/src/sqldapconfigcheck.cpp | 2 +-
core/dbsecurity/cert/Makefile | 10 +-
core/dbsecurity/cert/src/secsrvr.cpp | 2 +-
core/dbsecurity/macros.gmk | 2 +-
core/dbsecurity/scripts/sqcertgen | 2 +-
core/dbsecurity/scripts/update_auth | 16 +-
core/mpi/Makefile | 4 +-
core/rest/Makefile | 2 +-
core/rest/bin/rest | 8 +-
core/rest/conf/rest-env.sh | 4 +-
core/rest/genvers | 2 +-
.../asciidoc/_chapters/getting_started.adoc | 2 +-
core/seamonster/src/Makefile | 4 +-
core/seamonster/src/macros.gmk | 4 +-
core/sqf/LocalSettingsTemplate.sh | 10 +-
core/sqf/Makefile | 13 +-
core/sqf/build-scripts/check_man | 6 +-
core/sqf/build-scripts/genverhdr.ksh | 2 +-
core/sqf/commonLogger/CommonLogger.cpp | 6 +-
core/sqf/commonLogger/CommonLogger.h | 2 +-
core/sqf/conf/install_features | 2 +-
core/sqf/conf/log4cxx.monitor.mon.config | 2 +-
core/sqf/conf/log4cxx.monitor.mon.snmp.config | 2 +-
core/sqf/conf/log4cxx.monitor.psd.config | 2 +-
core/sqf/conf/log4cxx.monitor.wdg.config | 2 +-
core/sqf/conf/log4cxx.monitor.wdg.snmp.config | 2 +-
core/sqf/conf/log4cxx.trafodion.auth.config | 2 +-
core/sqf/conf/log4cxx.trafodion.lob.config | 2 +-
.../sqf/conf/log4cxx.trafodion.masterexe.config | 2 +-
core/sqf/conf/log4cxx.trafodion.sscp.config | 2 +-
core/sqf/conf/log4cxx.trafodion.ssmp.config | 2 +-
core/sqf/conf/log4cxx.trafodion.tm.config | 2 +-
core/sqf/conf/log4cxx.trafodion.udr.config | 2 +-
core/sqf/conf/trafodion.udr.config | 4 +-
.../export/include/common/evl_sqlog_eventnum.h | 2 +
core/sqf/export/include/dtm/tm.h | 10 +-
core/sqf/export/include/dtm/tmtransaction.h | 2 +-
.../sqf/export/limited-support-tools/LSO/README | 56 +-
.../export/limited-support-tools/LSO/offender | 13 +-
.../limited-support-tools/LSO/se_blocked.sql | 35 +
core/sqf/export/share/man/man1/createhooks.1 | 2 +-
core/sqf/export/share/man/man1/sqcore.1 | 4 +-
core/sqf/export/share/man/man1/sqcorefile.1 | 2 +-
core/sqf/export/share/man/man1/sqgen.1 | 38 +-
core/sqf/export/share/man/man1/sqid.1 | 2 +-
core/sqf/export/share/man/man1/sqinfo.1 | 8 +-
core/sqf/export/share/man/man1/sqvers.1 | 8 +-
core/sqf/export/share/man/man1/update_sql.1 | 2 +-
core/sqf/gdb/create-host-tar-lib | 14 +-
core/sqf/hbase_utilities/Makefile | 6 +-
.../backup_restore_functions.sh | 16 +-
core/sqf/inc/cextdecs/cextdecs.h | 14 +
core/sqf/macros.gmk | 8 +-
core/sqf/monitor/linux/clusterconf.cxx | 2 +-
core/sqf/monitor/linux/macros.gmk | 2 +-
core/sqf/monitor/linux/makefile | 5 +-
core/sqf/monitor/linux/monitor.cxx | 8 +-
core/sqf/monitor/linux/monlogging.cxx | 4 +-
core/sqf/monitor/linux/montest_run.virtual | 6 +-
core/sqf/monitor/linux/pnode.cxx | 2 +-
core/sqf/monitor/linux/pnodeconfig.cxx | 57 +-
core/sqf/monitor/linux/pnodeconfig.h | 1 +
core/sqf/monitor/linux/process.cxx | 43 +-
core/sqf/monitor/linux/process.h | 2 +-
core/sqf/monitor/linux/pstartd.cxx | 2 +-
core/sqf/monitor/linux/reqqueue.cxx | 14 +
core/sqf/monitor/linux/shell.cxx | 58 +-
core/sqf/monitor/linux/zclient.cxx | 110 +-
core/sqf/monitor/linux/zclient.h | 83 +-
core/sqf/monitor/linux/zootest.cxx | 5 +-
core/sqf/monitor/test/notes.txt | 2 +-
core/sqf/monitor/test/runtest | 46 +-
core/sqf/monitor/test/sqconfig.monitor.cluster | 2 +-
core/sqf/sqenvcom.sh | 67 +-
core/sqf/sqevlog/sq_evl_libs/macros.gmk | 2 +-
core/sqf/sqid | 10 +-
core/sqf/sqinfo | 18 +-
core/sqf/sql/macros.gmk | 2 +-
core/sqf/sql/scripts/UsasRepos | 2 +-
core/sqf/sql/scripts/analyzeMessageGuide.py | 656 +++
.../sqf/sql/scripts/bats/runmonitorbats.virtual | 6 +-
core/sqf/sql/scripts/bats/runseabedbats.virtual | 8 +-
core/sqf/sql/scripts/bats/runsqlreg.virtual | 8 +-
core/sqf/sql/scripts/bats/runtmbats.virtual | 14 +-
core/sqf/sql/scripts/bats/sqconfig.tm | 4 +-
core/sqf/sql/scripts/build_apidocs.sh | 4 +-
core/sqf/sql/scripts/ckill | 4 +-
core/sqf/sql/scripts/ckillall | 4 +-
core/sqf/sql/scripts/cleanZKNodes | 2 +-
core/sqf/sql/scripts/cleanat | 2 +-
core/sqf/sql/scripts/cleanlogs | 16 +-
core/sqf/sql/scripts/cresumeall | 4 +-
core/sqf/sql/scripts/cstat | 2 +-
core/sqf/sql/scripts/csuspendall | 6 +-
core/sqf/sql/scripts/dbcheck | 12 +-
core/sqf/sql/scripts/genmon | 2 +-
core/sqf/sql/scripts/genms | 10 +-
core/sqf/sql/scripts/gensq.pl | 4 +-
core/sqf/sql/scripts/genstats.sh | 2 +-
core/sqf/sql/scripts/get_libhdfs_files | 6 +-
core/sqf/sql/scripts/ilh_cleanhb | 12 +-
core/sqf/sql/scripts/ilh_hbase_repair | 8 +-
core/sqf/sql/scripts/ilh_hbcheck | 4 +-
core/sqf/sql/scripts/ilh_traf_restart | 16 +-
core/sqf/sql/scripts/ilh_trafinit | 16 +-
core/sqf/sql/scripts/install_apache_hadoop | 52 +-
core/sqf/sql/scripts/install_local_drill | 16 +-
core/sqf/sql/scripts/install_local_hadoop | 26 +-
core/sqf/sql/scripts/install_traf_components | 81 +-
core/sqf/sql/scripts/krb5check | 4 +-
core/sqf/sql/scripts/krb5functions | 4 +-
core/sqf/sql/scripts/krb5service | 8 +-
core/sqf/sql/scripts/makemsg.ksh | 8 +-
core/sqf/sql/scripts/qmmstart | 2 +-
core/sqf/sql/scripts/rmscheck | 2 +-
core/sqf/sql/scripts/runbats | 24 +-
core/sqf/sql/scripts/sqcheck | 2 +-
core/sqf/sql/scripts/sqcheckmon | 2 +-
core/sqf/sql/scripts/sqcore | 14 +-
core/sqf/sql/scripts/sqcorefile | 6 +-
core/sqf/sql/scripts/sqgen | 62 +-
core/sqf/sql/scripts/sqnodeipcrm | 4 +-
core/sqf/sql/scripts/sqnodestatus | 4 +-
core/sqf/sql/scripts/sqsmdstats | 10 +-
core/sqf/sql/scripts/sqstart | 32 +-
core/sqf/sql/scripts/sqstop | 22 +-
core/sqf/sql/scripts/sqsystem.pm | 4 +-
core/sqf/sql/scripts/traf_authentication_config | 4 +-
core/sqf/sql/scripts/traf_authentication_setup | 36 +-
core/sqf/sql/scripts/trafnodestatus | 10 +-
core/sqf/sql/scripts/uninstall_traf_components | 22 +-
core/sqf/sql/scripts/update_hbase | 11 +-
core/sqf/sql/scripts/update_sql | 10 +-
core/sqf/sqvers | 20 +-
core/sqf/src/seabed/macros.gmk | 2 +-
core/sqf/src/seabed/src/env.cpp | 2 +-
core/sqf/src/seabed/src/util.cpp | 2 +-
core/sqf/src/seabed/test/go284j | 2 +-
core/sqf/src/seabed/test/go9 | 4 +-
core/sqf/src/seabed/test/goshell205 | 2 +-
core/sqf/src/seabed/test/gostart | 4 +-
core/sqf/src/seabed/test/t9thread.rh6.supp | 56 +-
core/sqf/src/seabed/test/tcheck.cpp | 2 +-
core/sqf/src/seabed/tools/sqmanvers | 2 +-
core/sqf/src/seabed/tools/sqmanvers.java | 2 +-
core/sqf/src/seatrans/hbase-trx/Makefile | 64 +-
core/sqf/src/seatrans/hbase-trx/genvers | 2 +-
core/sqf/src/seatrans/hbase-trx/pp.awk | 152 +-
.../transactional/TransactionManager.java | 14 +-
.../client/transactional/TransactionState.java | 24 +
.../transactional/CommitConflictException.java | 61 +
.../transactional/TrxRegionEndpoint.java.tmpl | 90 +-
.../transactional/TrxTransactionState.java.tmpl | 73 +-
core/sqf/src/seatrans/tm/hbasetmlib2/Makefile | 6 +-
.../seatrans/tm/hbasetmlib2/TMInterface.java | 2 +-
.../sqf/src/seatrans/tm/hbasetmlib2/hbasetm.cpp | 234 +-
core/sqf/src/seatrans/tm/hbasetmlib2/hbasetm.h | 2 +-
.../tm/hbasetmlib2/javaobjectinterfacetm.cpp | 156 +-
.../tm/hbasetmlib2/javaobjectinterfacetm.h | 16 +-
.../src/seatrans/tm/hbasetmlib2/pom.xml.apache | 4 +-
.../sqf/src/seatrans/tm/hbasetmlib2/pom.xml.hdp | 2 +-
.../java/org/trafodion/dtm/HBaseTxClient.java | 65 +-
.../dtm/TransactionManagerException.java | 70 +
.../sqf/src/seatrans/tm/hbasetmlib2/testrun.cpp | 6 +-
core/sqf/src/seatrans/tm/macros.gmk | 6 +-
core/sqf/src/tm/Makefile | 6 +-
core/sqf/src/tm/macros.gmk | 6 +-
core/sqf/src/tm/tmlib.cpp | 56 +-
core/sqf/src/tm/tmlib.h | 1 +
core/sqf/src/tm/tmlibmsg.h | 2 +
core/sqf/src/tm/tmrm.h | 2 +-
core/sqf/src/tm/tmrmhbase.cpp | 9 +-
core/sqf/src/tm/tmrmhbase.h | 2 +-
core/sqf/src/tm/tmrmtse.cpp | 2 +-
core/sqf/src/tm/tmrmtse.h | 2 +-
core/sqf/src/tm/tmtransaction.cpp | 9 +-
core/sqf/src/tm/tmtx.cpp | 2 +-
core/sqf/src/tm/tmtxbranches.cpp | 7 +-
core/sqf/src/tm/tmtxbranches.h | 2 +-
core/sqf/src/tm/tmxatxn.cpp | 2 +-
core/sqf/src/tm/tools/dtmci.cpp | 1 +
core/sqf/src/tm/tools/run_dtmci | 4 +-
core/sqf/sysinstall/etc/init.d/trafodion | 131 +
.../etc/security/limits.d/trafodion.conf | 25 +
core/sqf/sysinstall/etc/sudoers.d/trafodion | 35 +
core/sqf/sysinstall/home/trafodion/.bashrc | 69 +
core/sqf/tools/sqdiag_core_compare | 2 +-
core/sqf/tools/sqdiag_core_mask | 2 +-
core/sqf/tools/sqtools.sh | 116 +-
core/sql/SqlCompilerDebugger/cln.sh | 6 +-
core/sql/arkcmp/CmpErrLog.cpp | 6 +-
core/sql/arkcmp/CmpStatement.cpp | 46 +-
core/sql/arkcmp/CmpStatement.h | 7 +-
core/sql/arkcmp/CompException.cpp | 82 +-
core/sql/arkcmp/CompException.h | 25 +-
core/sql/bin/SqlciErrors.txt | 131 +-
core/sql/bin/clitest.cpp | 97 +-
core/sql/bin/ex_esp_main.cpp | 20 +-
core/sql/cli/Cli.cpp | 174 +-
core/sql/cli/Cli.h | 1 +
core/sql/cli/CliExtern.cpp | 2 +
core/sql/cli/Context.cpp | 9 -
core/sql/cli/Globals.cpp | 97 +-
core/sql/cli/Globals.h | 4 -
core/sql/cli/SessionDefaults.cpp | 2 +-
core/sql/cli/Statement.cpp | 123 -
core/sql/cli/Statement.h | 5 -
core/sql/cli/memorymonitor.cpp | 76 +-
core/sql/cli/memorymonitor.h | 18 +-
core/sql/cli/sqlcli.h | 23 +-
core/sql/clitest/blobtest.cpp | 108 +-
core/sql/clitest/blobtest.h | 3 +
core/sql/comexe/ComTdb.h | 3 +
core/sql/comexe/ComTdbExeUtil.cpp | 82 +-
core/sql/comexe/ComTdbExeUtil.h | 116 +-
core/sql/comexe/ComTdbHbaseAccess.cpp | 22 +-
core/sql/comexe/ComTdbHbaseAccess.h | 27 +-
core/sql/comexe/ComTdbHdfsScan.h | 2 +-
core/sql/comexe/ComTdbRoot.h | 3 +-
core/sql/comexe/ComTdbSort.h | 2 +-
core/sql/common/CharType.cpp | 2 +-
core/sql/common/ComJSON.cpp | 1175 +++++
core/sql/common/ComJSON.h | 159 +
core/sql/common/ComJSONFuncs.cpp | 793 ++++
core/sql/common/ComJSONStringInfo.cpp | 297 ++
core/sql/common/ComJSONStringInfo.h | 176 +
core/sql/common/ComMisc.cpp | 28 +-
core/sql/common/ComMisc.h | 2 +
core/sql/common/ComResWords.cpp | 1 -
core/sql/common/ComRtUtils.cpp | 2 +-
core/sql/common/ComSSL.cpp | 49 +
core/sql/common/ComSSL.h | 60 +
core/sql/common/ComSmallDefs.h | 29 +-
core/sql/common/ComUser.cpp | 27 +
core/sql/common/ComUser.h | 2 +
core/sql/common/ExprNode.cpp | 19 +-
core/sql/common/Ipc.cpp | 4 +-
core/sql/common/NAMemory.cpp | 2 +-
core/sql/common/NAString.cpp | 1 +
core/sql/common/OperTypeEnum.h | 10 +-
core/sql/common/sql_charset_strings.h | 2 +
core/sql/executor/ExComTdb.cpp | 7 +
core/sql/executor/ExExeUtil.h | 119 +-
core/sql/executor/ExExeUtilCli.cpp | 10 +-
core/sql/executor/ExExeUtilCli.h | 3 +-
core/sql/executor/ExExeUtilCommon.cpp | 28 +-
core/sql/executor/ExExeUtilGet.cpp | 964 ++--
core/sql/executor/ExExeUtilGetStats.cpp | 306 +-
core/sql/executor/ExExeUtilLoad.cpp | 784 +++-
core/sql/executor/ExHbaseAccess.cpp | 353 +-
core/sql/executor/ExHbaseAccess.h | 18 +-
core/sql/executor/ExHbaseIUD.cpp | 308 +-
core/sql/executor/ExHbaseSelect.cpp | 4 +-
core/sql/executor/ExHdfsScan.cpp | 171 +-
core/sql/executor/ExHdfsScan.h | 13 +-
core/sql/executor/ExSMTrace.cpp | 6 +-
core/sql/executor/ExStats.cpp | 3097 +++++--------
core/sql/executor/ExStats.h | 623 +--
core/sql/executor/HBaseClient_JNI.cpp | 50 +-
core/sql/executor/HBaseClient_JNI.h | 3 +-
core/sql/executor/HdfsLogger.h | 2 +-
core/sql/executor/JavaObjectInterface.cpp | 2 +-
core/sql/executor/ex_control.cpp | 8 +-
core/sql/executor/ex_exe_stmt_globals.h | 3 -
core/sql/executor/ex_frag_rt.cpp | 16 +-
core/sql/executor/ex_hash_grby.h | 3 -
core/sql/executor/ex_root.cpp | 38 -
core/sql/executor/ex_sort.cpp | 6 +
core/sql/executor/ex_transaction.cpp | 15 +-
core/sql/executor/hiveHook.cpp | 3 +-
core/sql/exp/ExpError.h | 4 +-
core/sql/exp/ExpErrorEnums.h | 25 +
core/sql/exp/ExpHbaseDefs.h | 2 +
core/sql/exp/ExpHbaseInterface.cpp | 16 +-
core/sql/exp/ExpHbaseInterface.h | 8 +-
core/sql/exp/ExpLOB.cpp | 94 +-
core/sql/exp/ExpLOB.h | 14 +-
core/sql/exp/ExpLOBaccess.cpp | 359 +-
core/sql/exp/ExpLOBaccess.h | 42 +-
core/sql/exp/ExpLOBenums.h | 2 +
core/sql/exp/ExpLOBexternal.h | 1 +
core/sql/exp/ExpLOBinterface.cpp | 6 +-
core/sql/exp/ExpLOBinterface.h | 3 +
core/sql/exp/ExpLOBprocess.cpp | 2 +-
core/sql/exp/ExpPackDefs.cpp | 15 +
core/sql/exp/exp_clause.cpp | 21 +
core/sql/exp/exp_clause.h | 5 +-
core/sql/exp/exp_datetime.cpp | 72 +-
core/sql/exp/exp_datetime.h | 21 +
core/sql/exp/exp_function.cpp | 297 +-
core/sql/exp/exp_function.h | 94 +
core/sql/exp/exp_math_func.cpp | 19 +-
core/sql/export/ComDiags.cpp | 6 +-
core/sql/export/ComDiags.h | 2 +-
core/sql/export/ExceptionCallBack.h | 6 +-
core/sql/export/NAAbort.cpp | 16 +-
core/sql/generator/GenExpGenerator.cpp | 161 +-
core/sql/generator/GenExpGenerator.h | 57 +-
core/sql/generator/GenItemFunc.cpp | 36 +-
core/sql/generator/GenKey.cpp | 140 +-
core/sql/generator/GenPreCode.cpp | 113 +-
core/sql/generator/GenRelExeUtil.cpp | 206 +-
core/sql/generator/GenRelMisc.cpp | 19 +-
core/sql/generator/GenRelScan.cpp | 273 +-
core/sql/generator/GenRelUpdate.cpp | 140 +-
core/sql/generator/GenShape.cpp | 4 +-
core/sql/generator/Generator.cpp | 1 +
core/sql/generator/LmExpr.cpp | 6 +-
core/sql/langman/LmLangManagerJava.cpp | 2 +-
core/sql/lib_mgmt/Makefile | 4 +-
core/sql/lib_mgmt/README.rst | 2 +-
core/sql/lib_mgmt/pom.xml | 2 +-
.../java/org/trafodion/libmgmt/FileMgmt.java | 2 +-
.../lib_mgmt/src/main/resources/init_libmgmt.sh | 2 +-
core/sql/nskgmake/Makerules.linux | 30 +-
core/sql/nskgmake/Makerules.mk | 10 +-
core/sql/nskgmake/cli/Makefile | 2 +-
core/sql/nskgmake/clitest/Makefile | 2 +-
core/sql/nskgmake/common/Makefile | 4 +
core/sql/nskgmake/tdm_sqlexp/Makefile | 14 +-
core/sql/optimizer/BindItemExpr.cpp | 195 +-
core/sql/optimizer/BindRelExpr.cpp | 395 +-
core/sql/optimizer/BindWA.h | 13 +-
core/sql/optimizer/ColStatDesc.cpp | 96 +
core/sql/optimizer/ColStatDesc.h | 25 +-
core/sql/optimizer/ImplRule.cpp | 30 +-
core/sql/optimizer/Inlining.cpp | 88 +-
core/sql/optimizer/ItemExpr.cpp | 45 +-
core/sql/optimizer/ItemFunc.h | 13 +-
core/sql/optimizer/NAColumn.h | 9 +-
core/sql/optimizer/NAFileSet.cpp | 7 +
core/sql/optimizer/NAFileSet.h | 2 +-
core/sql/optimizer/NATable.cpp | 154 +-
core/sql/optimizer/NATable.h | 22 +-
core/sql/optimizer/NormRelExpr.cpp | 529 ++-
core/sql/optimizer/ObjectNames.cpp | 10 +
core/sql/optimizer/ObjectNames.h | 3 +
core/sql/optimizer/OptLogRelExpr.cpp | 77 +-
core/sql/optimizer/OptPhysRelExpr.cpp | 13 +-
core/sql/optimizer/RETDesc.cpp | 44 +-
core/sql/optimizer/RelExeUtil.cpp | 174 +-
core/sql/optimizer/RelExeUtil.h | 84 +-
core/sql/optimizer/RelExpr.cpp | 430 +-
core/sql/optimizer/RelExpr.h | 16 +-
core/sql/optimizer/RelGrby.h | 5 +-
core/sql/optimizer/RelJoin.h | 7 +-
core/sql/optimizer/RelMisc.h | 188 +-
core/sql/optimizer/RelRoutine.cpp | 150 +-
core/sql/optimizer/RelRoutine.h | 77 +-
core/sql/optimizer/RelScan.h | 14 +-
core/sql/optimizer/RelSequence.cpp | 9 +-
core/sql/optimizer/RelSet.h | 5 +-
core/sql/optimizer/RelUpdate.h | 86 +-
core/sql/optimizer/SynthType.cpp | 140 +-
core/sql/optimizer/TransRule.cpp | 5 +-
core/sql/optimizer/UdfDllInteraction.cpp | 44 +-
core/sql/optimizer/VEGTable.cpp | 29 +-
core/sql/optimizer/ValueDesc.cpp | 8 +-
core/sql/optimizer/ValueDesc.h | 2 +-
core/sql/optimizer/costmethod.cpp | 4 +
core/sql/parser/BindStmtDDL.cpp | 4 +
core/sql/parser/ElemDDLConstraintPK.h | 37 +-
core/sql/parser/ElemDDLLikeOptions.cpp | 23 +
core/sql/parser/ElemDDLLikeOptions.h | 28 +
core/sql/parser/ElemDDLNode.cpp | 5 +
core/sql/parser/ElemDDLNode.h | 2 +
core/sql/parser/ElemDDLStoreOptions.cpp | 3 +-
core/sql/parser/ElemDDLStoreOptions.h | 14 +
core/sql/parser/ParDDLLikeOpts.cpp | 16 +
core/sql/parser/ParDDLLikeOptsCreateTable.h | 14 +-
core/sql/parser/ParKeyWords.cpp | 14 +-
core/sql/parser/SqlParserAux.cpp | 7 +-
core/sql/parser/SqlParserAux.h | 2 +
core/sql/parser/StmtDDLAlterTable.h | 18 +
core/sql/parser/StmtDDLCleanupObjects.h | 18 +
core/sql/parser/StmtDDLCreate.cpp | 7 +-
core/sql/parser/StmtDDLCreateTable.h | 42 +-
core/sql/parser/StmtDDLMisc.cpp | 4 +
core/sql/parser/sqlparser.y | 286 +-
core/sql/parser/ulexer.cpp | 7 +
core/sql/pom.xml | 7 +
core/sql/pom.xml.apache | 2 +-
core/sql/pom.xml.hdp | 2 +-
core/sql/qms/QmmQmm.cpp | 2 +-
core/sql/qmscommon/QRLogger.cpp | 6 +-
core/sql/qmscommon/QRLogger.h | 2 +-
core/sql/regress/compGeneral/DIFF042.KNOWN | 106 +-
core/sql/regress/compGeneral/EXPECTED005 | 54 +-
core/sql/regress/compGeneral/EXPECTED006.SB | 682 ++-
core/sql/regress/compGeneral/EXPECTED013.SB | 21 +-
core/sql/regress/compGeneral/EXPECTED042 | 785 ++--
core/sql/regress/compGeneral/EXPECTED045 | 91 +-
core/sql/regress/compGeneral/EXPECTED071 | 4 +-
core/sql/regress/compGeneral/FILTER042 | 6 +-
core/sql/regress/compGeneral/TEST006 | 115 +
core/sql/regress/compGeneral/TEST042 | 92 +-
core/sql/regress/compGeneral/TEST045 | 11 +
core/sql/regress/compGeneral/TEST071 | 4 +-
core/sql/regress/core/EXPECTED005.SB | 2 +-
core/sql/regress/core/EXPECTED061.SB | 10 +-
core/sql/regress/core/EXPECTED116 | 47 +-
core/sql/regress/core/EXPECTEDRTS | 2189 +++++----
core/sql/regress/core/FILTERRTS | 15 +-
core/sql/regress/core/TESTRTS | 11 +
core/sql/regress/executor/DIFF015.KNOWN | 24 +
core/sql/regress/executor/EXPECTED013.SB | 2 +-
core/sql/regress/executor/EXPECTED015.SB | 211 +-
core/sql/regress/executor/EXPECTED107 | 52 +
core/sql/regress/executor/EXPECTED130 | 316 +-
core/sql/regress/executor/EXPECTED140 | 75 +-
core/sql/regress/executor/FILTER140 | 1 +
core/sql/regress/executor/TEST015 | 77 +-
core/sql/regress/executor/TEST107 | 27 +
core/sql/regress/executor/TEST130 | 63 +-
core/sql/regress/executor/TEST130_argfile3 | 3 +
core/sql/regress/hive/EXPECTED005 | 149 +-
core/sql/regress/hive/EXPECTED007 | 373 ++
core/sql/regress/hive/EXPECTED009 | 62 +-
core/sql/regress/hive/EXPECTED015 | 254 +-
core/sql/regress/hive/EXPECTED018 | 522 ++-
core/sql/regress/hive/FILTER005 | 34 +
core/sql/regress/hive/FILTER015 | 3 +-
core/sql/regress/hive/FILTER018 | 3 +-
core/sql/regress/hive/TEST005 | 13 +
core/sql/regress/hive/TEST007 | 160 +
core/sql/regress/hive/TEST009 | 10 +-
core/sql/regress/newregr/mvqr/installMvqrSQ | 6 +-
core/sql/regress/newregr/mvqr/uninstallMvqrSQ | 2 +-
core/sql/regress/privs1/EXPECTED123 | 1187 +++++
core/sql/regress/privs1/EXPECTED141 | Bin 100853 -> 102260 bytes
core/sql/regress/privs1/TEST123 | 178 +
core/sql/regress/privs1/TEST141 | 10 +-
core/sql/regress/privs2/EXPECTED129 | 52 +-
core/sql/regress/privs2/EXPECTED138 | 6 +-
core/sql/regress/privs2/EXPECTED140 | 4 +-
core/sql/regress/privs2/EXPECTED144 | Bin 59408 -> 59453 bytes
core/sql/regress/privs2/FILTER144 | 31 +
core/sql/regress/qat/eqatdml12 | 36 +-
core/sql/regress/qat/eqatdml13 | 36 +-
core/sql/regress/seabase/DIFF025.KNOWN | 2 +-
core/sql/regress/seabase/EXPECTED012 | 22 +-
core/sql/regress/seabase/EXPECTED020 | 24 +-
core/sql/regress/seabase/EXPECTED022 | 872 +++-
core/sql/regress/seabase/EXPECTED027 | 2 +-
core/sql/regress/seabase/EXPECTED030 | 141 +-
core/sql/regress/seabase/EXPECTED032 | 17 +-
core/sql/regress/seabase/TEST022 | 284 +-
core/sql/regress/seabase/TEST030 | 28 +-
core/sql/regress/seabase/TEST032 | 4 +-
core/sql/regress/tools/dll-compile.ksh | 6 +-
core/sql/regress/tools/java-compile.ksh | 2 +-
core/sql/regress/tools/regress-filter-linux | 8 +-
core/sql/regress/tools/regrhadoop.ksh | 2 +-
core/sql/regress/tools/regrhbase.ksh | 2 +-
core/sql/regress/tools/regrhive.ksh | 2 +-
core/sql/regress/tools/runallsb | 8 +-
core/sql/regress/tools/runregr_compGeneral.ksh | 39 +-
core/sql/regress/tools/runregr_executor.ksh | 2 +-
core/sql/regress/tools/runregr_hive.ksh | 2 +-
core/sql/regress/tools/runregr_seabase.ksh | 2 +-
core/sql/regress/tools/runregr_udr.ksh | 4 +-
core/sql/regress/tools/setupenv | 4 +-
core/sql/regress/tools/setuplnxenv | 24 +-
core/sql/regress/udr/EXPECTED001 | 98 +-
core/sql/regress/udr/EXPECTED002 | 10 +-
core/sql/regress/udr/EXPECTED100.SB | 2 +-
core/sql/regress/udr/TEST001 | 31 +-
core/sql/regress/udr/TEST002 | 10 +-
core/sql/regress/udr/TEST107 | 4 +-
core/sql/regress/udr/TEST163 | 4 +-
core/sql/regress/udr/Utils.java | 4 +-
core/sql/regress/udr/tvudf.c | 2 +-
core/sql/runtimestats/SqlStats.cpp | 12 +
core/sql/runtimestats/SqlStats.h | 7 +-
core/sql/runtimestats/sscpipc.cpp | 12 +
core/sql/runtimestats/ssmpipc.cpp | 1 -
core/sql/smdio/CmUtil.cpp | 1 -
core/sql/sort/CommonStructs.h | 1 -
core/sql/sqlcat/TrafDDLdesc.h | 7 +-
core/sql/sqlcat/desc.h | 29 -
core/sql/sqlci/SqlCmd.cpp | 4 +
core/sql/sqlci/SqlciStats.cpp | 44 +-
core/sql/sqlci/sqlci_yacc.y | 57 +-
core/sql/sqlcomp/CmpDDLCatErrorCodes.h | 89 +-
core/sql/sqlcomp/CmpDescribe.cpp | 162 +-
core/sql/sqlcomp/CmpMain.cpp | 15 +
core/sql/sqlcomp/CmpSeabaseDDL.h | 40 +-
core/sql/sqlcomp/CmpSeabaseDDLauth.cpp | 103 +-
core/sql/sqlcomp/CmpSeabaseDDLauth.h | 1 +
core/sql/sqlcomp/CmpSeabaseDDLcleanup.cpp | 4 +-
core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp | 115 +-
core/sql/sqlcomp/CmpSeabaseDDLindex.cpp | 38 +-
core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp | 24 +-
core/sql/sqlcomp/CmpSeabaseDDLschema.cpp | 57 +-
core/sql/sqlcomp/CmpSeabaseDDLtable.cpp | 1911 ++++----
core/sql/sqlcomp/CmpSeabaseDDLupgrade.cpp | 7 +
core/sql/sqlcomp/CmpSeabaseDDLutil.cpp | 6 +-
core/sql/sqlcomp/CmpSeabaseDDLview.cpp | 273 +-
core/sql/sqlcomp/DefaultConstants.h | 24 +-
core/sql/sqlcomp/PrivMgr.cpp | 10 +-
core/sql/sqlcomp/PrivMgr.h | 5 +-
core/sql/sqlcomp/PrivMgrCommands.cpp | 65 +-
core/sql/sqlcomp/PrivMgrCommands.h | 6 +
core/sql/sqlcomp/PrivMgrPrivileges.cpp | 26 +-
core/sql/sqlcomp/PrivMgrPrivileges.h | 4 +-
core/sql/sqlcomp/PrivMgrRoles.cpp | 106 +-
core/sql/sqlcomp/nadefaults.cpp | 26 +-
core/sql/sqlmsg/GetErrorMessage.cpp | 2 +-
core/sql/sqlmxevents/logmxevent_traf.cpp | 150 +-
core/sql/sqlmxevents/logmxevent_traf.h | 7 +-
core/sql/sqludr/SqlUdrPredefLogReader.cpp | 4 +-
core/sql/sqludr/doxygen_tmudr.1.6.config | 2 +-
core/sql/sqludr/sqludr.cpp | 370 +-
core/sql/sqludr/sqludr.h | 20 +-
.../java/org/trafodion/sql/HBaseClient.java | 97 +-
.../main/java/org/trafodion/sql/HiveClient.java | 5 +-
.../org/trafodion/sql/TrafConfiguration.java | 2 +-
.../java/org/trafodion/sql/udr/ColumnInfo.java | 22 +-
.../sql/udr/ComparisonPredicateInfo.java | 15 +-
.../org/trafodion/sql/udr/ConstraintInfo.java | 13 +-
.../java/org/trafodion/sql/udr/OrderInfo.java | 4 +
.../trafodion/sql/udr/ParameterListInfo.java | 14 +-
.../org/trafodion/sql/udr/PartitionInfo.java | 6 +-
.../org/trafodion/sql/udr/PredicateInfo.java | 17 +-
.../sql/udr/TMUDRSerializableObject.java | 72 +-
.../java/org/trafodion/sql/udr/TableInfo.java | 14 +-
.../java/org/trafodion/sql/udr/TupleInfo.java | 256 +-
.../java/org/trafodion/sql/udr/TypeInfo.java | 117 +-
.../main/java/org/trafodion/sql/udr/UDR.java | 103 +-
.../trafodion/sql/udr/UDRInvocationInfo.java | 39 +-
.../java/org/trafodion/sql/udr/UDRPlanInfo.java | 38 +-
.../org/trafodion/sql/udr/predef/JDBCUDR.java | 6 +-
.../org/trafodion/sql/ustat/ChgAutoList.java | 2 +-
.../java/org/trafodion/sql/ustat/UstatUtil.java | 4 +-
core/sql/udrserv/UdrCfgParser.cpp | 2 +-
core/sql/udrserv/spinfoCallback.cpp | 2 +-
core/sql/udrserv/udrload.cpp | 2 +-
core/sql/udrserv/udrserv.cpp | 2 +-
core/sql/ustat/FillAutoTbl.sh | 4 +-
core/sql/ustat/RunLogUstats.sh | 2 +-
core/sql/ustat/StopAutoStats.sh | 2 +-
core/sql/ustat/USAS.sh | 16 +-
core/sql/ustat/hs_cli.cpp | 27 +-
core/sql/ustat/hs_cli.h | 3 +
core/sql/ustat/hs_const.h | 1 +
core/sql/ustat/hs_globals.cpp | 50 +-
core/sql/ustat/hs_la.cpp | 31 +-
core/sql/ustat/hs_la.h | 27 +-
core/sql/ustat/hs_log.cpp | 7 +-
core/sql/ustat/hs_parser.cpp | 13 +
core/sql/ustat/hs_util.cpp | 4 +-
core/sql/ustat/stats_profile | 8 +-
core/trafodion.spec | 29 +-
dcs/Makefile | 2 +-
dcs/bin/dcs | 12 +-
dcs/bin/dcs-config.sh | 6 +-
dcs/conf/dcs-env.sh | 14 +-
dcs/genvers | 2 +-
.../main/asciidoc/_chapters/configuration.adoc | 2 +-
.../asciidoc/_chapters/getting_started.adoc | 2 +-
.../org/trafodion/dcs/server/ServerManager.java | 2 +-
.../trafodion/dcs/servermt/ServerManager.java | 14 +-
.../org/trafodion/dcs/util/RetryCounter.java | 2 +-
.../org/trafodion/jdbc_test/TestNumeric.java | 114 +
dcs/src/test/odbc/README.txt | 47 +
dcs/src/test/odbc/build/Makefile | 43 +
dcs/src/test/odbc/build/odbc.vcxproj | 157 +
dcs/src/test/odbc/build/odbc.vcxproj.filters | 40 +
dcs/src/test/odbc/src/Main.cpp | 57 +
dcs/src/test/odbc/src/common/Global.cpp | 116 +
dcs/src/test/odbc/src/common/Global.h | 60 +
dcs/src/test/odbc/src/common/TestBase.cpp | 263 ++
dcs/src/test/odbc/src/common/TestBase.h | 55 +
.../src/test/varchar32k/LargeVarcharCol.cpp | 2639 +++++++++++
.../odbc/src/test/varchar32k/LargeVarcharCol.h | 52 +
.../src/asciidoc/_chapters/ddl_msgs.adoc | 628 +--
.../src/asciidoc/_chapters/executor_msgs.adoc | 15 +
.../src/asciidoc/_chapters/about.adoc | 2 +-
.../src/asciidoc/_chapters/activate.adoc | 4 +-
.../src/asciidoc/_chapters/ambari_install.adoc | 92 +
.../src/asciidoc/_chapters/enable_security.adoc | 20 +-
.../src/asciidoc/_chapters/introduction.adoc | 28 +-
.../src/asciidoc/_chapters/prepare.adoc | 136 +-
.../src/asciidoc/_chapters/quickstart.adoc | 8 +-
.../src/asciidoc/_chapters/recipe_install.adoc | 29 -
.../src/asciidoc/_chapters/recipe_upgrade.adoc | 30 -
.../src/asciidoc/_chapters/requirements.adoc | 159 +-
.../src/asciidoc/_chapters/script_install.adoc | 2 -
.../src/asciidoc/_chapters/script_remove.adoc | 2 +-
.../src/asciidoc/_chapters/script_upgrade.adoc | 6 +-
docs/provisioning_guide/src/asciidoc/index.adoc | 4 +-
.../sql_functions_and_expressions.adoc | 286 +-
.../_chapters/sql_language_elements.adoc | 134 +-
.../src/asciidoc/_chapters/sql_statements.adoc | 437 +-
docs/src/site/markdown/architecture-overview.md | 2 +-
docs/src/site/markdown/management.md | 6 +-
.../site/markdown/traf_authentication_config.md | 8 +-
install/.gitignore | 5 +
install/Makefile | 39 +-
install/README.md | 81 +
install/ambari-installer/Makefile | 87 +
install/ambari-installer/meta.template | 34 +
.../mpack-install/am_install.sh | 56 +
install/ambari-installer/mpack.json | 46 +
install/ambari-installer/repo.template | 24 +
.../TRAFODION/2.1/configuration/dcs-env.xml | 150 +
.../TRAFODION/2.1/configuration/dcs-log4j.xml | 107 +
.../TRAFODION/2.1/configuration/dcs-site.xml | 271 ++
.../TRAFODION/2.1/configuration/rest-site.xml | 157 +
.../2.1/configuration/traf-cluster-env.xml | 41 +
.../2.1/configuration/trafodion-env.xml | 252 +
.../common-services/TRAFODION/2.1/metainfo.xml | 165 +
.../TRAFODION/2.1/package/scripts/params.py | 95 +
.../2.1/package/scripts/status_params.py | 23 +
.../2.1/package/scripts/trafodiondcs.py | 60 +
.../2.1/package/scripts/trafodionmaster.py | 186 +
.../2.1/package/scripts/trafodionnode.py | 217 +
.../TRAFODION/2.1/role_command_order.json | 21 +
.../TRAFODION/2.1/service_advisor.py | 255 +
.../TRAFODION/2.1/themes/theme.json | 192 +
install/ambari-installer/traf_ambari.spec | 76 +
install/installer/addNode_step1 | 8 +-
install/installer/addNode_step2 | 28 +-
install/installer/bashrc_default | 7 +-
install/installer/dcs_installer | 47 +-
install/installer/rest_installer | 29 +-
install/installer/traf_add_kerberos | 2 +-
install/installer/traf_add_ldap | 16 +-
.../installer/traf_authentication_conf_default | 4 +-
install/installer/traf_cloudera_mods | 2 +-
install/installer/traf_config | 30 +-
install/installer/traf_config_check | 4 +-
install/installer/traf_config_setup | 12 +-
install/installer/traf_hortonworks_mods | 10 -
install/installer/traf_secure | 20 +-
install/installer/traf_sqgen | 10 +-
install/installer/traf_start | 18 +-
install/installer/trafodion_config_default | 2 +-
install/installer/trafodion_install | 6 +-
install/installer/trafodion_uninstaller | 8 +-
install/python-installer/README.md | 2 +-
install/python-installer/apache_mods.py | 72 -
install/python-installer/bashrc.template | 79 -
install/python-installer/common.py | 478 --
.../configs/db_config_default.ini | 128 +
.../python-installer/configs/default_ports.ini | 25 +
install/python-installer/configs/mod_cfgs.json | 59 +
install/python-installer/configs/prompt.json | 236 +
install/python-installer/configs/script.json | 87 +
install/python-installer/configs/version.json | 10 +
install/python-installer/copy_files.py | 64 -
install/python-installer/db_config_default | 120 -
install/python-installer/db_install.py | 138 +-
install/python-installer/db_uninstall.py | 114 +
install/python-installer/dcs_setup.py | 114 -
install/python-installer/discovery.py | 12 +-
install/python-installer/hadoop_mods.py | 203 -
install/python-installer/hdfs_cmds.py | 68 -
install/python-installer/mod_cfgs.json | 73 -
install/python-installer/prettytable.py | 1475 ++++++
install/python-installer/prompt.json | 227 -
install/python-installer/script.json | 87 -
install/python-installer/scripts/__init__.py | 0
install/python-installer/scripts/apache_mods.py | 72 +
install/python-installer/scripts/common.py | 534 +++
install/python-installer/scripts/copy_files.py | 76 +
install/python-installer/scripts/dcs_setup.py | 105 +
install/python-installer/scripts/hadoop_mods.py | 184 +
install/python-installer/scripts/hdfs_cmds.py | 68 +
.../scripts/httplib2/__init__.py | 1714 +++++++
.../scripts/httplib2/iri2uri.py | 132 +
.../python-installer/scripts/httplib2/socks.py | 438 ++
install/python-installer/scripts/traf_check.py | 87 +
install/python-installer/scripts/traf_dep.py | 106 +
.../python-installer/scripts/traf_discover.py | 269 ++
.../python-installer/scripts/traf_kerberos.py | 118 +
install/python-installer/scripts/traf_ldap.py | 72 +
.../python-installer/scripts/traf_package.py | 50 +
install/python-installer/scripts/traf_setup.py | 137 +
.../python-installer/scripts/traf_sqconfig.py | 77 +
install/python-installer/scripts/traf_start.py | 80 +
install/python-installer/scripts/traf_user.py | 158 +
install/python-installer/scripts/wrapper.py | 274 ++
.../traf_authentication_conf.template | 71 -
install/python-installer/traf_check.py | 87 -
install/python-installer/traf_dep.py | 110 -
install/python-installer/traf_discover.py | 253 -
install/python-installer/traf_kerberos.py | 116 -
install/python-installer/traf_ldap.py | 73 -
install/python-installer/traf_package.py | 47 -
install/python-installer/traf_setup.py | 125 -
install/python-installer/traf_sqconfig.py | 74 -
install/python-installer/traf_start.py | 70 -
install/python-installer/traf_user.py | 146 -
install/python-installer/version.json | 10 -
install/python-installer/wrapper.py | 301 --
licenses/Makefile | 7 +-
licenses/lic-pyinstall-src | 63 +
licenses/lic-server-src | 29 +-
tests/phx/README.rst | 4 +-
tests/phx/phoenix_test.py | 6 +-
tests/phx/pom.xml.template | 8 +-
win-odbc64/odbcclient/drvr35/cdesc.cpp | 25 +-
win-odbc64/odbcclient/drvr35/cdesc.h | 6 +-
win-odbc64/odbcclient/drvr35/cdiag.cpp | 12 +-
win-odbc64/odbcclient/drvr35/ctosqlconv.cpp | 43 +-
win-odbc64/odbcclient/drvr35/ctosqlconv.h | 2 +-
win-odbc64/odbcclient/drvr35/sqltocconv.cpp | 454 +-
wms/conf/wms-env.sh | 6 +-
919 files changed, 69957 insertions(+), 43842 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9523fd2b/core/sqf/export/include/common/evl_sqlog_eventnum.h
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9523fd2b/core/sqf/monitor/linux/clusterconf.cxx
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/clusterconf.cxx
index 1c9fde9,7137e50..3f96015
mode 100644,100755..100644
--- a/core/sqf/monitor/linux/clusterconf.cxx
+++ b/core/sqf/monitor/linux/clusterconf.cxx
@@@ -502,146 -610,48 +502,146 @@@ bool CClusterConfig::DeleteDbUniqueStri
}
else
{
- return( false );
+ sqlite3_bind_int( prepStmtA, 1, nid );
+
+ rc = sqlite3_step( prepStmtA );
+ if (( rc != SQLITE_DONE ) && ( rc != SQLITE_ROW )
+ && ( rc != SQLITE_CONSTRAINT ) )
+ {
+ rs = false;
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf), "[%s] delete from monRegUniqueStrings "
+ "value (nid=%d) failed, error=%s (%d)\n"
+ , method_name
+ , nid
+ , sqlite3_errmsg(db_), rc );
+ mon_log_write( MON_CLUSTERCONF_DELETEDBUSTRING_2, SQ_LOG_ERR, buf );
+ }
}
-
+
+ if ( prepStmtA != NULL )
+ sqlite3_finalize( prepStmtA );
+
TRACE_EXIT;
- return( true );
+ return( rs );
}
-bool CClusterConfig::ParsePNid( void )
+// The following method maps the 'sqconfig' text file persist section's
+// <persist-key>_PROCESS_TYPE string value to the internal
+// PROCESSTYPE enum value
+PROCESSTYPE CClusterConfig::GetProcessType( const char *processtype )
{
- int pnid;
- const char method_name[] = "CClusterConfig::ParsePNid";
- TRACE_ENTRY;
-
- // Token: PNID
- cmdTail_ = GetToken( cmdTail_, token_, &delimiter_ );
- if ( strlen( token_ ) >= 1 )
+ if (strcmp( "DTM", processtype) == 0)
{
- if ( isdigit( *token_ ) )
- {
- pnid = atoi( token_ );
- if ( currPNid_ != pnid )
- {
- if ( ! spareNode_ && excludedNid_ && excludedProcessor_ )
- {
- excludedCores_ = true;
- prevExcludedCoreMask_ = excludedCoreMask_;
- CPU_ZERO( &excludedCoreMask_ );
- excludedNid_ = excludedProcessor_ = false;
- }
- prevPNid_ = currPNid_;
- currPNid_ = pnid;
- gatherSpares_ = newPNodeConfig_ = true;
- }
- }
- else
+ return(ProcessType_DTM);
+ }
+ else if (strcmp( "GENERIC", processtype) == 0)
+ {
+ return(ProcessType_Generic);
+ }
+ else if (strcmp( "WDG", processtype) == 0)
+ {
+ return(ProcessType_Watchdog);
+ }
+ else if (strcmp( "MXOSRVR", processtype) == 0)
+ {
+ return(ProcessType_MXOSRVR);
+ }
+ else if (strcmp( "SPX", processtype) == 0)
+ {
+ return(ProcessType_SPX);
+ }
+ else if (strcmp( "SSMP", processtype) == 0)
+ {
+ return(ProcessType_SSMP);
+ }
+ else if (strcmp( "PSD", processtype) == 0)
+ {
+ return(ProcessType_PSD);
+ }
+ else if (strcmp( "SMS", processtype) == 0)
+ {
+ return(ProcessType_SMS);
+ }
+ else if (strcmp( "TMID", processtype) == 0)
+ {
+ return(ProcessType_TMID);
+ }
+ else if (strcmp( "PERSIST", processtype) == 0)
+ {
+ return(ProcessType_PERSIST);
+ }
+
+ return(ProcessType_Undefined);
+}
+
+bool CClusterConfig::Initialize( void )
+{
+ const char method_name[] = "CClusterConfig::Initialize";
+ TRACE_ENTRY;
+
+ if ( db_ != NULL )
+ {
+ // Already initialized
+ return( true );
+ }
+
+ char dbase[MAX_PROCESS_PATH];
+
+ // Open the configuration database file
+ char *configenv = getenv("SQ_CONFIGDB");
+ if (configenv != NULL)
+ {
+ snprintf( dbase, sizeof(dbase), "%s", configenv);
+ }
+ else
+ {
+ snprintf( dbase, sizeof(dbase)
- , "%s/sql/scripts/sqconfig.db", getenv("MY_SQROOT"));
++ , "%s/sql/scripts/sqconfig.db", getenv("TRAF_HOME"));
+ }
+ int rc = sqlite3_open_v2( dbase, &db_
+ , SQLITE_OPEN_READWRITE | SQLITE_OPEN_FULLMUTEX
+ , NULL);
+ if ( rc )
+ {
+ db_ = NULL;
+
+ // See if database is in current directory
+ int rc2 = sqlite3_open_v2( "sqconfig.db", &db_
+ , SQLITE_OPEN_READWRITE | SQLITE_OPEN_FULLMUTEX
+ , NULL);
+ if ( rc2 )
{
- return( false );
+ char la_buf[MON_STRING_BUF_SIZE];
+ snprintf( la_buf, sizeof(la_buf)
+ , "[%s], Can't open configuration database %s, %s\n"
+ , method_name, dbase, sqlite3_errmsg(db_) );
+ mon_log_write( MON_CLUSTERCONF_INIT_1, SQ_LOG_CRIT, la_buf );
}
}
- else
+
+ if ( db_ != NULL )
{
- return( false );
+ rc = sqlite3_busy_timeout(db_, 1000);
+ if ( rc )
+ {
+ char la_buf[MON_STRING_BUF_SIZE];
+ snprintf( la_buf, sizeof(la_buf)
+ , "[%s] Can't set busy timeout for database %s, %s\n"
+ , method_name, dbase, sqlite3_errmsg(db_) );
+ mon_log_write( MON_CLUSTERCONF_INIT_2, SQ_LOG_ERR, la_buf );
+ }
+
+ char *sErrMsg = NULL;
+ sqlite3_exec(db_, "PRAGMA synchronous = OFF", NULL, NULL, &sErrMsg);
+ if (sErrMsg != NULL)
+ {
+ char la_buf[MON_STRING_BUF_SIZE];
+ snprintf( la_buf, sizeof(la_buf)
+ , "[%s] Can't set PRAGMA synchronous for database %s, %s\n"
+ , method_name, dbase, sErrMsg );
+ mon_log_write( MON_CLUSTERCONF_INIT_3, SQ_LOG_ERR, la_buf );
+ }
}
TRACE_EXIT;
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9523fd2b/core/sqf/monitor/linux/macros.gmk
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/macros.gmk
index 051e9df,e5324f1..e5324f1
mode 100644,100755..100644
--- a/core/sqf/monitor/linux/macros.gmk
+++ b/core/sqf/monitor/linux/macros.gmk
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9523fd2b/core/sqf/monitor/linux/makefile
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/makefile
index 0660414,614b945..e5b6a03
mode 100644,100755..100644
--- a/core/sqf/monitor/linux/makefile
+++ b/core/sqf/monitor/linux/makefile
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9523fd2b/core/sqf/monitor/linux/monitor.cxx
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9523fd2b/core/sqf/monitor/linux/monlogging.cxx
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9523fd2b/core/sqf/monitor/linux/pnode.cxx
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/pnode.cxx
index 4cacc7a,e1f620a..4fc35e6
mode 100644,100755..100644
--- a/core/sqf/monitor/linux/pnode.cxx
+++ b/core/sqf/monitor/linux/pnode.cxx
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9523fd2b/core/sqf/monitor/linux/pnodeconfig.cxx
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/pnodeconfig.cxx
index dcd67aa,f91c9d1..9d5b740
mode 100644,100755..100644
--- a/core/sqf/monitor/linux/pnodeconfig.cxx
+++ b/core/sqf/monitor/linux/pnodeconfig.cxx
@@@ -565,3 -410,52 +565,58 @@@ void CPNodeConfigContainer::GetSpareNod
TRACE_EXIT;
}
-int CPNodeConfigContainer::hostnamecmp(const char *p_str1,
- const char *p_str2)
++int CPNodeConfigContainer::hostnamecmp( const char *p_str1, const char *p_str2 )
+ {
- static bool sb_first_time = true;
- static bool sb_strict_hostname_check = false;
- if (sb_first_time) {
- sb_first_time = false;
- char *lv_envvar=getenv("MON_STRICT_HOSTNAME_CHECK");
-
- if (lv_envvar && (atoi(lv_envvar) == 1)) {
- sb_strict_hostname_check = true;
++ static bool sb_first_time = true;
++ static bool sb_strict_hostname_check = false;
++ if ( sb_first_time )
++ {
++ sb_first_time = false;
++ char *lv_envvar=getenv( "MON_STRICT_HOSTNAME_CHECK" );
++
++ if ( lv_envvar && (atoi( lv_envvar ) == 1) )
++ {
++ sb_strict_hostname_check = true;
++ }
++ }
++
++ if ( !p_str1 ) return 1;
++ if ( !p_str2 ) return 1;
++
++ int lv_ret = strcmp( p_str1, p_str2 );
++ if ( lv_ret == 0 )
++ {
++ return lv_ret;
++ }
++ if ( sb_strict_hostname_check )
++ {
++ return lv_ret;
++ }
++
++ char lv_str1_to_cmp[1024];
++ char lv_str2_to_cmp[1024];
++ memset( lv_str1_to_cmp, 0, 1024 );
++ memset( lv_str2_to_cmp, 0, 1024 );
++
++ char *lp_str1_dot = strchr( (char *) p_str1, '.' );
++ if ( lp_str1_dot )
++ {
++ memcpy( lv_str1_to_cmp, p_str1, lp_str1_dot - p_str1 );
++ }
++ else
++ {
++ strcpy( lv_str1_to_cmp, p_str1 );
++ }
++
++ char *lp_str2_dot = strchr( (char *) p_str2, '.' );
++ if ( lp_str2_dot )
++ {
++ memcpy( lv_str2_to_cmp, p_str2, lp_str2_dot - p_str2 );
++ }
++ else
++ {
++ strcpy( lv_str2_to_cmp, p_str2 );
+ }
- }
-
- if (!p_str1) return 1;
- if (!p_str2) return 1;
-
- int lv_ret = strcmp(p_str1, p_str2);
- if (lv_ret == 0) {
- return lv_ret;
- }
- if (sb_strict_hostname_check) {
- return lv_ret;
- }
-
- char lv_str1_to_cmp[1024];
- char lv_str2_to_cmp[1024];
- memset(lv_str1_to_cmp, 0, 1024);
- memset(lv_str2_to_cmp, 0, 1024);
-
- char *lp_str1_dot = strchr((char *) p_str1, '.');
- if (lp_str1_dot) {
- memcpy(lv_str1_to_cmp, p_str1, lp_str1_dot - p_str1);
- }
- else {
- strcpy(lv_str1_to_cmp, p_str1);
- }
-
- char *lp_str2_dot = strchr((char *) p_str2, '.');
- if (lp_str2_dot) {
- memcpy(lv_str2_to_cmp, p_str2, lp_str2_dot - p_str2);
- }
- else {
- strcpy(lv_str2_to_cmp, p_str2);
- }
-
- return strcmp(lv_str1_to_cmp, lv_str2_to_cmp);
+
++ return strcmp( lv_str1_to_cmp, lv_str2_to_cmp );
+ }
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9523fd2b/core/sqf/monitor/linux/pnodeconfig.h
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/pnodeconfig.h
index f0992cd,d4e59c2..d239513
mode 100644,100755..100644
--- a/core/sqf/monitor/linux/pnodeconfig.h
+++ b/core/sqf/monitor/linux/pnodeconfig.h
@@@ -35,22 -35,15 +35,23 @@@ typedef list<CPNodeConfig *> PNodesCo
class CPNodeConfigContainer
{
public:
- CPNodeConfigContainer( void );
+ CPNodeConfigContainer( int pnodesConfigMax );
~CPNodeConfigContainer( void );
- static int hostnamecmp(const char *p_str1, const char *p_str2);
- CPNodeConfig *AddPNodeConfig( int pnid, char *name, bool spare );
+ CPNodeConfig *AddPNodeConfig( int pnid
+ , char *name
+ , int excludedFirstCore
+ , int excludedLastCore
+ , bool spare );
+ void Clear( void );
++ static int hostnamecmp(const char *p_str1, const char *p_str2);
void DeletePNodeConfig( CPNodeConfig *pnodeConfig );
inline CPNodeConfig *GetFirstPNodeConfig( void ) { return ( head_ ); }
+ inline int GetNextPNid( void ) { return ( nextPNid_ ); }
int GetPNid( char *nodename );
+ CPNodeConfig *GetPNodeConfig( char *nodename );
CPNodeConfig *GetPNodeConfig( int pnid );
+ inline int GetPNodesConfigMax( void ) { return ( pnodesConfigMax_ ); }
inline int GetPNodesCount( void ) { return ( pnodesCount_ ); }
inline int GetSNodesCount( void ) { return ( snodesCount_ ); }
inline PNodesConfigList_t *GetSpareNodesConfigList( void ) { return ( &spareNodesConfigList_ ); }
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9523fd2b/core/sqf/monitor/linux/process.cxx
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/process.cxx
index eface3b,0ebe54c..a2eef47
mode 100644,100755..100644
--- a/core/sqf/monitor/linux/process.cxx
+++ b/core/sqf/monitor/linux/process.cxx
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9523fd2b/core/sqf/monitor/linux/process.h
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/process.h
index 3a63197,957f218..d6a56bd
mode 100644,100755..100644
--- a/core/sqf/monitor/linux/process.h
+++ b/core/sqf/monitor/linux/process.h
@@@ -460,9 -457,8 +460,9 @@@ private
string program_; // object file name
strId_t pathStrId_;
strId_t ldpathStrId_;
+ bool firstInstance_; // reset on persistent process re-creation
bool cmpOrEsp_;
- string sqRoot_; // MY_SQROOT passed to object file
+ string sqRoot_; // TRAF_HOME passed to object file
string infile_; // process's stdin
string outfile_; // process's stdout
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9523fd2b/core/sqf/monitor/linux/pstartd.cxx
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/pstartd.cxx
index 4f36e11,c09ba65..da72c8b
mode 100644,100755..100644
--- a/core/sqf/monitor/linux/pstartd.cxx
+++ b/core/sqf/monitor/linux/pstartd.cxx
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9523fd2b/core/sqf/monitor/linux/reqqueue.cxx
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/reqqueue.cxx
index 196f490,2684633..e681e34
--- a/core/sqf/monitor/linux/reqqueue.cxx
+++ b/core/sqf/monitor/linux/reqqueue.cxx
@@@ -2464,9 -2164,21 +2464,23 @@@ void CIntSnapshotReq::performRequest(
abort();
}
++#if 0
+ // copy sqconfig.db
+ char cmd[256];
+ sprintf(cmd, "pdcp -p -w %s %s/sql/scripts/sqconfig.db %s/sql/scripts/.", Monitor->GetIntegratingNode()->GetName(),
+ getenv("TRAF_HOME"), getenv("TRAF_HOME") );
+
+ error = system(cmd);
+
+ if (trace_settings & TRACE_REQUEST)
+ trace_printf("%s@%d - Copied config.db (%s) Error = %d\n", method_name, __LINE__, cmd, error);
+
+ mem_log_write(MON_REQQUEUE_SNAPSHOT_3, error);
-
++#endif
++
// estimate size of snapshot buffer
// about 100 bytes per process, 1.5 times total
- int procSize = Nodes->ProcessCount() * 1.5 * 100;
+ int procSize = Nodes->ProcessCount() * 1.75 * 100;
int spareNodeSize = Nodes->GetSpareNodesList()->size() * sizeof(int); // pnids
if (trace_settings & (TRACE_REQUEST | TRACE_INIT | TRACE_RECOVERY))
[27/50] [abbrv] incubator-trafodion git commit: Merge remote branch
'origin/master' into TRAFODION-2001
Posted by su...@apache.org.
Merge remote branch 'origin/master' into TRAFODION-2001
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/51756530
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/51756530
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/51756530
Branch: refs/heads/master
Commit: 5175653088a34225f48843ac147dd60ee65efb19
Parents: cf2aece 0cf28ae
Author: Zalo Correa <za...@esgyn.com>
Authored: Thu Nov 10 13:07:14 2016 -0800
Committer: Zalo Correa <za...@esgyn.com>
Committed: Thu Nov 10 13:07:14 2016 -0800
----------------------------------------------------------------------
.rat-excludes | 6 +-
.../jdbcT4/src/main/samples/t4jdbc.properties | 2 +-
core/conn/odb/build.bat | 29 +-
core/conn/odb/installer.iss | 134 +
core/conn/odb/odb/odb.rc | Bin 5124 -> 5120 bytes
core/conn/odb/odb/resource.h | 14 +
.../odbc/src/odbc/nsksrvrcore/srvrothers.cpp | 2 +
.../src/org/trafodion/ci/UserInterface.java | 11 +-
.../export/include/common/evl_sqlog_eventnum.h | 2 +
core/sqf/monitor/linux/cluster.cxx | 30 +-
core/sqf/monitor/linux/zclient.cxx | 98 +-
core/sqf/monitor/linux/zclient.h | 2 +-
core/sqf/sqenvcom.sh | 2 +-
core/sqf/sql/scripts/install_local_hadoop | 2 +-
core/sqf/sql/scripts/pstat | 2 +-
.../hbase/client/transactional/RMInterface.java | 14 +-
.../client/transactional/TransactionState.java | 41 +-
.../java/org/trafodion/dtm/HBaseTxClient.java | 27 +-
core/sql/arkcmp/CmpContext.cpp | 73 +-
core/sql/arkcmp/CmpContext.h | 15 +-
core/sql/arkcmp/CmpSqlSession.h | 2 +-
core/sql/arkcmp/CmpStatement.cpp | 39 +
core/sql/arkcmp/CmpStatement.h | 33 +-
core/sql/bin/SqlciErrors.txt | 4 +
core/sql/cli/Cli.cpp | 57 +-
core/sql/cli/Cli.h | 9 +-
core/sql/cli/CliExtern.cpp | 81 +-
core/sql/cli/Context.cpp | 208 +-
core/sql/cli/Context.h | 31 +-
core/sql/cli/SQLCLIdev.h | 7 +
core/sql/comexe/ComTdbExeUtil.cpp | 15 +
core/sql/comexe/ComTdbExeUtil.h | 36 +-
core/sql/comexe/ComTdbHdfsScan.h | 8 +-
core/sql/common/ComSecurityKey.cpp | 82 +
core/sql/common/ComSecurityKey.h | 5 +
core/sql/common/ComSmallDefs.h | 4 +-
core/sql/common/ComSqlId.cpp | 4 +-
core/sql/common/ComSqlId.h | 4 +-
core/sql/common/NAMemory.cpp | 5 +
core/sql/common/NAMemory.h | 8 +-
core/sql/common/NAType.cpp | 17 +-
core/sql/common/NAType.h | 4 +-
core/sql/common/OperTypeEnum.h | 7 +
core/sql/executor/ExExeUtil.h | 9 +-
core/sql/executor/ExExeUtilMisc.cpp | 18 +
core/sql/executor/ExExeUtilVolTab.cpp | 110 +-
core/sql/executor/ExHdfsScan.cpp | 179 +-
core/sql/executor/ExHdfsScan.h | 7 +
core/sql/exp/ExpPackDefs.cpp | 22 +-
core/sql/exp/exp_clause.cpp | 24 +
core/sql/exp/exp_clause.h | 6 +-
core/sql/exp/exp_function.cpp | 145 +
core/sql/exp/exp_function.h | 116 +
core/sql/export/NAStringDef.cpp | 7 +
core/sql/export/NAStringDef.h | 1 +
core/sql/generator/GenExplain.cpp | 4 -
core/sql/generator/GenItemFunc.cpp | 36 +
core/sql/generator/GenPreCode.cpp | 121 +-
core/sql/generator/GenRelExeUtil.cpp | 31 +-
core/sql/generator/GenRelMisc.cpp | 11 +
core/sql/generator/GenRelScan.cpp | 24 +-
core/sql/generator/Generator.cpp | 2 +
core/sql/generator/Generator.h | 20 +-
core/sql/nskgmake/arkcmplib/Makefile | 4 -
core/sql/optimizer/BindItemExpr.cpp | 4 +
core/sql/optimizer/BindRelExpr.cpp | 138 +-
core/sql/optimizer/BindWA.cpp | 1 +
core/sql/optimizer/BindWA.h | 9 +-
core/sql/optimizer/CacheWA.h | 2 +-
core/sql/optimizer/GroupAttr.cpp | 5 +-
core/sql/optimizer/GroupAttr.h | 2 +
core/sql/optimizer/HDFSHook.cpp | 35 +-
core/sql/optimizer/HDFSHook.h | 13 +-
core/sql/optimizer/ItemColRef.h | 1 +
core/sql/optimizer/ItemExpr.cpp | 45 +-
core/sql/optimizer/MVCandidates.cpp | 1 -
core/sql/optimizer/NARoutine.cpp | 26 +-
core/sql/optimizer/NATable.cpp | 67 +-
core/sql/optimizer/NATable.h | 2 +-
core/sql/optimizer/NormRelExpr.cpp | 1359 +-
core/sql/optimizer/NormWA.h | 10 +-
core/sql/optimizer/ObjectNames.cpp | 7 +
core/sql/optimizer/ObjectNames.h | 1 +
core/sql/optimizer/OptLogRelExpr.cpp | 94 +-
core/sql/optimizer/OptimizerSimulator.cpp | 36 +-
core/sql/optimizer/OptimizerSimulator.h | 1 -
core/sql/optimizer/RelExeUtil.cpp | 8 +-
core/sql/optimizer/RelExeUtil.h | 13 +-
core/sql/optimizer/RelExpr.cpp | 331 +-
core/sql/optimizer/RelExpr.h | 44 +
core/sql/optimizer/RelFastTransport.cpp | 115 +
core/sql/optimizer/RelFastTransport.h | 33 +-
core/sql/optimizer/RelGrby.h | 8 +
core/sql/optimizer/RelJoin.h | 8 +
core/sql/optimizer/RelMisc.h | 355 +-
core/sql/optimizer/RelScan.h | 46 +-
core/sql/optimizer/RelSet.h | 9 +
core/sql/optimizer/SynthType.cpp | 63 +-
core/sql/optimizer/TableDesc.cpp | 71 +-
core/sql/optimizer/TableDesc.h | 11 +
core/sql/optimizer/TransRule.cpp | 55 +-
core/sql/optimizer/TransRule.h | 19 +
core/sql/optimizer/ValueDesc.cpp | 171 +-
core/sql/optimizer/ValueDesc.h | 17 +-
core/sql/parser/ElemDDLLikeOptions.cpp | 25 +
core/sql/parser/ElemDDLLikeOptions.h | 34 +
core/sql/parser/ElemDDLNode.cpp | 5 +
core/sql/parser/ElemDDLNode.h | 2 +
core/sql/parser/ParDDLLikeOpts.cpp | 20 +
core/sql/parser/ParDDLLikeOptsCreateTable.h | 14 +
core/sql/parser/ParKeyWords.cpp | 7 +-
core/sql/parser/sqlparser.y | 109 +-
core/sql/regress/compGeneral/EXPECTED005 | 6 -
core/sql/regress/compGeneral/EXPECTED006.SB | 20 +
core/sql/regress/compGeneral/EXPECTED023 | 114 +-
core/sql/regress/compGeneral/EXPECTED042 | 74 +-
core/sql/regress/compGeneral/EXPECTED045 | 1610 ++
core/sql/regress/compGeneral/TEST005 | 2 -
core/sql/regress/compGeneral/TEST006 | 3 +
core/sql/regress/compGeneral/TEST023 | 68 +-
core/sql/regress/compGeneral/TEST045 | 1281 ++
core/sql/regress/core/EXPECTED004.SB | 66 +-
core/sql/regress/privs1/TEST120 | 4 +
core/sql/regress/seabase/EXPECTED016 | 14 -
core/sql/regress/seabase/EXPECTED018 | 6 +-
core/sql/regress/seabase/EXPECTED040 | 151 +
core/sql/regress/seabase/TEST040 | 37 +-
core/sql/regress/tools/runregr_compGeneral.ksh | 2 +-
core/sql/sqlcomp/CmpDescribe.cpp | 67 +-
core/sql/sqlcomp/CmpMain.cpp | 45 +-
core/sql/sqlcomp/CmpMain.h | 1 -
core/sql/sqlcomp/CmpSeabaseDDLauth.cpp | 18 +
core/sql/sqlcomp/CmpSeabaseDDLauth.h | 6 +-
core/sql/sqlcomp/CmpSeabaseDDLtable.cpp | 15 +-
core/sql/sqlcomp/DefaultConstants.h | 13 +
core/sql/sqlcomp/nadefaults.cpp | 19 +-
core/sql/sqlcomp/parser.cpp | 3 +
.../java/org/trafodion/sql/HTableClient.java | 38 +-
core/sql/ustat/hs_cli.cpp | 140 +-
core/sql/ustat/hs_globals.cpp | 23 +-
core/sql/ustat/hs_globals.h | 12 +-
core/sql/ustat/hs_parser.cpp | 2 +-
core/sql/ustat/hs_yacc.y | 5 +
.../java/org/trafodion/jdbc_test/TestCat.java | 74 +-
docs/client_install/pom.xml | 600 +-
.../src/asciidoc/_chapters/SQuirrel.adoc | 148 +-
.../src/asciidoc/_chapters/about.adoc | 331 +-
.../src/asciidoc/_chapters/dbviz.adoc | 193 +-
.../src/asciidoc/_chapters/howto.adoc | 164 +
.../src/asciidoc/_chapters/introduction.adoc | 217 +-
.../src/asciidoc/_chapters/jdbct4.adoc | 742 +-
.../src/asciidoc/_chapters/odb.adoc | 311 +-
.../src/asciidoc/_chapters/odbc_linux.adoc | 701 +-
.../src/asciidoc/_chapters/odbc_windows.adoc | 490 +-
.../src/asciidoc/_chapters/preparation.adoc | 273 +
.../src/asciidoc/_chapters/sample_prog.adoc | 150 +-
.../src/asciidoc/_chapters/tableau.adoc | 83 +
.../src/asciidoc/_chapters/trafci.adoc | 984 +-
docs/client_install/src/asciidoc/index.adoc | 138 +-
.../Database_Connection_in_DbVisualizer.jpg | Bin 58043 -> 63604 bytes
.../src/images/DbVisualizer_Driver_Manager.jpg | Bin 80198 -> 79645 bytes
.../src/images/Extracted_Files.jpg | Bin 28327 -> 26389 bytes
.../src/images/InstallComplete.jpg | Bin 47365 -> 73963 bytes
.../src/images/Physical_Connection.jpg | Bin 185241 -> 71998 bytes
.../src/images/SQuirrel_Add_Alias.jpg | Bin 0 -> 50396 bytes
.../src/images/SQuirrel_Extra_Class_Path.jpg | Bin 0 -> 54897 bytes
.../src/images/SQuirrel_New_Driver.jpg | Bin 0 -> 31639 bytes
.../src/images/tableau_connect.jpg | Bin 0 -> 39547 bytes
.../src/images/trafci_Installation_Choices.jpg | Bin 0 -> 78358 bytes
.../src/images/winodbc_admin_add.jpg | Bin 0 -> 60817 bytes
.../src/images/winodbc_admin_add_general.jpg | Bin 0 -> 48930 bytes
.../images/winodbc_admin_add_general_edited.jpg | Bin 0 -> 50337 bytes
.../src/images/winodbc_admin_add_network.jpg | Bin 0 -> 79462 bytes
.../src/images/winodbc_admin_add_schema.jpg | Bin 0 -> 32986 bytes
.../winodbc_admin_add_test_connection.jpg | Bin 0 -> 43949 bytes
.../winodbc_admin_add_tested_connection.jpg | Bin 0 -> 44916 bytes
.../images/winodbc_admin_add_translate_dll.jpg | Bin 0 -> 46249 bytes
.../src/images/winodbc_admin_intro.jpg | Bin 0 -> 59907 bytes
.../src/images/winodbc_destination.jpg | Bin 0 -> 36788 bytes
.../src/images/winodbc_install_finished.jpg | Bin 0 -> 36769 bytes
.../src/images/winodbc_license.jpg | Bin 0 -> 58430 bytes
.../src/images/winodbc_ready_to_install.jpg | Bin 0 -> 34193 bytes
.../src/images/winodbc_welcome.jpg | Bin 0 -> 39496 bytes
.../src/resources/source/basicsql.cpp | 850 +-
.../src/resources/source/build.bat | 50 +-
.../client_install/src/resources/source/run.bat | 46 +-
.../src/resources/tableau/trafodion.tdc | 16 +
.../resources/tableau/trafodion.tdc.template | 16 +
.../src/asciidoc/_chapters/binder_msgs.adoc | 6 +-
.../src/asciidoc/_chapters/install.adoc | Bin 13248 -> 2252 bytes
.../src/resources/source/partLocations.java | 42 +
.../src/resources/source/partlocations.java | 42 -
.../src/resources/source/supplierInfo.java | 38 +
.../src/resources/source/supplierinfo.java | 38 -
.../src/resources/source/supplyQuantities.java | 32 +
.../src/resources/source/supplyquantities.java | 32 -
docs/sql_reference/pom.xml | 602 +-
.../src/asciidoc/_chapters/about.adoc | 424 +-
.../src/asciidoc/_chapters/introduction.adoc | 1036 +-
.../src/asciidoc/_chapters/limits.adoc | 74 +-
.../src/asciidoc/_chapters/olap_functions.adoc | 2156 +--
.../src/asciidoc/_chapters/reserved_words.adoc | 572 +-
.../src/asciidoc/_chapters/runtime_stats.adoc | 2706 +--
.../src/asciidoc/_chapters/sql_clauses.adoc | 2864 +--
.../sql_functions_and_expressions.adoc | 15770 +++++++--------
.../_chapters/sql_language_elements.adoc | 8176 ++++----
.../src/asciidoc/_chapters/sql_statements.adoc | 17004 +++++++++--------
.../src/asciidoc/_chapters/sql_utilities.adoc | 2382 +--
docs/sql_reference/src/asciidoc/index.adoc | 137 +-
docs/src/site/markdown/index.md | 2 +
docs/src/site/site.xml | 3 +-
install/installer/traf_cloudera_mods | 15 +-
install/python-installer/README.md | 21 +
install/python-installer/apache_mods.py | 72 +
install/python-installer/bashrc.template | 79 +
install/python-installer/common.py | 478 +
install/python-installer/copy_files.py | 64 +
install/python-installer/db_config_default | 120 +
install/python-installer/db_install.py | 641 +
install/python-installer/dcs_setup.py | 114 +
install/python-installer/discovery.py | 144 +
install/python-installer/hadoop_mods.py | 203 +
install/python-installer/hdfs_cmds.py | 68 +
install/python-installer/mod_cfgs.json | 73 +
install/python-installer/prompt.json | 227 +
install/python-installer/script.json | 87 +
.../traf_authentication_conf.template | 71 +
install/python-installer/traf_check.py | 87 +
install/python-installer/traf_dep.py | 110 +
install/python-installer/traf_discover.py | 253 +
install/python-installer/traf_kerberos.py | 116 +
install/python-installer/traf_ldap.py | 73 +
install/python-installer/traf_package.py | 47 +
install/python-installer/traf_setup.py | 125 +
install/python-installer/traf_sqconfig.py | 74 +
install/python-installer/traf_start.py | 70 +
install/python-installer/traf_user.py | 146 +
install/python-installer/version.json | 10 +
install/python-installer/wrapper.py | 301 +
239 files changed, 43136 insertions(+), 30858 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/51756530/core/sqf/export/include/common/evl_sqlog_eventnum.h
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/51756530/core/sqf/monitor/linux/cluster.cxx
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/51756530/core/sqf/monitor/linux/zclient.cxx
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/51756530/install/installer/traf_cloudera_mods
----------------------------------------------------------------------
[42/50] [abbrv] incubator-trafodion git commit: Added persist node
section to Python installer scripts.
Posted by su...@apache.org.
Added persist node section to Python installer scripts.
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/51966563
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/51966563
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/51966563
Branch: refs/heads/master
Commit: 5196656354789906f53fe7ff5d4500725010131a
Parents: 16ef85d
Author: Zalo Correa <za...@esgyn.com>
Authored: Tue May 2 18:33:20 2017 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Tue May 2 18:33:20 2017 -0700
----------------------------------------------------------------------
core/sqf/sql/scripts/sqconfig.persist | 87 ++++++++++++++++++++
.../python-installer/scripts/traf_sqconfig.py | 13 ++-
2 files changed, 92 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/51966563/core/sqf/sql/scripts/sqconfig.persist
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/sqconfig.persist b/core/sqf/sql/scripts/sqconfig.persist
new file mode 100644
index 0000000..4de7fd8
--- /dev/null
+++ b/core/sqf/sql/scripts/sqconfig.persist
@@ -0,0 +1,87 @@
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+
+begin persist
+
+#
+# The following PROCESS_TYPEs are persistent and have special process management:
+# DTM
+# TMID
+# SSMP
+# PSD
+# WDG
+#
+# Generic persistent processes are of PROCESS_TYPE:
+# PERSIST
+#
+
+PERSIST_PROCESS_KEYS = DTM,TMID,SSCP,SSMP,PSD,WDG
+
+DTM_PROCESS_NAME = $TM%nid+
+DTM_PROCESS_TYPE = DTM
+DTM_PROGRAM_NAME = tm
+DTM_REQUIRES_DTM = N
+DTM_STDOUT = stdout_DTM%nid
+DTM_PERSIST_RETRIES = 2,30
+DTM_PERSIST_ZONES = %zid
+
+TMID_PROCESS_NAME = $TMID
+TMID_PROCESS_TYPE = TMID
+TMID_PROGRAM_NAME = idtmsrv
+TMID_REQUIRES_DTM = N
+TMID_STDOUT = stdout_TMID
+TMID_PERSIST_RETRIES = 2,30
+TMID_PERSIST_ZONES = %zid+
+
+SSCP_PROCESS_NAME = $ZSC%nid+
+SSCP_PROCESS_TYPE = PERSIST
+SSCP_PROGRAM_NAME = mxsscp
+SSCP_REQUIRES_DTM = Y
+SSCP_STDOUT = stdout_ZSC%nid
+SSCP_PERSIST_RETRIES = 10,60
+SSCP_PERSIST_ZONES = %zid
+
+SSMP_PROCESS_NAME = $ZSM%nid+
+SSMP_PROCESS_TYPE = SSMP
+SSMP_PROGRAM_NAME = mxssmp
+SSMP_REQUIRES_DTM = Y
+SSMP_STDOUT = stdout_ZSM%nid
+SSMP_PERSIST_RETRIES = 10,60
+SSMP_PERSIST_ZONES = %zid
+
+PSD_PROCESS_NAME = $PSD%nid+
+PSD_PROCESS_TYPE = PSD
+PSD_PROGRAM_NAME = pstartd
+PSD_REQUIRES_DTM = N
+PSD_STDOUT = stdout_PSD%nid
+PSD_PERSIST_RETRIES = 10,60
+PSD_PERSIST_ZONES = %zid
+
+WDG_PROCESS_NAME = $WDG%nid+
+WDG_PROCESS_TYPE = WDG
+WDG_PROGRAM_NAME = sqwatchdog
+WDG_REQUIRES_DTM = N
+WDG_STDOUT = stdout_WDG%nid
+WDG_PERSIST_RETRIES = 10,60
+WDG_PERSIST_ZONES = %zid
+
+end persist
+
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/51966563/install/python-installer/scripts/traf_sqconfig.py
----------------------------------------------------------------------
diff --git a/install/python-installer/scripts/traf_sqconfig.py b/install/python-installer/scripts/traf_sqconfig.py
index 31f8799..0bdbf74 100755
--- a/install/python-installer/scripts/traf_sqconfig.py
+++ b/install/python-installer/scripts/traf_sqconfig.py
@@ -38,6 +38,7 @@ def run():
traf_home = os.environ['TRAF_HOME']
if traf_home == '': err('TRAF_HOME var is empty')
sqconfig_file = traf_home + '/sql/scripts/sqconfig'
+ sqconfig_persist_file = traf_home + '/sql/scripts/sqconfig.persist'
core, processor = run_cmd("lscpu|grep -E '(^CPU\(s\)|^Socket\(s\))'|awk '{print $2}'").split('\n')[:2]
core = int(core)-1 if int(core) <= 256 else 255
@@ -51,18 +52,14 @@ def run():
lines.append(line)
lines.append('end node\n')
- lines.append('\n')
- lines.append('begin overflow\n')
-
- for scratch_loc in scratch_locs:
- line = 'hdd %s\n' % scratch_loc
- lines.append(line)
-
- lines.append('end overflow\n')
+ # write out the node section
with open(sqconfig_file, 'w') as f:
f.writelines(lines)
+ # append the current persist section
+ run_cmd('sed \'1,20d\' %s >> %s' % (sqconfig_file, sqconfig_persist_file))
+
print 'sqconfig generated successfully!'
run_cmd('sqgen')
[12/50] [abbrv] incubator-trafodion git commit: Merge pull request
#11 from zcorrea/amanda
Posted by su...@apache.org.
Merge pull request #11 from zcorrea/amanda
Mantis 657
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/a7b3b8da
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/a7b3b8da
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/a7b3b8da
Branch: refs/heads/master
Commit: a7b3b8dab9a0c81d5d52161f0d17992e828d866c
Parents: 83acf13 babeb4e
Author: Amanda <am...@esgyn.com>
Authored: Mon Aug 22 17:17:42 2016 -0700
Committer: GitHub <no...@github.com>
Committed: Mon Aug 22 17:17:42 2016 -0700
----------------------------------------------------------------------
install/installer/addNode_step2 | 15 +++-
install/installer/trafodion_config_default | 93 +++++++++++--------------
2 files changed, 56 insertions(+), 52 deletions(-)
----------------------------------------------------------------------
[02/50] [abbrv] incubator-trafodion git commit: Fixes to node up,
persist info, etc.
Posted by su...@apache.org.
Fixes to node up, persist info, etc.
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/adbef87b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/adbef87b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/adbef87b
Branch: refs/heads/master
Commit: adbef87bb7326c727d13ffd9387dfdfe48384fe2
Parents: 99042bd
Author: Zalo Correa <za...@esgyn.com>
Authored: Wed Aug 10 18:07:49 2016 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Wed Aug 10 18:07:49 2016 -0700
----------------------------------------------------------------------
core/sqf/monitor/linux/cluster.cxx | 4 +-
core/sqf/monitor/linux/commaccept.cxx | 19 ---
core/sqf/monitor/linux/lnode.cxx | 151 +++++++++++++++++-
core/sqf/monitor/linux/lnode.h | 11 ++
core/sqf/monitor/linux/monitor.cxx | 9 ++
core/sqf/monitor/linux/pnode.cxx | 193 ++++--------------------
core/sqf/monitor/linux/pnode.h | 11 +-
core/sqf/monitor/linux/reqprocinfo.cxx | 23 +--
core/sqf/monitor/linux/reqqueue.cxx | 2 +-
core/sqf/monitor/linux/shell.cxx | 14 --
core/sqf/sql/scripts/bats/sqconfig.monitor | 12 +-
core/sqf/sql/scripts/bats/sqconfig.seabed | 12 +-
12 files changed, 223 insertions(+), 238 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/adbef87b/core/sqf/monitor/linux/cluster.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/cluster.cxx b/core/sqf/monitor/linux/cluster.cxx
index fe7b08d..5a46cf8 100644
--- a/core/sqf/monitor/linux/cluster.cxx
+++ b/core/sqf/monitor/linux/cluster.cxx
@@ -2840,7 +2840,7 @@ bool CCluster::ReinitializeConfigCluster( bool nodeAdded, int pnid )
{
CClusterConfig *clusterConfig = Nodes->GetClusterConfig();
configPNodesCount_ = clusterConfig->GetPNodesCount();
- Nodes->UpdateCluster( &indexToPnid_ );
+ Nodes->UpdateCluster();
}
if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
@@ -2892,8 +2892,8 @@ void CCluster::InitializeConfigCluster( void )
// (for virtual nodes physical node equals "rank" (previously set))
MyPNID = clusterConfig->GetPNid( Node_name );
}
- Nodes->AddNodes( );
+ Nodes->AddNodes( );
MyNode = Nodes->GetNode(MyPNID);
Nodes->SetupCluster( &Node, &LNode, &indexToPnid_ );
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/adbef87b/core/sqf/monitor/linux/commaccept.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/commaccept.cxx b/core/sqf/monitor/linux/commaccept.cxx
index 91db931..2855cd3 100644
--- a/core/sqf/monitor/linux/commaccept.cxx
+++ b/core/sqf/monitor/linux/commaccept.cxx
@@ -191,25 +191,6 @@ bool CCommAccept::sendNodeInfoSock( int sockFd )
sizeof(nodeInfo[i].syncPort));
nodeInfo[i].pnid = node->GetPNid();
nodeInfo[i].creatorPNid = (nodeInfo[i].pnid == MyPNID) ? MyPNID : -1;
-
- if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
- {
- trace_printf( "%s@%d - Preparing port info for new monitor\n"
- , method_name, __LINE__);
- for (int i=0; i<pnodeCount; i++)
- {
- trace_printf( "Port info for pnid=%d\n"
- " nodeInfo[%d].nodeName=%s\n"
- " nodeInfo[%d].commPort=%s\n"
- " nodeInfo[%d].syncPort=%s\n"
- " nodeInfo[%d].creatorPNid=%d\n"
- , nodeInfo[i].pnid
- , i, nodeInfo[i].nodeName
- , i, nodeInfo[i].commPort
- , i, nodeInfo[i].syncPort
- , i, nodeInfo[i].creatorPNid );
- }
- }
}
else
{
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/adbef87b/core/sqf/monitor/linux/lnode.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/lnode.cxx b/core/sqf/monitor/linux/lnode.cxx
index 31b9682..6e81da3 100644
--- a/core/sqf/monitor/linux/lnode.cxx
+++ b/core/sqf/monitor/linux/lnode.cxx
@@ -969,8 +969,10 @@ void CLNode::Up( void )
}
CLNodeContainer::CLNodeContainer(CNode *node)
- :LastNid(0)
+ :LNode(NULL)
+ ,LastNid(0)
,lnodesCount_(0)
+ ,indexToNid_(NULL)
,node_(node)
,head_(NULL)
,tail_(NULL)
@@ -1175,6 +1177,153 @@ CLNode *CLNodeContainer::GetLNode(int nid)
return lnode;
}
+CLNode *CLNodeContainer::GetLNode( char *process_name, CProcess **process,
+ bool checkstate, bool backupOk )
+{
+ CLNode *lnode = head_;
+ CNode *node = lnode ? lnode->GetNode() : NULL;
+ CProcess *p_process;
+ CLNode *b_lnode = NULL;
+ CProcess *b_process = NULL;
+ const char method_name[] = "CLNodeContainer::GetLNode";
+ TRACE_ENTRY;
+
+ // Initialize return value
+ *process = NULL;
+
+ while (node)
+ {
+ if ( !node->IsSpareNode() &&
+ (node->GetState() == State_Up ||
+ node->GetState() == State_Shutdown) )
+ {
+ *process = node->CProcessContainer::GetProcess(process_name, checkstate);
+ if (*process)
+ {
+ p_process = *process;
+ if (trace_settings & (TRACE_REQUEST_DETAIL | TRACE_PROCESS_DETAIL))
+ trace_printf("%s@%d - process %s (%d, %d), backup=%d, backupOk=%d\n",
+ method_name, __LINE__,
+ p_process->GetName(), p_process->GetNid(),
+ p_process->GetPid(), p_process->IsBackup(),
+ backupOk);
+ if (!p_process->IsBackup())
+ {
+ lnode = LNode[p_process->GetNid()];
+ break;
+ }
+ else
+ {
+ // Save backup process and lnode
+ b_process = *process;
+ b_lnode = LNode[b_process->GetNid()];
+ }
+ }
+ }
+ lnode = lnode->GetNext ();
+ node = lnode ? lnode->GetNode() : NULL;
+ }
+
+ if ( !*process && backupOk )
+ {
+ // We did not find the primary and it's ok to return the backup
+ *process = b_process;
+ lnode = b_lnode;
+ }
+
+ TRACE_EXIT;
+ return lnode;
+}
+
+CLNode *CLNodeContainer::GetLNodeByMap(int index )
+{
+ const char method_name[] = "CNodeContainer::GetLNodeByMap";
+ TRACE_ENTRY;
+
+ CClusterConfig *clusterConfig = Nodes->GetClusterConfig();
+ CLNode *lnode = NULL;
+
+ if( index >= 0 && index < clusterConfig->GetLNodesCount() )
+ {
+ lnode = LNode[indexToNid_[index]];
+ }
+
+ TRACE_EXIT;
+ return lnode;
+}
+
+int CLNodeContainer::GetNidIndex( int nid )
+{
+ const char method_name[] = "CNodeContainer::GetNidIndex";
+ TRACE_ENTRY;
+
+ CClusterConfig *clusterConfig = Nodes->GetClusterConfig();
+
+ for (int i = 0; i < clusterConfig->GetLNodesCount(); i++ )
+ {
+ if (LNode[i]->GetNid() == nid)
+ {
+ return(i);
+ }
+ }
+
+ TRACE_EXIT;
+ return(-1);
+}
+
+CLNode *CLNodeContainer::GetLNodeNext( int nid, bool checkstate )
+{
+ const char method_name[] = "CLNodeContainer::GetLNodeNext";
+ TRACE_ENTRY;
+
+ CClusterConfig *clusterConfig = Nodes->GetClusterConfig();
+ CLNode *lnode = NULL;
+
+ for (int i = (nid+1); i < clusterConfig->GetLNodesCount(); i++ )
+ {
+ lnode = LNode[i];
+ if ( lnode )
+ {
+ if ( lnode->GetNid() > nid )
+ {
+ if (checkstate && lnode->GetState() == State_Up)
+ {
+ break; // found it
+ }
+ else
+ {
+ break; // found it
+ }
+ }
+ }
+ }
+
+ if ( lnode == NULL )
+ {
+ for (int i = 0; i < clusterConfig->GetLNodesCount(); i++ )
+ {
+ lnode = LNode[i];
+ if ( lnode )
+ {
+ if ( lnode->GetNid() <= nid )
+ {
+ if (checkstate && lnode->GetState() == State_Up)
+ {
+ break; // found it
+ }
+ else
+ {
+ break; // found it
+ }
+ }
+ }
+ }
+ }
+
+ TRACE_EXIT;
+ return lnode;
+}
+
bool CLNodeContainer::IsMyNode( int nid )
{
bool found = false;
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/adbef87b/core/sqf/monitor/linux/lnode.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/lnode.h b/core/sqf/monitor/linux/lnode.h
index 9575c2a..6b1dba7 100644
--- a/core/sqf/monitor/linux/lnode.h
+++ b/core/sqf/monitor/linux/lnode.h
@@ -153,6 +153,7 @@ private:
int eyecatcher_; // Debuggging aid -- leave as first
// member variable of the class
public:
+ CLNode **LNode; // array of logical node objects
int LastNid; // Last node selected for process startup
CLNodeContainer( CNode *node );
@@ -167,7 +168,16 @@ public:
void CheckForPendingCreates( CProcess *process=NULL );
inline CLNode *GetFirstLNode( void ) { return ( head_ ); }
inline CLNode *GetLastLNode( void ) { return ( tail_ ); }
+
CLNode *GetLNode( int nid );
+ CLNode *GetLNode( char *process_name, CProcess **process,
+ bool checkstate=true, bool backupOk=false );
+ CLNode *GetLNodeByMap( int index );
+ CLNode *GetLNodeNext( int nid, bool checkstate=true );
+
+ inline int GetNidByMap( int index ) { return ( indexToNid_[index] ); }
+ int GetNidIndex( int nid );
+
inline CNode *GetNode( void ) { return ( node_ ); }
inline int GetLNodesCount( void ) { return ( lnodesCount_ ); }
bool IsMyNode( int nid );
@@ -181,6 +191,7 @@ protected:
inline void SetLNodesCount( int lnodesCount ) { lnodesCount_ = lnodesCount; }
int lnodesCount_; // # of logical nodes in this container
+ int *indexToNid_; // map of configuration entries to LNode[nid]
private:
CNode *node_; // physical node of this container or
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/adbef87b/core/sqf/monitor/linux/monitor.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/monitor.cxx b/core/sqf/monitor/linux/monitor.cxx
index 8ba0540..34995f4 100755
--- a/core/sqf/monitor/linux/monitor.cxx
+++ b/core/sqf/monitor/linux/monitor.cxx
@@ -544,6 +544,15 @@ char * CMonitor::ProcCopy(char *bufPtr, CProcess *process)
procObj->argc = process->argc();
procObj->creation_time = process->GetCreationTime();
+
+ if (trace_settings & (TRACE_REQUEST | TRACE_INIT | TRACE_RECOVERY))
+ trace_printf( "%s@%d - Packing process %s (%d,%d:%d)\n"
+ , method_name, __LINE__
+ , process->GetName()
+ , process->GetNid()
+ , process->GetPid()
+ , process->GetVerifier() );
+
char * stringData = &procObj->stringData;
// Copy the program name
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/adbef87b/core/sqf/monitor/linux/pnode.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pnode.cxx b/core/sqf/monitor/linux/pnode.cxx
index 13f5d1d..5fdafc7 100644
--- a/core/sqf/monitor/linux/pnode.cxx
+++ b/core/sqf/monitor/linux/pnode.cxx
@@ -1411,9 +1411,8 @@ void CNode::StartSMServiceProcess( void )
CNodeContainer::CNodeContainer( void )
:CLNodeContainer(NULL)
,Node(NULL)
- ,LNode(NULL)
- ,indexToPnid_(NULL)
,pnodeCount_(0)
+ ,indexToPnid_(NULL)
,clusterConfig_(NULL)
,head_(NULL)
,tail_(NULL)
@@ -1440,9 +1439,11 @@ CNodeContainer::CNodeContainer( void )
Node[i] = NULL;
indexToPnid_[i] = -1;
}
+ indexToNid_ = new int[clusterConfig_->GetLNodesConfigMax()];
for (int i = 0; i < clusterConfig_->GetLNodesConfigMax(); i++ )
{
LNode[i] = NULL;
+ indexToNid_[i] = -1;
}
TRACE_EXIT;
@@ -1969,13 +1970,15 @@ void CNodeContainer::UnpackNodeMappings( intBuffPtr_t &buffer, int nodeMapCount
pnidConfig = *buffer++;
pnid = *buffer++;
- Nodes->AddLNodes( Nodes->GetNode(pnid), Nodes->GetNode(pnidConfig) );
-
if (trace_settings & ( TRACE_INIT || TRACE_RECOVERY || TRACE_REQUEST_DETAIL) )
trace_printf("%s@%d - Unpacking node mapping, pnidConfig=%d, pnid=%d \n",
method_name, __LINE__, pnidConfig, pnid);
+
+ Nodes->AddLNodes( Nodes->GetNode(pnid), Nodes->GetNode(pnidConfig) );
}
+ UpdateCluster();
+
TRACE_EXIT;
return;
}
@@ -2360,134 +2363,6 @@ void CNodeContainer::DeleteNodeLNodes( CNode *node )
TRACE_EXIT;
}
-CLNode *CNodeContainer::GetLNode(int nid)
-{
- const char method_name[] = "CNodeContainer::GetLNode";
- TRACE_ENTRY;
-
- CLNode *lnode = GetFirstLNode();
- while (lnode)
- {
- if ( lnode->GetNid() == nid )
- {
- break;
- }
- lnode = lnode->GetNext();
- }
-
- TRACE_EXIT;
- return lnode;
-}
-
-CLNode *CNodeContainer::GetLNodeNext( int nid, bool checkstate )
-{
- const char method_name[] = "CLNodeContainer::GetLNodeNext";
- TRACE_ENTRY;
-
- CLNode *lnode = NULL;
-
- for (int i = (nid+1); i < clusterConfig_->GetLNodesCount(); i++ )
- {
- lnode = LNode[i];
- if ( lnode )
- {
- if ( lnode->GetNid() > nid )
- {
- if (checkstate && lnode->GetState() == State_Up)
- {
- break; // found it
- }
- else
- {
- break; // found it
- }
- }
- }
- }
-
- if ( lnode == NULL )
- {
- for (int i = 0; i < clusterConfig_->GetLNodesCount(); i++ )
- {
- lnode = LNode[i];
- if ( lnode )
- {
- if ( lnode->GetNid() <= nid )
- {
- if (checkstate && lnode->GetState() == State_Up)
- {
- break; // found it
- }
- else
- {
- break; // found it
- }
- }
- }
- }
- }
-
- TRACE_EXIT;
- return lnode;
-}
-
-CLNode *CNodeContainer::GetLNode( char *process_name, CProcess **process,
- bool checkstate, bool backupOk )
-{
- CLNode *lnode = NULL;
- CNode *node = head_;
- CProcess *p_process;
- CLNode *b_lnode = NULL;
- CProcess *b_process = NULL;
- const char method_name[] = "CNodeContainer::GetLNode";
- TRACE_ENTRY;
-
- // Initialize return value
- *process = NULL;
-
- while (node)
- {
- if ( !node->IsSpareNode() &&
- (node->GetState() == State_Up ||
- node->GetState() == State_Shutdown) )
- {
- *process = node->CProcessContainer::GetProcess(process_name, checkstate);
- if (*process)
- {
- p_process = *process;
- if (trace_settings & (TRACE_REQUEST_DETAIL | TRACE_PROCESS_DETAIL))
- trace_printf("%s@%d - process %s (%d, %d), backup=%d, backupOk=%d\n",
- method_name, __LINE__,
- p_process->GetName(), p_process->GetNid(),
- p_process->GetPid(), p_process->IsBackup(),
- backupOk);
- if (!p_process->IsBackup())
- {
- lnode = LNode[p_process->GetNid()];
- break;
- }
- else
- {
- // Save backup process and lnode
- b_process = *process;
- b_lnode = LNode[b_process->GetNid()];
- }
- }
- }
- node = node->GetNext ();
- }
-
- if ( !*process && backupOk )
- {
- // We did not find the primary and it's ok to return the backup
- *process = b_process;
- lnode = b_lnode;
- }
-
- TRACE_EXIT;
- return lnode;
-}
-
int CNodeContainer::GetFirstNid( void )
{
const char method_name[] = "CNodeContainer::GetFirstNid";
@@ -3063,7 +2938,7 @@ struct internal_msg_def *CNodeContainer::PopMsg( struct sync_buffer_def *recvBuf
const char method_name[] = "CNodeContainer::PopMsg";
TRACE_ENTRY;
- if ( recvBuf->msgInfo.msg_count )
+ if ( recvBuf->msgInfo.msg_count > 0 )
{
msg = (struct internal_msg_def *)&recvBuf->msg[recvBuf->msgInfo.msg_offset];
recvBuf->msgInfo.msg_count --;
@@ -3220,7 +3095,6 @@ void CNodeContainer::SetupCluster( CNode ***pnode_list, CLNode ***lnode_list, in
{
if (node)
{
- indexToPnid_[i] = node->GetPNid();
if (trace_settings & TRACE_INIT)
trace_printf( "%s@%d - Node %s (pnid=%d, zid=%d, state=%s) is Spare=%d\n"
, method_name, __LINE__
@@ -3254,6 +3128,8 @@ void CNodeContainer::SetupCluster( CNode ***pnode_list, CLNode ***lnode_list, in
}
}
+ UpdateCluster();
+
TRACE_EXIT;
}
@@ -3451,53 +3327,42 @@ CLNode *CNodeContainer::NextPossibleLNode( CProcess *requester, ZoneType type, i
return lnode;
}
-void CNodeContainer::UpdateCluster( int **indexToPnid )
+void CNodeContainer::UpdateCluster( void )
{
const char method_name[] = "CNodeContainer::UpdateCluster";
TRACE_ENTRY;
- *indexToPnid = indexToPnid_;
-
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- for ( int i = 0; i < GetPNodesCount(); i++ )
- {
- trace_printf( "%s@%d - indexToPnid_[%d]=%d\n"
- , method_name, __LINE__, i, indexToPnid_[i]);
- }
- }
+ CLNode *lnode;
+ CNode *node;
for (int i = 0; i < clusterConfig_->GetPNodesConfigMax(); i++ )
{
indexToPnid_[i] = -1;
}
+ node = GetFirstNode();
// Refresh the index to pnid map
- CNode *node = GetFirstNode();
for ( int i = 0; node && i < GetPNodesCount(); i++, node = node->GetNext() )
{
- if (node)
- {
- indexToPnid_[i] = node->GetPNid();
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf( "%s@%d - Node %s (pnid=%d, zid=%d, state=%s) is Spare=%d\n"
- , method_name, __LINE__
- , node->GetName()
- , node->GetPNid()
- , node->GetZone()
- , StateString(node->GetState())
- , node->IsSpareNode());
- }
- }
+ indexToPnid_[i] = node->GetPNid();
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST))
+ trace_printf( "%s@%d - indexToPnid_[%d]=%d\n"
+ , method_name, __LINE__
+ , i
+ , indexToPnid_[i]);
}
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
+ // Refresh the index to nid map
+ lnode = GetFirstLNode();
+ for ( int i = 0; lnode && i < GetLNodesCount(); i++, lnode = lnode->GetNext() )
{
- for ( int i = 0; i < GetPNodesCount(); i++ )
+ indexToNid_[i] = lnode->GetNid();
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST))
{
- trace_printf( "%s@%d - indexToPnid_[%d]=%d\n"
- , method_name, __LINE__, i, indexToPnid_[i]);
+ trace_printf( "%s@%d - indexToNid_[%d]=%d\n"
+ , method_name, __LINE__
+ , i
+ , indexToNid_[i]);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/adbef87b/core/sqf/monitor/linux/pnode.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pnode.h b/core/sqf/monitor/linux/pnode.h
index d151a6c..8c3a5de 100644
--- a/core/sqf/monitor/linux/pnode.h
+++ b/core/sqf/monitor/linux/pnode.h
@@ -61,8 +61,6 @@ private:
public:
CNode **Node; // array of physical node objects
- CLNode **LNode; // array of logical node objects
- int *indexToPnid_; // map of configuration entries to Node[pnid]
CNodeContainer( void );
@@ -85,10 +83,6 @@ public:
int GetFirstNid( void );
int GetNextNid( int nid );
inline CNode *GetFirstNode( void ) { return ( head_ ); }
- CLNode *GetLNode( int nid );
- CLNode *GetLNode( char *process_name, CProcess **process,
- bool checkstate=true, bool backupOk=false );
- CLNode *GetLNodeNext( int nid, bool checkstate=true );
CNode *GetNode( char *name );
CNode *GetNode( int pnid );
CNode *GetNodeByMap( int index );
@@ -148,12 +142,13 @@ public:
void UnpackSpareNodesList( intBuffPtr_t &buffer, int spareNodesCount );
void UnpackZids( intBuffPtr_t &buffer );
- void UpdateCluster( int **indexToPnid );
+ void UpdateCluster( void );
protected:
private:
- int pnodeCount_; // # of physical node objects in array
+ int pnodeCount_; // # of physical node objects in array
+ int *indexToPnid_; // map of configuration entries to Node[pnid]
CClusterConfig *clusterConfig_; // 'sqconfig.db' objects
NodesList spareNodesList_; // current spare physical nodes list
NodesList spareNodesConfigList_; // configured spare physical nodes list
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/adbef87b/core/sqf/monitor/linux/reqprocinfo.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqprocinfo.cxx b/core/sqf/monitor/linux/reqprocinfo.cxx
index 9bbabad..f7eeefe 100644
--- a/core/sqf/monitor/linux/reqprocinfo.cxx
+++ b/core/sqf/monitor/linux/reqprocinfo.cxx
@@ -136,13 +136,13 @@ CProcess * CExtProcInfoBase::ProcessInfo_GetProcess (int &nid, bool getDataForAl
}
}
lnode = lnode->GetNext();
+ nid = lnode ? lnode->GetNid() : nid;
}
} while (getDataForAllNodes && lnode);
return(NULL);
}
-
// Information for more than one process is being requested. Iterate
// through the process list and return process information for processes
// meeting the requested criteria.
@@ -152,7 +152,9 @@ int CExtProcInfoBase::ProcessInfo_BuildReply(CProcess *process,
bool getDataForAllNodes,
char *pattern)
{
- int currentNode = (process != 0) ? process->GetNid() : Nodes->GetLNodesConfigMax();
+ int currentIndex = (process != 0)
+ ? Nodes->GetNidIndex( process->GetNid() )
+ : Nodes->GetLNodesCount();
bool moreToRetrieve;
bool copy = true;
bool reg = false;
@@ -202,22 +204,25 @@ int CExtProcInfoBase::ProcessInfo_BuildReply(CProcess *process,
// of whether there is more data remaining.
msg->u.reply.u.process_info.more_data
= (process != 0)
- || (++currentNode < Nodes->GetLNodesConfigMax());
+ || (++currentIndex < Nodes->GetLNodesCount());
return count;
}
}
moreToRetrieve = false;
- if (getDataForAllNodes && ++currentNode < Nodes->GetLNodesConfigMax())
+ if (getDataForAllNodes && ++currentIndex < Nodes->GetLNodesCount())
{ // Start retrieving process data for next node. We ask
- // ProcessInfo_GetProcess for the first process on
- // "currentNode" which has just been incremented. Note
+ // ProcessInfo_GetProcess for the first process on lnode of
+ // "currentIndex" which has just been incremented. Note
// that it is possible there are no processes on that node
// so ProcessInfo_GetProcess will return a process on the
- // first node it finds and "currentNode" will be updated
- // to be the node number where the process resides.
+ // first node it finds and "currentIndex" will be updated
+ // to be the node index number where the process resides.
- process = ProcessInfo_GetProcess(currentNode, getDataForAllNodes);
+ int nid = Nodes->GetNidByMap( currentIndex );
+ if (nid == -1) break;
+ process = ProcessInfo_GetProcess( nid, getDataForAllNodes);
+ currentIndex = Nodes->GetNidIndex( nid );
moreToRetrieve = true;
}
} while (moreToRetrieve);
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/adbef87b/core/sqf/monitor/linux/reqqueue.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqqueue.cxx b/core/sqf/monitor/linux/reqqueue.cxx
index 2962f6a..196f490 100644
--- a/core/sqf/monitor/linux/reqqueue.cxx
+++ b/core/sqf/monitor/linux/reqqueue.cxx
@@ -2466,7 +2466,7 @@ void CIntSnapshotReq::performRequest()
// estimate size of snapshot buffer
// about 100 bytes per process, 1.5 times total
- int procSize = Nodes->ProcessCount() * 1.5 * 100;
+ int procSize = Nodes->ProcessCount() * 1.75 * 100;
int spareNodeSize = Nodes->GetSpareNodesList()->size() * sizeof(int); // pnids
if (trace_settings & (TRACE_REQUEST | TRACE_INIT | TRACE_RECOVERY))
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/adbef87b/core/sqf/monitor/linux/shell.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/shell.cxx b/core/sqf/monitor/linux/shell.cxx
index 58d1a9d..bc4fc74 100644
--- a/core/sqf/monitor/linux/shell.cxx
+++ b/core/sqf/monitor/linux/shell.cxx
@@ -3620,20 +3620,6 @@ void node_info( int nid )
for (i=0; i < msg->u.reply.u.node_info.num_returned; i++)
{
-#if 0
- CPNodeConfig *pConfig = ClusterConfig.GetPNodeConfig (msg->u.reply.u.node_info.node[i].pnid);
- if (pConfig != NULL)
- {
- string downNodeToFind = " ";
- downNodeToFind += pConfig->GetName();
- downNodeToFind += " ";
-
- if ((downNodeList != NULL) && strstr(downNodeString.c_str(),downNodeToFind.c_str()))
- {
- continue; // We do not want to consider this node since it is in our exclude list
- }
- }
-#endif
if ( last_nid != -1 )
{
if ( (msg->u.reply.u.node_info.node[i].pnid !=
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/adbef87b/core/sqf/sql/scripts/bats/sqconfig.monitor
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/bats/sqconfig.monitor b/core/sqf/sql/scripts/bats/sqconfig.monitor
index 52e8ada..bb9f02b 100644
--- a/core/sqf/sql/scripts/bats/sqconfig.monitor
+++ b/core/sqf/sql/scripts/bats/sqconfig.monitor
@@ -23,6 +23,8 @@ begin node
_virtualnodes 6
end node
+begin persist
+
#
# The folling process types are persistent and have special process management:
# DTM
@@ -35,8 +37,6 @@ end node
# PERSIST
#
-begin persist
-
PERSIST_PROCESS_KEYS = DTM,TMID,SSCP,SSMP,PSD,WDG,QMN
DTM_PROCESS_NAME = $TM%nid+
@@ -87,12 +87,4 @@ WDG_STDOUT = stdout_WDG%nid
WDG_PERSIST_RETRIES = 10,60
WDG_PERSIST_ZONES = %zid
-QMN_PROCESS_NAME = $ZQM0000
-QMN_PROCESS_TYPE = PERSIST
-QMN_PROGRAM_NAME = tdm_arkqmm
-QMN_REQUIRES_DTM = Y
-QMN_STDOUT = stdout_ZQM0000
-QMN_PERSIST_RETRIES = 10,60
-QMN_PERSIST_ZONES = %zid+
-
end persist
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/adbef87b/core/sqf/sql/scripts/bats/sqconfig.seabed
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/bats/sqconfig.seabed b/core/sqf/sql/scripts/bats/sqconfig.seabed
index e5c2748..05729e8 100644
--- a/core/sqf/sql/scripts/bats/sqconfig.seabed
+++ b/core/sqf/sql/scripts/bats/sqconfig.seabed
@@ -23,6 +23,8 @@ begin node
_virtualnodes 4
end node
+begin persist
+
#
# The folling process types are persistent and have special process management:
# DTM
@@ -35,8 +37,6 @@ end node
# PERSIST
#
-begin persist
-
PERSIST_PROCESS_KEYS = DTM,TMID,SSCP,SSMP,PSD,WDG,QMN
DTM_PROCESS_NAME = $TM%nid+
@@ -87,12 +87,4 @@ WDG_STDOUT = stdout_WDG%nid
WDG_PERSIST_RETRIES = 10,60
WDG_PERSIST_ZONES = %zid
-QMN_PROCESS_NAME = $ZQM0000
-QMN_PROCESS_TYPE = PERSIST
-QMN_PROGRAM_NAME = tdm_arkqmm
-QMN_REQUIRES_DTM = Y
-QMN_STDOUT = stdout_ZQM0000
-QMN_PERSIST_RETRIES = 10,60
-QMN_PERSIST_ZONES = %zid+
-
end persist
[20/50] [abbrv] incubator-trafodion git commit: Merge remote branch
'origin/master' into TRAFODION-2001
Posted by su...@apache.org.
Merge remote branch 'origin/master' into TRAFODION-2001
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/1315eaf1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/1315eaf1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/1315eaf1
Branch: refs/heads/master
Commit: 1315eaf17488dc3f51a2de8da1f07ae102d60f57
Parents: 1e29423 b12b45e
Author: Zalo Correa <za...@esgyn.com>
Authored: Fri Oct 14 13:23:50 2016 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Fri Oct 14 13:23:50 2016 -0700
----------------------------------------------------------------------
core/conn/jdbc_type2/native/SQLMXDriver.cpp | 13 -
core/sqf/commonLogger/CommonLogger.cpp | 5 +-
core/sqf/commonLogger/CommonLogger.h | 2 +
core/sqf/monitor/linux/zclient.cxx | 16 +-
core/sqf/sql/scripts/rmscheck | 2 +-
core/sqf/sql/scripts/traf_authentication_setup | 2 +-
.../transactional/TransactionManager.java | 11 +-
.../client/transactional/TransactionState.java | 41 +-
.../transactional/SsccRegionEndpoint.java.tmpl | 9 +-
.../transactional/TrxRegionEndpoint.java.tmpl | 14 +-
.../transactional/TrxRegionObserver.java.tmpl | 2 +-
.../java/org/trafodion/dtm/HBaseTxClient.java | 49 +-
.../java/org/trafodion/dtm/TmAuditTlog.java | 11 +-
.../SqlCompilerDebugger/ItemExpressionView.cpp | 4 +-
core/sql/arkcmp/CmpContext.cpp | 8 +-
core/sql/arkcmp/CmpContext.h | 8 -
core/sql/arkcmp/CmpStatement.cpp | 7 +-
core/sql/arkcmp/CmpStoredProc.cpp | 2 +-
core/sql/arkcmp/cmpargs.cpp | 2 +-
core/sql/bin/SqlciErrors.txt | 11 +-
core/sql/cli/Cli.cpp | 110 +-
core/sql/cli/Cli.h | 16 -
core/sql/cli/CliExtern.cpp | 54 +-
core/sql/cli/Context.cpp | 21 +-
core/sql/cli/ExSqlComp.cpp | 10 +-
core/sql/cli/Globals.cpp | 17 +-
core/sql/cli/Statement.cpp | 1893 +-------
core/sql/cli/Statement.h | 50 +-
core/sql/comexe/CmpMessage.cpp | 28 +-
core/sql/comexe/CmpMessage.h | 30 +-
core/sql/comexe/ComTdbRoot.cpp | 9 +-
core/sql/comexe/ComTdbRoot.h | 9 +-
core/sql/comexe/ComTdbSort.h | 10 +-
core/sql/comexe/ComTdbSortGrby.cpp | 3 +-
core/sql/comexe/ComTdbSortGrby.h | 23 +-
core/sql/comexe/LateBindInfo.cpp | 393 +-
core/sql/comexe/LateBindInfo.h | 679 +--
core/sql/common/BloomFilter.cpp | 2 +-
core/sql/common/ColIndList.h | 4 +-
core/sql/common/Collections.cpp | 1 -
core/sql/common/Collections.h | 47 +-
core/sql/common/ComDistribution.cpp | 3 +-
core/sql/common/ComExeTrace.cpp | 1 +
core/sql/common/ComSecurityKey.cpp | 156 +-
core/sql/common/ComSecurityKey.h | 9 +-
core/sql/common/Ipc.cpp | 22 +-
core/sql/common/Ipc.h | 6 +-
core/sql/common/NAMemory.cpp | 2 +-
core/sql/common/NATestpoint.cpp | 3 +-
core/sql/common/NATraceList.h | 2 +-
core/sql/executor/ExExeUtilLoad.cpp | 3 +-
core/sql/executor/ExExeUtilMisc.cpp | 5 +-
core/sql/executor/ExFastTransport.cpp | 13 +-
core/sql/executor/ExFastTransport.h | 4 +-
core/sql/executor/ExHbaseAccess.cpp | 1 +
core/sql/executor/ExHbaseDDL.cpp | 2 +-
core/sql/executor/ExHdfsScan.cpp | 5 +-
core/sql/executor/Ex_esp_msg.h | 40 -
core/sql/executor/dfs2fe.h | 4 +-
core/sql/executor/ex_control.cpp | 2 +-
core/sql/executor/ex_ddl.cpp | 3 -
core/sql/executor/ex_esp_frag_dir.cpp | 11 -
core/sql/executor/ex_esp_msg.cpp | 243 -
core/sql/executor/ex_frag_rt.cpp | 63 +-
core/sql/executor/ex_globals.cpp | 2 +
core/sql/executor/ex_globals.h | 14 +
core/sql/executor/ex_sort.cpp | 16 +-
core/sql/executor/ex_sort_grby.cpp | 1041 ++++-
core/sql/executor/ex_sort_grby.h | 120 +-
core/sql/exp/ExpLOB.h | 4 +-
core/sql/exp/ExpLOBaccess.cpp | 119 +-
core/sql/exp/ExpLOBaccess.h | 14 +-
core/sql/exp/ExpLOBinterface.cpp | 31 +-
core/sql/exp/ExpLOBinterface.h | 9 +-
core/sql/exp/ExpPCodeClauseGen.cpp | 8 +
core/sql/exp/ExpPCodeOptimizations.cpp | 2 +-
core/sql/exp/ExpPCodeOptsBulk.cpp | 4 +-
core/sql/exp/ExpPCodeOptsNativeExpr.cpp | 2 +-
core/sql/exp/exp_clause.cpp | 21 +-
core/sql/exp/exp_clause_derived.h | 8 +-
core/sql/exp/exp_comp.cpp | 108 +-
core/sql/exp/exp_conv.cpp | 2 +-
core/sql/exp/exp_tuple_desc.cpp | 17 +-
core/sql/export/ComDiags.cpp | 4 +-
core/sql/generator/GenExpGenerator.cpp | 1 -
core/sql/generator/GenExplain.cpp | 18 +-
core/sql/generator/GenFastTransport.cpp | 25 +-
core/sql/generator/GenItemExpr.cpp | 4 +
core/sql/generator/GenItemFunc.cpp | 2 +
core/sql/generator/GenKey.cpp | 2 +-
core/sql/generator/GenPreCode.cpp | 10 +-
core/sql/generator/GenRelExeUtil.cpp | 7 +-
core/sql/generator/GenRelGrby.cpp | 87 +-
core/sql/generator/GenRelJoin.cpp | 2 +-
core/sql/generator/GenRelMisc.cpp | 105 +-
core/sql/generator/GenRelScan.cpp | 47 +-
core/sql/generator/GenRelUpdate.cpp | 162 +-
core/sql/generator/GenResources.cpp | 2 +-
core/sql/generator/Generator.cpp | 32 +-
core/sql/generator/Generator.h | 10 +
core/sql/langman/LmRoutineJava.cpp | 3 +-
core/sql/langman/LmUtility.cpp | 2 +-
core/sql/nskgmake/sort/Makefile | 3 +-
core/sql/optimizer/Analyzer.cpp | 15 +-
core/sql/optimizer/Analyzer.h | 5 +
core/sql/optimizer/BindItemExpr.cpp | 6 +-
core/sql/optimizer/BindRI.cpp | 2 +-
core/sql/optimizer/BindRelExpr.cpp | 245 +-
core/sql/optimizer/BindWA.cpp | 1 +
core/sql/optimizer/BindWA.h | 2 +-
core/sql/optimizer/CacheWA.cpp | 3 +
core/sql/optimizer/ColStatDesc.cpp | 20 +-
core/sql/optimizer/ControlDB.cpp | 8 +-
core/sql/optimizer/EncodedValue.cpp | 3 +-
core/sql/optimizer/HDFSHook.cpp | 2 +-
core/sql/optimizer/HbaseSearchSpec.h | 52 +-
core/sql/optimizer/ImplRule.cpp | 12 +-
core/sql/optimizer/Inlining.cpp | 19 -
core/sql/optimizer/ItemExpr.cpp | 17 +-
core/sql/optimizer/ItemExpr.h | 10 +-
core/sql/optimizer/ItemFunc.h | 11 +-
core/sql/optimizer/ItemFuncUDF.h | 11 +-
core/sql/optimizer/ItemLog.h | 22 +-
core/sql/optimizer/ItemOther.h | 2 +-
core/sql/optimizer/LargeScopeRules.cpp | 4 +-
core/sql/optimizer/MJVIndexBuilder.cpp | 12 +-
core/sql/optimizer/MVCandidates.cpp | 10 +-
core/sql/optimizer/MVInfo.cpp | 13 +-
core/sql/optimizer/MVJoinGraph.cpp | 5 +-
core/sql/optimizer/MjvBuilder.cpp | 2 +-
core/sql/optimizer/MultiJoin.cpp | 2 +-
core/sql/optimizer/MvRefreshBuilder.cpp | 4 +-
core/sql/optimizer/NAClusterInfo.cpp | 2 +-
core/sql/optimizer/NAFileSet.cpp | 8 -
core/sql/optimizer/NAFileSet.h | 4 -
core/sql/optimizer/NARoutine.cpp | 67 +-
core/sql/optimizer/NATable.cpp | 4362 +++++++++---------
core/sql/optimizer/NATable.h | 9 +-
core/sql/optimizer/NodeMap.cpp | 2 +-
core/sql/optimizer/NormItemExpr.cpp | 8 +-
core/sql/optimizer/NormRelExpr.cpp | 65 +-
core/sql/optimizer/NormWA.cpp | 4 +-
core/sql/optimizer/NormWA.h | 8 +
core/sql/optimizer/OptItemExpr.cpp | 2 +-
core/sql/optimizer/OptLogRelExpr.cpp | 2 +-
core/sql/optimizer/OptPhysRelExpr.cpp | 16 +-
core/sql/optimizer/OptRange.cpp | 4 +-
core/sql/optimizer/QRDescGenerator.cpp | 2 +-
core/sql/optimizer/QRDescGenerator.h | 5 +-
core/sql/optimizer/RETDesc.cpp | 10 +-
core/sql/optimizer/Refresh.cpp | 2 +-
core/sql/optimizer/RelCache.cpp | 12 +
core/sql/optimizer/RelExeUtil.h | 5 +-
core/sql/optimizer/RelExpr.cpp | 52 +-
core/sql/optimizer/RelGrby.h | 39 +-
core/sql/optimizer/RelJoin.h | 2 +-
core/sql/optimizer/RelMisc.h | 4 +-
core/sql/optimizer/RelPackedRows.cpp | 2 +-
core/sql/optimizer/RelRoutine.cpp | 2 +-
core/sql/optimizer/RelScan.h | 7 +-
core/sql/optimizer/Rule.cpp | 4 +-
core/sql/optimizer/ScanOptimizer.cpp | 4 +-
core/sql/optimizer/SchemaDB.cpp | 2 +-
core/sql/optimizer/SearchKey.cpp | 6 +-
core/sql/optimizer/Stats.cpp | 3 +-
core/sql/optimizer/Stats.h | 12 +-
core/sql/optimizer/SynthType.cpp | 14 +-
core/sql/optimizer/TableNameMap.h | 3 +-
core/sql/optimizer/TransRule.cpp | 14 +-
core/sql/optimizer/VEGTable.cpp | 6 +-
core/sql/optimizer/ValueDesc.cpp | 2 +-
core/sql/optimizer/memo.cpp | 2 +-
core/sql/parser/ElemDDLHbaseOptions.h | 3 +-
core/sql/parser/HvRoles.h | 2 +-
core/sql/parser/SqlParserAux.cpp | 38 +-
core/sql/parser/SqlParserAux.h | 4 -
core/sql/parser/StmtDDLCreate.cpp | 6 +-
core/sql/parser/sqlparser.y | 139 +-
core/sql/qmscommon/QRLogger.cpp | 14 +-
core/sql/qmscommon/Range.cpp | 3 +-
core/sql/qmscommon/Range.h | 3 +-
core/sql/regress/compGeneral/DIFF042.KNOWN | 36 +-
core/sql/regress/compGeneral/EXPECTED001.SB | 2 +-
core/sql/regress/compGeneral/EXPECTED011.SB | 22 +-
core/sql/regress/executor/TEST106 | 4 +
core/sql/regress/seabase/EXPECTED020 | 23 +
core/sql/regress/seabase/EXPECTED022 | 2 +-
core/sql/regress/seabase/EXPECTED033 | 617 +++
core/sql/regress/seabase/TEST020 | 10 +
core/sql/regress/seabase/TEST033 | 162 +
core/sql/regress/tools/regress-filter-linux | 2 +-
core/sql/runtimestats/ssmpipc.cpp | 5 +-
core/sql/sort/Qsort.h | 5 +-
core/sql/sort/Record.cpp | 14 +-
core/sql/sort/Record.h | 8 +
core/sql/sort/SortTopN.cpp | 318 ++
core/sql/sort/SortTopN.h | 89 +
core/sql/sort/SortUtil.cpp | 78 +-
core/sql/sort/SortUtil.h | 2 +-
core/sql/sort/SortUtilCfg.cpp | 43 +-
core/sql/sort/SortUtilCfg.h | 11 +-
core/sql/sqlcomp/CmpDescribe.cpp | 4 +-
core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp | 31 +-
core/sql/sqlcomp/CmpSeabaseDDLindex.cpp | 8 +-
core/sql/sqlcomp/CmpSeabaseDDLrepos.cpp | 4 +-
core/sql/sqlcomp/CmpSeabaseDDLtable.cpp | 63 +-
core/sql/sqlcomp/CmpSeabaseDDLview.cpp | 4 +-
core/sql/sqlcomp/DefaultConstants.h | 7 +-
core/sql/sqlcomp/PrivMgrCommands.cpp | 194 +-
core/sql/sqlcomp/PrivMgrCommands.h | 22 +-
core/sql/sqlcomp/PrivMgrDesc.h | 90 +-
core/sql/sqlcomp/PrivMgrPrivileges.cpp | 602 +--
core/sql/sqlcomp/PrivMgrPrivileges.h | 38 +-
core/sql/sqlcomp/PrivMgrRoles.cpp | 22 +-
core/sql/sqlcomp/QCache.cpp | 22 +-
core/sql/sqlcomp/QCache.h | 1 +
core/sql/sqlcomp/nadefaults.cpp | 18 +-
core/sql/sqlcomp/parser.cpp | 7 +-
core/sql/sqlmsg/GetErrorMessage.cpp | 2 +-
core/sql/sqlmxevents/logmxevent_traf.cpp | 10 +-
.../java/org/trafodion/sql/HBaseClient.java | 13 +-
core/sql/udrserv/spinfo.cpp | 3 +-
core/sql/ustat/hs_cli.cpp | 105 +-
core/sql/ustat/hs_cli.h | 4 +
core/sql/ustat/hs_globals.cpp | 30 +-
core/sql/ustat/hs_globals.h | 14 +
core/sql/ustat/hs_la.cpp | 3 +
core/sql/ustat/hs_log.h | 2 +
core/sql/ustat/hs_parser.cpp | 11 +-
core/sql/ustat/hs_update.cpp | 6 +
.../src/asciidoc/_chapters/binder_msgs.adoc | 102 +-
.../src/asciidoc/_chapters/ddl_msgs.adoc | 143 +
docs/messages_guide/src/asciidoc/index.adoc | 1 +
.../src/asciidoc/_chapters/sql_statements.adoc | 10 +-
docs/src/site/markdown/index.md | 21 +-
.../site/resources/images/carousel/meetup.png | Bin 81640 -> 0 bytes
docs/src/site/site.xml | 2 +-
install/installer/traf_cloudera_mods | 11 +-
install/installer/traf_config_setup | 5 -
install/installer/traf_secure_setup | 25 +-
install/installer/traf_sqconfig | 5 +-
install/installer/trafodion_install | 13 +
.../phoenix/end2end/MultiCfQueryExecTest.java | 7 +-
.../end2end/SaltedTableUpsertSelectTest.java | 13 +-
244 files changed, 7320 insertions(+), 7643 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1315eaf1/core/sqf/monitor/linux/zclient.cxx
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1315eaf1/core/sql/common/Ipc.cpp
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1315eaf1/core/sql/qmscommon/QRLogger.cpp
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1315eaf1/install/installer/traf_cloudera_mods
----------------------------------------------------------------------
[28/50] [abbrv] incubator-trafodion git commit: Merge remote branch
'origin/master' into TRAFODION-2001
Posted by su...@apache.org.
Merge remote branch 'origin/master' into TRAFODION-2001
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/79dccc2d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/79dccc2d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/79dccc2d
Branch: refs/heads/master
Commit: 79dccc2d7ae81e6182469383a002d4a0fa54a57b
Parents: 5175653 bbbd26e
Author: Zalo Correa <za...@esgyn.com>
Authored: Sat Nov 19 13:16:24 2016 -0800
Committer: Zalo Correa <za...@esgyn.com>
Committed: Sat Nov 19 13:16:24 2016 -0800
----------------------------------------------------------------------
.../jdbcT4/src/main/java/T4Messages.properties | 18 +
.../trafodion/jdbc/t4/ExtractLobMessage.java | 59 +++
.../org/trafodion/jdbc/t4/ExtractLobReply.java | 58 +++
.../java/org/trafodion/jdbc/t4/TRANSPORT.java | 3 +
.../java/org/trafodion/jdbc/t4/TrafT4Blob.java | 182 +++++++
.../java/org/trafodion/jdbc/t4/TrafT4Clob.java | 202 ++++++++
.../org/trafodion/jdbc/t4/TrafT4ResultSet.java | 91 +++-
.../jdbc/t4/odbc_SQLSvc_ExtractLob_exc_.java | 78 +++
core/conn/odb/src/odb.c | 12 +-
core/conn/odbc/src/odbc/Common/TransportBase.h | 1 +
.../src/odbc/Krypton/generated_incs/odbc_sv.h | 26 +
.../nsksrvr/Interface/marshalingsrvr_srvr.cpp | 102 ++++
.../nsksrvr/Interface/marshalingsrvr_srvr.h | 10 +-
.../src/odbc/nsksrvr/Interface/odbcs_srvr.cpp | 45 ++
.../odbc/nsksrvr/Interface/odbcs_srvr_res.cpp | 39 ++
.../src/odbc/nsksrvr/Interface/odbcs_srvr_res.h | 9 +-
core/conn/odbc/src/odbc/nsksrvr/SrvrConnect.cpp | 29 +-
core/conn/odbc/src/odbc/nsksrvr/SrvrConnect.h | 8 +
.../conn/odbc/src/odbc/nsksrvrcore/srvrcommon.h | 10 +
.../odbc/src/odbc/nsksrvrcore/srvrothers.cpp | 129 +++++
.../export/include/common/evl_sqlog_eventnum.h | 1 +
core/sqf/monitor/linux/cluster.cxx | 52 +-
core/sqf/monitor/linux/zclient.cxx | 32 +-
core/sqf/monitor/linux/zclient.h | 3 +-
.../transactional/TransactionalTable.java | 8 +-
.../transactional/TrxTransactionState.java.tmpl | 13 +-
core/sqf/src/tm/tmddlrequests.cpp | 8 +-
core/sql/cli/Statement.cpp | 2 +-
core/sql/comexe/ComTdbSort.h | 4 +-
core/sql/common/OperTypeEnum.h | 1 +
core/sql/executor/ExExeUtilMisc.cpp | 6 +-
core/sql/executor/ExFastTransport.cpp | 6 +-
core/sql/executor/ExHbaseIUD.cpp | 4 +-
core/sql/executor/ExHdfsScan.cpp | 24 +-
core/sql/executor/ExHdfsScan.h | 1 +
core/sql/executor/ex_sort.cpp | 222 +++++----
core/sql/executor/ex_sort.h | 130 ++++-
core/sql/executor/ex_sort_grby.cpp | 8 +-
core/sql/exp/ExpLOB.cpp | 22 +-
core/sql/exp/ExpLOBaccess.cpp | 36 +-
core/sql/exp/ExpLOBaccess.h | 11 +-
core/sql/exp/ExpLOBinterface.cpp | 5 +-
core/sql/exp/ExpLOBinterface.h | 2 +-
core/sql/exp/ExpSqlTupp.h | 7 +-
core/sql/generator/GenRelMisc.cpp | 2 +-
core/sql/optimizer/BindItemExpr.cpp | 9 +
core/sql/optimizer/BindRelExpr.cpp | 482 ++++++++++++++++++-
core/sql/optimizer/BindWA.cpp | 1 +
core/sql/optimizer/BindWA.h | 5 +-
core/sql/optimizer/HDFSHook.cpp | 8 +-
core/sql/optimizer/Inlining.cpp | 74 ++-
core/sql/optimizer/ItemExpr.cpp | 4 +-
core/sql/optimizer/ItemFunc.h | 2 +
core/sql/optimizer/NormRelExpr.cpp | 3 +
core/sql/optimizer/OptPhysRelExpr.cpp | 31 +-
core/sql/optimizer/RelCache.cpp | 10 +
core/sql/optimizer/RelExpr.cpp | 2 +
core/sql/optimizer/RelExpr.h | 6 +-
core/sql/optimizer/RelGrby.h | 13 +-
core/sql/optimizer/RelMisc.h | 1 +
core/sql/optimizer/RelSequence.cpp | 13 +-
core/sql/optimizer/RelUpdate.h | 5 +-
core/sql/parser/ParKeyWords.cpp | 1 +
core/sql/parser/sqlparser.y | 10 +-
core/sql/regress/executor/EXPECTED002.SB | 109 ++++-
core/sql/regress/executor/EXPECTED015.SB | 108 +++++
core/sql/regress/executor/TEST002 | 38 +-
core/sql/regress/executor/TEST015 | 25 +
core/sql/regress/seabase/EXPECTED033 | 129 ++---
core/sql/regress/seabase/TEST033 | 18 +-
core/sql/sort/SortTopN.cpp | 7 +-
core/sql/sqlcomp/DefaultConstants.h | 4 +
core/sql/sqlcomp/nadefaults.cpp | 1 +
core/sql/sqludr/sqludr.cpp | 22 +
core/sql/sqludr/sqludr.h | 1 +
core/sql/ustat/hs_cli.cpp | 361 ++++++++------
core/sql/ustat/hs_cli.h | 67 ++-
core/sql/ustat/hs_globals.cpp | 208 ++++----
core/sql/ustat/hs_globals.h | 18 +-
core/sql/ustat/hs_log.h | 15 +-
core/sql/ustat/hs_read.cpp | 4 +-
core/sql/ustat/hs_update.cpp | 1 +
.../java/org/trafodion/jdbc_test/TestClob.java | 95 ++++
install/installer/traf_start | 13 +-
84 files changed, 3046 insertions(+), 599 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/79dccc2d/core/sqf/export/include/common/evl_sqlog_eventnum.h
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/79dccc2d/core/sqf/monitor/linux/cluster.cxx
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/cluster.cxx
index eec0536,93362a3..c07e691
--- a/core/sqf/monitor/linux/cluster.cxx
+++ b/core/sqf/monitor/linux/cluster.cxx
@@@ -4515,14 -4317,20 +4515,20 @@@ int CCluster::AllgatherSock( int nbytes
bool p_sending;
bool p_receiving;
int p_timeout_count;
+ bool p_initial_check;
char *p_buff;
+ struct timespec znodeFailedTime;
} peer_t;
- peer_t p[cfgPNodes_];
+ peer_t p[GetConfigPNodesMax()];
memset( p, 0, sizeof(p) );
tag = 0; // make compiler happy
+ struct timespec currentTime;
+ // Set to twice the ZClient session timeout
+ static int sessionTimeout = ZClientEnabled
+ ? (ZClient->GetSessionTimeout() * 2) : 120;
int nsent = 0, nrecv = 0;
- for ( int iPeer = 0; iPeer < cfgPNodes_; iPeer++ )
+ for ( int iPeer = 0; iPeer < GetConfigPNodesMax(); iPeer++ )
{
peer_t *peer = &p[iPeer];
stats[iPeer].MPI_ERROR = MPI_SUCCESS;
@@@ -4588,12 -4397,13 +4595,13 @@@
}
// do the work
- struct epoll_event events[2*cfgPNodes_ + 1];
+ struct epoll_event events[2*GetConfigPNodesMax() + 1];
while ( 1 )
{
- int maxEvents = 2*cfgPNodes_ - nsent - nrecv;
+ int maxEvents = 2*GetConfigPNodesMax() - nsent - nrecv;
if ( maxEvents == 0 ) break;
int nw;
+ int zerr = ZOK;
while ( 1 )
{
nw = epoll_wait( epollFD_, events, maxEvents, sv_epoll_wait_timeout );
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/79dccc2d/core/sqf/monitor/linux/zclient.cxx
----------------------------------------------------------------------
[29/50] [abbrv] incubator-trafodion git commit: Merge remote branch
'origin/master' into TRAFODION-2001
Posted by su...@apache.org.
Merge remote branch 'origin/master' into TRAFODION-2001
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/cd7862ca
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/cd7862ca
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/cd7862ca
Branch: refs/heads/master
Commit: cd7862cab0ad243cd0e8f485d37376f2c23c3c57
Parents: 79dccc2 833f8a9
Author: Zalo Correa <za...@esgyn.com>
Authored: Wed Nov 30 15:27:48 2016 -0800
Committer: Zalo Correa <za...@esgyn.com>
Committed: Wed Nov 30 15:27:48 2016 -0800
----------------------------------------------------------------------
core/conn/jdbcT4/pom.xml | 79 +-
core/conn/odbc/src/odbc/nsksrvrcore/Makefile | 2 +-
core/dbsecurity/auth/Makefile | 1 +
core/sqf/.gitignore | 1 +
core/sqf/Makefile | 4 +-
core/sqf/build-scripts/build.branch | 8 +-
core/sqf/build-scripts/build.id | 2 +-
core/sqf/build-scripts/genverhdr.ksh | 15 +-
core/sqf/export/include/dtm/tm.h | 16 +-
core/sqf/export/include/dtm/tmtransaction.h | 13 +-
.../hbase/client/transactional/RMInterface.java | 40 +-
.../sqf/src/seatrans/tm/hbasetmlib2/hbasetm.cpp | 34 +-
core/sqf/src/seatrans/tm/hbasetmlib2/hbasetm.h | 14 +-
core/sqf/src/tm/tmddlrequests.cpp | 292 ++++---
core/sqf/src/tm/tmddlrequests.h | 8 +-
core/sqf/src/tm/tmlib.cpp | 26 +-
core/sqf/src/tm/tmlibmsg.h | 3 +
core/sqf/src/tm/tmrmhbase.cpp | 23 +-
core/sqf/src/tm/tmtransaction.cpp | 52 +-
core/sql/bin/SqlciErrors.txt | 8 +-
core/sql/comexe/ComTdbExeUtil.cpp | 26 +-
core/sql/comexe/ComTdbExeUtil.h | 112 ++-
core/sql/common/ComSmallDefs.h | 8 +
core/sql/common/NAType.cpp | 201 +++++
core/sql/common/NAType.h | 2 +
core/sql/common/OperTypeEnum.h | 8 +-
core/sql/executor/ExExeUtil.h | 8 +-
core/sql/executor/ExExeUtilGet.cpp | 365 ++++-----
core/sql/executor/ExExeUtilLoad.cpp | 46 +-
core/sql/executor/ExHbaseAccess.cpp | 30 +
core/sql/executor/ExHbaseAccess.h | 1 +
core/sql/executor/HBaseClient_JNI.cpp | 795 +++++++------------
core/sql/executor/HBaseClient_JNI.h | 12 +
core/sql/executor/JavaObjectInterface.cpp | 14 +
core/sql/executor/JavaObjectInterface.h | 4 +-
core/sql/executor/SequenceFileReader.cpp | 127 ---
core/sql/executor/SequenceFileReader.h | 12 -
core/sql/executor/hiveHook.cpp | 168 +++-
core/sql/exp/ExpHbaseDefs.h | 6 +
core/sql/exp/ExpHbaseInterface.cpp | 45 ++
core/sql/exp/ExpHbaseInterface.h | 12 +-
core/sql/exp/ExpLOBaccess.cpp | 2 -
core/sql/exp/ExpPackDefs.cpp | 10 +
core/sql/exp/exp_clause.cpp | 35 +-
core/sql/exp/exp_clause.h | 4 +-
core/sql/exp/exp_clause_derived.h | 169 ++++
core/sql/exp/exp_function.cpp | 204 ++++-
core/sql/exp/exp_function.h | 35 +-
core/sql/exp/exp_like.cpp | 80 ++
core/sql/generator/GenItemFunc.cpp | 42 +-
core/sql/generator/GenRelExeUtil.cpp | 77 +-
core/sql/optimizer/BindItemExpr.cpp | 24 +-
core/sql/optimizer/BindRelExpr.cpp | 17 +-
core/sql/optimizer/ImplRule.cpp | 2 +-
core/sql/optimizer/ItemCache.cpp | 4 +-
core/sql/optimizer/ItemExpr.cpp | 45 +-
core/sql/optimizer/ItemFunc.h | 104 ++-
core/sql/optimizer/NATable.cpp | 186 +----
core/sql/optimizer/NormItemExpr.cpp | 2 +-
core/sql/optimizer/RelRoutine.cpp | 9 +-
core/sql/optimizer/RelRoutine.h | 14 +-
core/sql/optimizer/SynthType.cpp | 67 +-
core/sql/optimizer/hiveHook.h | 116 +--
core/sql/parser/ParKeyWords.cpp | 2 +
core/sql/parser/sqlparser.y | 123 ++-
core/sql/regress/compGeneral/EXPECTED006.SB | 150 ++++
core/sql/regress/compGeneral/TEST006 | 40 +
core/sql/regress/executor/EXPECTED002.SB | 99 ++-
core/sql/regress/executor/TEST002 | 29 +-
core/sql/regress/seabase/EXPECTED002 | 266 +++++--
core/sql/regress/seabase/EXPECTED012 | 52 +-
core/sql/regress/seabase/TEST002 | 28 +
core/sql/regress/seabase/TEST012 | 11 +
core/sql/sqlcomp/CmpDDLCatErrorCodes.h | 4 +-
core/sql/sqlcomp/CmpSeabaseDDLrepos.cpp | 19 +-
core/sql/sqlcomp/CmpSeabaseDDLtable.cpp | 60 +-
.../java/org/trafodion/sql/HBaseClient.java | 40 +
.../java/org/trafodion/sql/HBulkLoadClient.java | 2 -
.../org/trafodion/sql/SequenceFileWriter.java | 70 +-
core/sql/ustat/hs_globals.cpp | 14 +
core/sql/ustat/hs_util.h | 3 +-
.../src/asciidoc/_chapters/ddl_msgs.adoc | 84 +-
.../sql_functions_and_expressions.adoc | 249 +++++-
.../_chapters/sql_language_elements.adoc | 3 +-
.../src/asciidoc/_chapters/sql_statements.adoc | 243 +++---
85 files changed, 3697 insertions(+), 1785 deletions(-)
----------------------------------------------------------------------
[16/50] [abbrv] incubator-trafodion git commit: Merge remote branch
'origin/master' into TRAFODION-2001
Posted by su...@apache.org.
Merge remote branch 'origin/master' into TRAFODION-2001
Conflicts:
install/installer/addNode_step2
install/installer/getNodes.py
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/b3503998
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/b3503998
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/b3503998
Branch: refs/heads/master
Commit: b3503998208bffac2f8cfdbdff4dc62b2b00406f
Parents: 9075957 34621af
Author: Zalo Correa <za...@esgyn.com>
Authored: Mon Aug 29 08:04:37 2016 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Mon Aug 29 08:04:37 2016 -0700
----------------------------------------------------------------------
core/sqf/sql/scripts/ckillall | 2 +-
.../transactional/TrxRegionEndpoint.java.tmpl | 2 -
core/sql/common/NAString.cpp | 1 +
core/sql/optimizer/ColStatDesc.cpp | 11 +--
core/sql/optimizer/ImplRule.cpp | 4 +
core/sql/parser/ParKeyWords.cpp | 2 +
core/sql/parser/sqlparser.y | 62 +++++++++++++++
core/sql/regress/executor/EXPECTED002.SB | 56 +++++++++++++
core/sql/regress/executor/TEST002 | 20 +++++
install/installer/checkJava.py | 66 +++++++++++++++
install/installer/getNodes.py | 22 +++++
install/installer/traf_config_check | 84 +++++---------------
12 files changed, 261 insertions(+), 71 deletions(-)
----------------------------------------------------------------------
[19/50] [abbrv] incubator-trafodion git commit: Merge remote branch
'origin/master' into TRAFODION-2001
Posted by su...@apache.org.
Merge remote branch 'origin/master' into TRAFODION-2001
Conflicts:
core/sqf/export/include/common/evl_sqlog_eventnum.h
core/sqf/monitor/linux/makefile
core/sqf/sql/scripts/sqcheck
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/1e294233
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/1e294233
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/1e294233
Branch: refs/heads/master
Commit: 1e2942337ed5888e7685406d786fe1fce6507d54
Parents: 52d45b7 1e94882
Author: Zalo Correa <za...@esgyn.com>
Authored: Wed Sep 28 15:37:47 2016 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Wed Sep 28 15:37:47 2016 -0700
----------------------------------------------------------------------
.../export/include/common/evl_sqlog_eventnum.h | 41 +
core/sqf/monitor/linux/cluster.cxx | 249 ++-
core/sqf/monitor/linux/cluster.h | 1 +
core/sqf/monitor/linux/makefile | 26 +-
core/sqf/monitor/linux/monitor.cxx | 187 +++
core/sqf/monitor/linux/monitor.h | 2 +
core/sqf/monitor/linux/zclient.cxx | 1432 ++++++++++++++++++
core/sqf/monitor/linux/zclient.h | 116 ++
core/sqf/monitor/linux/zootest.cxx | 283 ++++
core/sqf/monitor/linux/zootest.h | 34 +
core/sqf/sqenvcom.sh | 19 +-
core/sqf/sql/scripts/sqcheck | 27 +-
core/sql/bin/SqlciErrors.txt | 4 +-
core/sql/regress/compGeneral/EXPECTED023 | 2 +-
core/sql/regress/hive/EXPECTED018 | 183 ++-
core/sql/regress/privs1/EXPECTED132 | 100 +-
core/sql/regress/privs1/EXPECTED136 | 2 +
core/sql/regress/privs2/EXPECTED129 | 23 +-
core/sql/regress/privs2/EXPECTED135 | 17 +-
core/sql/regress/privs2/EXPECTED138 | 22 +
core/sql/regress/privs2/EXPECTED139 | 10 +
core/sql/regress/privs2/EXPECTED140 | 4 +-
core/sql/regress/privs2/EXPECTED142 | 6 +
core/sql/sqlcomp/PrivMgrDesc.cpp | 36 +-
core/sql/sqlcomp/PrivMgrDesc.h | 22 +-
core/sql/sqlcomp/PrivMgrPrivileges.cpp | 1349 +++++++----------
core/sql/sqlcomp/PrivMgrPrivileges.h | 78 +-
core/sql/sqlcomp/nadefaults.cpp | 2 +-
.../org/trafodion/dcs/server/ServerManager.java | 115 +-
.../phoenix/end2end/MultiCfQueryExecTest.java | 2 +-
30 files changed, 3345 insertions(+), 1049 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e294233/core/sqf/export/include/common/evl_sqlog_eventnum.h
----------------------------------------------------------------------
diff --cc core/sqf/export/include/common/evl_sqlog_eventnum.h
index b15382f,e723d33..ec85b13
--- a/core/sqf/export/include/common/evl_sqlog_eventnum.h
+++ b/core/sqf/export/include/common/evl_sqlog_eventnum.h
@@@ -768,9 -727,38 +777,41 @@@
/* Module: pstartd.cxx = 35 */
#define MON_PSTARTD_MAIN_1 101350101
+/* Module: persistconfig.cxx = 36 */
+#define MON_PERSISTCONFIG_ADDCONFIG_1 101360101
+
+ /* Module: zoonode.cxx = 37 */
+ #define MON_ZCLIENT_ZCLIENT_1 101370101
+ #define MON_ZCLIENT_ZCLIENT_2 101370102
+ #define MON_ZCLIENT_ZCLIENT_3 101370103
+ #define MON_ZCLIENT_SYNC_STRING_COMP_1 101370201
+ #define MON_ZCLIENT_CHECKCLUSTER_1 101370301
+ #define MON_ZCLIENT_CHECKCLUSTER_2 101370302
+ #define MON_ZCLIENT_CHECKCLUSTERZNODES_1 101370401
+ #define MON_ZCLIENT_CHECKCLUSTERZNODES_2 101370402
+ #define MON_ZCLIENT_CHECKCLUSTERZNODES_3 101370403
+ #define MON_ZCLIENT_GETCLUSTERZNODES_1 101370501
+ #define MON_ZCLIENT_GETCLUSTERZNODES_2 101370502
+ #define MON_ZCLIENT_REGISTERZNODE_1 101370601
+ #define MON_ZCLIENT_SHUTDOWNWORK_1 101370701
+ #define MON_ZCLIENT_ZCLIENTTHREAD_1 101370801
+ #define MON_ZCLIENT_STARTWORK_1 101370901
+ #define MON_ZCLIENT_MONITORZCLUSTER_1 101371001
+ #define MON_ZCLIENT_GETZNODEDATA_1 101371101
+ #define MON_ZCLIENT_GETZNODEDATA_2 101371102
+ #define MON_ZCLIENT_GETZNODEDATA_3 101371103
+ #define MON_ZCLIENT_WATCHCLUSTER_1 101371201
+ #define MON_ZCLIENT_WATCHCLUSTER_2 101371202
+ #define MON_ZCLIENT_SETZNODEWATCH_1 101371301
+ #define MON_ZCLIENT_SETZNODEWATCH_2 101371302
+ #define MON_ZCLIENT_WATCHNODE_1 101371401
+ #define MON_ZCLIENT_ZSESSIONWATCHER_1 101371501
+ #define MON_ZCLIENT_ZSESSIONWATCHER_2 101371502
+ #define MON_ZCLIENT_CHECKZNODE_1 101371601
+ #define MON_ZCLIENT_WATCHNODEDELETE_1 101371701
+ #define MON_ZCLIENT_WATCHNODEDELETE_2 101371702
+ #define MON_ZCLIENT_WATCHNODEDELETE_3 101371703
+
/**********************************************/
/*********** Seabed ***********/
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e294233/core/sqf/monitor/linux/cluster.cxx
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/cluster.cxx
index 5a46cf8,104f7d8..84768c9
--- a/core/sqf/monitor/linux/cluster.cxx
+++ b/core/sqf/monitor/linux/cluster.cxx
@@@ -4447,9 -4276,10 +4474,10 @@@ int CCluster::AllgatherSock( int nbytes
int p_n2recv;
bool p_sending;
bool p_receiving;
+ int p_timeout_count;
char *p_buff;
} peer_t;
- peer_t p[cfgPNodes_];
+ peer_t p[GetConfigPNodesMax()];
memset( p, 0, sizeof(p) );
tag = 0; // make compiler happy
@@@ -4481,18 -4312,116 +4510,116 @@@
inBarrier_ = true;
MonStats->BarrierWaitIncr( );
+ static int sv_epoll_wait_timeout = -2;
+ static int sv_epoll_retry_count = 1;
+ if ( sv_epoll_wait_timeout == -2 )
+ {
+ char *lv_epoll_wait_timeout_env = getenv( "SQ_MON_EPOLL_WAIT_TIMEOUT" );
+ if ( lv_epoll_wait_timeout_env )
+ {
+ // convert to milliseconds
+ sv_epoll_wait_timeout = atoi( lv_epoll_wait_timeout_env ) * 1000;
+ }
+ else
+ {
+ sv_epoll_wait_timeout = -1;
+ }
+
+ char *lv_epoll_retry_count_env = getenv( "SQ_MON_EPOLL_RETRY_COUNT" );
+ if ( lv_epoll_retry_count_env )
+ {
+ sv_epoll_retry_count = atoi( lv_epoll_retry_count_env );
+ }
+ if ( sv_epoll_retry_count < 0 )
+ {
+ sv_epoll_retry_count = 0;
+ }
+ if ( sv_epoll_retry_count > 100 )
+ {
+ sv_epoll_retry_count = 100;
+ }
+ }
+
// do the work
- struct epoll_event events[2*cfgPNodes_ + 1];
+ struct epoll_event events[2*GetConfigPNodesMax() + 1];
while ( 1 )
{
- int maxEvents = 2*cfgPNodes_ - nsent - nrecv;
+ int maxEvents = 2*GetConfigPNodesMax() - nsent - nrecv;
if ( maxEvents == 0 ) break;
int nw;
while ( 1 )
{
- nw = epoll_wait( epollFD_, events, maxEvents, -1 );
+ nw = epoll_wait( epollFD_, events, maxEvents, sv_epoll_wait_timeout );
if ( nw >= 0 || errno != EINTR ) break;
}
+ if ( nw == 0 )
+ {
- for ( int iPeer = 0; iPeer < cfgPNodes_; iPeer++ )
++ for ( int iPeer = 0; iPeer < GetConfigPNodesMax(); iPeer++ )
+ {
+ peer_t *peer = &p[iPeer];
+ if ( (iPeer != MyPNID) &&
+ (socks_[iPeer] != -1) )
+ {
+ if ( (peer->p_receiving) ||
+ (peer->p_sending) )
+ {
+
+ peer->p_timeout_count++;
+
+ if ( peer->p_timeout_count <= sv_epoll_retry_count )
+ {
+ continue;
+ }
+
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s@%d] Not heard from peer=%d\n"
+ , method_name
+ , __LINE__
+ , iPeer );
+
+ mon_log_write( MON_CLUSTER_ALLGATHERSOCK_1, SQ_LOG_CRIT, buf );
+ stats[iPeer].MPI_ERROR = MPI_ERR_EXITED;
+ err = MPI_ERR_IN_STATUS;
+ if ( peer->p_sending )
+ {
+ peer->p_sending = false;
+ nsent++;
+ }
+ if ( peer->p_receiving )
+ {
+ peer->p_receiving = false;
+ nrecv++;
+ }
+
+ // setup the epoll structures
+ struct epoll_event event;
+ event.data.fd = socks_[iPeer];
+ int op = 0;
+ if ( !peer->p_sending && !peer->p_receiving )
+ {
+ op = EPOLL_CTL_DEL;
+ event.events = 0;
+ }
+ else if ( peer->p_sending )
+ {
+ op = EPOLL_CTL_MOD;
+ event.events = EPOLLOUT | EPOLLET | EPOLLRDHUP;
+ }
+ else if ( peer->p_receiving )
+ {
+ op = EPOLL_CTL_MOD;
+ event.events = EPOLLIN | EPOLLET | EPOLLRDHUP;
+ }
+ if ( op == EPOLL_CTL_DEL || op == EPOLL_CTL_MOD )
+ {
+ EpollCtl( epollFD_, op, socks_[iPeer], &event );
+ }
+ }
+ }
+ }
+ }
+
if ( nw < 0 )
{
char ebuff[256];
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e294233/core/sqf/monitor/linux/cluster.h
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/cluster.h
index cfaf495,eba2d5c..4d429fd
mode 100644,100755..100644
--- a/core/sqf/monitor/linux/cluster.h
+++ b/core/sqf/monitor/linux/cluster.h
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e294233/core/sqf/monitor/linux/makefile
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/makefile
index 451e459,656e9e6..0660414
mode 100644,100755..100644
--- a/core/sqf/monitor/linux/makefile
+++ b/core/sqf/monitor/linux/makefile
@@@ -288,10 -288,13 +296,15 @@@ ALLOBJS += $(TRACE_LOG_OBJS
ALLOBJS += $(CONFOBJS)
ALLOBJS += $(MEMLOGOBJS)
ALLOBJS += $(RTSIGBLOCK_OBJS)
+ALLOBJS += $(TCONFOBJS)
+ ALLOBJS += $(ZOOMONOBJS)
- PGMS = $(BINEXPDIR)/monitor $(BINEXPDIR)/shell $(BINEXPDIR)/sqwatchdog $(BINEXPDIR)/monmemlog $(BINEXPDIR)/trafconf
+ PGMS = $(BINEXPDIR)/monitor
+ PGMS += $(BINEXPDIR)/shell
+ PGMS += $(BINEXPDIR)/sqwatchdog
+ PGMS += $(BINEXPDIR)/monmemlog
PGMS += $(BINEXPDIR)/pstartd
++PGMS += $(BINEXPDIR)/trafconf
PGMS += $(LIBEXPDIR)/libseabasesig.so
TEST_PGMS = $(OUTDIR)/client
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e294233/core/sqf/monitor/linux/monitor.cxx
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/monitor.cxx
index 34995f4,a4b114c..669f3ad
--- a/core/sqf/monitor/linux/monitor.cxx
+++ b/core/sqf/monitor/linux/monitor.cxx
@@@ -755,6 -750,150 +758,150 @@@ void CMonitor::StartPrimitiveProcesses
TRACE_EXIT;
}
+ void HandleZSessionExpiration( void )
+ {
+ const char method_name[] = "HandleZSessionExpiration";
+ TRACE_ENTRY;
+ ReqQueue.enqueueDownReq(MyPNID);
+ TRACE_EXIT;
+ }
+
+ void HandleNodeExpiration( const char *nodeName )
+ {
+ const char method_name[] = "HandleNodeExpiration";
+ TRACE_ENTRY;
+ CNode *node = Nodes->GetNode((char *)nodeName);
+ if (node)
+ {
+ ReqQueue.enqueueDownReq(node->GetPNid());
+ }
+ TRACE_EXIT;
+ }
+
+ void CMonitor::CreateZookeeperClient( void )
+ {
+ const char method_name[] = "CMonitor::CreateZookeeperClient";
+ TRACE_ENTRY;
+
+ if ( ZClientEnabled )
+ {
+ string hostName;
+ string zkQuorumHosts;
+ stringstream zkQuorumPort;
+ char *env;
- char hostsStr[MAX_PROCESSOR_NAME*3] = { 0 };
++ char hostsStr[MPI_MAX_PROCESSOR_NAME * 3] = { 0 };
+ char *tkn = NULL;
+
+ int zport;
+ env = getenv("ZOOKEEPER_PORT");
+ if ( env && isdigit(*env) )
+ {
+ zport = atoi(env);
+ }
+ else
+ {
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf(buf, sizeof(buf),
+ "[%s], Zookeeper quorum port is not defined!\n"
+ , method_name);
+ mon_log_write(MON_MONITOR_CREATEZCLIENT_1, SQ_LOG_CRIT, buf);
+
+ ZClientEnabled = false;
+ TRACE_EXIT;
+ return;
+ }
+
+ env = getenv("ZOOKEEPER_NODES");
+ if ( env )
+ {
+ zkQuorumHosts = env;
+ if ( zkQuorumHosts.length() == 0 )
+ {
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf(buf, sizeof(buf),
+ "[%s], Zookeeper quorum hosts are not defined!\n"
+ , method_name);
+ mon_log_write(MON_MONITOR_CREATEZCLIENT_2, SQ_LOG_CRIT, buf);
+
+ ZClientEnabled = false;
+ TRACE_EXIT;
+ return;
+ }
+
+ strcpy( hostsStr, zkQuorumHosts.c_str() );
+ zkQuorumPort.str( "" );
+
+ tkn = strtok( hostsStr, "," );
+ do
+ {
+ if ( tkn != NULL )
+ {
+ hostName = tkn;
+ zkQuorumPort << hostName.c_str()
+ << ":"
+ << zport;
+ }
+ tkn = strtok( NULL, "," );
+ if ( tkn != NULL )
+ {
+ zkQuorumPort << ",";
+ }
+
+ }
+ while( tkn != NULL );
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "%s@%d zkQuorumPort=%s\n"
+ , method_name, __LINE__
+ , zkQuorumPort.str().c_str() );
+ }
+ }
+
+ ZClient = new CZClient( zkQuorumPort.str().c_str()
+ , ZCLIENT_TRAFODION_ZNODE
+ , ZCLIENT_INSTANCE_ZNODE );
+ if ( ZClient == NULL )
+ {
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf(buf, sizeof(buf),
+ "[%s], Failed to allocate ZClient object!\n"
+ , method_name);
+ mon_log_write(MON_MONITOR_CREATEZCLIENT_3, SQ_LOG_CRIT, buf);
+ abort();
+ }
+ }
+
+ TRACE_EXIT;
+ }
+
+ void CMonitor::StartZookeeperClient( void )
+ {
+ const char method_name[] = "CMonitor::StartZookeeperClient";
+ TRACE_ENTRY;
+
+ int rc = -1;
+
+ if ( ZClientEnabled )
+ {
+ if ( ZClient )
+ {
+ rc = ZClient->StartWork();
+ if (rc == 0)
+ {
+ ZClient->StartMonitoring();
+
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf(buf, sizeof(buf),
+ "[%s], ZClient node monitoring started\n"
+ , method_name);
+ mon_log_write(MON_MONITOR_STARTZCLIENT_1, SQ_LOG_INFO, buf);
+ }
+ }
+ }
+
+ TRACE_EXIT;
+ }
+
#ifdef USE_SEQUENCE_NUM
long long CMonitor::GetTimeSeqNum()
{
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e294233/core/sqf/monitor/linux/monitor.h
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/monitor.h
index 49308b9,1b44c57..1b44c57
mode 100644,100755..100644
--- a/core/sqf/monitor/linux/monitor.h
+++ b/core/sqf/monitor/linux/monitor.h
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e294233/core/sqf/monitor/linux/zclient.cxx
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/zclient.cxx
index 0000000,01ab4e5..c767639
mode 000000,100644..100644
--- a/core/sqf/monitor/linux/zclient.cxx
+++ b/core/sqf/monitor/linux/zclient.cxx
@@@ -1,0 -1,1432 +1,1432 @@@
+ /**********************************************************************
+ // @@@ START COPYRIGHT @@@
+ //
+ // Licensed to the Apache Software Foundation (ASF) under one
+ // or more contributor license agreements. See the NOTICE file
+ // distributed with this work for additional information
+ // regarding copyright ownership. The ASF licenses this file
+ // to you under the Apache License, Version 2.0 (the
+ // "License"); you may not use this file except in compliance
+ // with the License. You may obtain a copy of the License at
+ //
+ // http://www.apache.org/licenses/LICENSE-2.0
+ //
+ // Unless required by applicable law or agreed to in writing,
+ // software distributed under the License is distributed on an
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ // KIND, either express or implied. See the License for the
+ // specific language governing permissions and limitations
+ // under the License.
+ //
+ // @@@ END COPYRIGHT @@@
+ ********************************************************************/
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <sys/ioctl.h>
+ #include <sys/time.h>
+ #include <signal.h>
+ #include <ctype.h>
+ #include <string.h>
+ #include <ifaddrs.h>
+ #include <netdb.h>
+ #include <new>
+ #include <stdio.h>
+ #include <list>
+ #include <string>
+
+ #include "lock.h"
+ #include "msgdef.h"
+ #include "montrace.h"
+ #include "monlogging.h"
+ #include "reqqueue.h"
+ #include "pnode.h"
+ #include "zclient.h"
+
+ // The following specify the default values for the timers if the
+ // zclient cluster monitoring timer related variables are not defined.
+ //
+ // NOTE: It is recommended to set the checkrate to -1 which essentially
+ // make the zclient event driven. Meaning the watcher is called
+ // only when watched a znode is changed or is deleted (expires)
+ // Also, the session timeout must be kept at or below 60 seconds
+ // as this is enforced by Zookeeper. Any, value above 60 seconds
+ // is renegotiated by Zookeeper to 60 seconds.
+ #define ZCLIENT_MONITORING_CHECKRATE -1 // seconds (disabled)
+ #define ZCLIENT_SESSION_TIMEOUT 60 // seconds (1 minute)
+
+ // The monitors register their znodes under the cluster znode
+ #define ZCLIENT_CLUSTER_ZNODE "/cluster"
+
+ using namespace std;
+
+ extern char Node_name[MPI_MAX_PROCESSOR_NAME];
+ extern int MyPNID;
+ extern int MyNid;
+ extern int MyPid;
+
+ extern CNodeContainer *Nodes;
+ extern CReqQueue ReqQueue;
+ extern CZClient *ZClient;
+ extern CMonLog *MonLog;
+ extern CMonLog *SnmpLog;
+
+ extern bool debugFlag;
+
+ static zhandle_t *ZHandle;
+ static clientid_t MyZooId;
+
+ void ZSessionWatcher( zhandle_t *zzh
+ , int type
+ , int state
+ , const char *path
+ , void *watcherCtx);
+
+ void FreeStringVector( struct String_vector *v )
+ {
+ if ( v->data )
+ {
+ for ( int32_t i=0; i < v->count; i++ )
+ {
+ free( v->data[i] );
+ }
+ free( v->data );
+ v->data = NULL;
+ v->count = 0;
+ }
+ }
+
+ static const char *ZClientStateStr( CZClient::ZClientState_t state )
+ {
+ switch (state)
+ {
+ case CZClient::ZC_DISABLED:
+ return "ZC_DISABLED";
+ case CZClient::ZC_START:
+ return "ZC_START";
+ case CZClient::ZC_CLUSTER:
+ return "ZC_CLUSTER";
+ case CZClient::ZC_ZNODE:
+ return "ZC_ZNODE";
+ case CZClient::ZC_WATCH:
+ return "ZC_WATCH";
+ case CZClient::ZC_STOP:
+ return "ZC_STOP";
+ case CZClient::ZC_SHUTDOWN:
+ return "ZC_SHUTDOWN";
+ default:
+ break;
+ }
+ return "ZClient State Invalid";
+ }
+
+ static const char *ZooConnectionTypeStr( int type )
+ {
+ if ( type == ZOO_CREATED_EVENT )
+ return "ZOO_CREATED_EVENT";
+ if ( type == ZOO_DELETED_EVENT )
+ return "ZOO_DELETED_EVENT";
+ if ( type == ZOO_CHANGED_EVENT )
+ return "ZOO_CHANGED_EVENT";
+ if ( type == ZOO_CHILD_EVENT )
+ return "ZOO_CHILD_EVENT";
+ if ( type == ZOO_SESSION_EVENT )
+ return "ZOO_SESSION_EVENT";
+ if ( type == ZOO_NOTWATCHING_EVENT )
+ return "ZOO_NOTWATCHING_EVENT";
+
+ return "INVALID_TYPE";
+ }
+
+ static const char *ZooConnectionStateStr( int state )
+ {
+ if ( state == 0 )
+ return "CLOSED_STATE";
+ if ( state == ZOO_EXPIRED_SESSION_STATE )
+ return "EXPIRED_SESSION_STATE";
+ if ( state == ZOO_AUTH_FAILED_STATE )
+ return "AUTH_FAILED_STATE";
+ if ( state == ZOO_CONNECTING_STATE )
+ return "CONNECTING_STATE";
+ if ( state == ZOO_ASSOCIATING_STATE )
+ return "ASSOCIATING_STATE";
+ if ( state == ZOO_CONNECTED_STATE )
+ return "CONNECTED_STATE";
+
+ return "INVALID_STATE";
+ }
+
+ const char *ZooErrorStr( int error )
+ {
+ if ( error == 0 )
+ return "ZOK";
+ if ( error == ZNONODE )
+ return "ZNONODE";
+ if ( error == ZNODEEXISTS )
+ return "ZNODEEXISTS";
+ if ( error == ZNOAUTH )
+ return "ZNOAUTH";
+ if ( error == ZNOCHILDRENFOREPHEMERALS )
+ return "ZNOCHILDRENFOREPHEMERALS";
+ if ( error == ZBADARGUMENTS )
+ return "ZBADARGUMENTS";
+ if ( error == ZINVALIDSTATE )
+ return "ZINVALIDSTATE";
+ if ( error == ZMARSHALLINGERROR )
+ return "ZMARSHALLINGERROR";
+ if ( error == ZCONNECTIONLOSS )
+ return "ZCONNECTIONLOSS";
+ if ( error == ZOPERATIONTIMEOUT )
+ return "ZOPERATIONTIMEOUT";
+
+ static char errorStr[20];
+ sprintf( errorStr, "%d", error );
+ return errorStr;
+ }
+
+ void ZSessionWatcher( zhandle_t *zzh
+ , int type
+ , int state
+ , const char *path
+ , void *watcherCtx)
+ {
+ const char method_name[] = "ZSessionWatcher";
+ TRACE_ENTRY;
+
+ watcherCtx = watcherCtx; // Make compiler happy!
+
+ /*
+ * Be careful using ZHandle here rather than zzh - as this may be mt code
+ * the client lib may call the watcher before zookeeper_init returns
+ */
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ if ( path && strlen( path ) > 0 )
+ {
+ trace_printf( "%s@%d" " - Watcher %s state = %s for path %s\n"
+ , method_name, __LINE__
+ , ZooConnectionTypeStr( type )
+ , ZooConnectionStateStr( state )
+ , path );
+ }
+ else
+ {
+ trace_printf( "%s@%d" " - Watcher %s state = %s\n"
+ , method_name, __LINE__
+ , ZooConnectionTypeStr( type )
+ , ZooConnectionStateStr( state ) );
+ }
+ }
+
+ if ( type == ZOO_SESSION_EVENT )
+ {
+ if ( state == ZOO_CONNECTED_STATE )
+ {
+ const clientid_t *id = zoo_client_id( zzh );
+ if ( MyZooId.client_id == 0 || MyZooId.client_id != id->client_id )
+ {
+ MyZooId = *id;
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "%s@%d" " - Got a new session id: 0x%llx\n"
+ , method_name, __LINE__
+ , static_cast<long long unsigned int>(MyZooId.client_id) );
+ }
+ }
+ }
+ else if ( state == ZOO_AUTH_FAILED_STATE )
+ {
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s], Error Zookeeper authentication failure. Node going down...\n"
+ , method_name );
+ mon_log_write(MON_ZCLIENT_ZSESSIONWATCHER_1, SQ_LOG_CRIT, buf);
+
+ HandleZSessionExpiration();
+
+ zookeeper_close( zzh );
+ ZHandle=0;
+ }
+ else if ( state == ZOO_EXPIRED_SESSION_STATE )
+ {
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s], Error Zookeeper session expired. Node going down...\n"
+ , method_name );
+ mon_log_write(MON_ZCLIENT_ZSESSIONWATCHER_2, SQ_LOG_CRIT, buf);
+
+ HandleZSessionExpiration();
+
+ zookeeper_close( zzh );
+ ZHandle=0;
+ }
+ }
+ else if ( type == ZOO_CREATED_EVENT )
+ {
+ ZClient->TriggerCheck( type, path );
+ }
+ else if ( type == ZOO_DELETED_EVENT )
+ {
+ ZClient->TriggerCheck( type, path );
+ }
+ else if ( type == ZOO_CHANGED_EVENT )
+ {
+ ZClient->TriggerCheck( type, path );
+ }
+ else if ( type == ZOO_CHILD_EVENT )
+ {
+ ZClient->TriggerCheck( type, path );
+ }
+ else if ( type == ZOO_NOTWATCHING_EVENT )
+ {
+ ZClient->TriggerCheck( type, path );
+ }
+
+ TRACE_EXIT;
+ }
+
+ CZClient::CZClient( const char *quorumHosts
+ , const char *rootNode
+ , const char *instanceNode )
+ :threadId_(0)
+ ,state_(ZC_DISABLED)
+ ,enabled_(false)
+ ,checkCluster_(false)
+ ,zcMonitoringRate_(ZCLIENT_MONITORING_CHECKRATE) // seconds
+ ,zkQuorumHosts_(quorumHosts)
+ ,zkRootNode_(rootNode)
+ ,zkRootNodeInstance_(instanceNode)
+ ,zkQuorumPort_("")
+ ,zkSessionTimeout_(ZCLIENT_SESSION_TIMEOUT) // seconds
+ {
+ const char method_name[] = "CZClient::CZClient";
+ TRACE_ENTRY;
+
+ memcpy(&eyecatcher_, "ZCLT", 4);
+
+ char *zcMonitoringRateValueC;
+ int zcMonitoringRateValue;
+ if ( (zcMonitoringRateValueC = getenv( "SQ_MON_ZCLIENT_MONITORING_CHECKRATE" )) )
+ {
+ // in seconds
+ zcMonitoringRateValue = atoi( zcMonitoringRateValueC );
+ zcMonitoringRate_ = zcMonitoringRateValue; // in seconds
+ }
+
+ char *zkSessionTimeoutC;
+ int zkSessionTimeoutValue;
+ if ( (zkSessionTimeoutC = getenv( "SQ_MON_ZCLIENT_SESSION_TIMEOUT" )) )
+ {
+ // in seconds
+ zkSessionTimeoutValue = atoi( zkSessionTimeoutC );
+ zkSessionTimeout_ = zkSessionTimeoutValue; // in seconds
+ }
+
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "%s@%d" " - ZClient monitoring rate in seconds=%ld\n"
+ , method_name, __LINE__, zcMonitoringRate_ );
+ trace_printf( "%s@%d" " - ZClient session timeout in seconds =%d\n"
+ , method_name, __LINE__, zkSessionTimeout_ );
+ }
+
+ if ( zkQuorumHosts_.length() == 0 )
+ {
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s], Zookeeper quorum port address not initialized\n"
+ , method_name);
+ mon_log_write(MON_ZCLIENT_ZCLIENT_1, SQ_LOG_ERR, buf);
+ abort();
+ }
+ else
+ {
+ zkQuorumPort_ << zkQuorumHosts_.c_str();
+
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "%s@%d zkQuorumPort is: %s\n"
+ , method_name, __LINE__
+ , zkQuorumPort_.str( ).c_str( ));
+ }
+ }
+
+ // Initialize zookeeper
+ zoo_deterministic_conn_order( 0 ); // non-deterministic order for client connections
+ ZHandle = zookeeper_init( zkQuorumPort_.str( ).c_str( )
+ , ZSessionWatcher
+ , zkSessionTimeout_ * 1000
+ , &MyZooId
+ , 0
+ , 0 );
+ if ( ZHandle == 0 )
+ {
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s], zookeeper_init() failed for host:port %s\n"
+ , method_name, zkQuorumPort_.str( ).c_str( ));
+ mon_log_write(MON_ZCLIENT_ZCLIENT_2, SQ_LOG_ERR, buf);
+ abort();
+ }
+
+ int rc = InitializeZClient();
+ if ( rc )
+ {
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s], Failed ZClient initialization (%s)\n"
+ , method_name, ZooErrorStr(rc) );
+ mon_log_write(MON_ZCLIENT_ZCLIENT_3, SQ_LOG_ERR, buf);
+ abort();
+ }
+
+ TRACE_EXIT;
+ }
+
+ CZClient::~CZClient( void )
+ {
+ const char method_name[] = "CZClient::~CZClient";
+ TRACE_ENTRY;
+
+ memcpy(&eyecatcher_, "zclt", 4);
+
+ if (ZHandle)
+ {
+ zookeeper_close(ZHandle);
+ ZHandle = 0;
+ }
+
+ TRACE_EXIT;
+ }
+
+ void CZClient::CheckCluster( void )
+ {
+ const char method_name[] = "CZClient::CheckCluster";
+ TRACE_ENTRY;
+
+ int rc;
+ struct String_vector nodes;
+
+ if ( IsCheckCluster() )
+ {
+ rc = GetClusterZNodes( &nodes );
+ if ( rc != ZOK )
+ {
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s], GetClusterZNodes() failed!\n"
+ , method_name );
+ mon_log_write(MON_ZCLIENT_CHECKCLUSTER_1, SQ_LOG_ERR, buf);
+ SetState( CZClient::ZC_STOP );
+ CLock::wakeOne();
+ return;
+ }
+
+ stringstream newpath;
+ string monZnode;
+ string nodeName;
+ int pnid = -1;
+
+ if ( nodes.count > 0 )
+ {
+ for (int i = 0; i < nodes.count ; i++ )
+ {
+ newpath.str( "" );
+ newpath << zkRootNode_.c_str()
+ << zkRootNodeInstance_.c_str()
+ << ZCLIENT_CLUSTER_ZNODE << "/"
+ << nodes.data[i];
+ string monZnode = newpath.str( );
+
+ rc = GetZNodeData( monZnode, nodeName, pnid );
+ if ( rc != ZOK )
+ {
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s], GetZNodeData() failed!\n"
+ , method_name );
+ mon_log_write(MON_ZCLIENT_CHECKCLUSTER_2, SQ_LOG_ERR, buf);
+ }
+ else
+ {
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "%s@%d monZnode=%s, nodeName=%s, pnid=%d)\n"
+ , method_name, __LINE__
+ , monZnode.c_str(), nodeName.c_str(), pnid );
+ }
+ }
+ }
+ FreeStringVector( &nodes );
+ }
+ }
+ else
+ {
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "%s@%d CheckCluster is NOT set!\n"
+ , method_name, __LINE__ );
+ }
+ }
+
+ TRACE_EXIT;
+ }
+
+ int CZClient::GetClusterZNodes( String_vector *nodes )
+ {
+ const char method_name[] = "CZClient::GetClusterZNodes";
+ TRACE_ENTRY;
+
+ bool found = false;
+ int rc = -1;
+ int retries = 0;
+ Stat stat;
+
+ stringstream ss;
+ ss.str( "" );
+ ss << zkRootNode_.c_str()
+ << zkRootNodeInstance_.c_str()
+ << ZCLIENT_CLUSTER_ZNODE;
+ string trafCluster( ss.str( ) );
+
+ nodes->count = 0;
+ nodes->data = NULL;
+
+ while ( !found )
+ {
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "%s@%d trafCluster=%s\n"
+ , method_name, __LINE__, trafCluster.c_str() );
+ }
+ // Verify the existence of the parent ZCLIENT_CLUSTER_ZNODE
+ rc = zoo_exists( ZHandle, trafCluster.c_str( ), 0, &stat );
+ if ( rc == ZNONODE )
+ {
+ if (retries > 10)
+ break;
+ retries++;
+ continue;
+ }
+ else if ( rc == ZOK )
+ {
+ // Now get the list of available znodes in the cluster.
+ //
+ // This will return child znodes for each monitor process that has
+ // registered, including this process.
+ rc = zoo_get_children( ZHandle, trafCluster.c_str( ), 0, nodes );
+ if ( nodes->count > 0 )
+ {
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "%s@%d nodes.count=%d\n"
+ , method_name, __LINE__
+ , nodes->count );
+ }
+ found = true;
+ }
+ else
+ {
+ if (retries > 10)
+ break;
+ retries++;
+ continue;
+ }
+ }
+ else // error
+ {
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s], zoo_exists() for %s failed with error %s\n"
+ , method_name, trafCluster.c_str( ), ZooErrorStr(rc));
+ mon_log_write(MON_ZCLIENT_GETCLUSTERZNODES_2, SQ_LOG_ERR, buf);
+ break;
+ }
+ }
+
+ TRACE_EXIT;
+ return( rc );
+ }
+
+ int CZClient::GetZNodeData( string &monZnode, string &nodeName, int &pnid )
+ {
+ const char method_name[] = "CZClient::GetZNodeData";
+ TRACE_ENTRY;
+
+ char pnidStr[8] = { 0 };
+ char *tkn = NULL;
- char zkData[MAX_PROCESSOR_NAME];
++ char zkData[MPI_MAX_PROCESSOR_NAME];
+ int rc = -1;
+ int zkDataLen = sizeof(zkData);
+ Stat stat;
+
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "%s@%d monZnode=%s\n"
+ , method_name, __LINE__, monZnode.c_str() );
+ }
+ rc = zoo_exists( ZHandle, monZnode.c_str( ), 0, &stat );
+ if ( rc == ZNONODE )
+ {
+ // return the error
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "%s@%d monZnode=%s does not exist (ZNONODE)\n"
+ , method_name, __LINE__, monZnode.c_str() );
+ }
+ }
+ else if ( rc == ZOK )
+ {
+ // Get the pnid from the data part of znode
+ rc = zoo_get( ZHandle, monZnode.c_str( ), false, zkData, &zkDataLen, &stat );
+ if ( rc == ZOK )
+ {
+ // The first token is the node name
+ tkn = strtok( zkData, ":" );
+ if ( tkn != NULL )
+ {
+ nodeName = tkn;
+ }
+ tkn = strtok( NULL, ":" );
+ if ( tkn != NULL )
+ {
+ strcpy( pnidStr, tkn );
+ pnid = atoi( pnidStr );
+ }
+ // TODO: Save monZnode path in corresponding physical node object
+ // to match with when ZC_NODE is triggered
+ }
+ else
+ {
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s], zoo_get() for %s failed with error %s\n"
+ , method_name, monZnode.c_str( ), ZooErrorStr(rc));
+ mon_log_write(MON_ZCLIENT_GETZNODEDATA_2, SQ_LOG_ERR, buf);
+ }
+ }
+ else
+ {
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s], zoo_exists() for %s failed with error %s\n"
+ , method_name, monZnode.c_str( ), ZooErrorStr(rc));
+ mon_log_write(MON_ZCLIENT_GETZNODEDATA_3, SQ_LOG_ERR, buf);
+ }
+
+ TRACE_EXIT;
+ return( rc );
+ }
+
+ void CZClient::HandleExpiredZNode( void )
+ {
+ const char method_name[] = "CZClient::HandleExpiredZNode";
+ TRACE_ENTRY;
+
+ if ( IsCheckCluster() )
+ {
- char pathStr[MAX_PROCESSOR_NAME] = { 0 };
- char nodeName[MAX_PROCESSOR_NAME] = { 0 };
++ char pathStr[MPI_MAX_PROCESSOR_NAME] = { 0 };
++ char nodeName[MPI_MAX_PROCESSOR_NAME] = { 0 };
+ char *tkn = NULL;
+ char *tknStart = pathStr;
+ char *tknLast = NULL;
+ string monZnode;
+
+ monZnode.assign( znodeQueue_.front() );
+
+ if (trace_settings)
+ {
+ trace_printf("%s@%d" " - znodePath=%s, znodeQueue_.size=%ld\n"
+ , method_name, __LINE__
+ , monZnode.c_str(), znodeQueue_.size() );
+ }
+
+ znodeQueue_.pop_front();
+
+ trace_printf( "%s@%d" " - Checking znode=%s\n"
+ , method_name, __LINE__
+ , monZnode.c_str() );
+
+ strcpy( pathStr, monZnode.c_str() );
+
+ tknStart++; // skip the first '/'
+ tkn = strtok( tknStart, "/" );
+ do
+ {
+ tknLast = tkn;
+ tkn = strtok( NULL, "/" );
+ }
+ while( tkn != NULL );
+
+ strcpy( nodeName, tknLast );
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "%s@%d nodeName=%s\n"
+ , method_name, __LINE__
+ , strlen(nodeName) ? nodeName : "" );
+ }
+
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s], %s was deleted, handling node (%s) as a down node!\n"
+ , method_name, monZnode.c_str(), nodeName );
+ mon_log_write(MON_ZCLIENT_CHECKZNODE_1, SQ_LOG_ERR, buf);
+
+ HandleNodeExpiration( nodeName );
+ }
+ else
+ {
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "%s@%d CheckCluster is NOT set!\n"
+ , method_name, __LINE__ );
+ }
+ }
+
+ TRACE_EXIT;
+ }
+
+ int CZClient::InitializeZClient( void )
+ {
+ const char method_name[] = "CZClient::MakeClusterZNodes";
+ TRACE_ENTRY;
+
+ int rc;
+
+ rc = MakeClusterZNodes();
+ if ( rc == ZOK )
+ {
+ rc = RegisterMyNodeZNode();
+ }
+
+ TRACE_EXIT;
+ return( rc );
+ }
+
+ int CZClient::MakeClusterZNodes( void )
+ {
+ const char method_name[] = "CZClient::MakeClusterZNodes";
+ TRACE_ENTRY;
+
+ int rc;
+ Stat stat;
+
+ stringstream ss;
+ ss.str( "" );
+ ss << zkRootNode_.c_str();
+ string rootDir( ss.str( ) );
+
+ rc = zoo_exists( ZHandle, rootDir.c_str(), 0, &stat );
+ switch (rc)
+ {
+ case ZOK:
+ break;
+ case ZNONODE:
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "%s@%d RegisterZNode(%s)\n"
+ , method_name, __LINE__
+ , rootDir.c_str() );
+ }
+ rc = RegisterZNode( rootDir.c_str(), NULL, 0 );
+ if (rc) return(rc); // Return the error
+ break;
+ default:
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s], zoo_exists() failed with error %s\n"
+ , method_name, ZooErrorStr(rc) );
+ mon_log_write(MON_ZCLIENT_CHECKCLUSTERZNODES_1, SQ_LOG_ERR, buf);
+ if (rc) return(rc); // Return the error
+ break;
+ }
+
+ ss.str( "" );
+ ss << zkRootNode_.c_str()
+ << zkRootNodeInstance_.c_str();
+ string instanceDir( ss.str( ) );
+
+ rc = zoo_exists( ZHandle, instanceDir.c_str( ), 0, &stat );
+ switch (rc)
+ {
+ case ZOK:
+ break;
+ case ZNONODE:
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "%s@%d RegisterZNode(%s)\n"
+ , method_name, __LINE__
+ , instanceDir.c_str() );
+ }
+ rc = RegisterZNode( instanceDir.c_str(), NULL, 0 );
+ break;
+ default:
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s], zoo_exists() failed with error %s\n"
+ , method_name, ZooErrorStr(rc) );
+ mon_log_write(MON_ZCLIENT_CHECKCLUSTERZNODES_2, SQ_LOG_ERR, buf);
+ break;
+ }
+
+ ss.str( "" );
+ ss << zkRootNode_.c_str()
+ << zkRootNodeInstance_.c_str()
+ << ZCLIENT_CLUSTER_ZNODE;
+ string clusterDir( ss.str( ) );
+
+ rc = zoo_exists( ZHandle, clusterDir.c_str( ), 0, &stat );
+ switch (rc)
+ {
+ case ZOK:
+ break;
+ case ZNONODE:
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "%s@%d RegisterZNode(%s)\n"
+ , method_name, __LINE__
+ , clusterDir.c_str() );
+ }
+ rc = RegisterZNode( clusterDir.c_str(), NULL, 0 );
+ break;
+ default:
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s], zoo_exists() failed with error %s\n"
+ , method_name, ZooErrorStr(rc) );
+ mon_log_write(MON_ZCLIENT_CHECKCLUSTERZNODES_3, SQ_LOG_ERR, buf);
+ break;
+ }
+
+ TRACE_EXIT;
+ return(rc);
+ }
+
+ // ZClient main processing loop
+ void CZClient::MonitorZCluster()
+ {
+ const char method_name[] = "CZClient::MonitorZCluster";
+ TRACE_ENTRY;
+
+ int rc;
+ struct timespec timeout;
+
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "%s@%d thread %lx starting\n"
+ , method_name, __LINE__, threadId_);
+ }
+
+ if (zcMonitoringRate_ >= 0)
+ {
+ SetTimeToWakeUp( timeout );
+ }
+
+ while ( GetState() != ZC_SHUTDOWN )
+ {
+ lock();
+ if ( !IsEnabled() )
+ {
+ // Wait until timer started
+ CLock::wait();
+ }
+ else
+ {
+ if (zcMonitoringRate_ < 0)
+ {
+ // Wait until signaled
+ CLock::wait();
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "%s@%d" " - ZCluster signaled, state_=%s\n"
+ , method_name, __LINE__
+ , ZClientStateStr(GetState()) );
+ }
+ }
+ else
+ {
+ // Wait until signaled or timer expires
+ rc = CLock::timedWait( &timeout );
+ if ( rc != ETIMEDOUT )
+ {
+ if ( rc != 0 )
+ {
+ StopClusterMonitoring();
+ }
+ else
+ {
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "%s@%d" " - ZCluster signaled, state_=%s\n"
+ , method_name, __LINE__
+ , ZClientStateStr(GetState()) );
+ }
+ }
+ }
+ }
+ }
+
+ switch ( GetState() )
+ {
+ case ZC_START:
+ StartClusterMonitoring();
+ break;
+ case ZC_CLUSTER:
+ if ( IsCheckCluster() )
+ {
+ CheckCluster();
+ }
+ break;
+ case ZC_WATCH:
+ if ( !IsCheckCluster() )
+ {
+ WatchCluster();
+ }
+ break;
+ case ZC_ZNODE:
+ if ( IsCheckCluster() )
+ {
+ HandleExpiredZNode();
+ }
+ break;
+ case ZC_STOP:
+ StopClusterMonitoring();
+ break;
+ default:
+ break;
+ }
+ if (zcMonitoringRate_ >= 0 )
+ {
+ SetTimeToWakeUp( timeout );
+ }
+ unlock();
+ }
+
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf("%s@%d thread %lx exiting\n"
+ , method_name,__LINE__, pthread_self());
+ }
+
+ TRACE_EXIT;
+ }
+
+ int CZClient::RegisterMyNodeZNode( void )
+ {
+ const char method_name[] = "CZClient::RegisterMyNodeZNode";
+ TRACE_ENTRY;
+
+ int rc;
+ char pnidStr[10];
+
+ sprintf( pnidStr, "%d", MyPNID);
+
+ stringstream newpath;
+ newpath.str( "" );
+ newpath << zkRootNode_.c_str()
+ << zkRootNodeInstance_.c_str()
+ << ZCLIENT_CLUSTER_ZNODE << "/"
+ << Node_name;
+ string monZnode = newpath.str( );
+
+ stringstream ss;
+ ss.str( "" );
+ ss << Node_name << ":" << pnidStr;
+ string monData = ss.str( );
+
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "%s@%d RegisterZNode(%s:%s)\n"
+ , method_name, __LINE__
+ , monZnode.c_str()
+ , monData.c_str() );
+ }
+
+ rc = RegisterZNode( monZnode.c_str(), monData.c_str(), ZOO_EPHEMERAL );
+
+ TRACE_EXIT;
+
+ return(rc);
+ }
+
+ int CZClient::RegisterZNode( const char *znodePath
+ , const char *znodeData
+ , int flags )
+ {
+ const char method_name[] = "CZClient::RegisterZNode";
+ TRACE_ENTRY;
+
+ int rc = -1;
+ char realpath[1024] = { 0 };
+
+ stringstream ss;
+ ss.str( "" );
+ ss << znodePath;
+ string zpath( ss.str( ) );
+
+ ss.str( "" );
+ ss << ((znodeData) ? znodeData : "");
+ string zdata( ss.str( ) );
+
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "%s@%d zoo_create (%s : %s)\n"
+ , method_name, __LINE__
+ , zpath.c_str()
+ , zdata.c_str());
+ }
+ rc = zoo_create( ZHandle
+ , zpath.c_str( )
+ , zdata.length() ? zdata.c_str() : NULL
+ , zdata.length() ? zdata.length() : -1
+ , &ZOO_OPEN_ACL_UNSAFE
+ , flags
+ , realpath
+ , sizeof(realpath)-1 );
+ if ( rc != ZOK )
+ {
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s], zoo_create(%s) failed with error %s\n"
+ , method_name
+ , zpath.c_str()
+ , ZooErrorStr(rc) );
+ mon_log_write(MON_ZCLIENT_REGISTERZNODE_1, SQ_LOG_ERR, buf);
+ }
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf("%s@%d realpath=%s\n", method_name, __LINE__, realpath);
+ }
+
+ TRACE_EXIT;
+ return( rc );
+ }
+
+ void CZClient::SetState( ZClientState_t state, const char *znodePath )
+ {
+ CAutoLock lock(getLocker());
+ state_ = state;
+ znodeQueue_.push_back( znodePath );
+ }
+
+ void CZClient::SetTimeToWakeUp( struct timespec &ts )
+ {
+ const char method_name[] = "CZClient::SetTimeToWakeUp";
+ TRACE_ENTRY;
+
+ clock_gettime(CLOCK_REALTIME, &ts);
+ #if 0
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf("%s@%d" " - Clock time %ld(secs):%ld(nsecs)(zcMonitoringRate_=%ld)\n"
+ , method_name, __LINE__
+ , ts.tv_sec, ts.tv_nsec, zcMonitoringRate_);
+ }
+ #endif
+
+ ts.tv_sec += zcMonitoringRate_;
+
+ #if 0
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf("%s@%d" " - Timeout time %ld(secs):%ld(nsecs)(zcMonitoringRate_=%ld)\n"
+ , method_name, __LINE__
+ , ts.tv_sec, ts.tv_nsec, zcMonitoringRate_);
+ }
+ #endif
+ TRACE_EXIT;
+ }
+
+ int CZClient::SetZNodeWatch( string &monZnode )
+ {
+ const char method_name[] = "CZClient::SetZNodeWatch";
+ TRACE_ENTRY;
+
- char zkData[MAX_PROCESSOR_NAME];
++ char zkData[MPI_MAX_PROCESSOR_NAME];
+ int rc = -1;
+ int zkDataLen = sizeof(zkData);
+ Stat stat;
+
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "%s@%d monZnode=%s\n"
+ , method_name, __LINE__, monZnode.c_str() );
+ }
+ rc = zoo_exists( ZHandle, monZnode.c_str( ), 0, &stat );
+ if ( rc == ZNONODE )
+ {
+ // return the error
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "%s@%d monZnode=%s does not exist (ZNONODE)\n"
+ , method_name, __LINE__, monZnode.c_str() );
+ }
+ }
+ else if ( rc == ZOK )
+ {
+ // Get the pnid from the data part of znode
+ rc = zoo_get( ZHandle, monZnode.c_str( ), true, zkData, &zkDataLen, &stat );
+ if ( rc != ZOK )
+ {
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s], zoo_get() for %s failed with error %s\n"
+ , method_name, monZnode.c_str( ), ZooErrorStr(rc));
+ mon_log_write(MON_ZCLIENT_SETZNODEWATCH_1, SQ_LOG_ERR, buf);
+ }
+ }
+ else
+ {
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s], zoo_exists() for %s failed with error %s\n"
+ , method_name, monZnode.c_str( ), ZooErrorStr(rc));
+ mon_log_write(MON_ZCLIENT_SETZNODEWATCH_1, SQ_LOG_ERR, buf);
+ }
+
+ TRACE_EXIT;
+ return( rc );
+ }
+
+ void CZClient::StartClusterMonitoring( void )
+ {
+ const char method_name[] = "CZClient::StartClusterMonitoring";
+ TRACE_ENTRY;
+
+ if ( !IsEnabled() )
+ {
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "%s@%d Cluster monitoring started!\n\n", method_name, __LINE__ );
+ }
+ SetEnabled( true );
+ SetState( ZC_WATCH );
+ CLock::wakeOne();
+ }
+
+ TRACE_EXIT;
+ }
+
+ void CZClient::StopClusterMonitoring( void )
+ {
+ const char method_name[] = "CZClient::StopClusterMonitoring";
+ TRACE_ENTRY;
+
+ if ( IsEnabled() )
+ {
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "\n%s@%d Cluster monitoring stopped!\n", method_name, __LINE__ );
+ }
+ SetCheckCluster( false );
+ SetEnabled( false );
+ SetState( ZC_DISABLED );
+ CLock::wakeOne();
+ }
+
+ TRACE_EXIT;
+ }
+
+ int CZClient::ShutdownWork(void)
+ {
+ const char method_name[] = "CZClient::ShutdownWork";
+ TRACE_ENTRY;
+
+ // Set flag that tells the commAcceptor thread to exit
+ SetState( ZC_SHUTDOWN );
+ CLock::wakeOne();
+
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "%s@%d waiting for ZClient thread %lx to exit.\n"
+ , method_name, __LINE__, threadId_);
+ }
+
+ // Wait for commAcceptor thread to exit
+ int rc = pthread_join( threadId_, NULL );
+ if (rc != 0)
+ {
+ char buf[MON_STRING_BUF_SIZE];
+ int err = rc;
+ sprintf(buf, "[%s], Error= Can't join thread! - errno=%d (%s)\n", method_name, err, strerror(err));
+ mon_log_write(MON_ZCLIENT_SHUTDOWNWORK_1, SQ_LOG_ERR, buf);
+ }
+
+ TRACE_EXIT;
+ return(rc);
+ }
+
+ // ZClientThread main
+ static void *ZClientThread(void *arg)
+ {
+ const char method_name[] = "ZClientThread";
+ TRACE_ENTRY;
+
+ // Parameter passed to the thread is an instance of the CommAccept object
+ CZClient *zooClient = (CZClient *) arg;
+
+ // Mask all allowed signals
+ sigset_t mask;
+ sigfillset(&mask);
+ sigdelset(&mask, SIGPROF); // allows profiling such as google profiler
+ int rc = pthread_sigmask(SIG_SETMASK, &mask, NULL);
+ if (rc != 0)
+ {
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf(buf, sizeof(buf), "[%s], pthread_sigmask error=%d\n",
+ method_name, rc);
+ mon_log_write(MON_ZCLIENT_ZCLIENTTHREAD_1, SQ_LOG_ERR, buf);
+ }
+
+ // Enter thread processing loop
+ zooClient->MonitorZCluster();
+
+ TRACE_EXIT;
+ return NULL;
+ }
+
+
+ // Create the ZClientThread
+ int CZClient::StartWork()
+ {
+ const char method_name[] = "CZClient::StartWork";
+ TRACE_ENTRY;
+
+ int rc = pthread_create(&threadId_, NULL, ZClientThread, this);
+ if (rc != 0)
+ {
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf(buf, sizeof(buf), "[%s], ZClientThread create error=%d\n",
+ method_name, rc);
+ mon_log_write(MON_ZCLIENT_STARTWORK_1, SQ_LOG_ERR, buf);
+ }
+
+ TRACE_EXIT;
+ return(rc);
+ }
+
+ void CZClient::StartMonitoring( void )
+ {
+ const char method_name[] = "CZClient::StartMonitoring";
+ TRACE_ENTRY;
+ if (ZHandle)
+ {
+ ZClient->SetState( CZClient::ZC_START );
+ ZClient->CLock::wakeOne();
+ }
+ TRACE_EXIT;
+ }
+
+ void CZClient::StopMonitoring( void )
+ {
+ const char method_name[] = "CZClient::StopMonitoring";
+ TRACE_ENTRY;
+ ZClient->SetState( CZClient::ZC_STOP );
+ ZClient->CLock::wakeOne();
+ TRACE_EXIT;
+ }
+
+ void CZClient::TriggerCheck( int type, const char *znodePath )
+ {
+ const char method_name[] = "CZClient::TriggerCheck";
+ TRACE_ENTRY;
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "%s@%d" " - state = %s\n"
+ , method_name, __LINE__
+ , ZooConnectionTypeStr( type ) );
+ }
+
+ if ( type == ZOO_CREATED_EVENT )
+ {
+ SetState( ZC_ZNODE, znodePath );
+ }
+ else if ( type == ZOO_DELETED_EVENT )
+ {
+ SetState( ZC_ZNODE, znodePath );
+ }
+ else if ( type == ZOO_CHANGED_EVENT )
+ {
+ SetState( ZC_ZNODE, znodePath );
+ }
+ else if ( type == ZOO_CHILD_EVENT )
+ {
+ SetState( ZC_CLUSTER, znodePath );
+ }
+ else if ( type == ZOO_NOTWATCHING_EVENT )
+ {
+ SetState( ZC_CLUSTER );
+ }
+ CLock::wakeOne();
+ TRACE_EXIT;
+ }
+
+ void CZClient::WatchCluster( void )
+ {
+ const char method_name[] = "CZClient::WatchCluster";
+ TRACE_ENTRY;
+
+ int rc;
+ struct String_vector nodes;
+
+ if ( !IsCheckCluster() )
+ {
+ rc = GetClusterZNodes( &nodes );
+ if ( rc != ZOK )
+ {
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s], GetClusterZNodes() failed!\n"
+ , method_name );
+ mon_log_write(MON_ZCLIENT_WATCHCLUSTER_1, SQ_LOG_ERR, buf);
+ SetState( CZClient::ZC_STOP );
+ CLock::wakeOne();
+ return;
+ }
+
+ stringstream newpath;
+ string monZnode;
+
+ if ( nodes.count > 0 )
+ {
+ for (int i = 0; i < nodes.count ; i++ )
+ {
+ newpath.str( "" );
+ newpath << zkRootNode_.c_str()
+ << zkRootNodeInstance_.c_str()
+ << ZCLIENT_CLUSTER_ZNODE << "/"
+ << nodes.data[i];
+ string monZnode = newpath.str( );
+
+ rc = SetZNodeWatch( monZnode );
+ if ( rc != ZOK )
+ {
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s], GetZNodeData() failed!\n"
+ , method_name );
+ mon_log_write(MON_ZCLIENT_WATCHCLUSTER_2, SQ_LOG_ERR, buf);
+
+ FreeStringVector( &nodes );
+ TRACE_EXIT;
+ return;
+ }
+ else
+ {
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "%s@%d Watch set on monZnode=%s\n"
+ , method_name, __LINE__
+ , monZnode.c_str() );
+ }
+ }
+ }
+ SetCheckCluster( true );
+ SetState( ZC_CLUSTER );
+ FreeStringVector( &nodes );
+ }
+ }
+ else
+ {
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "%s@%d CheckCluster is NOT set!\n"
+ , method_name, __LINE__ );
+ }
+ }
+
+ TRACE_EXIT;
+ }
+
+ int CZClient::WatchNode( const char *nodeName )
+ {
+ const char method_name[] = "CZClient::WatchNode";
+ TRACE_ENTRY;
+
+ int rc;
+ stringstream newpath;
+ newpath.str( "" );
+ newpath << zkRootNode_.c_str()
+ << zkRootNodeInstance_.c_str()
+ << ZCLIENT_CLUSTER_ZNODE << "/"
+ << nodeName;
+ string monZnode = newpath.str( );
+
+ lock();
+ rc = SetZNodeWatch( monZnode );
+ unlock();
+ if ( rc != ZOK )
+ {
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s], SetZNodeWatch() failed!\n"
+ , method_name );
+ mon_log_write(MON_ZCLIENT_WATCHNODE_1, SQ_LOG_ERR, buf);
+ }
+ else
+ {
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "%s@%d Watch set on monZnode=%s\n"
+ , method_name, __LINE__
+ , monZnode.c_str() );
+ }
+ }
+
+ TRACE_EXIT;
+ return(rc);
+ }
+
+ int CZClient::WatchNodeDelete( const char *nodeName )
+ {
+ const char method_name[] = "CZClient::WatchNodeDelete";
+ TRACE_ENTRY;
+
+ int rc = -1;
+
+ stringstream newpath;
+ newpath.str( "" );
+ newpath << zkRootNode_.c_str()
+ << zkRootNodeInstance_.c_str()
+ << ZCLIENT_CLUSTER_ZNODE << "/"
+ << nodeName;
+ string monZnode = newpath.str( );
+
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "%s@%d zoo_delete(%s)\n"
+ , method_name, __LINE__
+ , monZnode.c_str() );
+ }
+ rc = zoo_delete( ZHandle
+ , monZnode.c_str( )
+ , -1 );
+ if ( rc == ZOK )
+ {
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s], znode (%s) deleted!\n"
+ , method_name, nodeName );
+ mon_log_write(MON_ZCLIENT_WATCHNODEDELETE_1, SQ_LOG_INFO, buf);
+ }
+ else if ( rc == ZNONODE )
+ {
+ rc = ZOK;
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s], znode (%s) already deleted!\n"
+ , method_name, nodeName );
+ mon_log_write(MON_ZCLIENT_WATCHNODEDELETE_2, SQ_LOG_INFO, buf);
+ }
+ else
+ {
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s], zoo_delete(%s) failed with error %s\n"
+ , method_name, nodeName, ZooErrorStr(rc) );
+ mon_log_write(MON_ZCLIENT_WATCHNODEDELETE_3, SQ_LOG_INFO, buf);
+ }
+
+ TRACE_EXIT;
+ return( rc );
+ }
+
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e294233/core/sqf/monitor/linux/zootest.cxx
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/zootest.cxx
index 0000000,8a90299..1536e98
mode 000000,100644..100644
--- a/core/sqf/monitor/linux/zootest.cxx
+++ b/core/sqf/monitor/linux/zootest.cxx
@@@ -1,0 -1,283 +1,283 @@@
+ /**********************************************************************
+ // @@@ START COPYRIGHT @@@
+ //
+ // Licensed to the Apache Software Foundation (ASF) under one
+ // or more contributor license agreements. See the NOTICE file
+ // distributed with this work for additional information
+ // regarding copyright ownership. The ASF licenses this file
+ // to you under the Apache License, Version 2.0 (the
+ // "License"); you may not use this file except in compliance
+ // with the License. You may obtain a copy of the License at
+ //
+ // http://www.apache.org/licenses/LICENSE-2.0
+ //
+ // Unless required by applicable law or agreed to in writing,
+ // software distributed under the License is distributed on an
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ // KIND, either express or implied. See the License for the
+ // specific language governing permissions and limitations
+ // under the License.
+ //
+ // @@@ END COPYRIGHT @@@
+ ********************************************************************/
+ #include <errno.h>
+ #include <sys/socket.h>
+ #include <signal.h>
+ #include <ctype.h>
+ #include <string.h>
+ #include <ifaddrs.h>
+ #include <netdb.h>
+ #include <new>
+ #include <stdio.h>
+ #include <list>
+ #include <string>
+
+ #include "msgdef.h"
+ #include "montrace.h"
+ #include "monlogging.h"
+ #include "zookeeper/zookeeper.h"
+ #include "zclient.h"
+ #include "zootest.h"
+
+ using namespace std;
+
+ bool debugFlag = true;
+
+ bool ZClientEnabled = true;
+ char Node_name[MPI_MAX_PROCESSOR_NAME] = {'\0'};
+ char MyPNidStr[8];
+ int MyPNID = -1;
+ int MyNid = -1;
+ int MyPid = -1;
+
+ CZClient *ZClient = NULL;
+ CMonLog *MonLog = NULL;
+ CMonLog *SnmpLog = NULL;
+
+ void HandleZSessionExpiration( void )
+ {
+ const char method_name[] = "HandleZSessionExpiration";
+ TRACE_ENTRY;
+ printf( "%s@%d ZSession expired!\n", method_name, __LINE__ );
+ ZClient->StopMonitoring();
+ ZClient->ShutdownWork();
+ printf( "%s@%d zootest exiting!\n", method_name, __LINE__ );
+ TRACE_EXIT;
+ exit( 1 );
+ }
+
+ void HandleNodeExpiration( const char *nodeName )
+ {
+ const char method_name[] = "HandleNodeExpiration";
+ TRACE_ENTRY;
+ printf( "%s@%d Node %s znode deleted!\n"
+ , method_name, __LINE__, nodeName );
+ TRACE_EXIT;
+ }
+
+ void CreateZookeeperClient( void )
+ {
+ const char method_name[] = "CreateZookeeperClient";
+ TRACE_ENTRY;
+
+ if ( ZClientEnabled )
+ {
+ string hostName;
+ string zkQuorumHosts;
+ stringstream zkQuorumPort;
+ char *env;
- char hostsStr[MAX_PROCESSOR_NAME*3] = { 0 };
++ char hostsStr[MPI_MAX_PROCESSOR_NAME*3] = { 0 };
+ char *tkn = NULL;
+
+ int zport;
+ env = getenv("ZOOKEEPER_PORT");
+ if ( env && isdigit(*env) )
+ {
+ zport = atoi(env);
+ }
+ else
+ {
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf(buf, sizeof(buf),
+ "[%s], Zookeeper quorum port is not defined!\n"
+ , method_name);
+ mon_log_write(MON_ZOOCLIENT_MAIN_3, SQ_LOG_CRIT, buf);
+
+ ZClientEnabled = false;
+ TRACE_EXIT;
+ return;
+ }
+
+ env = getenv("ZOOKEEPER_NODES");
+ if ( env )
+ {
+ zkQuorumHosts = env;
+ if ( zkQuorumHosts.length() == 0 )
+ {
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf(buf, sizeof(buf),
+ "[%s], Zookeeper quorum hosts are not defined!\n"
+ , method_name);
+ mon_log_write(MON_ZOOCLIENT_MAIN_4, SQ_LOG_CRIT, buf);
+
+ ZClientEnabled = false;
+ TRACE_EXIT;
+ return;
+ }
+
+ strcpy( hostsStr, zkQuorumHosts.c_str() );
+ zkQuorumPort.str( "" );
+
+ tkn = strtok( hostsStr, "," );
+ do
+ {
+ if ( tkn != NULL )
+ {
+ hostName = tkn;
+ zkQuorumPort << hostName.c_str()
+ << ":"
+ << zport;
+ }
+ tkn = strtok( NULL, "," );
+ if ( tkn != NULL )
+ {
+ zkQuorumPort << ",";
+ }
+
+ }
+ while( tkn != NULL );
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
+ {
+ trace_printf( "%s@%d zkQuorumPort=%s\n"
+ , method_name, __LINE__
+ , zkQuorumPort.str().c_str() );
+ }
+ }
+
+ ZClient = new CZClient( zkQuorumPort.str().c_str()
+ , ZCLIENT_TRAFODION_ZNODE
+ , ZCLIENT_INSTANCE_ZNODE );
+ if ( ZClient == NULL )
+ {
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf(buf, sizeof(buf),
+ "[%s], Failed to allocate ZClient object!\n"
+ , method_name);
+ mon_log_write(MON_ZOOCLIENT_MAIN_5, SQ_LOG_CRIT, buf);
+ abort();
+ }
+ }
+
+ TRACE_EXIT;
+ }
+
+ /*
+ *
+ * The znode hierarchy is as follows:
+ * /trafodion/<instance-name>/cluster
+ * /trafodion/<instance-name>/cluster/<node-name-1>
+ * /trafodion/<instance-name>/cluster/<node-name-2>
+ * Each monitor will create an ephemeral node using its node name (hostname)
+ * followed by its <pnid>.
+ * The monitor processes will watch the cluster parent znode changes.
+ * When a change in the cluster znode occurs they will check the state of
+ * each child. A missing child znode will is assumed to be a down node.
+ *
+ */
+ int main( int argc, char *argv[], char *envp[] )
+ {
+ const char method_name[] = "main";
+ TRACE_ENTRY;
+
+ char *env;
+ char MyName[MPI_MAX_PROCESSOR_NAME];
+
+ trace_settings |= TRACE_INIT;
+
+ int count = 1;
+ while ( count < argc )
+ {
+ if ( strcmp( argv[count], "-pnid" ) == 0 )
+ {
+ if ( ++count < argc )
+ {
+ MyPNID=atoi( argv[count] );
+ }
+ }
+ count++;
+ }
+
+
+ sigset_t newset, oldset;
+ sigemptyset( &newset );
+ sigaddset( &newset,SIGQUIT );
+ sigaddset( &newset,SIGTERM );
+ sigprocmask( SIG_BLOCK,&newset,&oldset );
+
+ gethostname(Node_name, MPI_MAX_PROCESSOR_NAME);
+
+ sprintf( MyName,"zooclient" );
+ MyPid = getpid();
+
+ MonLog = new CMonLog( "log4cxx.monitor.wdg.config", "ZOO", "alt.wdg", MyPNID, MyNid, MyPid, MyName );
+
+ int rc;
+ env = getenv("SQ_MON_ZCLIENT_ENABLED");
+ if ( env )
+ {
+ if ( env && isdigit(*env) )
+ {
+ if ( strcmp(env,"0")==0 )
+ {
+ ZClientEnabled = false;
+ }
+ }
+ }
+
+ if ( ZClientEnabled )
+ {
+ CreateZookeeperClient();
+
+ sleep( 3 ); // Wait for the other zclients to register
+
+ rc = ZClient->StartWork();
+ if (rc != 0)
+ {
+ TRACE_EXIT;
+ exit( 1 );
+ }
+
+ ZClient->StartMonitoring();
+
+ unsigned int sleepTime = 10; // 10 seconds
+ env = getenv("MON_INIT_SLEEP");
+ if ( env && isdigit(*env) )
+ {
+ sleepTime = atoi(env);
+ }
+ sleep( sleepTime ); // Til' quitting time!
+
+ ZClient->StopMonitoring();
+
+ sleep( 1 );
+
+ // Stop the Process Monitor thread
+ rc = ZClient->ShutdownWork();
+ if (rc != 0)
+ {
+ TRACE_EXIT;
+ exit( 1 );
+ }
+ }
+ else
+ {
+ printf( "%s@%d ZClient is disabled, exiting!\n"
+ , method_name, __LINE__ );
+ }
+
+ printf( "%s@%d zootest exiting!\n"
+ , method_name, __LINE__ );
+
+ TRACE_EXIT;
+ exit( 0 );
+ }
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1e294233/core/sqf/sql/scripts/sqcheck
----------------------------------------------------------------------
diff --cc core/sqf/sql/scripts/sqcheck
index f5806c9,b5d79ae..2c10044
--- a/core/sqf/sql/scripts/sqcheck
+++ b/core/sqf/sql/scripts/sqcheck
@@@ -226,7 -251,14 +247,11 @@@ if [[ -z $SQSCRIPTS_DIR ]]; the
SQSCRIPTS_DIR=$MY_SQROOT/sql/scripts
fi
-SQSCRIPT_FILE="$SQSCRIPTS_DIR/gomon.cold"
-STARTSSMP_FILE="$SQSCRIPTS_DIR/ssmpstart"
-STARTSSCP_FILE="$SQSCRIPTS_DIR/sscpstart"
+ if [ $check_node '>' -1 ]; then
+ getNodeStatus
+ fi
+
### CONFIGURED NODEs
sq_tmp_node_info=`mktemp -t`
sqshell -c node info > $sq_tmp_node_info
[15/50] [abbrv] incubator-trafodion git commit: Removed copy of
'sqconfig.db' at end of addNode_step2 script.
Posted by su...@apache.org.
Removed copy of 'sqconfig.db' at end of addNode_step2 script.
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/90759577
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/90759577
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/90759577
Branch: refs/heads/master
Commit: 90759577e4e6874b46c003fab05a8472a91c17ca
Parents: a8a68a1
Author: Zalo Correa <za...@esgyn.com>
Authored: Tue Aug 23 13:53:03 2016 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Tue Aug 23 13:53:03 2016 -0700
----------------------------------------------------------------------
install/installer/addNode_step2 | 2 --
1 file changed, 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/90759577/install/installer/addNode_step2
----------------------------------------------------------------------
diff --git a/install/installer/addNode_step2 b/install/installer/addNode_step2
index 40318b0..4d7a6f0 100755
--- a/install/installer/addNode_step2
+++ b/install/installer/addNode_step2
@@ -320,11 +320,9 @@ source $TRAF_CONFIG
$TRAF_PDSH mkdir -p $HOME/tmpTraf
sudo cp -r $SQ_ROOT/sql/scripts/sqconfig $HOME/tmpTraf
-sudo cp -r $SQ_ROOT/sql/scripts/sqconfig.db $HOME/tmpTraf
sudo chown -R $(whoami).$(whoami) $HOME/tmpTraf
$TRAF_PDCP -r $HOME/tmpTraf $HOME
$TRAF_PDSH sudo cp -rf $HOME/tmpTraf/sqconfig $SQ_ROOT/sql/scripts 2>&1 > /dev/null
-$TRAF_PDSH sudo cp -rf $HOME/tmpTraf/sqconfig.db $SQ_ROOT/sql/scripts 2>&1 > /dev/null
$TRAF_PDSH sudo chown -R $TRAF_USER.trafodion $SQ_ROOT/sql/scripts 2>&1 > /dev/null
$TRAF_PDSH rm -r $HOME/tmpTraf
[44/50] [abbrv] incubator-trafodion git commit: Fix to default bashrc
file to setup node membership of MY_NODES env var.
Posted by su...@apache.org.
Fix to default bashrc file to setup node membership of MY_NODES env var.
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/c8f07c1f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/c8f07c1f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/c8f07c1f
Branch: refs/heads/master
Commit: c8f07c1f7e4dcf8ed4cdb8e9322ac0006798d1b0
Parents: 69a4b7e
Author: Zalo Correa <za...@esgyn.com>
Authored: Wed May 3 12:15:51 2017 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Wed May 3 12:15:51 2017 -0700
----------------------------------------------------------------------
install/installer/bashrc_default | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/c8f07c1f/install/installer/bashrc_default
----------------------------------------------------------------------
diff --git a/install/installer/bashrc_default b/install/installer/bashrc_default
index bbac162..8e345fd 100755
--- a/install/installer/bashrc_default
+++ b/install/installer/bashrc_default
@@ -68,7 +68,7 @@ if [ -f $TRAF_HOME/sqenv.sh ]; then
source ./sqenv.sh
popd >/dev/null
export MANPATH=$MANPATH:$MPI_ROOT/share/man
- #setup_my_nodes
+ setup_my_nodes
fi
#-------------------------------------------
[34/50] [abbrv] incubator-trafodion git commit: Trafodion
configuration API changes
Posted by su...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/04040d30/core/sqf/monitor/linux/config.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/config.cxx b/core/sqf/monitor/linux/config.cxx
index 7e13fbc..cb2f486 100644
--- a/core/sqf/monitor/linux/config.cxx
+++ b/core/sqf/monitor/linux/config.cxx
@@ -386,7 +386,7 @@ void CConfigGroup::SendChangeNotification (CConfigKey *key)
snprintf(buf, sizeof(buf), "[CConfigGroup::SendChangeNotification],"
" Invalid group ConfigType for %s (%p).\n", name_.c_str(),
this);
- mon_log_write(MON_CONFIGGROUP_SENDCHANGENOTICE, SQ_LOG_ERR, buf);
+ mon_log_write(MON_CONFIGGROUP_SENDCHANGENOTICE_1, SQ_LOG_ERR, buf);
delete msg;
}
TRACE_EXIT;
@@ -485,7 +485,6 @@ void CConfigGroup::Set(char *key, char *value, bool replicated, bool addToDb)
CConfigContainer::CConfigContainer(void)
: Head (NULL)
, Tail (NULL)
- , db_ (NULL)
{
const char method_name[] = "CConfigContainer::CConfigContainer";
TRACE_ENTRY;
@@ -493,10 +492,7 @@ CConfigContainer::CConfigContainer(void)
// Add eyecatcher sequence as a debugging aid
memcpy(&eyecatcher_, "CCTR", 4);
- CClusterConfig *clusterConfig = Nodes->GetClusterConfig();
- db_ = clusterConfig->GetConfigDb();
-
- cluster_ = AddGroup((char *) "CLUSTER",ConfigType_Cluster);
+ cluster_ = AddGroup( (char *)"CLUSTER", ConfigType_Cluster );
if ( ! getenv("SQ_VIRTUAL_NODES") )
{
int pnid = Nodes->GetClusterConfig()->GetPNid(Node_name);
@@ -506,7 +502,7 @@ CConfigContainer::CConfigContainer(void)
{
snprintf(localNodeName_, sizeof(localNodeName_), "NODE%d",MyPNID);
}
- node_ = AddGroup(localNodeName_,ConfigType_Node);
+ node_ = AddGroup( localNodeName_, ConfigType_Node );
TRACE_EXIT;
}
@@ -533,176 +529,119 @@ CConfigContainer::~CConfigContainer(void)
void CConfigContainer::Init(void)
{
- int rc;
-
const char method_name[] = "CConfigContainer::Init";
TRACE_ENTRY;
- if ( db_ == NULL)
- {
- if (trace_settings & TRACE_INIT)
- {
- trace_printf("%s@%d cannot initialize registry from database "
- "since database open failed.\n", method_name,
- __LINE__);
+ int rc;
+ int regClusterCount = 0;
+ int regProcessCount = 0;
+ int regClusterMax = 0;
+ int regProcessMax = 0;
+ ConfigType type;
+ registry_configuration_t *regClusterConfig;
+ registry_configuration_t *regProcessConfig;
+
+ // Get cluster scope configuration registry entries count
+ rc = tc_get_registry_cluster_set( ®ClusterCount
+ , regClusterMax
+ , NULL );
+ if ( rc )
+ {
+ char la_buf[MON_STRING_BUF_SIZE];
+ snprintf( la_buf, sizeof(la_buf)
+ , "[%s] Node configuration access failed!\n"
+ , method_name );
+ mon_log_write(MON_CONFIGCONT_INIT_1, SQ_LOG_ERR, la_buf);
+ }
+
+ regClusterMax = regClusterCount;
+ regClusterConfig = new registry_configuration_t[regClusterMax];
+ if (regClusterConfig)
+ {
+ rc = tc_get_registry_cluster_set( ®ClusterCount
+ , regClusterMax
+ , regClusterConfig );
+ if ( rc )
+ {
+ char la_buf[MON_STRING_BUF_SIZE];
+ snprintf( la_buf, sizeof(la_buf)
+ , "[%s] Cluster scope configuration registry access failed!\n"
+ , method_name );
+ mon_log_write(MON_CONFIGCONT_INIT_2, SQ_LOG_CRIT, la_buf);
}
+
+ type = ConfigType_Cluster;
- TRACE_EXIT;
- return;
- }
-
- // Read cluster configuration registry entries and populate in-memory
- // structures.
- const char *selStmt;
- selStmt = "select k.keyName, d.dataValue "
- " from monRegKeyName k, monRegClusterData d "
- " where k.keyId = d.keyId";
- sqlite3_stmt *prepStmt;
-
- rc = sqlite3_prepare_v2( db_, selStmt, strlen(selStmt)+1, &prepStmt, NULL);
- if( rc!=SQLITE_OK )
- {
- if (trace_settings & TRACE_INIT)
+ // Process cluster scope configuration registry entries
+ for (int i = 0; i < regClusterCount; i++ )
{
- trace_printf("%s@%d prepare failed, error=%s (%d)\n", method_name,
- __LINE__, sqlite3_errmsg(db_), rc);
+ Set( regClusterConfig[i].scope
+ , type
+ , regClusterConfig[i].key
+ , regClusterConfig[i].value
+ , false );
}
-
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] prepare failed, error=%s (%d)\n",
- method_name, sqlite3_errmsg(db_), rc );
- mon_log_write( MON_DATABASE_ERROR, SQ_LOG_ERR, buf );
-
- TRACE_EXIT;
- return;
}
-
-
- ConfigType type;
- const unsigned char * group;
- const unsigned char * key;
- const unsigned char * value;
- int rowNum = 1;
-
- while ( 1 )
+ else
{
- rc = sqlite3_step(prepStmt);
- if ( rc == SQLITE_ROW )
- { // Process row
- type = ConfigType_Cluster;
- group = (const unsigned char *) "CLUSTER";
- key = sqlite3_column_text(prepStmt, 0);
- value = sqlite3_column_text(prepStmt, 1);
- if (trace_settings & TRACE_INIT)
- {
- trace_printf("%s@%d row %d: type=%d, group=%s, key=%s, "
- "value=%s\n", method_name, __LINE__, rowNum,
- type, group, key, value);
- }
- Set( (char *) group, type, (char *) key, (char *) value, false );
- ++rowNum;
- }
- else if ( rc == SQLITE_DONE )
- {
- break;
- }
- else
- {
- if (trace_settings & TRACE_INIT)
- {
- trace_printf("%s@%d step failed, retrieving cluster registry "
- "data, error=%s (%d)\n",
- method_name, __LINE__, sqlite3_errmsg(db_), rc);
- }
-
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] step failed, retrieving "
- "cluster registry data, error=%s (%d)\n",
- method_name, sqlite3_errmsg(db_), rc );
- mon_log_write( MON_DATABASE_ERROR, SQ_LOG_ERR, buf );
-
- break;
- }
+ char la_buf[MON_STRING_BUF_SIZE];
+ snprintf( la_buf, sizeof(la_buf)
+ , "[%s] Node configuration access failed!\n"
+ , method_name );
+ mon_log_write(MON_CONFIGCONT_INIT_3, SQ_LOG_CRIT, la_buf);
}
- // Destroy prepared statement object
- if ( prepStmt != NULL )
- sqlite3_finalize(prepStmt);
-
- // Read process configuration registry entries and populate in-memory
- // structures.
- selStmt = "select p.procName, k.keyName, d.dataValue"
- " from monRegProcName p, monRegKeyName k, monRegProcData d"
- " where p.procId = d.procId"
- " and k.keyId = d.keyId";
-
- rc = sqlite3_prepare_v2( db_, selStmt, strlen(selStmt)+1, &prepStmt, NULL);
- if( rc!=SQLITE_OK )
+ // Get process scope configuration registry entries count
+ rc = tc_get_registry_cluster_set( ®ProcessCount
+ , regProcessMax
+ , NULL );
+ if ( rc )
{
- if (trace_settings & TRACE_INIT)
- {
- trace_printf("%s@%d prepare failed, error=%s (%d)\n", method_name,
- __LINE__, sqlite3_errmsg(db_), rc);
- }
-
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] prepare failed, error=%s (%d)\n",
- method_name, sqlite3_errmsg(db_), rc );
- mon_log_write( MON_DATABASE_ERROR, SQ_LOG_ERR, buf );
-
- TRACE_EXIT;
- return;
+ char la_buf[MON_STRING_BUF_SIZE];
+ snprintf( la_buf, sizeof(la_buf)
+ , "[%s] Node configuration access failed!\n"
+ , method_name );
+ mon_log_write(MON_CONFIGCONT_INIT_4, SQ_LOG_ERR, la_buf);
}
- rowNum = 1;
-
- while ( 1 )
+ regProcessMax = regProcessCount;
+ regProcessConfig = new registry_configuration_t[regProcessMax];
+ if (regClusterConfig)
{
- rc = sqlite3_step(prepStmt);
- if ( rc == SQLITE_ROW )
- { // Process row
- type = ConfigType_Process;
- group = sqlite3_column_text(prepStmt, 0);
- key = sqlite3_column_text(prepStmt, 1);
- value = sqlite3_column_text(prepStmt, 2);
- if (trace_settings & TRACE_INIT)
- {
- trace_printf("%s@%d row %d: type=%d, group=%s, key=%s, "
- "value=%s\n", method_name, __LINE__, rowNum,
- type, group, key, value);
- }
- Set( (char *) group, type, (char *) key, (char *) value, false );
- ++rowNum;
- }
- else if ( rc == SQLITE_DONE )
+ rc = tc_get_registry_cluster_set( ®ProcessCount
+ , regProcessMax
+ , regProcessConfig );
+ if ( rc )
{
- break;
+ char la_buf[MON_STRING_BUF_SIZE];
+ snprintf( la_buf, sizeof(la_buf)
+ , "[%s] Process scope configuration registry access failed!\n"
+ , method_name );
+ mon_log_write(MON_CONFIGCONT_INIT_5, SQ_LOG_CRIT, la_buf);
}
- else
- {
- if (trace_settings & TRACE_INIT)
- {
- trace_printf("%s@%d step failed, retrieving process registry"
- " data, error=%s (%d)\n",
- method_name, __LINE__, sqlite3_errmsg(db_), rc);
- }
-
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] step failed, retrieving process"
- " registry data, error=%s (%d)\n",
- method_name, sqlite3_errmsg(db_), rc );
- mon_log_write( MON_DATABASE_ERROR, SQ_LOG_ERR, buf );
+
+ type = ConfigType_Process;
- break;
+ // Process cluster scope configuration registry entries
+ for (int i = 0; i < regClusterCount; i++ )
+ {
+ Set( regProcessConfig[i].scope
+ , type
+ , regProcessConfig[i].key
+ , regProcessConfig[i].value
+ , false );
}
}
+ else
+ {
+ char la_buf[MON_STRING_BUF_SIZE];
+ snprintf( la_buf, sizeof(la_buf)
+ , "[%s] Node configuration access failed!\n"
+ , method_name );
+ mon_log_write(MON_CONFIGCONT_INIT_6, SQ_LOG_CRIT, la_buf);
+ }
- // Destroy prepared statement object
- if ( prepStmt != NULL )
- sqlite3_finalize(prepStmt);
-
TRACE_EXIT;
-
}
CConfigGroup *CConfigContainer::AddGroup(char *groupkey, ConfigType type,
@@ -797,64 +736,24 @@ void CConfigContainer::addDbKeyName ( const char * key )
const char method_name[] = "CConfigContainer::addDbKeyName";
TRACE_ENTRY;
- if ( db_ == NULL)
- {
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf("%s@%d cannot use database since database open"
- " failed.\n", method_name, __LINE__);
- }
-
- TRACE_EXIT;
- return;
- }
-
+ int rc;
+
if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
{
- trace_printf("%s@%d inserting key=%s into monRegKeyName\n",
- method_name, __LINE__, key);
+ trace_printf( "%s@%d saving registry key=%s\n"
+ , method_name, __LINE__
+ , key );
}
- int rc;
- const char * sqlStmt;
- sqlStmt = "insert into monRegKeyName (keyName) values ( :key );";
- sqlite3_stmt * prepStmt;
- rc = sqlite3_prepare_v2( db_, sqlStmt, strlen(sqlStmt)+1, &prepStmt,
- NULL);
- if ( rc != SQLITE_OK )
+ rc = tc_put_registry_key( key );
+ if ( rc )
{
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf("%s@%d prepare failed, error=%s (%d)\n",
- method_name, __LINE__, sqlite3_errmsg(db_), rc);
- }
-
char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] prepare failed, error=%s (%d)\n",
- method_name, sqlite3_errmsg(db_), rc );
- mon_log_write( MON_DATABASE_ERROR, SQ_LOG_ERR, buf );
+ snprintf( buf, sizeof(buf)
+ , "[%s] tc_put_registry_key() failed, error=%d (%s)\n"
+ , method_name, rc, tc_errmsg( rc ) );
+ mon_log_write( MON_CONFIGCONT_ADDKEYNAME_1, SQ_LOG_ERR, buf );
}
- else
- {
- sqlite3_bind_text( prepStmt,
- sqlite3_bind_parameter_index( prepStmt, ":key" ),
- key, -1, SQLITE_STATIC );
-
- rc = sqlite3_step( prepStmt );
- if (( rc != SQLITE_DONE ) && ( rc != SQLITE_ROW )
- && ( rc != SQLITE_CONSTRAINT ) )
- {
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf),
- "[%s] inserting key=%s into "
- "monRegKeyName failed, error=%s (%d)\n",
- method_name, key, sqlite3_errmsg(db_), rc );
- mon_log_write( MON_DATABASE_ERROR, SQ_LOG_ERR, buf );
- }
- }
-
- if ( prepStmt != NULL )
- sqlite3_finalize( prepStmt );
TRACE_EXIT;
}
@@ -865,64 +764,24 @@ void CConfigContainer::addDbProcName ( const char * name )
const char method_name[] = "CConfigContainer::addDbProcName";
TRACE_ENTRY;
- if ( db_ == NULL)
- {
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf("%s@%d cannot use database since database open"
- " failed.\n", method_name, __LINE__);
- }
-
- TRACE_EXIT;
- return;
- }
-
+ int rc;
+
if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
{
- trace_printf("%s@%d inserting name=%s into monRegProcName\n",
- method_name, __LINE__, name);
+ trace_printf( "%s@%d saving registry process, name=%s\n"
+ , method_name, __LINE__
+ , name );
}
- int rc;
- const char * sqlStmt;
- sqlStmt = "insert into monRegProcName (procName) values ( :name );";
- sqlite3_stmt * prepStmt;
- rc = sqlite3_prepare_v2( db_, sqlStmt, strlen(sqlStmt)+1, &prepStmt,
- NULL);
- if ( rc != SQLITE_OK )
+ rc = tc_put_registry_process( name );
+ if ( rc )
{
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf("%s@%d prepare failed, error=%s (%d)\n",
- method_name, __LINE__, sqlite3_errmsg(db_), rc);
- }
-
char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] prepare failed, error=%s (%d)\n",
- method_name, sqlite3_errmsg(db_), rc );
- mon_log_write( MON_DATABASE_ERROR, SQ_LOG_ERR, buf );
- }
- else
- {
- sqlite3_bind_text( prepStmt,
- sqlite3_bind_parameter_index( prepStmt, ":name" ),
- name, -1, SQLITE_STATIC );
-
- rc = sqlite3_step( prepStmt );
- if (( rc != SQLITE_DONE ) && ( rc != SQLITE_ROW )
- && ( rc != SQLITE_CONSTRAINT ) )
- {
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf),
- "[%s] inserting name=%s into "
- "monRegProcName failed, error=%s (%d)\n",
- method_name, name, sqlite3_errmsg(db_), rc );
- mon_log_write( MON_DATABASE_ERROR, SQ_LOG_ERR, buf );
- }
+ snprintf( buf, sizeof(buf)
+ , "[%s] tc_put_registry_process() failed, error=%d (%s)\n"
+ , method_name, rc, tc_errmsg( rc ) );
+ mon_log_write( MON_CONFIGCONT_ADDPROCNAME_1, SQ_LOG_ERR, buf );
}
-
- if ( prepStmt != NULL )
- sqlite3_finalize( prepStmt );
TRACE_EXIT;
}
@@ -933,70 +792,24 @@ void CConfigContainer::addDbClusterData ( const char * key,
const char method_name[] = "CConfigContainer::addDbClusterData";
TRACE_ENTRY;
- if ( db_ == NULL)
- {
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf("%s@%d cannot use database since database open"
- " failed.\n", method_name, __LINE__);
- }
-
- TRACE_EXIT;
- return;
- }
-
+ int rc;
+
if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
{
- trace_printf("%s@%d inserting key=%s into monRegClusterData\n",
- method_name, __LINE__, key);
+ trace_printf( "%s@%d saving registry cluster data key=%s\n"
+ , method_name, __LINE__
+ , key);
}
- int rc;
- const char * sqlStmt;
- sqlStmt = "insert or replace into monRegClusterData (dataValue, keyId)"
- " select :dataValue,"
- " k.keyId FROM monRegKeyName k"
- " where k.keyName = :key";
- sqlite3_stmt * prepStmt;
- rc = sqlite3_prepare_v2( db_, sqlStmt, strlen(sqlStmt)+1, &prepStmt,
- NULL);
- if ( rc != SQLITE_OK )
+ rc = tc_put_registry_cluster_data( key, dataValue );
+ if ( rc )
{
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf("%s@%d prepare failed, error=%s (%d)\n",
- method_name, __LINE__, sqlite3_errmsg(db_), rc);
- }
-
char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] prepare failed, error=%s (%d)\n",
- method_name, sqlite3_errmsg(db_), rc );
- mon_log_write( MON_DATABASE_ERROR, SQ_LOG_ERR, buf );
- }
- else
- {
- sqlite3_bind_text( prepStmt,
- sqlite3_bind_parameter_index( prepStmt,
- ":dataValue" ),
- dataValue, -1, SQLITE_STATIC );
- sqlite3_bind_text( prepStmt,
- sqlite3_bind_parameter_index( prepStmt, ":key" ),
- key, -1, SQLITE_STATIC );
-
- rc = sqlite3_step( prepStmt );
- if (( rc != SQLITE_DONE ) && ( rc != SQLITE_ROW )
- && ( rc != SQLITE_CONSTRAINT ) )
- {
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] inserting key=%s into "
- "monRegClusterData failed, error=%s (%d)\n",
- method_name, key, sqlite3_errmsg(db_), rc );
- mon_log_write( MON_DATABASE_ERROR, SQ_LOG_ERR, buf );
- }
+ snprintf( buf, sizeof(buf)
+ , "[%s] tc_put_registry_cluster_data() failed, error=%d (%s)\n"
+ , method_name, rc, tc_errmsg( rc ) );
+ mon_log_write( MON_CONFIGCONT_ADDCLUSTERDATA_1, SQ_LOG_ERR, buf );
}
-
- if ( prepStmt != NULL )
- sqlite3_finalize( prepStmt );
TRACE_EXIT;
}
@@ -1008,80 +821,26 @@ void CConfigContainer::addDbProcData ( const char * procName,
const char method_name[] = "CConfigContainer::addDbProcData";
TRACE_ENTRY;
- if ( db_ == NULL)
- {
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf("%s@%d cannot use database since database open"
- " failed.\n", method_name, __LINE__);
- }
-
- TRACE_EXIT;
- return;
- }
-
+ int rc;
+
if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
{
- trace_printf("%s@%d inserting key=%s into monRegProcData for "
- "proc=%s\n", method_name, __LINE__, key, procName);
+ trace_printf( "%s@%d saving registry process data procName=%s, "
+ "key=%s\n"
+ , method_name, __LINE__
+ , procName, key );
}
- int rc;
- const char * sqlStmt;
- sqlStmt = "insert or replace into monRegProcData (dataValue, procId, keyId )"
- " select :dataValue,"
- " p.procId,"
- " (SELECT k.keyId "
- " FROM monRegKeyName k"
- " WHERE k.keyName = :key)"
- " FROM monRegProcName p"
- " WHERE UPPER(p.procName) = UPPER(:procName)";
-
- sqlite3_stmt * prepStmt;
- rc = sqlite3_prepare_v2( db_, sqlStmt, strlen(sqlStmt)+1, &prepStmt,
- NULL);
- if ( rc != SQLITE_OK )
+ rc = tc_put_registry_process_data( procName, key, dataValue );
+ if ( rc )
{
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf("%s@%d prepare failed, error=%s (%d)\n",
- method_name, __LINE__, sqlite3_errmsg(db_), rc);
- }
-
char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] prepare failed, error=%s (%d)\n",
- method_name, sqlite3_errmsg(db_), rc );
- mon_log_write( MON_DATABASE_ERROR, SQ_LOG_ERR, buf );
- }
- else
- {
- sqlite3_bind_text( prepStmt,
- sqlite3_bind_parameter_index( prepStmt,
- ":procName" ),
- procName, -1, SQLITE_STATIC );
- sqlite3_bind_text( prepStmt,
- sqlite3_bind_parameter_index( prepStmt,
- ":dataValue" ),
- dataValue, -1, SQLITE_STATIC );
- sqlite3_bind_text( prepStmt,
- sqlite3_bind_parameter_index( prepStmt, ":key" ),
- key, -1, SQLITE_STATIC );
-
- rc = sqlite3_step( prepStmt );
- if (( rc != SQLITE_DONE ) && ( rc != SQLITE_ROW )
- && ( rc != SQLITE_CONSTRAINT ) )
- {
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] inserting key=%s into "
- "monRegProcData for proc=%s failed, error=%s (%d)\n",
- method_name, key, procName, sqlite3_errmsg(db_), rc );
- mon_log_write( MON_DATABASE_ERROR, SQ_LOG_ERR, buf );
- }
+ snprintf( buf, sizeof(buf)
+ , "[%s] tc_put_registry_process_data() failed, error=%d (%s)\n"
+ , method_name, rc, tc_errmsg( rc ) );
+ mon_log_write( MON_CONFIGCONT_ADDPROCDATA_1, SQ_LOG_ERR, buf );
}
- if ( prepStmt != NULL )
- sqlite3_finalize( prepStmt );
-
TRACE_EXIT;
}
@@ -1090,145 +849,66 @@ void CConfigContainer::addUniqueString(int nid, int id, const char * uniqStr )
const char method_name[] = "CConfigContainer::addUniqueString";
TRACE_ENTRY;
- if ( db_ == NULL)
- {
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf("%s@%d cannot use database since database open"
- " failed.\n", method_name, __LINE__);
- }
-
- TRACE_EXIT;
- return;
- }
-
-
+ int rc;
+
if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
{
- trace_printf("%s@%d inserting unique string nid=%d id=%d into "
- "monRegUniqueStrings\n", method_name, __LINE__,
- nid, id);
+ trace_printf( "%s@%d saving unique string nid=%d id=%d\n"
+ , method_name, __LINE__
+ , nid, id );
}
- int rc;
- const char * sqlStmt;
- sqlStmt = "insert or replace into monRegUniqueStrings values (?, ?, ?)";
-
- sqlite3_stmt * prepStmt;
- rc = sqlite3_prepare_v2( db_, sqlStmt, strlen(sqlStmt)+1, &prepStmt,
- NULL);
- if ( rc != SQLITE_OK )
+ rc = tc_put_unique_string( nid, id, uniqStr );
+ if ( rc )
{
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf("%s@%d prepare failed, error=%s (%d)\n",
- method_name, __LINE__, sqlite3_errmsg(db_), rc);
- }
-
char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] prepare failed, error=%s (%d)\n",
- method_name, sqlite3_errmsg(db_), rc );
- mon_log_write( MON_DATABASE_ERROR, SQ_LOG_ERR, buf );
+ snprintf( buf, sizeof(buf)
+ , "[%s] tc_put_unique_string() failed, error=%d (%s)\n"
+ , method_name, rc, tc_errmsg( rc ) );
+ mon_log_write( MON_CONFIGCONT_ADDUNIQUESTRING_1, SQ_LOG_ERR, buf );
}
- else
- {
- sqlite3_bind_int( prepStmt, 1, nid );
- sqlite3_bind_int( prepStmt, 2, id );
- sqlite3_bind_text( prepStmt, 3, uniqStr, -1, SQLITE_STATIC );
-
- rc = sqlite3_step( prepStmt );
- if ( rc != SQLITE_DONE )
- {
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf),
- "[%s] inserting into monRegUniqueStrings "
- "for nid=%d id=%d failed, error=%s (%d)\n",
- method_name, nid, id, sqlite3_errmsg(db_), rc );
- mon_log_write( MON_DATABASE_ERROR, SQ_LOG_ERR, buf );
- }
- }
-
- if ( prepStmt != NULL )
- sqlite3_finalize( prepStmt );
TRACE_EXIT;
}
-bool CConfigContainer::findUniqueString(int nid, const char * uniqStr,
- strId_t & id )
+bool CConfigContainer::findUniqueString( int nid
+ , const char *uniqStr
+ , strId_t &strId )
{
const char method_name[] = "CConfigContainer::findUniqueString";
TRACE_ENTRY;
- if ( db_ == NULL)
- {
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf("%s@%d cannot use database since database open"
- " failed.\n", method_name, __LINE__);
- }
-
- TRACE_EXIT;
- return false;
- }
-
+ bool result = false;
+ int rc;
+ int id;
if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
{
- trace_printf("%s@%d finding unique string nid=%d string=%s in "
- "monRegUniqueStrings\n", method_name, __LINE__,
- nid, uniqStr);
+ trace_printf( "%s@%d finding unique string nid=%d string=%s\n"
+ , method_name, __LINE__
+ , nid, uniqStr );
}
-
- bool result = false;
- int rc;
- const char * sqlStmt;
- sqlStmt = "select id from monRegUniqueStrings where nid = ? and dataValue = ?";
-
- sqlite3_stmt * prepStmt;
- rc = sqlite3_prepare_v2( db_, sqlStmt, strlen(sqlStmt)+1, &prepStmt,
- NULL);
-
- if ( rc != SQLITE_OK )
+ rc = tc_get_unique_string_id( nid, uniqStr, &id );
+ if ( rc )
{
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
+ if ( rc != TCDBNOEXIST )
{
- trace_printf("%s@%d prepare failed, error=%s (%d)\n",
- method_name, __LINE__, sqlite3_errmsg(db_), rc);
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] tc_get_unique_string_id() failed, ""error=%d (%s)\n"
+ , method_name, rc, tc_errmsg( rc ) );
+ mon_log_write( MON_CONFIGCONT_FINDUNIQUESTRING_1, SQ_LOG_ERR, buf );
}
-
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] prepare failed, error=%s (%d)\n",
- method_name, sqlite3_errmsg(db_), rc );
- mon_log_write( MON_DATABASE_ERROR, SQ_LOG_ERR, buf );
}
else
{
- sqlite3_bind_int( prepStmt, 1, nid );
- sqlite3_bind_text( prepStmt, 2, uniqStr, -1, SQLITE_STATIC );
-
- rc = sqlite3_step( prepStmt );
-
- if ( rc == SQLITE_ROW )
- { // Found string in database, return id
- id.nid = nid;
- id.id = sqlite3_column_int (prepStmt, 0);
- result = true;
-
- if (trace_settings & TRACE_REQUEST)
- {
- trace_printf("%s@%d found unique string nid=%d, id=%d\n",
- method_name, __LINE__, nid, id.id);
- }
- }
+ strId.nid = nid;
+ strId.id = id;
+ result = true;
}
- if ( prepStmt != NULL )
- sqlite3_finalize( prepStmt );
-
TRACE_EXIT;
-
return result;
}
@@ -1237,81 +917,39 @@ int CConfigContainer::getMaxUniqueId( int nid )
const char method_name[] = "CConfigContainer::getMaxUniqueId";
TRACE_ENTRY;
+ int id = 0;
+ int rc;
- if ( db_ == NULL)
+ if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
{
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf("%s@%d cannot use database since database open"
- " failed.\n", method_name, __LINE__);
- }
-
- TRACE_EXIT;
- return false;
+ trace_printf( "%s@%d finding max unique string id for nid=%d\n"
+ , method_name, __LINE__
+ , nid );
}
-
- int result = 0;
- int rc;
- const char * sqlStmt;
- sqlStmt = "select max(id) from monRegUniqueStrings where nid=?";
-
- sqlite3_stmt * prepStmt;
- rc = sqlite3_prepare_v2( db_, sqlStmt, strlen(sqlStmt)+1, &prepStmt,
- NULL);
- if ( rc != SQLITE_OK )
+ rc = tc_get_unique_string_id_max( nid, &id );
+ if ( rc )
{
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
+ if ( rc != TCDBNOEXIST )
{
- trace_printf("%s@%d prepare failed, error=%s (%d)\n",
- method_name, __LINE__, sqlite3_errmsg(db_), rc);
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] tc_get_unique_string_id_max() failed, error=%d (%s)\n"
+ , method_name, rc, tc_errmsg( rc ) );
+ mon_log_write( MON_CONFIGCONT_GETUNIQUESTRIDMAX_1, SQ_LOG_ERR, buf );
}
-
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] prepare failed, error=%s (%d)\n",
- method_name, sqlite3_errmsg(db_), rc );
- mon_log_write( MON_DATABASE_ERROR, SQ_LOG_ERR, buf );
}
else
{
- sqlite3_bind_int( prepStmt, 1, nid );
-
- rc = sqlite3_step( prepStmt );
-
- if ( rc == SQLITE_ROW )
- {
- result = sqlite3_column_int(prepStmt, 0);
-
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf("%s@%d found max(id)=%d for nid=%d in "
- "monRegUniqueStrings\n", method_name, __LINE__,
- result, nid);
- }
- }
- else
+ if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
{
- if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
- {
- trace_printf("%s@%d finding max(id) in monRegUniqueStrings "
- "for nid=%d, error=%s (%d)\n", method_name, __LINE__,
- nid, sqlite3_errmsg(db_), rc);
- }
-
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] finding max(id) in monRegUnique"
- "Strings for nid=%d, error=%s (%d)\n",
- method_name, nid, sqlite3_errmsg(db_), rc );
- mon_log_write( MON_DATABASE_ERROR, SQ_LOG_ERR, buf );
+ trace_printf( "%s@%d found max(id)=%d for nid=%d\n"
+ , method_name, __LINE__, id, nid);
}
}
-
- if ( prepStmt != NULL )
- sqlite3_finalize( prepStmt );
TRACE_EXIT;
-
- return result;
+ return id;
}
void CConfigContainer::strIdToString( strId_t stringId, string & value )
@@ -1320,61 +958,32 @@ void CConfigContainer::strIdToString( strId_t stringId, string & value )
TRACE_ENTRY;
int rc;
- const char * selStmt;
- sqlite3_stmt * prepStmt;
+ char uniqueString[TC_UNIQUE_STRING_VALUE_MAX] = { 0 };
- // Read process configuration registry entries and populate in-memory
- // structures.
- selStmt = "select dataValue from monRegUniqueStrings where nid = ? and id = ?";
- rc = sqlite3_prepare_v2( db_, selStmt, strlen(selStmt)+1, &prepStmt, NULL);
+ if (trace_settings & (TRACE_INIT | TRACE_REQUEST))
+ {
+ trace_printf( "%s@%d Get unique string, stringId(nid=%d, id=%d)\n"
+ , method_name, __LINE__
+ , stringId.nid, stringId.id );
+ }
- if ( rc != SQLITE_OK )
+ rc = tc_get_unique_string( stringId.nid, stringId.id, uniqueString );
+ if ( rc )
{
- if (trace_settings & TRACE_REQUEST)
+ value.assign( "" );
+ if ( rc != TCDBNOEXIST )
{
- trace_printf("%s@%d prepare failed, error=%s (%d)\n",
- method_name, __LINE__, sqlite3_errmsg(db_), rc);
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] tc_get_unique_string() failed, ""error=%d (%s)\n"
+ , method_name, rc, tc_errmsg( rc ) );
+ mon_log_write( MON_CONFIGCONT_STRINGIDTPSTRING_1, SQ_LOG_ERR, buf );
}
-
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] prepare failed, error=%s (%d)\n",
- method_name, sqlite3_errmsg(db_), rc );
- mon_log_write( MON_DATABASE_ERROR, SQ_LOG_ERR, buf );
}
else
{
- sqlite3_bind_int ( prepStmt, 1, stringId.nid );
- sqlite3_bind_int ( prepStmt, 2, stringId.id );
-
- rc = sqlite3_step( prepStmt );
-
- if ( rc == SQLITE_ROW )
- {
- value.assign( (const char *) sqlite3_column_text(prepStmt, 0) );
-
- if (trace_settings & TRACE_REQUEST)
- {
- trace_printf("%s@%d retrieved unique string (%d, %d), "
- "value=%s\n", method_name, __LINE__,
- stringId.nid, stringId.id, value.c_str());
- }
- }
- else
- {
- value.assign( "" );
-
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] unable to retrieve unique string"
- " (%d, %d), error=%s (%d)\n",
- method_name, stringId.nid, stringId.id,
- sqlite3_errmsg(db_), rc );
- mon_log_write( MON_DATABASE_ERROR, SQ_LOG_ERR, buf );
- }
-
+ value.assign( uniqueString );
}
-
- if ( prepStmt != NULL )
- sqlite3_finalize( prepStmt );
TRACE_EXIT;
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/04040d30/core/sqf/monitor/linux/config.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/config.h b/core/sqf/monitor/linux/config.h
index 3aacf86..ea606de 100644
--- a/core/sqf/monitor/linux/config.h
+++ b/core/sqf/monitor/linux/config.h
@@ -27,7 +27,7 @@
#define CONFIG_H_
#include <string>
-#include <sqlite3.h>
+//#include <sqlite3.h>
#include "msgdef.h"
#include "internal.h"
#include "clusterconf.h"
@@ -135,7 +135,7 @@ private:
char localNodeName_[MAX_KEY_NAME];
CConfigGroup *Head; // Head of process configuration group list
CConfigGroup *Tail; // Tail of process configuration group list
- sqlite3 *db_;
+ //sqlite3 *db_;
};
#endif /*CONFIG_H_*/
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/04040d30/core/sqf/monitor/linux/gentrap.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/gentrap.cxx b/core/sqf/monitor/linux/gentrap.cxx
index 5a6ea6a..cbf4363 100644
--- a/core/sqf/monitor/linux/gentrap.cxx
+++ b/core/sqf/monitor/linux/gentrap.cxx
@@ -40,7 +40,7 @@ void genSnmpTrap ( const char *event )
trace_printf( "%s@%d - snmptrap(%d): %s\n"
, method_name, __LINE__, genSnmpTrapEnabled, event);
- snmp_log_write( MON_GEN_SNMP_TRAP, (char *)event );
+ mon_log_write( MON_GEN_SNMP_TRAP, SQ_LOG_CRIT, (char *)event );
if ( genSnmpTrapEnabled )
{
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/04040d30/core/sqf/monitor/linux/lnodeconfig.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/lnodeconfig.cxx b/core/sqf/monitor/linux/lnodeconfig.cxx
index 34dee6d..34df543 100644
--- a/core/sqf/monitor/linux/lnodeconfig.cxx
+++ b/core/sqf/monitor/linux/lnodeconfig.cxx
@@ -47,19 +47,14 @@ using namespace std;
///////////////////////////////////////////////////////////////////////////////
CLNodeConfig::CLNodeConfig( CPNodeConfig *pnodeConfig
- , int nid
- , cpu_set_t &coreMask
- , int firstCore
- , int lastCore
- , int processors
- , ZoneType zoneType
+ , lnodeConfigInfo_t &lnodeConfigInfo
)
- : nid_(nid)
- , coreMask_(coreMask)
- , firstCore_(firstCore)
- , lastCore_(lastCore)
- , processors_(processors)
- , zoneType_(zoneType)
+ : nid_(lnodeConfigInfo.nid)
+ , coreMask_(lnodeConfigInfo.coreMask)
+ , firstCore_(lnodeConfigInfo.firstCore)
+ , lastCore_(lnodeConfigInfo.lastCore)
+ , processors_(lnodeConfigInfo.processor)
+ , zoneType_(lnodeConfigInfo.zoneType)
, pnodeConfig_(pnodeConfig)
, next_(NULL)
, prev_(NULL)
@@ -230,41 +225,32 @@ CLNodeConfig *CLNodeConfigContainer::AddLNodeConfigP( CLNodeConfig *lnodeConfig
}
CLNodeConfig *CLNodeConfigContainer::AddLNodeConfig( CPNodeConfig *pnodeConfig
- , int nid
- , cpu_set_t &coreMask
- , int firstCore
- , int lastCore
- , int processors
- , ZoneType zoneType
+ , lnodeConfigInfo_t &lnodeConfigInfo
)
{
const char method_name[] = "CLNodeConfigContainer::AddLNodeConfig";
TRACE_ENTRY;
// nid list is NOT sequential from zero
- if ( ! (nid >= 0 && nid < lnodesConfigMax_) )
+ if ( ! (lnodeConfigInfo.nid >= 0 && lnodeConfigInfo.nid < lnodesConfigMax_) )
{
char la_buf[MON_STRING_BUF_SIZE];
- sprintf(la_buf, "[%s], Error: Invalid nid=%d - should be >= 0 and < %d)\n", method_name, nid, lnodesConfigMax_);
+ sprintf( la_buf, "[%s], Error: Invalid nid=%d - should be >= 0 and < %d)\n"
+ , method_name, lnodeConfigInfo.nid, lnodesConfigMax_);
mon_log_write(MON_LNODECONF_ADD_LNODE_1, SQ_LOG_CRIT, la_buf);
return( NULL );
}
- assert( lnodesConfig_[nid] == NULL );
+ assert( lnodesConfig_[lnodeConfigInfo.nid] == NULL );
CLNodeConfig *lnodeConfig = new CLNodeConfig( pnodeConfig
- , nid
- , coreMask
- , firstCore
- , lastCore
- , processors
- , zoneType );
+ , lnodeConfigInfo );
if (lnodeConfig)
{
// Bump the logical node count
lnodesCount_++;
// Add it to the array
- lnodesConfig_[nid] = lnodeConfig;
+ lnodesConfig_[lnodeConfigInfo.nid] = lnodeConfig;
// Add it to the container list
if ( head_ == NULL )
{
@@ -278,7 +264,7 @@ CLNodeConfig *CLNodeConfigContainer::AddLNodeConfig( CPNodeConfig *pnodeConfig
}
// Set the next available nid
- nextNid_ = (nid == nextNid_) ? (nid+1) : nextNid_ ;
+ nextNid_ = (lnodeConfigInfo.nid == nextNid_) ? (lnodeConfigInfo.nid+1) : nextNid_ ;
if ( nextNid_ == lnodesConfigMax_ )
{ // We are at the limit, search for unused nid from begining
nextNid_ = -1;
@@ -311,7 +297,7 @@ CLNodeConfig *CLNodeConfigContainer::AddLNodeConfig( CPNodeConfig *pnodeConfig
" (nid=%d, pnid=%d, nextNid_=%d)\n"
" (lnodesCount_=%d,lnodesConfigMax=%d)\n"
, method_name, __LINE__
- , nid, pnodeConfig->GetPNid(), nextNid_
+ , lnodeConfigInfo.nid, pnodeConfig->GetPNid(), nextNid_
, lnodesCount_, lnodesConfigMax_);
}
}
@@ -319,7 +305,8 @@ CLNodeConfig *CLNodeConfigContainer::AddLNodeConfig( CPNodeConfig *pnodeConfig
{
int err = errno;
char la_buf[MON_STRING_BUF_SIZE];
- sprintf(la_buf, "[%s], Error: Can't allocate logical node configuration object - errno=%d (%s)\n", method_name, err, strerror(errno));
+ sprintf( la_buf, "[%s], Error: Can't allocate logical node configuration object - errno=%d (%s)\n"
+ , method_name, err, strerror(errno));
mon_log_write(MON_LNODECONF_ADD_LNODE_2, SQ_LOG_ERR, la_buf);
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/04040d30/core/sqf/monitor/linux/lnodeconfig.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/lnodeconfig.h b/core/sqf/monitor/linux/lnodeconfig.h
index abeab48..37185c8 100644
--- a/core/sqf/monitor/linux/lnodeconfig.h
+++ b/core/sqf/monitor/linux/lnodeconfig.h
@@ -26,6 +26,19 @@
#ifndef LNODECONFIG_H_
#define LNODECONFIG_H_
+typedef struct lnodeConfigInfo_s
+{
+ int nid;
+ int pnid;
+ char nodename[MPI_MAX_PROCESSOR_NAME];
+ int firstCore;
+ int lastCore;
+ cpu_set_t coreMask;
+ int processor;
+ ZoneType zoneType;
+} lnodeConfigInfo_t;
+
+
class CLNodeConfig;
class CPNodeConfig;
@@ -35,15 +48,8 @@ public:
CLNodeConfigContainer( void );
CLNodeConfigContainer( int lnodesConfigMax );
~CLNodeConfigContainer( void );
-
CLNodeConfig *AddLNodeConfig( CPNodeConfig *pnodeConfig
- , int nid
- , cpu_set_t &coreMask
- , int firstCore
- , int lastCore
- , int processors
- , ZoneType zoneType
- );
+ , lnodeConfigInfo_t &lnodeConfigInfo );
CLNodeConfig *AddLNodeConfigP( CLNodeConfig *lnodeConfig );
void Clear( void );
void DeleteLNodeConfig( CLNodeConfig *lnodeConfig );
@@ -69,24 +75,13 @@ private:
class CLNodeConfig
{
friend CLNodeConfig *CLNodeConfigContainer::AddLNodeConfig( CPNodeConfig *pnodeConfig
- , int nid
- , cpu_set_t &coreMask
- , int firstCore
- , int lastCore
- , int processors
- , ZoneType zoneType
- );
+ , lnodeConfigInfo_t &lnodeConfigInfo );
friend CLNodeConfig *CLNodeConfigContainer::AddLNodeConfigP( CLNodeConfig *lnodeConfig );
friend void CLNodeConfigContainer::DeleteLNodeConfig( CLNodeConfig *lnodeConfig );
friend void CLNodeConfigContainer::RemoveLNodeConfigP( CLNodeConfig *lnodeConfig );
public:
CLNodeConfig( CPNodeConfig *pnodeConfig
- , int nid
- , cpu_set_t &coreMask
- , int firstCore
- , int lastCore
- , int processors
- , ZoneType zoneType
+ , lnodeConfigInfo_t &lnodeConfigInfo
);
~CLNodeConfig( void );
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/04040d30/core/sqf/monitor/linux/makefile
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/makefile b/core/sqf/monitor/linux/makefile
index 0660414..c8660a3 100644
--- a/core/sqf/monitor/linux/makefile
+++ b/core/sqf/monitor/linux/makefile
@@ -33,7 +33,7 @@ endif
#DEBUG = -O0 -g3
DEBUG = $(CFLAGS)
-FLAGS = $(DEBUG) -Wno-deprecated -fmessage-length=0
+FLAGS = $(DEBUG) -Wno-deprecated -fmessage-length=0 -fPIC
ifeq ($(USE_DMALLOC),1)
FLAGS+= -DDMALLOC
endif
@@ -48,14 +48,14 @@ FLAGS+= -UNDEBUG
FLAGS+= -Wall -Wextra
# Flags for use in compiling Seabed trace modules
-SBFLAGS = -Wall -Wextra -pedantic -Werror -Wno-long-long $(DBG_FLGS) $(OPTIM_FLGS) -Xlinker --copy-dt-needed-entries
+SBFLAGS = -Wall -Wextra -pedantic -Werror -Wno-long-long $(DBG_FLGS) $(OPTIM_FLGS) -Xlinker --copy-dt-needed-entries -fPIC
SBDIR = ../../src/seabed/src
COMMONLOGGERDIR = ../../commonLogger
INCLUDE = monitor.h msgdef.h internal.h monlogging.h clio.h mlio.h localio.h lock.h
-LIBS = -L$(LIBEXPDIR) -L$(ZOOKEEPER_DIR)/lib -lrt -lsblogalt -lzookeeper_mt
+LIBS = -L$(LIBEXPDIR) -L$(ZOOKEEPER_DIR)/lib -lrt -lsblogalt -lzookeeper_mt -ltrafconfig
LIBS+= -lmpich
@@ -151,6 +151,7 @@ MONITORSRC += reqzoneinfo.cxx
MONITORSRC += replicate.cxx
MONITORSRC += gentrap.cxx
MONITORSRC += monrobsem.cxx
+
MONITOROBJS = $(OUTDIR)/versmon.o
MONITOROBJS += $(OUTDIR)/monitor.o
MONITOROBJS += $(OUTDIR)/cluster.o
@@ -285,6 +286,30 @@ TRACE_LOG_OBJS += $(OUTDIR)/threadtls.o
RTSIGBLOCK_SRC = rtsigblock.cxx
RTSIGBLOCK_OBJS = $(OUTDIR)/rtsigblock.o
+CONFOBJS = $(OUTDIR)/testconf.o
+CONFOBJS += $(OUTDIR)/clusterconf.o
+CONFOBJS += $(OUTDIR)/lnodeconfig.o
+CONFOBJS += $(OUTDIR)/pnodeconfig.o
+CONFOBJS += $(OUTDIR)/persistconfig.o
+
+TRAFCONFOBJS = $(OUTDIR)/trafconf.o
+TRAFCONFOBJS += $(OUTDIR)/clusterconf.o
+TRAFCONFOBJS += $(OUTDIR)/lnodeconfig.o
+TRAFCONFOBJS += $(OUTDIR)/pnodeconfig.o
+TRAFCONFOBJS += $(OUTDIR)/persistconfig.o
+
+SQLITECONFIG_SRC = sqliteconfig.cxx
+SQLITECONFIG_OBJS = $(OUTDIR)/sqliteconfig.o
+
+TRAFCONFIGLOG_SRC = trafconfiglog.cxx
+TRAFCONFIGLOG_OBJS = $(OUTDIR)/trafconfiglog.o
+
+TRAFCONFIGTRACE_SRC = trafconfigtrace.cxx
+TRAFCONFIGTRACE_OBJS = $(OUTDIR)/trafconfigtrace.o
+
+TRAFCONFIG_SRC = trafconfig.cxx
+TRAFCONFIG_OBJS = $(OUTDIR)/trafconfig.o
+
ALLOBJS = $(MONITOROBJS)
ALLOBJS += $(SHELLOBJS)
ALLOBJS += $(CLIENTOBJS)
@@ -296,16 +321,22 @@ ALLOBJS += $(TRACE_LOG_OBJS)
ALLOBJS += $(CONFOBJS)
ALLOBJS += $(MEMLOGOBJS)
ALLOBJS += $(RTSIGBLOCK_OBJS)
-ALLOBJS += $(TCONFOBJS)
ALLOBJS += $(ZOOMONOBJS)
+ALLOBJS += $(TRAFCONFOBJS)
+ALLOBJS += $(SQLITECONFIG_OBJS)
+ALLOBJS += $(TRAFCONFIG_OBJS)
+ALLOBJS += $(TRAFCONFIGLOG_OBJS)
+ALLOBJS += $(TRAFCONFIGTRACE_OBJS)
+
+SHAREDLIBS = $(LIBEXPDIR)/libtrafconfig.so
+SHAREDLIBS += $(LIBEXPDIR)/libseabasesig.so
-PGMS = $(BINEXPDIR)/monitor
+PGMS = $(BINEXPDIR)/monitor
PGMS += $(BINEXPDIR)/shell
PGMS += $(BINEXPDIR)/sqwatchdog
PGMS += $(BINEXPDIR)/monmemlog
PGMS += $(BINEXPDIR)/pstartd
PGMS += $(BINEXPDIR)/trafconf
-PGMS += $(LIBEXPDIR)/libseabasesig.so
TEST_PGMS = $(OUTDIR)/client
TEST_PGMS += $(OUTDIR)/client2
@@ -388,15 +419,19 @@ $(OUTDIR)/%.o:$(COMMONLOGGERDIR)/%.cpp $(INCLUDE)
# Targets
# Uncomment the following target to disable parallel make
-#.NOTPARALLEL: $(PGMS)
+.NOTPARALLEL:
-all: $(PGMS) example
+all: programs examples
+
+programs: sharedlibs $(PGMS)
+
+examples: $(TEST_PGMS)
+
+sharedlibs: $(SHAREDLIBS)
montim:
@$(MAKE) $(OUTDIR)/montim
-example : $(TEST_PGMS)
-
$(OUTDIR)/client : client.cxx $(CLIENTOBJS) $(TRACE_LOG_OBJS)
$(OUTDIR)/nsclient : nsclient.cxx $(CLIENTOBJS) $(TRACE_LOG_OBJS)
@@ -419,18 +454,6 @@ $(OUTDIR)/testtm : testtm.cxx $(CLIENTOBJS) $(TRACE_LOG_OBJS)
$(OUTDIR)/pingpong2 : pingpong2.cxx $(CLIENTOBJS) $(TRACE_LOG_OBJS)
-CONFOBJS = $(OUTDIR)/testconf.o \
- $(OUTDIR)/clusterconf.o \
- $(OUTDIR)/lnodeconfig.o \
- $(OUTDIR)/pnodeconfig.o \
- $(OUTDIR)/persistconfig.o
-
-TCONFOBJS = $(OUTDIR)/trafconf.o \
- $(OUTDIR)/clusterconf.o \
- $(OUTDIR)/lnodeconfig.o \
- $(OUTDIR)/pnodeconfig.o \
- $(OUTDIR)/persistconfig.o
-
$(OUTDIR)/testconf : $(CONFOBJS) $(TRACE_LOG_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: Linker'
@@ -439,7 +462,7 @@ $(OUTDIR)/testconf : $(CONFOBJS) $(TRACE_LOG_OBJS)
@echo 'Finished building target: $@'
@echo ' '
-$(BINEXPDIR)/trafconf : $(TCONFOBJS) $(TRACE_LOG_OBJS)
+$(BINEXPDIR)/trafconf : $(TRAFCONFOBJS) $(TRACE_LOG_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: Linker'
@echo $(CXX) $(CDEPFLAGS) $(FLAGS) $(OPTIONS) $(INCLUDES) -o $@ -lrt $^
@@ -506,6 +529,15 @@ $(LIBEXPDIR)/libseabasesig.so: $(RTSIGBLOCK_OBJS)
@echo 'Finished building target: $@'
@echo ' '
+$(LIBEXPDIR)/libtrafconfig.so: $(TRAFCONFIG_OBJS) $(SQLITECONFIG_OBJS) $(TRACE_LOG_OBJS) $(TRAFCONFIGLOG_OBJS) $(TRAFCONFIGTRACE_OBJS)
+ @echo 'Building target: $@'
+ @echo 'Invoking: Linker'
+ @echo $(CXX) $(LNK_FLGS) -shared -o $@ $(TRAFCONFIG_OBJS) $(SQLITECONFIG_OBJS) $(TRACE_LOG_OBJS) $(TRAFCONFIGLOG_OBJS) $(TRAFCONFIGTRACE_OBJS)
+ @$(CXX) $(LNK_FLGS) -shared -o $@ $(TRAFCONFIG_OBJS) $(SQLITECONFIG_OBJS) $(TRACE_LOG_OBJS) $(TRAFCONFIGLOG_OBJS) $(TRAFCONFIGTRACE_OBJS)
+ @echo 'Finished building target: $@'
+ @echo ' '
+
+
setup:
@# do nothing
@@ -514,6 +546,7 @@ clean:
-rm -f $(ALLOBJS)
-rm -f $(CDEP_DIR)/*.dep
-rm -f $(LIBEXPDIR)/libseabasesig.so
+ -rm -f $(LIBEXPDIR)/libtrafconfig.so
@echo ' '
cleanall: clean
@@ -522,29 +555,20 @@ cleanall: clean
cleaner: clean
-rm -f *~
-install:
- @echo 'Installing programs in $(INSTALL_DIR)'
- -cp $(PGMS) $(INSTALL_DIR)
- @echo 'Finished installing programs'
- @echo ' '
+#install:
+# @echo 'Installing programs in $(INSTALL_DIR)'
+# -cp $(PGMS) $(INSTALL_DIR)
+# @echo 'Finished installing programs'
+# @echo ' '
-uninstall:
- @echo 'Uninstalling programs from $(INSTALL_DIR)'
- -cd $(INSTALL_DIR);rm -f $(PGMS) $(TEST_PGMS)
- @echo 'Finished uninstalling programs'
- @echo ' '
+#uninstall:
+# @echo 'Uninstalling programs from $(INSTALL_DIR)'
+# -cd $(INSTALL_DIR);rm -f $(PGMS) $(TEST_PGMS)
+# @echo 'Finished uninstalling programs'
+# @echo ' '
rebuild: clean all
-@echo ' '
-$(RTSIGBLOCK_OBJS):$(RTSIGBLOCK_SRC)
- @echo 'Building target: $@'
- @echo 'Invoking: C++ Compiler'
- @echo $(CXX) $(CDEPFLAGS) $(FLAGS) -fPIC $(OPTIONS) $(INCLUDES) -c -o $@ $<
- @$(CXX) $(CDEPFLAGS) $(FLAGS) -fPIC $(OPTIONS) $(INCLUDES) -c -o $@ $<
- @echo 'Finished building target: $@'
- @echo ' '
-
-
-include $(CDEP_DIR)/*.dep
_dummy := $(shell if [ ! -d $(CDEP_DIR) ]; then mkdir -p $(CDEP_DIR); fi)
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/04040d30/core/sqf/monitor/linux/monitor.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/monitor.cxx b/core/sqf/monitor/linux/monitor.cxx
index 0652cce..f73b972 100755
--- a/core/sqf/monitor/linux/monitor.cxx
+++ b/core/sqf/monitor/linux/monitor.cxx
@@ -121,7 +121,6 @@ CDeviceContainer *Devices = NULL;
int MyPNID = -1;
CNode *MyNode;
CMonLog *MonLog = NULL;
-CMonLog *SnmpLog = NULL;
CMonStats * MonStats = NULL;
extern CMonTrace *MonTrace;
CRedirector Redirector;
@@ -962,7 +961,6 @@ int main (int argc, char *argv[])
const char method_name[] = "main";
- SnmpLog = new CMonLog( "log4cxx.monitor.mon.snmp.config", "MON-SNMP", "alt.mon.snmp", -1, -1, getpid(), "$MONITOR" );
MonLog = new CMonLog( "log4cxx.monitor.mon.config", "MON", "alt.mon", -1, -1, getpid(), "$MONITOR" );
MonLog->setupInMemoryLog();
@@ -1082,7 +1080,6 @@ int main (int argc, char *argv[])
MPI_Comm_set_errhandler(MPI_COMM_SELF, MPI_ERRORS_RETURN);
MPI_Comm_rank (MPI_COMM_WORLD, &MyPNID);
MonLog->setPNid( MyPNID );
- SnmpLog->setPNid( MyPNID );
gethostname(Node_name, MPI_MAX_PROCESSOR_NAME);
char *tmpptr = Node_name;
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/04040d30/core/sqf/monitor/linux/monlogging.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/monlogging.cxx b/core/sqf/monitor/linux/monlogging.cxx
index b8c7146..c441254 100755
--- a/core/sqf/monitor/linux/monlogging.cxx
+++ b/core/sqf/monitor/linux/monlogging.cxx
@@ -47,7 +47,8 @@ using namespace std;
extern int MyPNID;
extern CMonLog *MonLog;
-extern CMonLog *SnmpLog;
+
+pthread_mutex_t MonLogMutex = PTHREAD_MUTEX_INITIALIZER;
int mon_log_write(int eventType, posix_sqlog_severity_t severity, char *msg)
{
@@ -82,19 +83,6 @@ int monproc_log_write(int eventType, posix_sqlog_severity_t severity, char *msg)
return(0);
}
-int snmp_log_write(int eventType, char *msg)
-{
- if (SnmpLog->isUseAltLog())
- {
- SnmpLog->writeSnmpAltLog(eventType, msg);
- }
- else
- {
- SnmpLog->writeMonLog(eventType, SQ_LOG_CRIT, msg);
- }
- return(0);
-}
-
void mem_log_write(int eventType, int value1, int value2)
{
MonLog->memLogWrite(eventType, value1, value2);
@@ -268,60 +256,21 @@ void CMonLog::writeAltLog(int eventType, posix_sqlog_severity_t severity, char *
return;
}
-void CMonLog::writeSnmpAltLog(int eventType, const char *msg)
-{
- char logFileDir[PATH_MAX];
- char *logFileDirPtr;
- char logFilePrefix[MAX_FILE_NAME];
- char *rootDir;
-
- if ( useAltLog_ )
- {
- rootDir = getenv("MY_SQROOT");
- if (rootDir == NULL)
- {
- logFileDirPtr = NULL;
- }
- else
- {
- sprintf(logFileDir, "%s/logs", rootDir);
- logFileDirPtr = logFileDir;
- }
-
- // log file prefix will be snmp.mon.nn
- // nn is the file number. If the log file becomes too big,
- // LogFileNum can be incremented.
- sprintf( logFilePrefix, "%s.%s.%02d"
- , logFileNamePrefix_.c_str(), (char *)&startTimeFmt_, logFileNum_);
-
- SBX_log_write(logFileType_, // log_type
- logFileDirPtr, // log_file_dir
- logFilePrefix, // log_file_prefix
- SQEVL_MONITOR, // component id
- eventType, // event id
- SQ_LOG_SEAQUEST, // facility
- SQ_LOG_CRIT, // severity
- myProcessName_.c_str(), // name
- NULL, // msg_prefix
- msg, // msg
- NULL, // snmptrap_cmd
- NULL, // msg_snmptrap
- NULL, // msg_ret
- 0); // msg_ret size
- }
-
- return;
-}
-
void CMonLog::writeMonLog(int eventType, posix_sqlog_severity_t severity, char *msg)
{
logLevel llevel = getLogLevel( severity );
+ int status = pthread_mutex_lock(&MonLogMutex);
+ assert(status == 0);
+
// Log4cxx logging
CommonLogger::log( log4cxxComponent_
, llevel
, "Node Number: %u,, PIN: %u , Process Name: %s,,, TID: %d, Message ID: %u, %s"
, myPNid_, myPid_, myProcessName_.c_str(), gettid(), eventType, msg);
+ status = pthread_mutex_unlock(&MonLogMutex);
+ assert(status == 0);
+
return;
}
@@ -329,11 +278,18 @@ void CMonLog::writeMonProcLog(int eventType, posix_sqlog_severity_t severity, ch
{
logLevel llevel = getLogLevel( severity );
+ int status = pthread_mutex_lock(&MonLogMutex);
+ assert(status == 0);
+
// Log4cxx logging
CommonLogger::log( log4cxxComponent_
, llevel
, "Node Number: %u, CPU: %u, PIN: %u , Process Name: %s,,, TID: %u, Message ID: %u, %s"
, myPNid_, myNid_, myPid_, myProcessName_.c_str(), gettid(), eventType, msg);
+
+ status = pthread_mutex_unlock(&MonLogMutex);
+ assert(status == 0);
+
return;
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/04040d30/core/sqf/monitor/linux/monlogging.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/monlogging.h b/core/sqf/monitor/linux/monlogging.h
index 356f8f0..f3b1840 100755
--- a/core/sqf/monitor/linux/monlogging.h
+++ b/core/sqf/monitor/linux/monlogging.h
@@ -50,9 +50,6 @@ void mem_log_write(int eventType, int value1 = 0, int value2 = 0);
// Used by monitor primitive processes
int monproc_log_write(int event_type, posix_sqlog_severity_t severity, char *evl_buf);
-// Used by monitor and SQWatchdog process
-int snmp_log_write(int event_type, char *evl_buf);
-
// header of the memory log buffer
typedef struct memLogHeader
{
@@ -92,8 +89,6 @@ public:
void writeMonProcLog(int eventType, posix_sqlog_severity_t severity, char *msg);
- void writeSnmpAltLog(int event_type, const char *msg);
-
inline int getLogFileNum() { return logFileNum_; }
void setLogFileNum(int value);
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/04040d30/core/sqf/monitor/linux/montrace.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/montrace.cxx b/core/sqf/monitor/linux/montrace.cxx
index 9b0e098..9f2a391 100644
--- a/core/sqf/monitor/linux/montrace.cxx
+++ b/core/sqf/monitor/linux/montrace.cxx
@@ -59,6 +59,7 @@ const CMonTrace::traceArea CMonTrace::traceAreaList[] =
{"MON_TRACE_EVLOG_MSG", TRACE_EVLOG_MSG},
{"MON_TRACE_ENTRY_EXIT", TRACE_ENTRY_EXIT},
{"MON_TRACE_REDIRECTION", TRACE_REDIRECTION},
+ {"MON_TRACE_TRAFCONFIG", TRACE_TRAFCONFIG},
{"MON_TRACE_HEALTH", TRACE_HEALTH},
{"MON_TRACE_SIG_HANDLER", TRACE_SIG_HANDLER}
};
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/04040d30/core/sqf/monitor/linux/montrace.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/montrace.h b/core/sqf/monitor/linux/montrace.h
index 6dcfbcc..dce911a 100644
--- a/core/sqf/monitor/linux/montrace.h
+++ b/core/sqf/monitor/linux/montrace.h
@@ -57,8 +57,7 @@
// Input/output redirection from child processes
#define TRACE_REDIRECTION 0x10000
// Cluster Configration
-#define TRACE_CLUST_CONF 0x20000
-#define TRACE_CLUST_CONF_DETAIL 0x20000
+#define TRACE_TRAFCONFIG 0x20000
// Health check
#define TRACE_HEALTH 0x40000
// Signal handler
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/04040d30/core/sqf/monitor/linux/persistconfig.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/persistconfig.cxx b/core/sqf/monitor/linux/persistconfig.cxx
index e69d151..485c6a4 100644
--- a/core/sqf/monitor/linux/persistconfig.cxx
+++ b/core/sqf/monitor/linux/persistconfig.cxx
@@ -189,32 +189,21 @@ const char *FormatZidString( FormatZid_t type )
// Persistent Process Configuration
///////////////////////////////////////////////////////////////////////////////
-CPersistConfig::CPersistConfig( const char *persistPrefix
- , const char *processNamePrefix
- , const char *processNameFormat
- , const char *stdoutPrefix
- , const char *stdoutFormat
- , const char *programName
- , const char *zidFormat
- , PROCESSTYPE processType
- , bool requiresDTM
- , int persistRetries
- , int persistWindow
- )
- : persistPrefix_(persistPrefix)
- , processNamePrefix_(processNamePrefix)
- , processNameFormat_(processNameFormat)
- , stdoutPrefix_(stdoutPrefix)
- , stdoutFormat_(stdoutFormat)
- , programName_(programName)
- , zoneFormat_(zidFormat)
- , processType_(processType)
+CPersistConfig::CPersistConfig( persistConfigInfo_t &persistConfigInfo )
+ : persistPrefix_(persistConfigInfo.persistPrefix)
+ , processNamePrefix_(persistConfigInfo.processNamePrefix)
+ , processNameFormat_(persistConfigInfo.processNameFormat)
+ , stdoutPrefix_(persistConfigInfo.stdoutPrefix)
+ , stdoutFormat_(persistConfigInfo.stdoutFormat)
+ , programName_(persistConfigInfo.programName)
+ , zoneFormat_(persistConfigInfo.zoneFormat)
+ , processType_(persistConfigInfo.processType)
, processNameNidFormat_(Nid_Undefined)
, stdoutNidFormat_(Nid_Undefined)
, zoneZidFormat_(Zid_Undefined)
- , requiresDTM_(requiresDTM)
- , persistRetries_(persistRetries)
- , persistWindow_(persistWindow)
+ , requiresDTM_(persistConfigInfo.requiresDTM)
+ , persistRetries_(persistConfigInfo.persistRetries)
+ , persistWindow_(persistConfigInfo.persistWindow)
, next_(NULL)
, prev_(NULL)
{
@@ -373,34 +362,12 @@ void CPersistConfigContainer::Clear( void )
TRACE_EXIT;
}
-CPersistConfig *CPersistConfigContainer::AddPersistConfig( const char *persistPrefix
- , const char *processNamePrefix
- , const char *processNameFormat
- , const char *stdoutPrefix
- , const char *stdoutFormat
- , const char *programName
- , const char *zidFormat
- , PROCESSTYPE processType
- , bool requiresDTM
- , int persistRetries
- , int persistWindow
- )
+CPersistConfig *CPersistConfigContainer::AddPersistConfig( persistConfigInfo_t &persistConfigInfo )
{
const char method_name[] = "CPersistConfigContainer::AddPersistConfig";
TRACE_ENTRY;
- CPersistConfig *persistConfig = new CPersistConfig( persistPrefix
- , processNamePrefix
- , processNameFormat
- , stdoutPrefix
- , stdoutFormat
- , programName
- , zidFormat
- , processType
- , requiresDTM
- , persistRetries
- , persistWindow
- );
+ CPersistConfig *persistConfig = new CPersistConfig( persistConfigInfo );
if (persistConfig)
{
persistsCount_++;
@@ -496,7 +463,8 @@ CPersistConfig *CPersistConfigContainer::GetPersistConfig( PROCESSTYPE processTy
return config;
}
-void CPersistConfigContainer::InitializePersistKeys( char *persistkeys )
+void CPersistConfigContainer::InitializePersistKeys( char *persistkeys
+ , pkeysVector_t &pkeysVector )
{
const char method_name[] = "CPersistConfigContainer::InitializePersistKeys";
TRACE_ENTRY;
@@ -512,6 +480,7 @@ void CPersistConfigContainer::InitializePersistKeys( char *persistkeys )
trace_printf("%s@%d Setting pkeysVector=%s\n",
method_name, __LINE__, token);
}
+ pkeysVector.push_back( token );
pkeysVector_.push_back( token );
token = strtok( NULL, " ," );
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/04040d30/core/sqf/monitor/linux/persistconfig.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/persistconfig.h b/core/sqf/monitor/linux/persistconfig.h
index cd1386b..0614b7e 100644
--- a/core/sqf/monitor/linux/persistconfig.h
+++ b/core/sqf/monitor/linux/persistconfig.h
@@ -26,6 +26,8 @@
#include <string>
#include <vector>
#include "msgdef.h"
+#include "trafconfig.h"
+
using namespace std;
#define TOKEN_NID "%nid"
@@ -49,6 +51,23 @@ typedef enum
//, Zid_SET // %zid[n,...] future?
} FormatZid_t;
+typedef vector<string> pkeysVector_t;
+
+typedef struct persistConfigInfo_s
+{
+ char persistPrefix[TC_PERSIST_KEY_MAX];
+ char processNamePrefix[TC_PERSIST_VALUE_MAX];
+ char processNameFormat[TC_PERSIST_VALUE_MAX];
+ char stdoutPrefix[TC_PERSIST_VALUE_MAX];
+ char stdoutFormat[TC_PERSIST_VALUE_MAX];
+ char programName[TC_PERSIST_VALUE_MAX];
+ char zoneFormat[TC_PERSIST_VALUE_MAX];
+ PROCESSTYPE processType;
+ bool requiresDTM;
+ int persistRetries;
+ int persistWindow;
+} persistConfigInfo_t;
+
class CPersistConfig;
class CPersistConfigContainer
@@ -57,18 +76,7 @@ public:
CPersistConfigContainer( void );
~CPersistConfigContainer( void );
- CPersistConfig *AddPersistConfig( const char *persistPrefix
- , const char *processNamePrefix
- , const char *processNameFormat
- , const char *stdoutPrefix
- , const char *stdoutFormat
- , const char *programName
- , const char *zidFormat
- , PROCESSTYPE processType
- , bool requiresDTM
- , int persistRetries
- , int persistWindow
- );
+ CPersistConfig *AddPersistConfig( persistConfigInfo_t &persistConfigInfo );
void Clear( void );
void DeletePersistConfig( CPersistConfig *persistConfig );
inline CPersistConfig *GetFirstPersistConfig( void ) { return ( head_ ); }
@@ -79,11 +87,12 @@ public:
inline int GetPersistConfigCount( void ) { return ( persistsCount_ ); }
protected:
- void InitializePersistKeys( char *persistkeys );
+ void InitializePersistKeys( char *persistkeys
+ , pkeysVector_t &pkeysVector );
int GetPersistKeysCount( void ) { return ( pkeysVector_.size() ); }
int persistsCount_; // # of persistent configuration object
- vector<string> pkeysVector_; // vector of persist keys
+ pkeysVector_t pkeysVector_; // vector of persist keys
private:
CPersistConfig *head_; // head of persist configuration linked list
@@ -92,32 +101,10 @@ private:
class CPersistConfig
{
- friend CPersistConfig *CPersistConfigContainer::AddPersistConfig( const char *persistPrefix
- , const char *processNamePrefix
- , const char *processNameFormat
- , const char *stdoutPrefix
- , const char *stdoutFormat
- , const char *programName
- , const char *zidFormat
- , PROCESSTYPE processType
- , bool requiresDTM
- , int persistRetries
- , int persistWindow
- );
+ friend CPersistConfig *CPersistConfigContainer::AddPersistConfig( persistConfigInfo_t &persistConfigInfo );
friend void CPersistConfigContainer::DeletePersistConfig( CPersistConfig *persistConfig );
public:
- CPersistConfig( const char *persistPrefix
- , const char *processNamePrefix
- , const char *processNameFormat
- , const char *stdoutPrefix
- , const char *stdoutFormat
- , const char *programName
- , const char *zidFormat
- , PROCESSTYPE processType
- , bool requiresDTM
- , int persistRetries
- , int persistWindow
- );
+ CPersistConfig( persistConfigInfo_t &persistConfigInfo );
~CPersistConfig( void );
inline CPersistConfig *GetNext( void ){ return( next_); }
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/04040d30/core/sqf/monitor/linux/pnodeconfig.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pnodeconfig.cxx b/core/sqf/monitor/linux/pnodeconfig.cxx
index dcd67aa..82b42d6 100644
--- a/core/sqf/monitor/linux/pnodeconfig.cxx
+++ b/core/sqf/monitor/linux/pnodeconfig.cxx
@@ -46,15 +46,12 @@ using namespace std;
///////////////////////////////////////////////////////////////////////////////
CPNodeConfig::CPNodeConfig( CPNodeConfigContainer *pnodesConfig
- , int pnid
- , int excludedLastCore
- , int excludedFirstCore
- , const char *hostname
+ , pnodeConfigInfo_t &pnodeConfigInfo
)
: pnodesConfig_(pnodesConfig)
- , pnid_(pnid)
- , excludedFirstCore_(excludedFirstCore)
- , excludedLastCore_(excludedLastCore)
+ , pnid_(pnodeConfigInfo.pnid)
+ , excludedFirstCore_(pnodeConfigInfo.excludedFirstCore)
+ , excludedLastCore_(pnodeConfigInfo.excludedLastCore)
, spareNode_(false)
, sparePNids_(NULL)
, sparePNidsCount_(0)
@@ -64,11 +61,7 @@ CPNodeConfig::CPNodeConfig( CPNodeConfigContainer *pnodesConfig
const char method_name[] = "CPNodeConfig::CPNodeConfig";
TRACE_ENTRY;
- int len = strlen( hostname );
- assert( len <= MPI_MAX_PROCESSOR_NAME );
-
- strcpy( name_, hostname );
-
+ strcpy( name_, pnodeConfigInfo.nodename );
CPU_ZERO( &excludedCoreMask_ );
TRACE_EXIT;
@@ -263,35 +256,27 @@ void CPNodeConfigContainer::Clear( void )
TRACE_EXIT;
}
-CPNodeConfig *CPNodeConfigContainer::AddPNodeConfig( int pnid
- , char *name
- , int excludedFirstCore
- , int excludedLastCore
- , bool spare
- )
+CPNodeConfig *CPNodeConfigContainer::AddPNodeConfig( pnodeConfigInfo_t &pnodeConfigInfo )
{
const char method_name[] = "CPNodeConfigContainer::AddPNodeConfig";
TRACE_ENTRY;
// pnid list is NOT sequential from zero
- if ( ! (pnid >= 0 && pnid < pnodesConfigMax_) )
+ if ( ! (pnodeConfigInfo.pnid >= 0 && pnodeConfigInfo.pnid < pnodesConfigMax_) )
{
char la_buf[MON_STRING_BUF_SIZE];
- sprintf(la_buf, "[%s], Error: Invalid pnid=%d - should be >= 0 and < %d)\n", method_name, pnid, pnodesConfigMax_);
+ sprintf( la_buf, "[%s], Error: Invalid pnid=%d - should be >= 0 and < %d)\n"
+ , method_name, pnodeConfigInfo.pnid, pnodesConfigMax_);
mon_log_write(MON_PNODECONF_ADD_PNODE_1, SQ_LOG_CRIT, la_buf);
return( NULL );
}
- assert( pnodesConfig_[pnid] == NULL );
+ assert( pnodesConfig_[pnodeConfigInfo.pnid] == NULL );
- CPNodeConfig *pnodeConfig = new CPNodeConfig( this
- , pnid
- , excludedFirstCore
- , excludedLastCore
- , name );
+ CPNodeConfig *pnodeConfig = new CPNodeConfig( this, pnodeConfigInfo );
if (pnodeConfig)
{
- if ( spare )
+ if ( pnodeConfigInfo.spareCount )
{
snodesCount_++;
spareNodesConfigList_.push_back( pnodeConfig );
@@ -300,7 +285,7 @@ CPNodeConfig *CPNodeConfigContainer::AddPNodeConfig( int pnid
// Bump the physical node count
pnodesCount_++;
// Add it to the array
- pnodesConfig_[pnid] = pnodeConfig;
+ pnodesConfig_[pnodeConfigInfo.pnid] = pnodeConfig;
// Add it to the container list
if ( head_ == NULL )
{
@@ -314,7 +299,7 @@ CPNodeConfig *CPNodeConfigContainer::AddPNodeConfig( int pnid
}
// Set the next available pnid
- nextPNid_ = (pnid == nextPNid_) ? (pnid+1) : nextPNid_ ;
+ nextPNid_ = (pnodeConfigInfo.pnid == nextPNid_) ? (pnodeConfigInfo.pnid+1) : nextPNid_ ;
if ( nextPNid_ == pnodesConfigMax_ )
{ // We are at the limit, search for unused pnid from begining
nextPNid_ = -1;
@@ -347,7 +332,7 @@ CPNodeConfig *CPNodeConfigContainer::AddPNodeConfig( int pnid
" (pnid=%d, nextPNid_=%d)\n"
" (pnodesCount_=%d,pnodesConfigMax=%d)\n"
, method_name, __LINE__
- , pnid, nextPNid_
+ , pnodeConfigInfo.pnid, nextPNid_
, pnodesCount_, pnodesConfigMax_);
}
}
@@ -355,7 +340,8 @@ CPNodeConfig *CPNodeConfigContainer::AddPNodeConfig( int pnid
{
int err = errno;
char la_buf[MON_STRING_BUF_SIZE];
- sprintf(la_buf, "[%s], Error: Can't allocate physical node configuration object - errno=%d (%s)\n", method_name, err, strerror(errno));
+ sprintf( la_buf, "[%s], Error: Can't allocate physical node configuration object - errno=%d (%s)\n"
+ , method_name, err, strerror(errno));
mon_log_write(MON_PNODECONF_ADD_PNODE_2, SQ_LOG_ERR, la_buf);
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/04040d30/core/sqf/monitor/linux/pnodeconfig.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pnodeconfig.h b/core/sqf/monitor/linux/pnodeconfig.h
index f0992cd..2bf7cc2 100644
--- a/core/sqf/monitor/linux/pnodeconfig.h
+++ b/core/sqf/monitor/linux/pnodeconfig.h
@@ -30,19 +30,29 @@
#include "lnodeconfig.h"
+class CLNodeConfig;
+class CPNodeConfig;
+
typedef list<CPNodeConfig *> PNodesConfigList_t;
+typedef struct pnodeConfigInfo_s
+{
+ int pnid;
+ char nodename[MPI_MAX_PROCESSOR_NAME];
+ int excludedFirstCore;
+ int excludedLastCore;
+ cpu_set_t excludedCoreMask;
+ int spareCount;
+ int sparePNid[MAX_NODES];
+} pnodeConfigInfo_t;
+
class CPNodeConfigContainer
{
public:
CPNodeConfigContainer( int pnodesConfigMax );
~CPNodeConfigContainer( void );
- CPNodeConfig *AddPNodeConfig( int pnid
- , char *name
- , int excludedFirstCore
- , int excludedLastCore
- , bool spare );
+ CPNodeConfig *AddPNodeConfig( pnodeConfigInfo_t &pnodeConfigInfo );
void Clear( void );
void DeletePNodeConfig( CPNodeConfig *pnodeConfig );
inline CPNodeConfig *GetFirstPNodeConfig( void ) { return ( head_ ); }
@@ -72,19 +82,12 @@ private:
class CPNodeConfig : public CLNodeConfigContainer
{
- friend CPNodeConfig *CPNodeConfigContainer::AddPNodeConfig( int pnid
- , char *name
- , int excludedFirstCore
- , int excludedLastCore
- , bool spare );
- friend void CPNodeConfigContainer::DeletePNodeConfig( CPNodeConfig *entry );
+ friend CPNodeConfig *CPNodeConfigContainer::AddPNodeConfig( pnodeConfigInfo_t &pnodeConfigInfo );
+ friend void CPNodeConfigContainer::DeletePNodeConfig( CPNodeConfig *pnodeConfig );
public:
CPNodeConfig( CPNodeConfigContainer *pnodesConfig
- , int pnid
- , int excludedFirstCore
- , int excludedLastCore
- , const char *hostname
+ , pnodeConfigInfo_t &pnodeConfigInfo
);
~CPNodeConfig( void );
@@ -102,8 +105,8 @@ public:
inline bool IsSpareNode( void ) { return ( spareNode_ ); }
inline void SetExcludedCoreMask( cpu_set_t &coreMask ) { excludedCoreMask_ = coreMask; }
- void SetSpareList( int sparePNid[], int spareCount );
- void ResetSpare( void );
+ void SetSpareList( int sparePNid[], int spareCount );
+ void ResetSpare( void );
protected:
private:
[22/50] [abbrv] incubator-trafodion git commit: Merge remote branch
'origin/master' into TRAFODION-2001
Posted by su...@apache.org.
Merge remote branch 'origin/master' into TRAFODION-2001
Conflicts:
install/installer/addNode_step2
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/6fb4a506
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/6fb4a506
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/6fb4a506
Branch: refs/heads/master
Commit: 6fb4a5062f3ca5f552ae17f219287db75f49574c
Parents: 8fad692 fe07eda
Author: Zalo Correa <za...@esgyn.com>
Authored: Wed Oct 26 13:26:49 2016 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Wed Oct 26 13:26:49 2016 -0700
----------------------------------------------------------------------
.gitignore | 1 +
core/Makefile | 54 +-
core/conn/odbc/src/odbc/nsksrvr/SrvrConnect.cpp | 26 +
.../odbc/src/odbc/nsksrvrcore/srvrothers.cpp | 40 +-
core/sqf/conf/log4cxx.trafodion.tm.config | 2 +-
core/sqf/monitor/linux/cluster.cxx | 104 +-
core/sqf/monitor/linux/internal.h | 3 +-
core/sqf/monitor/linux/monitor.cxx | 1 +
core/sqf/monitor/linux/pnode.cxx | 2 -
core/sqf/monitor/linux/pnode.h | 7 +-
core/sqf/monitor/linux/zclient.cxx | 41 +
core/sqf/sqenvcom.sh | 12 +-
core/sqf/sql/scripts/install_local_hadoop | 24 +-
core/sqf/sql/scripts/sqgen | 15 +-
.../sqf/sql/scripts/traf_coprocessor.properties | 26 -
core/sqf/sql/scripts/trafodion-site.xml | 38 +
core/sqf/src/seatrans/hbase-trx/Makefile | 6 +-
.../sqf/src/seatrans/hbase-trx/pom.xml.apache10 | 2 +-
.../sqf/src/seatrans/hbase-trx/pom.xml.apache11 | 2 +-
.../sqf/src/seatrans/hbase-trx/pom.xml.apache12 | 2 +-
.../transactional/TransactionManager.java | 607 +++++----
.../client/transactional/TransactionState.java | 79 +-
.../transactional/TrxRegionEndpoint.java.tmpl | 2 +-
.../java/org/trafodion/dtm/HBaseTxClient.java | 6 +-
.../java/org/trafodion/dtm/TmAuditTlog.java | 11 +-
.../main/java/org/trafodion/dtm/TrafInfo.java | 4 +-
.../org/trafodion/sql/TrafConfiguration.java | 1 +
core/sqf/src/tm/tmmsg.h | 21 +-
core/sqf/src/tm/tmtx.cpp | 4 +-
core/sql/bin/SqlciErrors.txt | 2 +-
core/sql/cli/CliExtern.cpp | 7 +
core/sql/common/ComDistribution.cpp | 3 +-
core/sql/common/ComSecurityKey.cpp | 4 +-
core/sql/common/ComSecurityKey.h | 2 +-
core/sql/common/ComSmallDefs.h | 2 +
core/sql/exp/exp_clause_derived.h | 6 +
core/sql/exp/exp_fixup.cpp | 110 +-
core/sql/optimizer/NATable.cpp | 230 ++--
core/sql/optimizer/NATable.h | 175 +--
core/sql/optimizer/opt.cpp | 21 +-
core/sql/optimizer/opt.h | 16 +-
core/sql/parser/sqlparser.y | 11 -
core/sql/qmscommon/QRLogger.cpp | 3 +
core/sql/regress/compGeneral/EXPECTED011.SB | 8 +-
core/sql/regress/compGeneral/EXPECTED015.SB | 292 +++--
core/sql/regress/compGeneral/EXPECTED042 | 83 +-
core/sql/regress/core/EXPECTED005.SB | 4 +-
core/sql/regress/executor/DIFF107.KNOWN.SB | 16 -
core/sql/regress/executor/DIFF107.KNOWN.SB.OS | 14 -
core/sql/regress/executor/EXPECTED107 | 565 ++++++++
core/sql/regress/executor/EXPECTED107.LINUX | 574 --------
core/sql/regress/executor/TEST107 | 51 +-
core/sql/regress/hive/EXPECTED018 | 218 ++--
core/sql/regress/privs1/EXPECTED120 | 1222 ++++++++++++++++++
core/sql/regress/privs1/EXPECTED137 | 216 +++-
core/sql/regress/privs1/TEST120 | 379 ++++++
core/sql/regress/privs1/TEST137 | 53 +-
core/sql/regress/privs2/EXPECTED144 | Bin 0 -> 59186 bytes
core/sql/regress/privs2/LOG144 | Bin 0 -> 17980 bytes
core/sql/regress/privs2/TEST144 | 241 ++++
core/sql/regress/privs2/udfs.cpp | 174 +++
core/sql/regress/seabase/EXPECTED011 | 20 +-
core/sql/regress/seabase/EXPECTED013 | 144 +--
core/sql/regress/udr/TEST103 | 2 +-
core/sql/runtimestats/SqlStats.cpp | 5 +-
core/sql/runtimestats/sscpipc.cpp | 7 +-
core/sql/runtimestats/ssmpipc.cpp | 3 +
core/sql/sort/SortTopN.cpp | 8 +
core/sql/sqlcomp/CmpMain.cpp | 9 +
core/sql/sqlcomp/CmpMain.h | 2 +
core/sql/sqlcomp/CmpSeabaseDDL.h | 2 +
core/sql/sqlcomp/CmpSeabaseDDLtable.cpp | 9 +
core/sql/sqlcomp/DefaultConstants.h | 7 -
core/sql/sqlcomp/PrivMgrComponentPrivileges.cpp | 76 +-
core/sql/sqlcomp/QCache.cpp | 24 +-
core/sql/sqlcomp/nadefaults.cpp | 18 -
core/sql/sqludr/SqlUdrPredefLogReader.cpp | 482 ++++++-
.../org/trafodion/sql/CoprocessorUtils.java | 104 --
.../java/org/trafodion/sql/HBaseClient.java | 29 +-
.../org/trafodion/sql/TrafConfiguration.java | 70 +
.../java/org/trafodion/sql/TrafRegionStats.java | 4 +-
core/sql/ustat/hs_const.h | 1 +
core/sql/ustat/hs_globals.cpp | 6 +
core/sql/ustat/hs_read.cpp | 44 -
core/sql/ustat/hs_read.h | 32 -
core/sql/ustat/hs_update.cpp | 19 +-
core/trafodion.spec | 114 ++
.../org/trafodion/jdbc_test/TestForeignKey.java | 224 ++++
.../asciidoc/_chapters/update_stats_msgs.adoc | 15 +
install/installer/addNode_step1 | 89 +-
install/installer/addNode_step2 | 102 +-
install/installer/deleteNode | 244 ----
.../Install/win64_installer/installer.iss | 53 +-
win-odbc64/odbcclient/Drvr35Res/Drvr35Res.rc | 8 +-
.../odbcclient/TranslationDll/TranslationDll.rc | 8 +-
win-odbc64/odbcclient/build_os.bat | 10 +-
win-odbc64/odbcclient/drvr35/TCPIPV4/TCPIPV4.RC | 8 +-
win-odbc64/odbcclient/drvr35/TCPIPV6/TCPIPV6.RC | 8 +-
win-odbc64/odbcclient/drvr35/cconnect.cpp | 17 +-
win-odbc64/odbcclient/drvr35/cdatasource.cpp | 2 +-
win-odbc64/odbcclient/drvr35/drvr35.rc | 8 +-
win-odbc64/odbcclient/drvr35adm/drvr35adm.h | 2 +-
win-odbc64/odbcclient/drvr35adm/drvr35adm.rc | 8 +-
103 files changed, 5522 insertions(+), 2370 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/6fb4a506/core/sqf/monitor/linux/cluster.cxx
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/cluster.cxx
index 84768c9,a986b67..3ede266
--- a/core/sqf/monitor/linux/cluster.cxx
+++ b/core/sqf/monitor/linux/cluster.cxx
@@@ -434,13 -446,18 +446,23 @@@ void CCluster::AssignTmLeader(int pnid
continue; // this is the node that is going down, skip it
}
+ if (Node[TmLeaderPNid] == NULL)
+ {
+ continue;
+ }
+
node = Node[TmLeaderPNid];
+ if (trace_settings & (TRACE_INIT | TRACE_RECOVERY | TRACE_REQUEST | TRACE_SYNC | TRACE_TMSYNC))
+ {
+ trace_printf( "%s@%d - Node pnid=%d (%s), phase=%s, isSoftNodeDown=%d\n"
+ , method_name, __LINE__
+ , node->GetPNid()
+ , node->GetName()
+ , NodePhaseString(node->GetPhase())
+ , node->IsSoftNodeDown());
+ }
+
if ( node->IsSpareNode() ||
node->IsSoftNodeDown() ||
node->GetState() != State_Up ||
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/6fb4a506/core/sqf/monitor/linux/internal.h
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/6fb4a506/core/sqf/monitor/linux/monitor.cxx
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/6fb4a506/core/sqf/monitor/linux/pnode.cxx
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/pnode.cxx
index 5fdafc7,d5c8555..4cacc7a
mode 100644,100755..100644
--- a/core/sqf/monitor/linux/pnode.cxx
+++ b/core/sqf/monitor/linux/pnode.cxx
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/6fb4a506/core/sqf/monitor/linux/pnode.h
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/pnode.h
index 8c3a5de,607678b..d484b6a
mode 100644,100755..100644
--- a/core/sqf/monitor/linux/pnode.h
+++ b/core/sqf/monitor/linux/pnode.h
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/6fb4a506/core/sqf/monitor/linux/zclient.cxx
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/6fb4a506/core/sqf/sql/scripts/sqgen
----------------------------------------------------------------------
diff --cc core/sqf/sql/scripts/sqgen
index 1aa0e46,a761f08..2169e60
--- a/core/sqf/sql/scripts/sqgen
+++ b/core/sqf/sql/scripts/sqgen
@@@ -211,10 -187,24 +211,23 @@@ f
./gensqstatem2lenv > $SQETC_DIR/sqstatem2l.env
- cp ./traf_coprocessor.properties $SQETC_DIR/
+ if [ -f $SQETC_DIR/trafodion-site.xml ]; then
+ echo "Trafodion customization file $SQETC_DIR/trafodion-site.xml exists."
+ echo "The file will not be copied."
+ echo
+ else
+ echo "Copying Trafodion customization file: $SQETC_DIR/trafodion-site.xml"
+ echo
+ cp ./trafodion-site.xml $SQETC_DIR
+ lv_retcode=$?
+ if [[ $lv_retcode != 0 ]]; then
+ echo "Error $lv_retcode while copying Exiting..."
+ exit $lv_retcode
+ fi
+ fi
# Create configuration database tables
-rm -f sqconfig.db
-sqlite3 -init createConfigDb sqconfig.db <<eof
+sqlite3 -init createConfigDb $SQCONFIG_DB_FILE <<eof
.quit
eof
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/6fb4a506/core/sql/qmscommon/QRLogger.cpp
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/6fb4a506/install/installer/addNode_step2
----------------------------------------------------------------------
[25/50] [abbrv] incubator-trafodion git commit: Merge remote branch
'origin/master' into TRAFODION-2001
Posted by su...@apache.org.
Merge remote branch 'origin/master' into TRAFODION-2001
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/1323127e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/1323127e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/1323127e
Branch: refs/heads/master
Commit: 1323127e0ce01c3fb5d9f8d146f10d950665090e
Parents: a4a2034 2d93f39
Author: Zalo Correa <za...@esgyn.com>
Authored: Mon Oct 31 11:56:52 2016 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Mon Oct 31 11:56:52 2016 -0700
----------------------------------------------------------------------
core/sqf/sql/scripts/install_local_hadoop | 2 +-
core/sql/cli/CliExpExchange.cpp | 4 +-
core/sql/executor/ExHbaseAccess.cpp | 70 +++++++-
core/sql/executor/ExHbaseAccess.h | 3 +
core/sql/exp/ExpPCodeExpGen.cpp | 6 +-
core/sql/exp/exp_attrs.cpp | 4 +-
core/sql/exp/exp_attrs.h | 16 +-
core/sql/exp/exp_conv.cpp | 2 +-
core/sql/exp/exp_eval.cpp | 3 +-
core/sql/exp/exp_expr.h | 3 +-
core/sql/exp/exp_tuple_desc.cpp | 21 ++-
core/sql/generator/GenExpGenerator.cpp | 39 ++---
core/sql/generator/GenExpGenerator.h | 17 +-
core/sql/generator/GenPreCode.cpp | 3 +-
core/sql/generator/GenRelScan.cpp | 10 +-
core/sql/generator/GenRelUpdate.cpp | 4 +-
core/sql/generator/Generator.h | 1 +
core/sql/optimizer/BindRelExpr.cpp | 5 +
core/sql/optimizer/NATable.cpp | 3 +-
core/sql/regress/hive/EXPECTED018 | 6 +-
core/sql/regress/privs2/EXPECTED144 | Bin 59186 -> 59408 bytes
core/sql/regress/privs2/TEST144 | 7 +-
core/sql/regress/seabase/EXPECTED027 | 86 +++++-----
core/sql/regress/seabase/EXPECTED033 | 40 +++++
core/sql/regress/seabase/TEST027 | 4 +-
core/sql/regress/seabase/TEST033 | 7 +
core/sql/sqlcomp/CmpSeabaseDDL.h | 10 +-
core/sql/sqlcomp/CmpSeabaseDDLtable.cpp | 212 ++++++++++++++++++-------
28 files changed, 423 insertions(+), 165 deletions(-)
----------------------------------------------------------------------
[18/50] [abbrv] incubator-trafodion git commit: Merge remote branch
'origin/master' into TRAFODION-2001
Posted by su...@apache.org.
Merge remote branch 'origin/master' into TRAFODION-2001
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/52d45b78
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/52d45b78
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/52d45b78
Branch: refs/heads/master
Commit: 52d45b78ea8eeb2d264c922b2fb8d408db427e2f
Parents: 7c9abd4 708f58f
Author: Zalo Correa <za...@esgyn.com>
Authored: Tue Sep 27 09:16:07 2016 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Tue Sep 27 09:16:07 2016 -0700
----------------------------------------------------------------------
.../transactional/TrxRegionEndpoint.java.tmpl | 112 +++++++++++--------
.../transactional/TrxRegionObserver.java.tmpl | 54 ++++++---
.../transactional/TransactionState.java | 14 ++-
.../transactional/TrxTransactionState.java.tmpl | 4 +-
core/sql/common/ExprNode.cpp | 5 +
core/sql/optimizer/RelExpr.cpp | 37 ++++++
core/sql/optimizer/RelSet.h | 4 +
7 files changed, 165 insertions(+), 65 deletions(-)
----------------------------------------------------------------------
[11/50] [abbrv] incubator-trafodion git commit: Mantis 657
Posted by su...@apache.org.
Mantis 657
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/babeb4ed
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/babeb4ed
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/babeb4ed
Branch: refs/heads/master
Commit: babeb4ed002612066ec5f12cc3eeae3d077957a8
Parents: 83acf13
Author: Amanda Moran <am...@apache.com>
Authored: Tue Aug 23 00:14:03 2016 +0000
Committer: Amanda Moran <am...@apache.com>
Committed: Tue Aug 23 00:14:03 2016 +0000
----------------------------------------------------------------------
install/installer/addNode_step2 | 15 +++-
install/installer/trafodion_config_default | 93 +++++++++++--------------
2 files changed, 56 insertions(+), 52 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/babeb4ed/install/installer/addNode_step2
----------------------------------------------------------------------
diff --git a/install/installer/addNode_step2 b/install/installer/addNode_step2
index 2eeba96..40318b0 100755
--- a/install/installer/addNode_step2
+++ b/install/installer/addNode_step2
@@ -307,7 +307,7 @@ sudo chown -R $(whoami).$(whoami) $HOME/tmpTraf
$TRAF_PDCP -r $HOME/tmpTraf $HOME
$TRAF_PDSH sudo mkdir -p $HOME_DIR/$TRAF_USER/sqcert
$TRAF_PDSH sudo chown -R $TRAF_USER.trafodion $HOME_DIR/$TRAF_USER/sqcert 2>&1 > /dev/null
-$TRAF_PDSH sudo cp -rf $HOME/tmpTraf/sqcert $HOME_DIR/$TRAF_USER/sqcert 2>&1 > /dev/null
+$TRAF_PDSH sudo cp -rf $HOME/tmpTraf/sqcert/* $HOME_DIR/$TRAF_USER/sqcert 2>&1 > /dev/null
$TRAF_PDSH sudo chown -R $TRAF_USER.trafodion $HOME_DIR/$TRAF_USER/sqcert 2>&1 > /dev/null
$TRAF_PDSH rm -r $HOME/tmpTraf
@@ -368,6 +368,18 @@ function dcsStart {
sudo su $TRAF_USER --login --command "cd $SQ_ROOT/sql/scripts; dcsstart"
}
+function cleanUp {
+
+$TRAF_PDSH rm -rf $HOME/hbase-site*
+$TRAF_PDSH rm -rf $HOME/hbaseVersion*
+$TRAF_PDSH rm -rf $HOME/sysctl.conf
+$TRAF_PDSH rm -rf $HOME/tempBashrc
+$TRAF_PDSH rm -rf $HOME/tempServers
+$TRAF_PDSH rm -rf $HOME/trafodion_config
+$TRAF_PDSH rm -rf $HOME/trafodion.conf
+
+}
+
#Main
@@ -394,5 +406,6 @@ addUpNodes
sqRegen
copysqConfig
dcsStart
+cleanUp
printMessage
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/babeb4ed/install/installer/trafodion_config_default
----------------------------------------------------------------------
diff --git a/install/installer/trafodion_config_default b/install/installer/trafodion_config_default
index 6c67c0b..ad99d5f 100755
--- a/install/installer/trafodion_config_default
+++ b/install/installer/trafodion_config_default
@@ -32,77 +32,69 @@
#
#=====================================================
-
#=====================================================
+##################################################
+#THESE MUST BE FILLED OUT.
+#IF NOT INSTALL WILL FAIL
+##################################################
+
+# a blank separated list of nodes in your cluster
+# node names should include full domain names
+#This can not be left blank!
+export NODE_LIST=""
+
+#JAVA HOME must be a JDK. Must include FULL Path. Must be 1.7.0_65 or higher.
+export JAVA_HOME=""
+
+# full path of the Trafodion package tar file
+export TRAF_PACKAGE=""
+
+# Either "cloudera" or "hortonworks" (all lowercase)
+export HADOOP_TYPE=""
+
+# The URL for Cloudera/Hortonworks REST API (i.e. http://node1.hp.com:8080)
+# Include 'http' or 'https'
+export URL=""
+
+
+
+##################################################
+#Can MOSTLY LIKELY stay as defaults.
+#Please review though before starting install
+#################################################
+
#Must be set to 'true' if on a SUSE linux system. If on another type of system
#this must be set to false.
-
export SUSE_LINUX="false"
# The working directory where Trafodion installer untars files, etc.
# do not change this unless you really know what you are doing
export TRAF_WORKDIR="/usr/lib/trafodion"
-# This is the directory where the installer scripts were untarred to
-export LOCAL_WORKDIR="$HOME/<downloadsDirectory>/installer"
-
# The maximum number of dcs servers, i.e. client connections
export DCS_SERVERS_PARM="8"
-# "true" if this is an upgrade
-export UPGRADE_TRAF="false"
-
# Trafodion userid, This is the userid the Trafodion instance will run under
export TRAF_USER="trafodion"
# Trafodion userid's password
export TRAF_USER_PASSWORD="traf123"
-# a blank separated list of nodes in your cluster
-# node names should include full domain names
-#This can not be left blank!
-export NODE_LIST=""
-
-# count of nodes in node list
-export node_count=""
-
-# another list of the same nodes in NODE_LIST but specified in a pdsh usable format
-# i.e. "-w centos-cdh[1-6]" or "-w node1 -w node2 -w node3"
-export MY_NODES=""
-
# the directory prefix for the trafodion userid's $HOME directory
# i.e. /opt/home, not /opt/home/trafodion
-export HOME_DIR="/home"
-
-#JAVA HOME must be a JDK. Must include FULL Path. Must be 1.7.0_65 or higher.
-
-export JAVA_HOME=""
-
-# If your machine doesn't have external internet access then you must
-# specify the location of the EPEL rpm, otherwise leave blank and it
-# will be installed from the internet
-export EPEL_RPM=""
-
-# full path of the Trafodion package tar file
-export TRAF_PACKAGE=""
+export HOME_DIR="/opt"
#Default value set to "Y" if using a build BEFORE 05/11/2016 set this to "N"
export ONE_TAR_INSTALL="Y"
-# Either "cloudera" or "hortonworks" (all lowercase)
-export HADOOP_TYPE=""
-
-# The URL for Cloudera/Hortonworks REST API (i.e. http://node1.hp.com:8080)
-# Include http or https
-export URL=""
+#This user will be set for backup and restore.
+#Must be able to have select sudo access
+export BACKUP_USER="trafodion"
# Cloudera/Hortonworks UI admin's userid and password
export ADMIN="admin"
export PASSWORD="admin"
-# hadoop cluster name
-export CLUSTER_NAME=""
-
# the Hadoop HDFS userid
export HDFS_USER="hdfs"
@@ -118,17 +110,10 @@ export HBASE="hbase"
# First time install : /home/trafodion/traf
# On Upgrade: /home/trafodion/traf_<date>
# By doing this the previous version will remain and allow for an easier rollback.
-export SQ_ROOT=""
+export SQ_ROOT="/opt/trafodion/trafodion"
# Start Trafodion after install completes
-export START="N"
-
-# initialize trafodion after starting
-export INIT_TRAFODION="N"
-
-# full path to the sqconfig file
-# Default is to leave as is and this file will be created.
-export SQCONFIG=""
+export START="Y"
#----------------- security configuration information -----------------
#Enter in Kerberos details if Kerberos is enabled on your cluster
@@ -198,3 +183,9 @@ export CLOUD_OTHER=""
#dcs start script is run
export DCS_PRIMARY_MASTER_NODE=`hostname -f`
+
+#Ability to add nodes while trafodion is running
+export ELASTICITY_ENABLED="Y"
+
+#Default is number of nodes
+export NUM_ELASTIC_NODES=""
[10/50] [abbrv] incubator-trafodion git commit: Merge remote branch
'origin/master' into TRAFODION-2001
Posted by su...@apache.org.
Merge remote branch 'origin/master' into TRAFODION-2001
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/83acf135
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/83acf135
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/83acf135
Branch: refs/heads/master
Commit: 83acf1353b06b3ec5e312168db3c4e2c70d8e452
Parents: 7432ad5 8361098
Author: Zalo Correa <za...@esgyn.com>
Authored: Mon Aug 15 14:23:32 2016 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Mon Aug 15 14:23:32 2016 -0700
----------------------------------------------------------------------
.../org/trafodion/jdbc/t4/TrafT4Connection.java | 48 +-
core/conn/odb/src/odb.c | 4 +-
core/sql/bin/SqlciErrors.txt | 2 +-
core/sql/cli/CliExpExchange.cpp | 14 +-
core/sql/comexe/ComTdb.h | 1 +
core/sql/comexe/ComTdbStoredProc.cpp | 2 +-
core/sql/comexe/ComTdbStoredProc.h | 8 +-
core/sql/common/ComSmallDefs.h | 3 +-
core/sql/common/ComViewColUsage.h | 112 +
core/sql/common/DateTimeType.cpp | 8 +-
core/sql/common/IntervalType.cpp | 18 +-
core/sql/common/NumericType.cpp | 86 +-
core/sql/common/OperTypeEnum.h | 8 +-
core/sql/common/dfs2rec.h | 3 +
core/sql/executor/ExFastTransport.cpp | 7 +-
core/sql/exp/ExpPCode.cpp | 15 +
core/sql/exp/ExpPCodeClauseGen.cpp | 81 +-
core/sql/exp/ExpPCodeInstruction.h | 10 +
core/sql/exp/ExpPCodeOptimizations.cpp | 44 +-
core/sql/exp/ExpPCodeOptsNativeExpr.cpp | 84 +-
core/sql/exp/exp_arith.cpp | 2 +-
core/sql/exp/exp_clause.cpp | 57 +-
core/sql/exp/exp_clause.h | 20 +-
core/sql/exp/exp_clause_derived.h | 759 +++---
core/sql/exp/exp_comp.cpp | 2 +-
core/sql/exp/exp_conv.cpp | 239 +-
core/sql/exp/exp_datetime.cpp | 20 +-
core/sql/exp/exp_eval.cpp | 117 +-
core/sql/exp/exp_expr.cpp | 2 +-
core/sql/exp/exp_fixup.cpp | 2287 ++++++++++--------
core/sql/exp/exp_function.cpp | 4 +-
core/sql/generator/GenExpGenerator.cpp | 70 +-
core/sql/generator/GenPreCode.cpp | 10 +-
core/sql/generator/GenStoredProc.cpp | 12 +-
core/sql/generator/Generator.cpp | 8 +
core/sql/optimizer/EncodedValue.cpp | 2 +
core/sql/optimizer/NATable.cpp | 28 +
core/sql/optimizer/NATable.h | 3 +
core/sql/regress/core/EXPECTED032 | 136 +-
core/sql/regress/core/EXPECTED056.SB | 146 +-
core/sql/regress/executor/EXPECTED012 | 18 +-
core/sql/regress/executor/EXPECTED022.SB | 44 +-
core/sql/regress/privs1/EXPECTED141 | Bin 123489 -> 100853 bytes
core/sql/regress/privs1/TEST141 | 52 -
core/sql/regress/privs2/EXPECTED143 | Bin 0 -> 59506 bytes
core/sql/regress/privs2/TEST143 | 457 ++++
core/sql/regress/qat/eqatdml01 | 506 ++--
core/sql/regress/qat/eqatdml08 | 1612 ++++++------
core/sql/regress/qat/eqatdml09 | 1414 +++++------
core/sql/regress/seabase/EXPECTED003 | 154 +-
core/sql/regress/seabase/EXPECTED030 | 24 +-
core/sql/regress/seabase/EXPECTED031 | 27 +-
core/sql/regress/seabase/TEST003 | 3 +
core/sql/regress/seabase/TEST030 | 8 +-
core/sql/regress/seabase/TEST031 | 3 +
core/sql/regress/udr/EXPECTED100.SB | 4 +-
core/sql/sqlcat/ReadTableDef.cpp | 1 -
core/sql/sqlcat/TrafDDLdesc.cpp | 2 +
core/sql/sqlcat/TrafDDLdesc.h | 1 +
core/sql/sqlcomp/CmpDDLCatErrorCodes.h | 2 +-
core/sql/sqlcomp/CmpSeabaseDDL.h | 5 +
core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp | 2 +-
core/sql/sqlcomp/CmpSeabaseDDLtable.cpp | 14 +-
core/sql/sqlcomp/CmpSeabaseDDLview.cpp | 294 ++-
core/sql/sqlcomp/PrivMgr.h | 22 +-
core/sql/sqlcomp/PrivMgrMD.cpp | 136 +-
core/sql/sqlcomp/PrivMgrMD.h | 49 +
core/sql/sqlcomp/PrivMgrPrivileges.cpp | 1063 +++++---
core/sql/sqlcomp/PrivMgrPrivileges.h | 29 +
.../src/asciidoc/_chapters/sql_statements.adoc | 13 +-
70 files changed, 6306 insertions(+), 4135 deletions(-)
----------------------------------------------------------------------
[24/50] [abbrv] incubator-trafodion git commit: Merge remote branch
'origin/master' into TRAFODION-2001
Posted by su...@apache.org.
Merge remote branch 'origin/master' into TRAFODION-2001
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/a4a20343
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/a4a20343
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/a4a20343
Branch: refs/heads/master
Commit: a4a20343976c6b787bbc283039dc7ad0ad922826
Parents: 8fcf71a 9585cf0
Author: Zalo Correa <za...@esgyn.com>
Authored: Thu Oct 27 10:13:29 2016 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Thu Oct 27 10:13:29 2016 -0700
----------------------------------------------------------------------
.rat-excludes | 1 +
core/conn/odb/build.bat | 7 +-
core/conn/odb/odb/odb.rc | Bin 0 -> 5124 bytes
core/conn/odb/odb/odb.vcxproj | 4 +
core/conn/odb/odb/odb.vcxproj.filters | 8 +
core/conn/odbc/src/odbc/Makefile | 2 -
core/rest/src/main/asciidoc/_chapters/apis.adoc | 182 ++++----------
.../main/asciidoc/_chapters/architecture.adoc | 6 +-
.../main/asciidoc/_chapters/configuration.adoc | 26 +-
.../asciidoc/_chapters/troubleshooting.adoc | 6 +-
core/rest/src/main/asciidoc/index.adoc | 4 +-
.../main/java/org/trafodion/rest/Constants.java | 2 +-
core/sqf/monitor/linux/cluster.cxx | 2 +-
core/sqf/sql/scripts/cleanlogs | 8 +
core/sqf/sql/scripts/dcscheck | 22 +-
core/sqf/sql/scripts/install_local_hadoop | 4 +
core/sqf/sql/scripts/install_traf_components | 3 +-
core/sqf/sql/scripts/sqcheck | 6 +-
core/sql/cli/Statement.cpp | 11 +-
core/sql/comexe/ComTdbHashGrby.h | 4 +
core/sql/comexe/ComTdbSortGrby.h | 2 +
core/sql/common/OperTypeEnum.h | 3 +
core/sql/executor/ex_hash_grby.cpp | 38 +--
core/sql/executor/ex_hash_grby.h | 8 +-
core/sql/executor/ex_sort_grby.cpp | 126 ++++++----
core/sql/executor/ex_sort_grby.h | 11 +-
core/sql/exp/ExpPackDefs.cpp | 4 +
core/sql/exp/exp_aggregate.cpp | 105 ++++++++
core/sql/exp/exp_clause.cpp | 17 ++
core/sql/exp/exp_clause.h | 3 +-
core/sql/exp/exp_clause_derived.h | 37 +++
core/sql/exp/exp_eval.cpp | 38 ---
core/sql/exp/exp_expr.cpp | 17 +-
core/sql/exp/exp_expr.h | 35 ++-
core/sql/exp/exp_fixup.cpp | 7 +
core/sql/generator/GenExpGenerator.cpp | 48 +++-
core/sql/generator/GenItemFunc.cpp | 24 ++
.../lib_mgmt/src/main/resources/init_libmgmt.sh | 2 +-
core/sql/optimizer/BindRelExpr.cpp | 52 +++-
core/sql/optimizer/ItemExpr.cpp | 32 +++
core/sql/optimizer/ItemFunc.h | 44 +++-
core/sql/optimizer/SynthType.cpp | 22 +-
core/sql/parser/sqlparser.y | 1 +
core/sql/regress/compGeneral/EXPECTED023 | 50 ++--
core/sql/regress/seabase/EXPECTED033 | 240 +++++++++++++------
core/sql/regress/seabase/TEST033 | 66 ++++-
.../main/asciidoc/_chapters/configuration.adoc | 17 +-
.../asciidoc/_chapters/troubleshooting.adoc | 18 +-
dcs/src/main/resources/dcs-default.xml | 2 +-
.../src/asciidoc/_chapters/requirements.adoc | 2 +-
50 files changed, 935 insertions(+), 444 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a4a20343/core/sqf/monitor/linux/cluster.cxx
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a4a20343/core/sqf/sql/scripts/sqcheck
----------------------------------------------------------------------
[43/50] [abbrv] incubator-trafodion git commit: Fix to Python
installer scripts.
Posted by su...@apache.org.
Fix to Python installer scripts.
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/69a4b7ee
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/69a4b7ee
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/69a4b7ee
Branch: refs/heads/master
Commit: 69a4b7eecad9ed77baa53e3bc67d767455784f80
Parents: 5196656
Author: Zalo Correa <za...@esgyn.com>
Authored: Wed May 3 08:46:33 2017 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Wed May 3 08:46:33 2017 -0700
----------------------------------------------------------------------
install/python-installer/scripts/traf_sqconfig.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/69a4b7ee/install/python-installer/scripts/traf_sqconfig.py
----------------------------------------------------------------------
diff --git a/install/python-installer/scripts/traf_sqconfig.py b/install/python-installer/scripts/traf_sqconfig.py
index 0bdbf74..05c7a54 100755
--- a/install/python-installer/scripts/traf_sqconfig.py
+++ b/install/python-installer/scripts/traf_sqconfig.py
@@ -57,8 +57,9 @@ def run():
with open(sqconfig_file, 'w') as f:
f.writelines(lines)
- # append the current persist section
- run_cmd('sed \'1,20d\' %s >> %s' % (sqconfig_file, sqconfig_persist_file))
+ # append the current persist section to the Trafodion configuration file
+ run_cmd('echo "sed \'1,20d\' %s >> %s"' % (sqconfig_persist_file, sqconfig_file))
+ run_cmd('sed \'1,20d\' %s >> %s' % (sqconfig_persist_file, sqconfig_file))
print 'sqconfig generated successfully!'
[33/50] [abbrv] incubator-trafodion git commit: Trafodion
configuration API changes
Posted by su...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/04040d30/core/sqf/monitor/linux/pstartd.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pstartd.cxx b/core/sqf/monitor/linux/pstartd.cxx
index 4f36e11..63ac28e 100644
--- a/core/sqf/monitor/linux/pstartd.cxx
+++ b/core/sqf/monitor/linux/pstartd.cxx
@@ -27,14 +27,15 @@
#include <stdlib.h>
#include <unistd.h>
-#include "pstartd.h"
+
+#include "SCMVersHelp.h"
#include "clio.h"
#include "monlogging.h"
#include "msgdef.h"
#include "seabed/trace.h"
#include "montrace.h"
+#include "pstartd.h"
-#include "SCMVersHelp.h"
const char *MyName;
char ga_ms_su_c_port[MPI_MAX_PORT_NAME] = {0}; // connection port - not used
@@ -52,7 +53,6 @@ bool shuttingDown = false;
CMonUtil monUtil;
CPStartD *pStartD;
CMonLog *MonLog = NULL;
-CMonLog *SnmpLog = NULL;
DEFINE_EXTERN_COMP_DOVERS(pstartd)
DEFINE_EXTERN_COMP_PRINTVERS(pstartd)
@@ -237,7 +237,7 @@ void localIONoticeCallback(struct message_def *recv_msg, int )
shuttingDown = true;
snprintf( buf, sizeof(buf), "Received 'Shutdown' event.\n");
- monproc_log_write( PSTARTD_INFO, SQ_LOG_INFO, buf );
+ monproc_log_write( LIO_NOTICE_CALLBACK_1, SQ_LOG_INFO, buf );
CShutdownReq * reqShutdown;
reqShutdown = new CShutdownReq();
@@ -278,7 +278,7 @@ void localIONoticeCallback(struct message_def *recv_msg, int )
snprintf( buf, sizeof(buf),
"[%s], Unexpected callback notice, type=%d\n",
method_name, recv_msg->type );
- monproc_log_write( PSTARTD_UNEXP_NOTICE, SQ_LOG_ERR, buf );
+ monproc_log_write( LIO_NOTICE_CALLBACK_2, SQ_LOG_ERR, buf );
}
}
@@ -311,7 +311,7 @@ void localIOEventCallback(struct message_def *recv_msg, int )
snprintf( buf, sizeof(buf),
"[%s], Unable to convert event data [%s] to node id\n",
method_name, recv_msg->u.request.u.event_notice.data );
- monproc_log_write( PSTARTD_BAD_EVENT, SQ_LOG_ERR, buf );
+ monproc_log_write( LIO_EVENT_CALLBACK_1, SQ_LOG_ERR, buf );
return;
}
@@ -335,7 +335,7 @@ void localIOEventCallback(struct message_def *recv_msg, int )
snprintf( buf, sizeof(buf),
"[%s], Unexpected event id=%d (ignored)\n",
method_name, eventId );
- monproc_log_write( PSTARTD_BAD_EVENT, SQ_LOG_ERR, buf );
+ monproc_log_write( LIO_EVENT_CALLBACK_2, SQ_LOG_ERR, buf );
}
if ( req != NULL )
@@ -409,7 +409,7 @@ bool CMonUtil::requestGet ( ConfigType type,
char buf[MON_STRING_BUF_SIZE];
snprintf( buf, sizeof(buf), "[%s], Unable to acquire message buffer\n",
method_name );
- monproc_log_write( PSTARTD_ACQUIRE_ERROR, SQ_LOG_ERR, buf );
+ monproc_log_write( MONUTIL_REQUEST_GET_1, SQ_LOG_ERR, buf );
return result;
}
@@ -457,7 +457,7 @@ bool CMonUtil::requestGet ( ConfigType type,
"[%s] Get reply message invalid. Reply tag=%d, count=%d "
"(expected %d)\n", method_name, msg->reply_tag,
count, (int) sizeof (struct message_def) );
- monproc_log_write( PSTARTD_MONCALL_ERROR, SQ_LOG_ERR, buf );
+ monproc_log_write( MONUTIL_REQUEST_GET_2, SQ_LOG_ERR, buf );
}
@@ -486,7 +486,7 @@ void CMonUtil::requestExit ( void )
char buf[MON_STRING_BUF_SIZE];
snprintf( buf, sizeof(buf), "[%s], Unable to acquire message buffer\n",
method_name );
- monproc_log_write( PSTARTD_ACQUIRE_ERROR, SQ_LOG_ERR, buf );
+ monproc_log_write( MONUTIL_REQUEST_EXIT_1, SQ_LOG_ERR, buf );
return;
}
@@ -517,7 +517,7 @@ void CMonUtil::requestExit ( void )
"[%s], exit process failed, rc=%d (%s)\n",
method_name, msg->u.reply.u.generic.return_code,
MPIErrMsg(msg->u.reply.u.generic.return_code));
- monproc_log_write( PSTARTD_MONCALL_ERROR, SQ_LOG_ERR, buf );
+ monproc_log_write( MONUTIL_REQUEST_EXIT_2, SQ_LOG_ERR, buf );
}
}
else
@@ -526,7 +526,7 @@ void CMonUtil::requestExit ( void )
snprintf( buf, sizeof(buf),
"[%s], Invalid MsgType(%d)/ReplyType(%d) for Exit "
"message\n", method_name, msg->type, msg->u.reply.type );
- monproc_log_write( PSTARTD_MONCALL_ERROR, SQ_LOG_ERR, buf );
+ monproc_log_write( MONUTIL_REQUEST_EXIT_3, SQ_LOG_ERR, buf );
}
}
else
@@ -537,7 +537,7 @@ void CMonUtil::requestExit ( void )
"count=%d (expected %d)\n",
method_name, msg->reply_tag,
count, (int) sizeof (struct message_def) );
- monproc_log_write( PSTARTD_MONCALL_ERROR, SQ_LOG_ERR, buf );
+ monproc_log_write( MONUTIL_REQUEST_EXIT_4, SQ_LOG_ERR, buf );
}
gp_local_mon_io->release_msg(msg);
@@ -571,7 +571,7 @@ bool CMonUtil::requestNewProcess (int nid, PROCESSTYPE type,
char buf[MON_STRING_BUF_SIZE];
snprintf( buf, sizeof(buf), "[%s], Unable to acquire message buffer\n",
method_name );
- monproc_log_write( PSTARTD_ACQUIRE_ERROR, SQ_LOG_ERR, buf );
+ monproc_log_write( MONUTIL_REQUEST_NEWPROC_1, SQ_LOG_ERR, buf );
return result;
}
@@ -635,7 +635,7 @@ bool CMonUtil::requestNewProcess (int nid, PROCESSTYPE type,
"[%s], new process failed to spawn, rc=%d (%s)\n",
method_name, msg->u.reply.u.new_process.return_code,
MPIErrMsg(msg->u.reply.u.new_process.return_code) );
- monproc_log_write( PSTARTD_MONCALL_ERROR, SQ_LOG_ERR, buf );
+ monproc_log_write( MONUTIL_REQUEST_NEWPROC_2, SQ_LOG_ERR, buf );
}
}
else
@@ -644,7 +644,7 @@ bool CMonUtil::requestNewProcess (int nid, PROCESSTYPE type,
snprintf( buf, sizeof(buf),
"[%s], Invalid MsgType(%d)/ReplyType(%d) for Exit "
"message\n", method_name, msg->type, msg->u.reply.type );
- monproc_log_write( PSTARTD_MONCALL_ERROR, SQ_LOG_ERR, buf );
+ monproc_log_write( MONUTIL_REQUEST_NEWPROC_3, SQ_LOG_ERR, buf );
}
}
else
@@ -654,7 +654,7 @@ bool CMonUtil::requestNewProcess (int nid, PROCESSTYPE type,
" Reply tag=%d, count=%d (expected %d)\n",
method_name, msg->reply_tag,
count, (int) sizeof (struct message_def));
- monproc_log_write( PSTARTD_MONCALL_ERROR, SQ_LOG_ERR, buf );
+ monproc_log_write( MONUTIL_REQUEST_NEWPROC_4, SQ_LOG_ERR, buf );
}
gp_local_mon_io->release_msg(msg);
@@ -678,7 +678,7 @@ bool CMonUtil::requestProcInfo( const char *processName, int &nid, int &pid )
char buf[MON_STRING_BUF_SIZE];
snprintf( buf, sizeof(buf), "[%s], Unable to acquire message buffer\n",
method_name );
- monproc_log_write( PSTARTD_ACQUIRE_ERROR, SQ_LOG_ERR, buf );
+ monproc_log_write( MONUTIL_REQUEST_PROCINFO_1, SQ_LOG_ERR, buf );
return result;
}
@@ -743,7 +743,7 @@ bool CMonUtil::requestProcInfo( const char *processName, int &nid, int &pid )
"[%s] ProcessInfo failed, rc=%d (%s)\n",
method_name, msg->u.reply.u.process_info.return_code,
MPIErrMsg(msg->u.reply.u.process_info.return_code));
- monproc_log_write( PSTARTD_MONCALL_ERROR, SQ_LOG_ERR, buf );
+ monproc_log_write( MONUTIL_REQUEST_PROCINFO_2, SQ_LOG_ERR, buf );
}
}
else
@@ -753,7 +753,7 @@ bool CMonUtil::requestProcInfo( const char *processName, int &nid, int &pid )
"[%s], Invalid MsgType(%d)/ReplyType(%d) for "
"ProcessInfo\n", method_name, msg->type,
msg->u.reply.type );
- monproc_log_write( PSTARTD_MONCALL_ERROR, SQ_LOG_ERR, buf );
+ monproc_log_write( MONUTIL_REQUEST_PROCINFO_3, SQ_LOG_ERR, buf );
}
}
@@ -765,7 +765,7 @@ bool CMonUtil::requestProcInfo( const char *processName, int &nid, int &pid )
"count=%d (expected %d)\n",
method_name, msg->reply_tag,
count, (int) sizeof (struct message_def) );
- monproc_log_write( PSTARTD_MONCALL_ERROR, SQ_LOG_ERR, buf );
+ monproc_log_write( MONUTIL_REQUEST_PROCINFO_4, SQ_LOG_ERR, buf );
}
gp_local_mon_io->release_msg(msg);
@@ -789,7 +789,7 @@ void CMonUtil::requestStartup ( )
char buf[MON_STRING_BUF_SIZE];
snprintf( buf, sizeof(buf), "[%s], Unable to acquire message buffer\n",
method_name );
- monproc_log_write( PSTARTD_ACQUIRE_ERROR, SQ_LOG_ERR, buf );
+ monproc_log_write( MONUTIL_REQUEST_STARTUP_1, SQ_LOG_ERR, buf );
return;
}
@@ -873,7 +873,7 @@ void CNodeUpReq::performRequest()
char buf[MON_STRING_BUF_SIZE];
snprintf( buf, sizeof(buf), "Received 'Node Up' event for node %d, "
"requires DTM flag=%d\n", nid_, requiresDTM_);
- monproc_log_write( PSTARTD_INFO, SQ_LOG_INFO, buf );
+ monproc_log_write( MONUTIL_PERFORM_REQUEST_1, SQ_LOG_INFO, buf );
// [ todo: need to check if nid_ is any one of the logical nodes in
// the physical node ]
@@ -896,60 +896,22 @@ void CNodeUpReq::performRequest()
}
CPStartD::CPStartD()
- : db_(NULL)
+ :trafConfigInitialized_(false)
{
const char method_name[] = "CPStartD::CPStartD";
- // Open the configuration database file
- char dbase[MAX_PROCESS_PATH];
- snprintf(dbase, sizeof(dbase), "%s/sql/scripts/sqconfig.db",
- getenv("MY_SQROOT"));
- int rc = sqlite3_open_v2(dbase, &db_, SQLITE_OPEN_READONLY, NULL);
-
+ int rc = tc_initialize( tracing );
if ( rc )
{
- db_ = NULL;
-
- // See if have database in current directory
- int rc2 = sqlite3_open_v2("sqconfig.db", &db_,
- SQLITE_OPEN_READWRITE | SQLITE_OPEN_FULLMUTEX,
- NULL);
- if ( rc2 )
- {
- // failed to open database
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] Can't open database: %s, %s\n",
- method_name, dbase, sqlite3_errmsg(db_) );
- monproc_log_write( PSTARTD_DATABASE_ERROR, SQ_LOG_ERR, buf );
-
- abort();
- }
- }
-
- if ( db_ != NULL )
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s], Can't initialize configuration!\n"
+ , method_name );
+ monproc_log_write( PSTARTD_PSTARTD_1, SQ_LOG_CRIT, buf );
+ }
+ else
{
- rc = sqlite3_busy_timeout(db_, 500);
-
- if ( rc )
- {
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] Can't set busy timeout for "
- "database %s: %s (%d)\n",
- method_name, dbase, sqlite3_errmsg(db_), rc );
- monproc_log_write( PSTARTD_DATABASE_ERROR, SQ_LOG_ERR, buf );
- }
-
- char *sErrMsg = NULL;
- sqlite3_exec(db_, "PRAGMA synchronous = OFF", NULL, NULL, &sErrMsg);
- if (sErrMsg != NULL)
- {
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] Can't set PRAGMA synchronous for "
- "database %s: %s\n",
- method_name, dbase, sErrMsg );
- monproc_log_write( PSTARTD_DATABASE_ERROR, SQ_LOG_ERR, buf );
- }
-
+ trafConfigInitialized_ = true;
}
}
@@ -987,9 +949,9 @@ void CPStartD::waitForEvent( void )
}
-void CPStartD::startProcess( const char * pName
- , string prefix
- , map<string,string> * persistMap)
+void CPStartD::startProcess( const char *pName
+ , const char *prefix
+ , persist_configuration_t &persistConfig )
{
const char method_name[] = "CPStartD::startProcess";
@@ -1006,43 +968,32 @@ void CPStartD::startProcess( const char * pName
int okMask = 0;
int argBegin[MAX_ARGS];
int argLen[MAX_ARGS];
- map<string,string>::iterator fIt;
- fIt = persistMap->find(prefix + "_PROCESS_TYPE");
- if (fIt != persistMap->end())
- {
- string value = fIt->second;
- okMask |= 0x1;
- if (value.compare("DTM") == 0)
- progType = ProcessType_DTM;
- else if (value.compare("GENERIC") == 0)
- progType = ProcessType_Generic;
- else if (value.compare("PERSIST") == 0)
- progType = ProcessType_PERSIST;
- else if (value.compare("PSD") == 0)
- progType = ProcessType_PSD;
- else if (value.compare("SPX") == 0)
- progType = ProcessType_SPX;
- else if (value.compare("SSMP") == 0)
- progType = ProcessType_SSMP;
- else if (value.compare("SMS") == 0)
- progType = ProcessType_SMS;
- else if (value.compare("TMID") == 0)
- progType = ProcessType_TMID;
- else if (value.compare("WDG") == 0)
- progType = ProcessType_Watchdog;
- }
- fIt = persistMap->find(prefix + "_STDOUT");
- if (fIt != persistMap->end())
- {
- okMask |= 0x2;
- progStdout = fIt->second;
- }
- fIt = persistMap->find(prefix + "_PROGRAM_NAME");
- if (fIt != persistMap->end())
- {
- okMask |= 0x4;
- progProgram = fIt->second;
- }
+
+ string value = persistConfig.process_type;
+ okMask |= 0x1;
+ if (value.compare("DTM") == 0)
+ progType = ProcessType_DTM;
+ else if (value.compare("GENERIC") == 0)
+ progType = ProcessType_Generic;
+ else if (value.compare("PERSIST") == 0)
+ progType = ProcessType_PERSIST;
+ else if (value.compare("PSD") == 0)
+ progType = ProcessType_PSD;
+ else if (value.compare("SPX") == 0)
+ progType = ProcessType_SPX;
+ else if (value.compare("SSMP") == 0)
+ progType = ProcessType_SSMP;
+ else if (value.compare("SMS") == 0)
+ progType = ProcessType_SMS;
+ else if (value.compare("TMID") == 0)
+ progType = ProcessType_TMID;
+ else if (value.compare("WDG") == 0)
+ progType = ProcessType_Watchdog;
+
+ okMask |= 0x2;
+ progStdout = persistConfig.std_out;
+ okMask |= 0x4;
+ progProgram = persistConfig.program_name;
if ( okMask & 0x7 )
{
@@ -1058,7 +1009,7 @@ void CPStartD::startProcess( const char * pName
char buf[MON_STRING_BUF_SIZE];
snprintf( buf, sizeof(buf), "Starting process %s on nid=%d, program="
"%s, type=%d\n", pName, progNid, progProgram.c_str(), progType);
- monproc_log_write( PSTARTD_INFO, SQ_LOG_INFO, buf );
+ monproc_log_write( PSTARTD_START_PROCESS_1, SQ_LOG_INFO, buf );
result = monUtil.requestNewProcess(progNid,
progType, pName,
@@ -1116,189 +1067,104 @@ void CPStartD::startProcs ( int nid, bool requiresDTM )
list<string> prefixToStart;
list<string> keys;
map<string,string> persistDataMap;
+ persist_configuration_t persistConfig;
+
+ // Get persistent process keys
int rc;
- const char *selStmt;
- selStmt = "select keyName,valueName from monRegPersistData";
-
- sqlite3_stmt *prepStmt;
-
- rc = sqlite3_prepare_v2( db_, selStmt, strlen(selStmt)+1, &prepStmt, NULL);
- if ( rc != SQLITE_OK )
+ char persistProcessKeys[TC_PERSIST_KEYS_VALUE_MAX];
+ rc = tc_get_persist_keys( persistProcessKeys );
+ if ( rc )
{
char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "[%s] prepare failed: %s (%d)\n",
- method_name, sqlite3_errmsg(db_), rc );
- monproc_log_write( PSTARTD_DATABASE_ERROR, SQ_LOG_ERR, buf );
+ snprintf( buf, sizeof(buf)
+ , "[%s] Persist keys configuration does not exist!\n"
+ , method_name );
+ monproc_log_write( PSTARTD_STARTPROCS_1, SQ_LOG_CRIT, buf );
return; // no keys, no work
}
- while ( 1 )
+ if ( strlen( persistProcessKeys ) )
{
- rc = sqlite3_step( prepStmt );
- if ( rc == SQLITE_ROW )
- { // Process row
- const char *key = (const char *) sqlite3_column_text(prepStmt, 0);
- const char *value = (const char *) sqlite3_column_text(prepStmt, 1);
- if ( tracing )
- trace_printf("%s@%d monRegPersistData key=%s, value=%s\n", method_name, __LINE__, key, value);
- if (strcmp(key, "PERSIST_PROCESS_KEYS") == 0)
- {
- processKeys(value, keys);
- }
- else if (strstr(key, "_PERSIST_ZONES") != NULL)
- {
- char zones[1000];
- strcpy(zones, value);
- replaceZid(zones);
- persistDataMap.insert(map<string,string>::value_type(key, zones));
- }
- else if (strstr(key, "_PROCESS_NAME") != NULL)
- {
- char process_name[1000];
- strcpy(process_name, value);
- replaceNid(process_name);
- persistDataMap.insert(map<string,string>::value_type(key, process_name));
- }
- else if (strstr(key, "_STDOUT") != NULL)
- {
- char stdout_str[1000];
- strcpy(stdout_str, value);
- replaceNid(stdout_str);
- persistDataMap.insert(map<string,string>::value_type(key, stdout_str));
- }
- else
- persistDataMap.insert(map<string,string>::value_type(key, value));
- }
- else if ( rc == SQLITE_DONE )
- {
- if ( tracing )
- {
- trace_printf("%s@%d Finished processing all rows.\n",
- method_name, __LINE__);
- }
-
- break;
- }
- else
- {
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf),
- "[%s] step failed: %s (%d)\n",
- method_name, sqlite3_errmsg(db_), rc );
- monproc_log_write( PSTARTD_DATABASE_ERROR, SQ_LOG_ERR, buf );
- break;
- }
+ processKeys( persistProcessKeys, keys );
}
+ // Get persistent process configuration for each key
list<string>::iterator keyIt;
for (keyIt = keys.begin(); keyIt != keys.end(); ++keyIt)
{
string procName = "";
string procType = "";
- string requiresDtm = "";
string zones = "";
string prefix = (*keyIt);
- string keyProcName = prefix + "_PROCESS_NAME";
- map<string,string>::iterator fIt;
- fIt = persistDataMap.find(keyProcName);
- if (fIt != persistDataMap.end())
+ rc = tc_get_persist_process( prefix.c_str(), &persistConfig );
+ if ( rc )
{
- procName = fIt->second;
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] Persist configuration for %s does not exist!\n"
+ , method_name, prefix.c_str() );
+ monproc_log_write( PSTARTD_STARTPROCS_2, SQ_LOG_ERR, buf );
+ continue;
}
- string keyRequiresDtm = prefix + "_REQUIRES_DTM";
- fIt = persistDataMap.find(keyRequiresDtm);
- if (fIt != persistDataMap.end())
+ if ( tracing )
{
- requiresDtm = fIt->second;
- if ( tracing )
- {
- trace_printf("%s@%d %s = %s, requiresDTM = %d\n",
- method_name, __LINE__,
- keyRequiresDtm.c_str(),
- requiresDtm.c_str(),
- requiresDTM);
- }
- if ((requiresDtm.compare("Y") == 0) && !requiresDTM)
- {
- if ( tracing )
- {
- trace_printf("%s@%d Persist type %s NOT targeted for restart DTM not ready\n",
- method_name, __LINE__, prefix.c_str());
- }
- continue;
- }
- else if ((requiresDtm.compare("N") == 0) && requiresDTM)
- {
- if ( tracing )
- {
- trace_printf("%s@%d Persist type %s NOT targeted for restart DTM ready\n",
- method_name, __LINE__, prefix.c_str());
- }
- continue;
- }
+ trace_printf( "%s@%d Persist Prefix =%s\n"
+ "\t\tProcess Name = %s\n"
+ "\t\tProcess Type = %s\n"
+ "\t\tProgram Name = %s\n"
+ "\t\tSTDOUT = %s\n"
+ "\t\tRequires DTM = %s\n"
+ "\t\tPersist Retries = %d\n"
+ "\t\tPersist Window = %d\n"
+ "\t\tPersist Zones = %s\n"
+ , method_name, __LINE__
+ , persistConfig.persist_prefix
+ , persistConfig.process_name
+ , persistConfig.process_type
+ , persistConfig.program_name
+ , persistConfig.std_out
+ , persistConfig.requires_DTM ? "Y" : "N"
+ , persistConfig.persist_retries
+ , persistConfig.persist_window
+ , persistConfig.persist_zones );
}
- string keyProcessType = prefix + "_PROCESS_TYPE";
- fIt = persistDataMap.find(keyProcessType);
- if (fIt != persistDataMap.end())
+ procName = persistConfig.process_name;
+
+ if ( persistConfig.requires_DTM && !requiresDTM )
{
- string procType = fIt->second;
if ( tracing )
{
- trace_printf("%s@%d %s = %s\n",
- method_name, __LINE__,
- keyProcessType.c_str(), procType.c_str());
- }
- if (procType.compare("PERSIST") == 0)
- {
- if ( tracing )
- {
- trace_printf("%s@%d Persist %s process type %s targeted for restart\n",
- method_name, __LINE__,
- prefix.c_str(), procType.c_str());
- }
- }
- else if (procType.compare("SSMP") == 0)
- {
- if ( tracing )
- {
- trace_printf("%s@%d Persist %s process type %s targeted for restart\n",
- method_name, __LINE__,
- prefix.c_str(), procType.c_str());
- }
+ trace_printf("%s@%d Persist type %s NOT targeted for restart DTM not ready\n",
+ method_name, __LINE__, persistConfig.persist_prefix );
}
- else if (procType.compare("TMID") == 0)
- {
- if ( tracing )
- {
- trace_printf("%s@%d Persist %s process type %s targeted for restart\n",
- method_name, __LINE__,
- prefix.c_str(), procType.c_str());
- }
- }
- else
+ continue;
+ }
+ else if ( persistConfig.requires_DTM && requiresDTM )
+ {
+ if ( tracing )
{
- if ( tracing )
- {
- trace_printf("%s@%d Persist %s process type %s NOT targeted for restart\n",
- method_name, __LINE__,
- prefix.c_str(), procType.c_str());
- }
- continue;
+ trace_printf("%s@%d Persist type %s NOT targeted for restart DTM ready\n",
+ method_name, __LINE__, persistConfig.persist_prefix );
}
+ continue;
}
- string keyZones = prefix + "_PERSIST_ZONES";
- fIt = persistDataMap.find(keyZones);
- if (fIt != persistDataMap.end())
+ procType = persistConfig.process_type;
+ zones = persistConfig.persist_zones;
+
+ if ( tracing )
{
- zones = fIt->second;
+ trace_printf("%s@%d Persist %s process type %s targeted for restart\n",
+ method_name, __LINE__,
+ prefix.c_str(), persistConfig.process_type );
}
+
- if ((procName.length() != 0) && (requiresDtm.length() != 0) && (zones.length() != 0))
+ if ((procName.length() != 0) && (zones.length() != 0))
{
int procNid = -1;
int procPid = -1;
@@ -1317,7 +1183,7 @@ void CPStartD::startProcs ( int nid, bool requiresDTM )
snprintf( buf, sizeof(buf), "Not starting process %s "
"because it is already running\n",
procName.c_str());
- monproc_log_write( PSTARTD_INFO, SQ_LOG_INFO, buf );
+ monproc_log_write( PSTARTD_STARTPROCS_3, SQ_LOG_INFO, buf );
if ( tracing )
{
@@ -1341,7 +1207,7 @@ void CPStartD::startProcs ( int nid, bool requiresDTM )
trace_printf("%s@%d Will start process %s for zone %d\n",
method_name, __LINE__, procName, nid);
}
- startProcess( procName, prefix, &persistDataMap );
+ startProcess( procName, prefix, persistConfig );
}
procsToStart.clear();
}
@@ -1514,7 +1380,7 @@ int main (int argc, char *argv[])
{
char buf[MON_STRING_BUF_SIZE];
sprintf( buf, "[%s - main], pthread_sigmask error=%d\n", MyName, rc );
- monproc_log_write( MON_PSTARTD_MAIN_1, SQ_LOG_ERR, buf );
+ monproc_log_write( PSTARTD_MAIN_1, SQ_LOG_ERR, buf );
}
// This process does not use MPI. But unless MPI is initialized
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/04040d30/core/sqf/monitor/linux/pstartd.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pstartd.h b/core/sqf/monitor/linux/pstartd.h
index a02f2f4..81c60ed 100644
--- a/core/sqf/monitor/linux/pstartd.h
+++ b/core/sqf/monitor/linux/pstartd.h
@@ -35,7 +35,7 @@ using namespace std;
#include "msgdef.h"
#include "lock.h"
-#include <sqlite3.h>
+#include "trafconfig.h"
class CMonUtil
{
@@ -141,8 +141,8 @@ class CPStartD : public CLock
void waitForEvent( void ) ;
void startProcess( const char *pName
- , string prefix
- , map<string, string> *persistMap );
+ , const char *prefix
+ , persist_configuration_t &persistConfig );
void startProcs ( int nid, bool requiresDTM );
@@ -158,7 +158,7 @@ class CPStartD : public CLock
list<CRequest *> workQ_;
- sqlite3 *db_;
+ bool trafConfigInitialized_;
};
#endif
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/04040d30/core/sqf/monitor/linux/reqget.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqget.cxx b/core/sqf/monitor/linux/reqget.cxx
index d5df11c..fe8bab9 100644
--- a/core/sqf/monitor/linux/reqget.cxx
+++ b/core/sqf/monitor/linux/reqget.cxx
@@ -134,7 +134,9 @@ void CExtGetReq::performRequest()
break;
default:
char buf[MON_STRING_BUF_SIZE];
- sprintf(buf, "[CMonitor::Get_Configuration], Invalid ConfigType=%d.\n", msg_->u.request.u.get.type);
+ sprintf( buf, "%s@%d - Invalid ConfigType=%d.\n"
+ , method_name, __LINE__
+ , msg_->u.request.u.get.type);
mon_log_write(MON_MONITOR_GETCONF_1, SQ_LOG_ERR, buf);
group = NULL;
}
@@ -212,7 +214,9 @@ void CExtGetReq::performRequest()
else
{
char buf[MON_STRING_BUF_SIZE];
- sprintf(buf, "[CMonitor::Get_Configuration], Can't find group(%s).\n", msg_->u.request.u.get.group);
+ sprintf( buf, "%s@%d - Can't find group(%s).\n"
+ , method_name, __LINE__
+ , msg_->u.request.u.get.group);
mon_log_write(MON_MONITOR_GETCONF_3, SQ_LOG_ERR, buf);
msg_->u.reply.type = ReplyType_Get;
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/04040d30/core/sqf/monitor/linux/reqnodeadd.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqnodeadd.cxx b/core/sqf/monitor/linux/reqnodeadd.cxx
index 6a21163..8ecccc3 100644
--- a/core/sqf/monitor/linux/reqnodeadd.cxx
+++ b/core/sqf/monitor/linux/reqnodeadd.cxx
@@ -74,6 +74,8 @@ void CExtNodeAddReq::performRequest()
TRACE_ENTRY;
int rc = MPI_SUCCESS;
+ pnodeConfigInfo_t pnodeConfigInfo;
+ lnodeConfigInfo_t lnodeConfigInfo;
CClusterConfig *clusterConfig = NULL;
CLNodeConfig *lnodeConfig = NULL;
CPNodeConfig *pnodeConfig = NULL;
@@ -107,25 +109,37 @@ void CExtNodeAddReq::performRequest()
pnodeConfig = clusterConfig->GetPNodeConfig( msg_->u.request.u.node_add.node_name );
if (!pnodeConfig)
{
+ pnodeConfigInfo.pnid = -1;
+ strncpy( pnodeConfigInfo.nodename
+ , msg_->u.request.u.node_add.node_name
+ , sizeof(pnodeConfigInfo.nodename) );
+ pnodeConfigInfo.excludedFirstCore = -1;
+ pnodeConfigInfo.excludedLastCore = -1;
+ clusterConfig->SetCoreMask( pnodeConfigInfo.excludedFirstCore
+ , pnodeConfigInfo.excludedLastCore
+ , pnodeConfigInfo.excludedCoreMask );
+ pnodeConfigInfo.spareCount = 0;
+ memset( pnodeConfigInfo.sparePNid
+ , -1
+ , sizeof(pnodeConfigInfo.sparePNid) );
pnodeConfig = new CPNodeConfig( NULL // pnodesConfig
- , -1 // pnid
- , -1 // excludedFirstCore
- , -1 // excludedLastCore
- , msg_->u.request.u.node_add.node_name
- );
+ , pnodeConfigInfo );
if (pnodeConfig)
{
- clusterConfig->SetCoreMask( msg_->u.request.u.node_add.first_core
- , msg_->u.request.u.node_add.last_core
- , coreMask );
+ lnodeConfigInfo.nid = -1;
+ lnodeConfigInfo.pnid = -1;
+ strncpy( lnodeConfigInfo.nodename
+ , msg_->u.request.u.node_add.node_name
+ , sizeof(lnodeConfigInfo.nodename) );
+ lnodeConfigInfo.lastCore = msg_->u.request.u.node_add.first_core;
+ lnodeConfigInfo.firstCore = msg_->u.request.u.node_add.last_core;
+ lnodeConfigInfo.processor = msg_->u.request.u.node_add.processors;
+ clusterConfig->SetCoreMask( lnodeConfigInfo.lastCore
+ , lnodeConfigInfo.firstCore
+ , lnodeConfigInfo.coreMask );
+ lnodeConfigInfo.zoneType = (ZoneType)msg_->u.request.u.node_add.roles;
lnodeConfig = new CLNodeConfig( pnodeConfig
- , -1 // nid
- , coreMask
- , msg_->u.request.u.node_add.first_core
- , msg_->u.request.u.node_add.last_core
- , msg_->u.request.u.node_add.processors
- , (ZoneType)msg_->u.request.u.node_add.roles
- );
+ , lnodeConfigInfo );
if (lnodeConfig)
{
// Tell all monitors to add this node to the configuration database
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/04040d30/core/sqf/monitor/linux/shell.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/shell.cxx b/core/sqf/monitor/linux/shell.cxx
index bc4fc74..4a954ad 100644
--- a/core/sqf/monitor/linux/shell.cxx
+++ b/core/sqf/monitor/linux/shell.cxx
@@ -616,7 +616,7 @@ void TraceOpen ( void )
// Initialize tracing
trace_init(traceFileName,
false, // don't append pid to file name
- NULL, // prefix
+ "shell", // prefix
false);
if (traceFileFb > 0)
{
@@ -634,6 +634,7 @@ void TraceUpdate ( int flags )
if ( flags & 2 )
{
trace_settings |= TRACE_INIT;
+ trace_settings |= TRACE_TRAFCONFIG;
}
if ( flags & 4 )
{
@@ -696,6 +697,7 @@ void TraceInit( int & argc, char **&argv )
if (envVar && atoi (envVar) != 0 )
{
trace_settings |= TRACE_INIT;
+ trace_settings |= TRACE_TRAFCONFIG;
}
envVar = getenv("SHELL_TRACE_LIO");
@@ -739,7 +741,7 @@ void TraceInit( int & argc, char **&argv )
}
}
- if ( trace_settings & TRACE_SHELL_CMD)
+ if ( trace_settings & TRACE_SHELL_CMD )
{
printf("traceFileName=%s, trace_settings=%lX, traceFileFb=%d\n",
traceFileName, trace_settings, traceFileFb);
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/04040d30/core/sqf/monitor/linux/trafconf.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/trafconf.cxx b/core/sqf/monitor/linux/trafconf.cxx
index 2505da1..7128967 100644
--- a/core/sqf/monitor/linux/trafconf.cxx
+++ b/core/sqf/monitor/linux/trafconf.cxx
@@ -137,8 +137,10 @@ void DisplayUsage( void )
" -wname Displays all node names in configuration prefixed with '-w'\n"
" - Name is as stored in configuration, which could be in short host name or FQDN form.\n"
" -wshort Displays all node names in configuration short host name form prefixed with '-w'.\n"
-" -node Displays node configuration (bracketed with begin/end).\n"
-" -persist Displays persist configuration (bracketed with begin/end).\n\n"
+" -node Displays node configuration (without begin/end brackets).\n"
+" -persist Displays persist configuration (without begin/end brackets).\n\n"
+" --node Displays node configuration (with begin/end brackets).\n"
+" --persist Displays persist configuration (with begin/end brackets).\n\n"
);
}
@@ -270,7 +272,7 @@ int DisplayNodeConfig( char *nodeName )
if ( DisplayBeginEnd && TrafConfType == TrafConfType_NodeConfig )
{
- printf( "begin node\n\n" );
+ printf( "BEGIN NODE\n\n" );
}
else if ( TrafConfType == TrafConfType_NodeConfig )
{
@@ -310,7 +312,7 @@ int DisplayNodeConfig( char *nodeName )
if ( DisplayBeginEnd && TrafConfType == TrafConfType_NodeConfig )
{
- printf( "\nend node\n" );
+ printf( "\nEND NODE\n" );
}
else if ( TrafConfType == TrafConfType_NodeConfig )
{
@@ -343,6 +345,7 @@ int DisplayPersistKeys( void )
{
strcat( persist_config_str, "," );
}
+ rc = 0;
}
printf ("%s\n\n", persist_config_str);
}
@@ -375,7 +378,7 @@ int DisplayPersistConfig( char *key )
if ( DisplayBeginEnd )
{
- printf( "begin persist\n\n" );
+ printf( "BEGIN PERSIST\n\n" );
}
else
{
@@ -464,6 +467,7 @@ int DisplayPersistConfig( char *key )
{
printf ("%s", persist_config_buf);
}
+ rc = 0;
}
}
}
@@ -474,7 +478,7 @@ int DisplayPersistConfig( char *key )
if ( DisplayBeginEnd )
{
- printf( "\nend persist\n" );
+ printf( "\nEND PERSIST\n" );
}
else
{
@@ -569,6 +573,16 @@ int main( int argc, char *argv[] )
{
TrafConfType = TrafConfType_PersistConfig;
}
+ else if ( strcasecmp( argv [argx], "--node" ) == 0 )
+ {
+ DisplayBeginEnd = true;
+ TrafConfType = TrafConfType_NodeConfig;
+ }
+ else if ( strcasecmp( argv [argx], "--persist" ) == 0 )
+ {
+ DisplayBeginEnd = true;
+ TrafConfType = TrafConfType_PersistConfig;
+ }
else
{
DisplayUsage();
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/04040d30/core/sqf/monitor/linux/watchdog.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/watchdog.cxx b/core/sqf/monitor/linux/watchdog.cxx
index be3c7b1..9875e68 100644
--- a/core/sqf/monitor/linux/watchdog.cxx
+++ b/core/sqf/monitor/linux/watchdog.cxx
@@ -70,7 +70,6 @@ bool genSnmpTrapEnabled = false;
class CWatchdog;
CMonLog *MonLog = NULL;
-CMonLog *SnmpLog = NULL;
CWatchdog *Watchdog = NULL;
CProcessMonitor *ProcessMonitor = NULL;
@@ -754,7 +753,6 @@ int main (int argc, char *argv[])
MyPid = atoi (argv[4]);
gv_ms_su_verif = MyVerifier = atoi(argv[9]);
- SnmpLog = new CMonLog( "log4cxx.monitor.wdg.snmp.config", "WDG-SNMP", "alt.wdg.snmp", MyPNID, MyNid, MyPid, MyName );
MonLog = new CMonLog( "log4cxx.monitor.wdg.config", "WDG", "alt.wdg", MyPNID, MyNid, MyPid, MyName );
Watchdog = new CWatchdog();
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/04040d30/core/sqf/monitor/linux/zclient.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/zclient.cxx b/core/sqf/monitor/linux/zclient.cxx
index 33f9499..c850eea 100644
--- a/core/sqf/monitor/linux/zclient.cxx
+++ b/core/sqf/monitor/linux/zclient.cxx
@@ -68,7 +68,6 @@ extern CNodeContainer *Nodes;
extern CReqQueue ReqQueue;
extern CZClient *ZClient;
extern CMonLog *MonLog;
-extern CMonLog *SnmpLog;
extern bool debugFlag;
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/04040d30/core/sqf/monitor/linux/zootest.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/zootest.cxx b/core/sqf/monitor/linux/zootest.cxx
index 1536e98..43cb4ff 100644
--- a/core/sqf/monitor/linux/zootest.cxx
+++ b/core/sqf/monitor/linux/zootest.cxx
@@ -52,7 +52,6 @@ int MyPid = -1;
CZClient *ZClient = NULL;
CMonLog *MonLog = NULL;
-CMonLog *SnmpLog = NULL;
void HandleZSessionExpiration( void )
{
[04/50] [abbrv] incubator-trafodion git commit: Merge remote branch
'origin/master' into TRAFODION-2001
Posted by su...@apache.org.
Merge remote branch 'origin/master' into TRAFODION-2001
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/3677b73d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/3677b73d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/3677b73d
Branch: refs/heads/master
Commit: 3677b73d96dadcee06191922345c77210faab089
Parents: 7c6002b dda167c
Author: Zalo Correa <za...@esgyn.com>
Authored: Thu Aug 11 08:04:46 2016 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Thu Aug 11 08:04:46 2016 -0700
----------------------------------------------------------------------
.../jdbc/t4/TrafT4PreparedStatement.java | 2 +-
.../odbc/src/odbc/nsksrvrcore/srvrothers.cpp | 77 +-
core/sqf/export/include/stfs/stfslib.h | 19 +-
core/sqf/sql/scripts/genms | 2 +-
core/sqf/sql/scripts/keepHBaseUp.py | 113 ++
.../transactional/TransactionManager.java | 520 +++--
core/sqf/src/stfs/stfs_stub.cpp | 82 +-
core/sqf/src/tm/tmlogging.cpp | 138 +-
core/sqf/src/tm/tmlogging.h | 2 -
core/sql/bin/SqlciErrors.txt | 12 +-
core/sql/comexe/ComResourceInfo.cpp | 259 +--
core/sql/comexe/ComResourceInfo.h | 98 +-
core/sql/comexe/ComTdbExeUtil.cpp | 3 +-
core/sql/comexe/ComTdbExeUtil.h | 89 +-
core/sql/common/CharType.cpp | 4 +-
core/sql/common/ComSmallDefs.h | 4 +
core/sql/common/NAString.cpp | 7 +
core/sql/common/OperTypeEnum.h | 1 +
core/sql/common/arkcmp_proc.cpp | 4 +-
core/sql/common/str.cpp | 23 +-
core/sql/executor/ExExeUtil.h | 48 +-
core/sql/executor/ExExeUtilCommon.cpp | 31 +
core/sql/executor/ExExeUtilGet.cpp | 396 +++-
core/sql/executor/ExExplain.cpp | 26 +-
core/sql/executor/ExHdfsScan.cpp | 52 +-
core/sql/executor/HBaseClient_JNI.cpp | 48 +-
core/sql/executor/HBaseClient_JNI.h | 2 +
core/sql/executor/cluster.cpp | 8 +-
core/sql/executor/ex_sort.cpp | 8 +-
core/sql/exp/ExpHbaseInterface.cpp | 20 +
core/sql/exp/ExpHbaseInterface.h | 3 +
core/sql/exp/ExpLOBaccess.cpp | 2 +-
core/sql/generator/GenRelExeUtil.cpp | 39 +-
core/sql/generator/GenRelScan.cpp | 13 +-
core/sql/generator/GenResources.cpp | 187 +-
core/sql/generator/GenResources.h | 2 +-
core/sql/optimizer/BindRelExpr.cpp | 131 +-
core/sql/optimizer/EncodedKeyValue.cpp | 18 +-
core/sql/optimizer/OptRange.cpp | 17 +-
core/sql/optimizer/RelExeUtil.cpp | 9 +-
core/sql/optimizer/RelExeUtil.h | 23 +-
core/sql/optimizer/RelExpr.cpp | 17 +
core/sql/optimizer/RelSample.cpp | 1 -
core/sql/optimizer/RelSet.h | 23 +
core/sql/parser/sqlparser.y | 40 +-
core/sql/regress/compGeneral/EXPECTED001.SB | 10 +
core/sql/regress/compGeneral/EXPECTED006.SB | 29 -
core/sql/regress/compGeneral/EXPECTED023 | 559 ++++++
core/sql/regress/compGeneral/EXPECTED042 | 8 +-
core/sql/regress/compGeneral/FILTER023 | 36 +
core/sql/regress/compGeneral/TEST001 | 1 +
core/sql/regress/compGeneral/TEST006 | 8 -
core/sql/regress/compGeneral/TEST023 | 273 +++
core/sql/regress/core/EXPECTED116 | 3 +
core/sql/regress/executor/EXPECTED130 | 1 +
core/sql/regress/hive/EXPECTED002 | 4 +-
core/sql/regress/hive/EXPECTED009 | 1 +
core/sql/regress/privs1/EXPECTED132 | 5 +
core/sql/regress/privs1/EXPECTED133 | Bin 26390 -> 27095 bytes
core/sql/regress/privs1/EXPECTED141 | Bin 113222 -> 123489 bytes
core/sql/regress/privs1/TEST132 | 2 +-
core/sql/regress/privs2/EXPECTED138 | 24 +-
core/sql/regress/privs2/EXPECTED140 | 25 +-
core/sql/regress/seabase/EXPECTED002 | 224 ++-
core/sql/regress/seabase/EXPECTED012 | 1 +
core/sql/regress/seabase/EXPECTED026 | 24 +-
core/sql/regress/seabase/EXPECTED031 | 124 +-
core/sql/regress/seabase/FILTER002 | 4 +-
core/sql/regress/seabase/TEST002 | 38 +-
core/sql/regress/seabase/TEST031 | 19 +
core/sql/regress/tools/runregr_compGeneral.ksh | 2 +-
core/sql/sort/DiskPool_base.h | 6 +-
core/sql/sort/DiskPool_sq.h | 6 +-
core/sql/sort/ScratchFileMap.cpp | 4 +-
core/sql/sort/ScratchFileMap.h | 2 +-
core/sql/sort/ScratchFile_sq.h | 2 +-
core/sql/sort/ScratchSpace.cpp | 51 +-
core/sql/sort/ScratchSpace.h | 58 +-
core/sql/sort/SortUtil.cpp | 8 +-
core/sql/sort/SortUtilCfg.cpp | 8 +-
core/sql/sort/SortUtilCfg.h | 59 +-
core/sql/sort/diskpool_sq.cpp | 4 -
core/sql/sort/scratchfile_sq.cpp | 55 +-
core/sql/sqlcat/TrafDDLdesc.cpp | 2 +
core/sql/sqlcat/TrafDDLdesc.h | 8 +-
core/sql/sqlcomp/CmpSeabaseDDL.h | 10 +-
core/sql/sqlcomp/CmpSeabaseDDLcleanup.cpp | 5 +-
core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp | 198 +-
core/sql/sqlcomp/CmpSeabaseDDLmd.h | 25 +
core/sql/sqlcomp/CmpSeabaseDDLschema.cpp | 2 +-
core/sql/sqlcomp/CmpSeabaseDDLtable.cpp | 40 +-
core/sql/sqlcomp/DefaultConstants.h | 16 +-
core/sql/sqlcomp/DefaultValidator.cpp | 348 +---
core/sql/sqlcomp/DefaultValidator.h | 96 +-
core/sql/sqlcomp/nadefaults.cpp | 140 +-
.../java/org/trafodion/sql/HBaseClient.java | 124 +-
.../java/org/trafodion/sql/TrafRegionStats.java | 118 +-
core/sql/ustat/hs_auto.h | 4 +-
core/sql/ustat/hs_cli.cpp | 831 ++++----
core/sql/ustat/hs_cli.h | 81 +-
core/sql/ustat/hs_const.h | 11 +-
core/sql/ustat/hs_globals.cpp | 1822 ++++++++++++------
core/sql/ustat/hs_globals.h | 110 +-
core/sql/ustat/hs_la.cpp | 24 +
core/sql/ustat/hs_la.h | 24 +-
core/sql/ustat/hs_log.h | 21 +-
core/sql/ustat/hs_parser.cpp | 4 +
core/sql/ustat/hs_update.cpp | 3 -
core/sql/ustat/hs_yacc.y | 65 +-
.../trafodion/jdbc_test/TestGetIndexInfo.java | 196 ++
docs/src/site/markdown/index.md | 14 +-
.../site/resources/images/carousel/meetup.png | Bin 0 -> 81640 bytes
112 files changed, 5503 insertions(+), 3150 deletions(-)
----------------------------------------------------------------------
[40/50] [abbrv] incubator-trafodion git commit: More changes from
MY_SQROOT to TRAF_HOME.
Posted by su...@apache.org.
More changes from MY_SQROOT to TRAF_HOME.
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/5aa87996
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/5aa87996
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/5aa87996
Branch: refs/heads/master
Commit: 5aa87996c8748bc15932d0bfb13d63eb73dad05a
Parents: 145cd9b
Author: Zalo Correa <za...@esgyn.com>
Authored: Wed Apr 5 13:20:59 2017 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Wed Apr 5 13:20:59 2017 -0700
----------------------------------------------------------------------
core/sqf/monitor/linux/sqliteconfig.cxx | 2 +-
core/sqf/sql/scripts/gensq.pl | 2 +-
core/sqf/sql/scripts/sqregen | 4 ++--
core/sqf/src/seabed/test/gocleandb | 2 +-
core/sqf/src/seabed/test/godb | 2 +-
5 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5aa87996/core/sqf/monitor/linux/sqliteconfig.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/sqliteconfig.cxx b/core/sqf/monitor/linux/sqliteconfig.cxx
index ecae848..f69e402 100644
--- a/core/sqf/monitor/linux/sqliteconfig.cxx
+++ b/core/sqf/monitor/linux/sqliteconfig.cxx
@@ -780,7 +780,7 @@ int CSqliteConfig::Initialize( void )
else
{
snprintf( dbase, sizeof(dbase)
- , "%s/sql/scripts/sqconfig.db", getenv("MY_SQROOT"));
+ , "%s/sql/scripts/sqconfig.db", getenv("TRAF_HOME"));
}
int rc = sqlite3_open_v2( dbase, &db_
, SQLITE_OPEN_READWRITE | SQLITE_OPEN_FULLMUTEX
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5aa87996/core/sqf/sql/scripts/gensq.pl
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/gensq.pl b/core/sqf/sql/scripts/gensq.pl
index 346236d..ffeddaf 100755
--- a/core/sqf/sql/scripts/gensq.pl
+++ b/core/sqf/sql/scripts/gensq.pl
@@ -246,7 +246,7 @@ sub printInitialLines {
printScript(1, "set MY_NODES=\$MY_NODES\n");
sqconfigdb::addDbClusterData( "SQ_MBTYPE", $ENV{'SQ_MBTYPE'});
- sqconfigdb::addDbClusterData( "MY_SQROOT", "$SQ_ROOT"); # comes out null
+ sqconfigdb::addDbClusterData( "TRAF_HOME", "$TRAF_HOME"); # comes out null
genSQShellExit();
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5aa87996/core/sqf/sql/scripts/sqregen
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/sqregen b/core/sqf/sql/scripts/sqregen
index c5a6921..3996bc9 100755
--- a/core/sqf/sql/scripts/sqregen
+++ b/core/sqf/sql/scripts/sqregen
@@ -27,14 +27,14 @@ SQCONFIG_FILE=sqconfig
function Usage {
script_name=`/bin/basename $0`
echo
- echo $script_name regenerates the Trafodion configuration file in the $MY_SQROOT/sql/scripts directory.
+ echo $script_name regenerates the Trafodion configuration file in the $TRAF_HOME/sql/scripts directory.
echo
echo "Usage: $script_name [-? | -h ] | { -config } [ <sqconfig_filename> ]"
echo " -? Help"
echo " -h Help"
echo " -config Regenerate the Trafodion configuration file ($SQCONFIG_FILE)"
echo " <sqconfig_filename> Name of the Trafodion configuration file"
- echo " in $MY_SQROOT/sql/scripts directory (defaults to 'sqconfig')"
+ echo " in $TRAF_HOME/sql/scripts directory (defaults to 'sqconfig')"
echo
exit 1;
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5aa87996/core/sqf/src/seabed/test/gocleandb
----------------------------------------------------------------------
diff --git a/core/sqf/src/seabed/test/gocleandb b/core/sqf/src/seabed/test/gocleandb
index 0e00ba6..a7adb65 100755
--- a/core/sqf/src/seabed/test/gocleandb
+++ b/core/sqf/src/seabed/test/gocleandb
@@ -22,4 +22,4 @@
# @@@ END COPYRIGHT @@@
rm -f sqconfig.db
-sqlite3 sqconfig.db < $MY_SQROOT/sql/scripts/createConfigDb
+sqlite3 sqconfig.db < $TRAF_HOME/sql/scripts/createConfigDb
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5aa87996/core/sqf/src/seabed/test/godb
----------------------------------------------------------------------
diff --git a/core/sqf/src/seabed/test/godb b/core/sqf/src/seabed/test/godb
index bf7c345..33ea172 100755
--- a/core/sqf/src/seabed/test/godb
+++ b/core/sqf/src/seabed/test/godb
@@ -20,6 +20,6 @@
#
# @@@ END COPYRIGHT @@@
-export PERL5LIB=$PERL5LIB:$MY_SQROOT/sql/scripts
+export PERL5LIB=$PERL5LIB:$TRAF_HOME/sql/scripts
./gocleandb
./godb.pl $*
[14/50] [abbrv] incubator-trafodion git commit: Merge branch
'TRAFODION-2001' of github.com:zcorrea/incubator-trafodion into
TRAFODION-2001
Posted by su...@apache.org.
Merge branch 'TRAFODION-2001' of github.com:zcorrea/incubator-trafodion into TRAFODION-2001
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/a8a68a1a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/a8a68a1a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/a8a68a1a
Branch: refs/heads/master
Commit: a8a68a1ab6b4c0ed7675179e7878297a0e4c8bd8
Parents: ccd0b90 a7b3b8d
Author: Zalo Correa <za...@esgyn.com>
Authored: Tue Aug 23 10:48:29 2016 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Tue Aug 23 10:48:29 2016 -0700
----------------------------------------------------------------------
install/installer/addNode_step2 | 15 +++-
install/installer/trafodion_config_default | 93 +++++++++++--------------
2 files changed, 56 insertions(+), 52 deletions(-)
----------------------------------------------------------------------
[09/50] [abbrv] incubator-trafodion git commit: Merge branch
'TRAFODION-2001' of github.com:zcorrea/incubator-trafodion into
TRAFODION-2001
Posted by su...@apache.org.
Merge branch 'TRAFODION-2001' of github.com:zcorrea/incubator-trafodion into TRAFODION-2001
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/7432ad5d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/7432ad5d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/7432ad5d
Branch: refs/heads/master
Commit: 7432ad5d0ec187a3aea4de1f3a7c18bacadf9665
Parents: bcda47c d96e648
Author: Zalo Correa <za...@esgyn.com>
Authored: Thu Aug 11 15:39:30 2016 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Thu Aug 11 15:39:30 2016 -0700
----------------------------------------------------------------------
install/installer/addNode_step1 | 22 ++++++++++++----------
install/installer/addNode_step2 | 4 ++--
2 files changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
[37/50] [abbrv] incubator-trafodion git commit: Trafodion
configuration API changes - new library files
Posted by su...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/fd1c115f/core/sqf/monitor/linux/sqliteconfig.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/sqliteconfig.cxx b/core/sqf/monitor/linux/sqliteconfig.cxx
new file mode 100644
index 0000000..ecae848
--- /dev/null
+++ b/core/sqf/monitor/linux/sqliteconfig.cxx
@@ -0,0 +1,3136 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#include <string>
+#include <stdlib.h>
+#include <string.h>
+
+using namespace std;
+
+#include "trafconfig.h"
+#include "trafconfiglog.h"
+#include "trafconfigtrace.h"
+#include "sqliteconfig.h"
+
+///////////////////////////////////////////////////////////////////////////////
+// Cluster Configuration
+///////////////////////////////////////////////////////////////////////////////
+
+CSqliteConfig::CSqliteConfig( void )
+ : db_(NULL)
+{
+ const char method_name[] = "CSqliteConfig::CSqliteConfig";
+ TRACE_ENTRY;
+
+ TRACE_EXIT;
+}
+
+CSqliteConfig::~CSqliteConfig ( void )
+{
+ const char method_name[] = "CSqliteConfig::~CSqliteConfig";
+ TRACE_ENTRY;
+
+ TRACE_EXIT;
+}
+
+// insert key into monRegKeyName table
+int CSqliteConfig::AddRegistryKey( const char *key )
+{
+ const char method_name[] = "CSqliteConfig::AddRegistryKey";
+ TRACE_ENTRY;
+
+ if ( !IsInitialized() )
+ {
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST | TC_TRACE_INIT))
+ {
+ trace_printf( "%s@%d Database is not initialized for access!\n"
+ , method_name, __LINE__);
+ }
+ TRACE_EXIT;
+ return( TCNOTINIT );
+ }
+
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST))
+ {
+ trace_printf("%s@%d inserting key=%s into monRegKeyName\n",
+ method_name, __LINE__, key);
+ }
+
+ int rc;
+ const char * sqlStmt;
+ sqlStmt = "insert into monRegKeyName (keyName) values ( :key );";
+ sqlite3_stmt * prepStmt;
+ rc = sqlite3_prepare_v2( db_, sqlStmt, strlen(sqlStmt)+1, &prepStmt,
+ NULL);
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] prepare (%s) failed, error: %s\n"
+ , method_name, sqlStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ else
+ {
+ rc = sqlite3_bind_text( prepStmt,
+ sqlite3_bind_parameter_index( prepStmt, ":key" ),
+ key, -1, SQLITE_STATIC );
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] sqlite3_bind_text(:key) failed, error: %s\n"
+ , method_name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+
+ rc = sqlite3_step( prepStmt );
+ if (( rc != SQLITE_DONE ) && ( rc != SQLITE_ROW )
+ && ( rc != SQLITE_CONSTRAINT ) )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] (%s) failed, key=%s, error: %s\n"
+ , method_name, sqlStmt, key, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ }
+
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
+
+ TRACE_EXIT;
+ return( TCSUCCESS );
+}
+
+// insert key into monRegProcName table
+int CSqliteConfig::AddRegistryProcess( const char *name )
+{
+ const char method_name[] = "CSqliteConfig::AddRegistryProcess";
+ TRACE_ENTRY;
+
+ if ( !IsInitialized() )
+ {
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST | TC_TRACE_INIT))
+ {
+ trace_printf( "%s@%d Database is not initialized for access!\n"
+ , method_name, __LINE__);
+ }
+ TRACE_EXIT;
+ return( TCNOTINIT );
+ }
+
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST))
+ {
+ trace_printf("%s@%d inserting name=%s into monRegProcName\n",
+ method_name, __LINE__, name);
+ }
+
+ int rc;
+ const char * sqlStmt;
+ sqlStmt = "insert into monRegProcName (procName) values ( :name );";
+ sqlite3_stmt * prepStmt;
+ rc = sqlite3_prepare_v2( db_, sqlStmt, strlen(sqlStmt)+1, &prepStmt,
+ NULL);
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] prepare (%s) failed, error: %s\n"
+ , method_name, sqlStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ else
+ {
+ rc = sqlite3_bind_text( prepStmt,
+ sqlite3_bind_parameter_index( prepStmt, ":name" ),
+ name, -1, SQLITE_STATIC );
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] sqlite3_bind_text(:name) failed, error: %s\n"
+ , method_name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+
+ rc = sqlite3_step( prepStmt );
+ if (( rc != SQLITE_DONE ) && ( rc != SQLITE_ROW )
+ && ( rc != SQLITE_CONSTRAINT ) )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] (%s) failed, name=%s, error: %s\n"
+ , method_name, sqlStmt, name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ }
+
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
+
+ TRACE_EXIT;
+ return( TCSUCCESS );
+}
+
+int CSqliteConfig::AddRegistryClusterData( const char *key
+ , const char *dataValue )
+{
+ const char method_name[] = "CSqliteConfig::AddRegistryClusterData";
+ TRACE_ENTRY;
+
+ if ( !IsInitialized() )
+ {
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST | TC_TRACE_INIT))
+ {
+ trace_printf( "%s@%d Database is not initialized for access!\n"
+ , method_name, __LINE__);
+ }
+ TRACE_EXIT;
+ return( TCNOTINIT );
+ }
+
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST))
+ {
+ trace_printf("%s@%d inserting key=%s into monRegClusterData\n",
+ method_name, __LINE__, key);
+ }
+
+ int rc;
+ const char * sqlStmt;
+ sqlStmt = "insert or replace into monRegClusterData (dataValue, keyId)"
+ " select :dataValue,"
+ " k.keyId FROM monRegKeyName k"
+ " where k.keyName = :key";
+ sqlite3_stmt * prepStmt;
+ rc = sqlite3_prepare_v2( db_, sqlStmt, strlen(sqlStmt)+1, &prepStmt,
+ NULL);
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] prepare (%s) failed, error: %s\n"
+ , method_name, sqlStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ else
+ {
+ rc = sqlite3_bind_text( prepStmt,
+ sqlite3_bind_parameter_index( prepStmt,
+ ":dataValue" ),
+ dataValue, -1, SQLITE_STATIC );
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] sqlite3_bind_text(:dataValue) failed, error: %s\n"
+ , method_name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ rc = sqlite3_bind_text( prepStmt,
+ sqlite3_bind_parameter_index( prepStmt, ":key" ),
+ key, -1, SQLITE_STATIC );
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] sqlite3_bind_text(:key) failed, error: %s\n"
+ , method_name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+
+ rc = sqlite3_step( prepStmt );
+ if (( rc != SQLITE_DONE ) && ( rc != SQLITE_ROW )
+ && ( rc != SQLITE_CONSTRAINT ) )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] (%s) failed, key=%s, error: %s\n"
+ , method_name, sqlStmt, key, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ }
+
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
+
+ TRACE_EXIT;
+ return( TCSUCCESS );
+}
+
+int CSqliteConfig::AddRegistryProcessData( const char *procName
+ , const char *key
+ , const char *dataValue )
+{
+ const char method_name[] = "CSqliteConfig::AddRegistryProcessData";
+ TRACE_ENTRY;
+
+ if ( !IsInitialized() )
+ {
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST | TC_TRACE_INIT))
+ {
+ trace_printf( "%s@%d Database is not initialized for access!\n"
+ , method_name, __LINE__);
+ }
+ TRACE_EXIT;
+ return( TCNOTINIT );
+ }
+
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST))
+ {
+ trace_printf("%s@%d inserting key=%s into monRegProcData for "
+ "proc=%s\n", method_name, __LINE__, key, procName);
+ }
+
+ int rc;
+ const char * sqlStmt;
+ sqlStmt = "insert or replace into monRegProcData (dataValue, procId, keyId )"
+ " select :dataValue,"
+ " p.procId,"
+ " (SELECT k.keyId "
+ " FROM monRegKeyName k"
+ " WHERE k.keyName = :key)"
+ " FROM monRegProcName p"
+ " WHERE UPPER(p.procName) = UPPER(:procName)";
+
+ sqlite3_stmt * prepStmt;
+ rc = sqlite3_prepare_v2( db_, sqlStmt, strlen(sqlStmt)+1, &prepStmt,
+ NULL);
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] prepare (%s) failed, error: %s\n"
+ , method_name, sqlStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ else
+ {
+ rc = sqlite3_bind_text( prepStmt,
+ sqlite3_bind_parameter_index( prepStmt,
+ ":procName" ),
+ procName, -1, SQLITE_STATIC );
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] sqlite3_bind_text(:procName) failed, error: %s\n"
+ , method_name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ rc = sqlite3_bind_text( prepStmt,
+ sqlite3_bind_parameter_index( prepStmt,
+ ":dataValue" ),
+ dataValue, -1, SQLITE_STATIC );
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] sqlite3_bind_text(:dataValue) failed, error: %s\n"
+ , method_name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ rc = sqlite3_bind_text( prepStmt,
+ sqlite3_bind_parameter_index( prepStmt, ":key" ),
+ key, -1, SQLITE_STATIC );
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] sqlite3_bind_text(:key) failed, error: %s\n"
+ , method_name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+
+ rc = sqlite3_step( prepStmt );
+ if (( rc != SQLITE_DONE ) && ( rc != SQLITE_ROW )
+ && ( rc != SQLITE_CONSTRAINT ) )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] (%s) failed, key=%s, proc=%s, error: %s\n"
+ , method_name, sqlStmt, key, procName, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ }
+
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
+
+ TRACE_EXIT;
+ return( TCSUCCESS );
+}
+
+int CSqliteConfig::AddUniqueString( int nid
+ , int id
+ , const char *uniqStr )
+{
+ const char method_name[] = "CSqliteConfig::AddUniqueString";
+ TRACE_ENTRY;
+
+ if ( !IsInitialized() )
+ {
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST | TC_TRACE_INIT))
+ {
+ trace_printf( "%s@%d Database is not initialized for access!\n"
+ , method_name, __LINE__);
+ }
+ TRACE_EXIT;
+ return( TCNOTINIT );
+ }
+
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST))
+ {
+ trace_printf("%s@%d inserting unique string nid=%d id=%d into "
+ "monRegUniqueStrings\n", method_name, __LINE__,
+ nid, id);
+ }
+
+ int rc;
+ const char * sqlStmt;
+ sqlStmt = "insert or replace into monRegUniqueStrings values (?, ?, ?)";
+
+ sqlite3_stmt * prepStmt;
+ rc = sqlite3_prepare_v2( db_, sqlStmt, strlen(sqlStmt)+1, &prepStmt,
+ NULL);
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] prepare (%s) failed, error: %s\n"
+ , method_name, sqlStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ else
+ {
+ rc = sqlite3_bind_int( prepStmt, 1, nid );
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf),
+ "[%s] sqlite3_bind_int(nid) failed, error: %s\n"
+ , method_name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ rc = sqlite3_bind_int( prepStmt, 2, id );
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf),
+ "[%s] sqlite3_bind_int(id) failed, error: %s\n"
+ , method_name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ rc = sqlite3_bind_text( prepStmt, 3, uniqStr, -1, SQLITE_STATIC );
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] sqlite3_bind_text(uniqStr) failed, error: %s\n"
+ , method_name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+
+ rc = sqlite3_step( prepStmt );
+ if ( rc != SQLITE_DONE )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] (%s) failed, nid=%d, id=%d, error: %s\n"
+ , method_name, sqlStmt, nid, id, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ }
+
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
+
+ TRACE_EXIT;
+ return( TCSUCCESS );
+}
+
+int CSqliteConfig::Close( void )
+{
+ const char method_name[] = "CSqliteConfig::Close";
+ TRACE_ENTRY;
+
+ if ( !IsInitialized() )
+ {
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST | TC_TRACE_INIT))
+ {
+ trace_printf( "%s@%d Database is not initialized for access!\n"
+ , method_name, __LINE__);
+ }
+ TRACE_EXIT;
+ return( TCNOTINIT );
+ }
+
+ int rc = sqlite3_close( db_ );
+ if ( rc == SQLITE_OK)
+ {
+ db_ = NULL;
+ }
+ else
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] sqlite3_close() error: %s\n"
+ , method_name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+
+ TRACE_EXIT;
+ return( TCSUCCESS );
+}
+
+int CSqliteConfig::DeleteNodeData( int pnid )
+{
+ const char method_name[] = "CSqliteConfig::DeleteNodeData";
+ TRACE_ENTRY;
+
+ if ( !IsInitialized() )
+ {
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST | TC_TRACE_INIT))
+ {
+ trace_printf( "%s@%d Database is not initialized for access!\n"
+ , method_name, __LINE__);
+ }
+ TRACE_EXIT;
+ return( TCNOTINIT );
+ }
+
+ if (TcTraceSettings & (TC_TRACE_NODE | TC_TRACE_REQUEST))
+ {
+ trace_printf( "%s@%d delete from lnode, pnode values (pNid=%d)\n"
+ , method_name, __LINE__
+ , pnid );
+ }
+
+ int rc;
+
+ const char *sqlStmt1;
+ sqlStmt1 = "delete from lnode where lnode.pNid = ?";
+
+ sqlite3_stmt *prepStmt1 = NULL;
+ rc = sqlite3_prepare_v2( db_, sqlStmt1, strlen(sqlStmt1)+1, &prepStmt1, NULL);
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] prepare (%s) failed, error=%s\n"
+ , method_name, sqlStmt1, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ else
+ {
+ rc = sqlite3_bind_int( prepStmt1, 1, pnid );
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf),
+ "[%s] sqlite3_bind_int(pnid) failed, error: %s\n"
+ , method_name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+
+ rc = sqlite3_step( prepStmt1 );
+ if (( rc != SQLITE_DONE ) && ( rc != SQLITE_ROW )
+ && ( rc != SQLITE_CONSTRAINT ) )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] (%s) failed, pNid=%d, error: %s\n"
+ , method_name, sqlStmt1, pnid, sqlite3_errmsg(db_));
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ }
+
+ const char *sqlStmt2;
+ sqlStmt2 = "delete from pnode where pnode.pNid = ?";
+
+ sqlite3_stmt *prepStmt2 = NULL;
+ rc = sqlite3_prepare_v2( db_, sqlStmt2, strlen(sqlStmt2)+1, &prepStmt2, NULL);
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] prepare (%s) failed, error=%s\n"
+ , method_name, sqlStmt2, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ else
+ {
+ rc = sqlite3_bind_int( prepStmt2, 1, pnid );
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf),
+ "[%s] sqlite3_bind_int(pnid) failed, error: %s\n"
+ , method_name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+
+ rc = sqlite3_step( prepStmt2 );
+ if (( rc != SQLITE_DONE ) && ( rc != SQLITE_ROW )
+ && ( rc != SQLITE_CONSTRAINT ) )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] (%s) failed, pNid=%d, error: %s\n"
+ , method_name, sqlStmt2, pnid, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ }
+
+ if ( prepStmt1 != NULL )
+ {
+ sqlite3_finalize( prepStmt1 );
+ }
+ if ( prepStmt2 != NULL )
+ {
+ sqlite3_finalize( prepStmt2 );
+ }
+
+ TRACE_EXIT;
+ return( TCSUCCESS );
+}
+
+int CSqliteConfig::DeleteUniqueString( int nid )
+{
+ const char method_name[] = "CSqliteConfig::DeleteUniqueString";
+ TRACE_ENTRY;
+
+ if ( !IsInitialized() )
+ {
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST | TC_TRACE_INIT))
+ {
+ trace_printf( "%s@%d Database is not initialized for access!\n"
+ , method_name, __LINE__);
+ }
+ TRACE_EXIT;
+ return( TCNOTINIT );
+ }
+
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST))
+ {
+ trace_printf( "%s@%d delete from monRegUniqueStrings values (nid=%d)\n"
+ , method_name, __LINE__
+ , nid );
+ }
+
+ int rc;
+
+ const char *sqlStmtA;
+ sqlStmtA = "delete from monRegUniqueStrings where monRegUniqueStrings.nid = ?";
+
+ sqlite3_stmt *prepStmtA = NULL;
+ rc = sqlite3_prepare_v2( db_, sqlStmtA, strlen(sqlStmtA)+1, &prepStmtA, NULL);
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] prepare (%s) failed, error=%s\n"
+ , method_name, sqlStmtA, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ else
+ {
+ rc = sqlite3_bind_int( prepStmtA, 1, nid );
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf),
+ "[%s] sqlite3_bind_int(nid) failed, error: %s\n"
+ , method_name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+
+ rc = sqlite3_step( prepStmtA );
+ if (( rc != SQLITE_DONE ) && ( rc != SQLITE_ROW )
+ && ( rc != SQLITE_CONSTRAINT ) )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] (%s) failed, pNid=%d, error: %s\n"
+ , method_name, sqlStmtA, nid, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ }
+
+ if ( prepStmtA != NULL )
+ {
+ sqlite3_finalize( prepStmtA );
+ }
+
+ TRACE_EXIT;
+ return( TCSUCCESS );
+}
+
+int CSqliteConfig::Initialize( void )
+{
+ const char method_name[] = "CSqliteConfig::Initialize";
+ TRACE_ENTRY;
+
+ if ( IsInitialized() )
+ {
+ // Already initialized
+ return( TCALREADYINIT );
+ }
+
+ char dbase[MAX_PROCESS_PATH];
+
+ // Open the configuration database file
+ char *configenv = getenv("SQ_CONFIGDB");
+ if (configenv != NULL)
+ {
+ snprintf( dbase, sizeof(dbase), "%s", configenv);
+ }
+ else
+ {
+ snprintf( dbase, sizeof(dbase)
+ , "%s/sql/scripts/sqconfig.db", getenv("MY_SQROOT"));
+ }
+ int rc = sqlite3_open_v2( dbase, &db_
+ , SQLITE_OPEN_READWRITE | SQLITE_OPEN_FULLMUTEX
+ , NULL);
+ if ( rc )
+ {
+ db_ = NULL;
+
+ // See if database is in current directory
+ int rc2 = sqlite3_open_v2( "sqconfig.db", &db_
+ , SQLITE_OPEN_READWRITE | SQLITE_OPEN_FULLMUTEX
+ , NULL);
+ if ( rc2 )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s], sqlite3_open_v2(%s) failed, error: %s\n"
+ , method_name, dbase, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ }
+
+ if ( db_ != NULL )
+ {
+ rc = sqlite3_busy_timeout(db_, 1000);
+ if ( rc )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s], sqlite3_busy_timeout(%s) failed, error: %s\n"
+ , method_name, dbase, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+
+ char *sErrMsg = NULL;
+ sqlite3_exec(db_, "PRAGMA synchronous = OFF", NULL, NULL, &sErrMsg);
+ if (sErrMsg != NULL)
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s], sqlite3_exec(PRAGMA synchronous = OFF) failed, error: %s\n"
+ , method_name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ }
+
+ TRACE_EXIT;
+ return( TCSUCCESS );
+}
+
+int CSqliteConfig::GetNode( int nid
+ , node_configuration_t &nodeConfig )
+{
+ const char method_name[] = "CSqliteConfig::GetNode";
+ TRACE_ENTRY;
+
+ if ( !IsInitialized() )
+ {
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST | TC_TRACE_INIT))
+ {
+ trace_printf( "%s@%d Database is not initialized for access!\n"
+ , method_name, __LINE__);
+ }
+ TRACE_EXIT;
+ return( TCNOTINIT );
+ }
+
+ int rc;
+ int firstcore = -1;
+ int lastcore = -1;
+ int excfirstcore = -1;
+ int exclastcore = -1;
+ int lnid = -1;
+ int pnid = -1;
+ int processors = 0;
+ int roles;
+ const char *nodename = NULL;
+ const char *sqlStmt;
+ sqlite3_stmt *prepStmt = NULL;
+
+ // Prepare select logical nodes
+ sqlStmt = "select p.pNid, l.lNid, p.nodeName, l.firstCore, l.lastCore,"
+ " p.excFirstCore, p.excLastCore, l.processors, l.roles"
+ " from pnode p, lnode l where p.pNid = l.pNid"
+ " and l.nid = ?";
+
+ rc = sqlite3_prepare_v2( db_
+ , sqlStmt
+ , strlen(sqlStmt)+1
+ , &prepStmt
+ , NULL);
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] prepare (%s) failed, error: %s\n"
+ , method_name, sqlStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ else
+ { // Set nid in prepared statement
+ rc = sqlite3_bind_int(prepStmt, 1, nid );
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf),
+ "[%s] sqlite3_bind_int(nid) failed, error: %s\n"
+ , method_name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ }
+
+ rc = sqlite3_step( prepStmt );
+ if ( rc == SQLITE_ROW )
+ { // Process row
+ int colCount = sqlite3_column_count(prepStmt);
+ if ( TcTraceSettings & (TC_TRACE_NODE | TC_TRACE_REQUEST) )
+ {
+ trace_printf("%s@%d sqlite3_column_count=%d\n",
+ method_name, __LINE__, colCount);
+ for (int i=0; i<colCount; ++i)
+ {
+ trace_printf("%s@%d column %d is %s\n",
+ method_name, __LINE__, i,
+ sqlite3_column_name(prepStmt, i));
+ }
+ }
+
+ pnid = sqlite3_column_int(prepStmt, 0);
+ lnid = sqlite3_column_int(prepStmt, 1);
+ nodename = (const char *) sqlite3_column_text(prepStmt, 2);
+ firstcore = sqlite3_column_int(prepStmt, 3);
+ lastcore = sqlite3_column_int(prepStmt, 4);
+ excfirstcore = sqlite3_column_int(prepStmt, 5);
+ exclastcore = sqlite3_column_int(prepStmt, 6);
+ processors = sqlite3_column_int(prepStmt, 7);
+ roles = sqlite3_column_int(prepStmt, 8);
+ SetLNodeData( lnid
+ , pnid
+ , nodename
+ , excfirstcore
+ , exclastcore
+ , firstcore
+ , lastcore
+ , processors
+ , roles
+ , nodeConfig );
+ }
+ else if ( rc == SQLITE_DONE )
+ {
+ // Destroy prepared statement object
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
+
+ if ( TcTraceSettings & (TC_TRACE_NODE | TC_TRACE_REQUEST) )
+ {
+ trace_printf("%s@%d Finished processing logical nodes.\n",
+ method_name, __LINE__);
+ }
+ return( TCDBNOEXIST );
+ }
+ else
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] (%s) failed, error: %s\n"
+ , method_name, sqlStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+
+ // Destroy prepared statement object
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
+
+ TRACE_EXIT;
+ return( TCSUCCESS );
+}
+
+int CSqliteConfig::GetNode( const char *name
+ , node_configuration_t &nodeConfig )
+{
+ const char method_name[] = "CSqliteConfig::GetNode";
+ TRACE_ENTRY;
+
+ if ( !IsInitialized() )
+ {
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST | TC_TRACE_INIT))
+ {
+ trace_printf( "%s@%d Database is not initialized for access!\n"
+ , method_name, __LINE__);
+ }
+ TRACE_EXIT;
+ return( TCNOTINIT );
+ }
+
+ int rc;
+ int firstcore = -1;
+ int lastcore = -1;
+ int excfirstcore = -1;
+ int exclastcore = -1;
+ int nid = -1;
+ int pnid = -1;
+ int processors = 0;
+ int roles;
+ const char *nodename = NULL;
+ const char *sqlStmt;
+ sqlite3_stmt *prepStmt = NULL;
+
+ // Prepare select logical nodes
+ sqlStmt = "select p.pNid, l.lNid, p.nodeName, l.firstCore, l.lastCore,"
+ " p.excFirstCore, p.excLastCore, l.processors, l.roles"
+ " from pnode p, lnode l where p.pNid = l.pNid"
+ " and p.nodeName = ?";
+
+ rc = sqlite3_prepare_v2( db_
+ , sqlStmt
+ , strlen(sqlStmt)+1
+ , &prepStmt
+ , NULL);
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] prepare (%s) failed, error: %s\n"
+ , method_name, sqlStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ else
+ { // Set name in prepared statement
+ rc = sqlite3_bind_text( prepStmt, 1, name, -1, SQLITE_STATIC );
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] sqlite3_bind_text(name) failed, error: %s\n"
+ , method_name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ }
+
+ rc = sqlite3_step( prepStmt );
+ if ( rc == SQLITE_ROW )
+ { // Process row
+ int colCount = sqlite3_column_count(prepStmt);
+ if ( TcTraceSettings & (TC_TRACE_NODE | TC_TRACE_REQUEST) )
+ {
+ trace_printf("%s@%d sqlite3_column_count=%d\n",
+ method_name, __LINE__, colCount);
+ for (int i=0; i<colCount; ++i)
+ {
+ trace_printf("%s@%d column %d is %s\n",
+ method_name, __LINE__, i,
+ sqlite3_column_name(prepStmt, i));
+ }
+ }
+
+ pnid = sqlite3_column_int(prepStmt, 0);
+ nid = sqlite3_column_int(prepStmt, 1);
+ nodename = (const char *) sqlite3_column_text(prepStmt, 2);
+ firstcore = sqlite3_column_int(prepStmt, 3);
+ lastcore = sqlite3_column_int(prepStmt, 4);
+ excfirstcore = sqlite3_column_int(prepStmt, 5);
+ exclastcore = sqlite3_column_int(prepStmt, 6);
+ processors = sqlite3_column_int(prepStmt, 7);
+ roles = sqlite3_column_int(prepStmt, 8);
+ SetLNodeData( nid
+ , pnid
+ , nodename
+ , excfirstcore
+ , exclastcore
+ , firstcore
+ , lastcore
+ , processors
+ , roles
+ , nodeConfig );
+ }
+ else if ( rc == SQLITE_DONE )
+ {
+ // Destroy prepared statement object
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
+
+ if ( TcTraceSettings & (TC_TRACE_NODE | TC_TRACE_REQUEST) )
+ {
+ trace_printf("%s@%d Finished processing logical nodes.\n",
+ method_name, __LINE__);
+ }
+
+ return( TCDBNOEXIST );
+ }
+ else
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] (%s) failed, error: %s\n"
+ , method_name, sqlStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+
+ // Destroy prepared statement object
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
+
+ TRACE_EXIT;
+ return( TCSUCCESS );
+}
+
+int CSqliteConfig::GetNodes( int &count
+ , int max
+ , node_configuration_t nodeConfig[] )
+{
+ const char method_name[] = "CSqliteConfig::GetNodes";
+ TRACE_ENTRY;
+
+ if ( !IsInitialized() )
+ {
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST | TC_TRACE_INIT))
+ {
+ trace_printf( "%s@%d Database is not initialized for access!\n"
+ , method_name, __LINE__);
+ }
+ TRACE_EXIT;
+ return( TCNOTINIT );
+ }
+
+ int rc;
+ int firstcore = -1;
+ int lastcore = -1;
+ int excfirstcore = -1;
+ int exclastcore = -1;
+ int nid = -1;
+ int pnid = -1;
+ int processors = 0;
+ int roles;
+ int nodeCount = 0;
+ const char *nodename = NULL;
+ const char *sqlStmt;
+ sqlite3_stmt *prepStmt = NULL;
+
+ // Prepare select logical nodes
+ sqlStmt = "select p.pNid, l.lNid, p.nodeName, l.firstCore, l.lastCore,"
+ " p.excFirstCore, p.excLastCore, l.processors, l.roles"
+ " from pnode p, lnode l where p.pNid = l.pNid";
+
+ rc = sqlite3_prepare_v2( db_
+ , sqlStmt
+ , strlen(sqlStmt)+1
+ , &prepStmt
+ , NULL);
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] prepare (%s) failed, error: %s\n"
+ , method_name, sqlStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+
+ // Process logical nodes
+ while ( 1 )
+ {
+ rc = sqlite3_step( prepStmt );
+ if ( rc == SQLITE_ROW )
+ { // Process row
+ if ( max == 0 )
+ {
+ nodeCount++;
+ continue;
+ }
+
+ int colCount = sqlite3_column_count(prepStmt);
+ if ( TcTraceSettings & (TC_TRACE_NODE | TC_TRACE_REQUEST) )
+ {
+ trace_printf("%s@%d sqlite3_column_count=%d\n",
+ method_name, __LINE__, colCount);
+ for (int i=0; i<colCount; ++i)
+ {
+ trace_printf("%s@%d column %d is %s\n",
+ method_name, __LINE__, i,
+ sqlite3_column_name(prepStmt, i));
+ }
+ }
+
+ if ( nodeCount < max )
+ {
+ pnid = sqlite3_column_int(prepStmt, 0);
+ nid = sqlite3_column_int(prepStmt, 1);
+ nodename = (const char *) sqlite3_column_text(prepStmt, 2);
+ firstcore = sqlite3_column_int(prepStmt, 3);
+ lastcore = sqlite3_column_int(prepStmt, 4);
+ excfirstcore = sqlite3_column_int(prepStmt, 5);
+ exclastcore = sqlite3_column_int(prepStmt, 6);
+ processors = sqlite3_column_int(prepStmt, 7);
+ roles = sqlite3_column_int(prepStmt, 8);
+ SetLNodeData( nid
+ , pnid
+ , nodename
+ , excfirstcore
+ , exclastcore
+ , firstcore
+ , lastcore
+ , processors
+ , roles
+ , nodeConfig[nodeCount] );
+ nodeCount++;
+ }
+ else
+ {
+ count = nodeCount;
+ // Destroy prepared statement object
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
+ return( TCDBTRUNCATE );
+ }
+ }
+ else if ( rc == SQLITE_DONE )
+ {
+ count = nodeCount;
+ // Destroy prepared statement object
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
+
+ if ( TcTraceSettings & (TC_TRACE_NODE | TC_TRACE_REQUEST) )
+ {
+ trace_printf("%s@%d Finished processing logical nodes.\n",
+ method_name, __LINE__);
+ }
+
+ break;
+ }
+ else
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] (%s) failed, error: %s\n"
+ , method_name, sqlStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ }
+
+ TRACE_EXIT;
+ return( TCSUCCESS );
+}
+
+int CSqliteConfig::GetPNode( int pNid
+ , physical_node_configuration_t &pnodeConfig )
+{
+ const char method_name[] = "CSqliteConfig::GetPNode";
+ TRACE_ENTRY;
+
+ if ( !IsInitialized() )
+ {
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST | TC_TRACE_INIT))
+ {
+ trace_printf( "%s@%d Database is not initialized for access!\n"
+ , method_name, __LINE__);
+ }
+ TRACE_EXIT;
+ return( TCNOTINIT );
+ }
+
+ int rc;
+ int excfirstcore = -1;
+ int exclastcore = -1;
+ int pnid = -1;
+ const char *nodename = NULL;
+ const char *sqlStmt;
+ sqlite3_stmt *prepStmt = NULL;
+
+ // Prepare select logical nodes
+ sqlStmt = "select p.pNid, p.nodeName, p.excFirstCore, p.excLastCore"
+ " from pnode p where p.pNid = ?";
+
+ rc = sqlite3_prepare_v2( db_
+ , sqlStmt
+ , strlen(sqlStmt)+1
+ , &prepStmt
+ , NULL);
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] prepare (%s) failed, error: %s\n"
+ , method_name, sqlStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ else
+ { // Set nid in prepared statement
+ rc = sqlite3_bind_int(prepStmt, 1, pNid );
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf),
+ "[%s] sqlite3_bind_int(pNid) failed, error: %s\n"
+ , method_name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ }
+
+ rc = sqlite3_step( prepStmt );
+ if ( rc == SQLITE_ROW )
+ { // Process row
+ int colCount = sqlite3_column_count(prepStmt);
+ if ( TcTraceSettings & (TC_TRACE_NODE | TC_TRACE_REQUEST) )
+ {
+ trace_printf("%s@%d sqlite3_column_count=%d\n",
+ method_name, __LINE__, colCount);
+ for (int i=0; i<colCount; ++i)
+ {
+ trace_printf("%s@%d column %d is %s\n",
+ method_name, __LINE__, i,
+ sqlite3_column_name(prepStmt, i));
+ }
+ }
+
+ pnid = sqlite3_column_int(prepStmt, 0);
+ nodename = (const char *) sqlite3_column_text(prepStmt, 1);
+ excfirstcore = sqlite3_column_int(prepStmt, 2);
+ exclastcore = sqlite3_column_int(prepStmt, 3);
+ SetPNodeData( pnid
+ , nodename
+ , excfirstcore
+ , exclastcore
+ , pnodeConfig );
+ }
+ else if ( rc == SQLITE_DONE )
+ {
+ // Destroy prepared statement object
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
+
+ if ( TcTraceSettings & (TC_TRACE_NODE | TC_TRACE_REQUEST) )
+ {
+ trace_printf("%s@%d Finished processing logical nodes.\n",
+ method_name, __LINE__);
+ }
+ }
+ else
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] (%s) failed, error: %s\n"
+ , method_name, sqlStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+
+ TRACE_EXIT;
+ return( TCSUCCESS );
+}
+
+int CSqliteConfig::GetPNode( const char *name
+ , physical_node_configuration_t &pnodeConfig )
+{
+ const char method_name[] = "CSqliteConfig::GetPNode";
+ TRACE_ENTRY;
+
+ if ( !IsInitialized() )
+ {
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST | TC_TRACE_INIT))
+ {
+ trace_printf( "%s@%d Database is not initialized for access!\n"
+ , method_name, __LINE__);
+ }
+ TRACE_EXIT;
+ return( TCNOTINIT );
+ }
+
+ int rc;
+ int excfirstcore = -1;
+ int exclastcore = -1;
+ int pnid = -1;
+ const char *nodename = NULL;
+ const char *sqlStmt;
+ sqlite3_stmt *prepStmt = NULL;
+
+ // Prepare select logical nodes
+ sqlStmt = "select p.pNid, p.nodeName, p.excFirstCore, p.excLastCore"
+ " from pnode p where p.nodeName = ?";
+
+ rc = sqlite3_prepare_v2( db_
+ , sqlStmt
+ , strlen(sqlStmt)+1
+ , &prepStmt
+ , NULL);
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] prepare (%s) failed, error: %s\n"
+ , method_name, sqlStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+
+ rc = sqlite3_bind_text( prepStmt, 1, name, -1, SQLITE_STATIC );
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] sqlite3_bind_text(name) failed, error: %s\n"
+ , method_name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+
+ rc = sqlite3_step( prepStmt );
+ if ( rc == SQLITE_ROW )
+ { // Process row
+ int colCount = sqlite3_column_count(prepStmt);
+ if ( TcTraceSettings & (TC_TRACE_NODE | TC_TRACE_REQUEST) )
+ {
+ trace_printf("%s@%d sqlite3_column_count=%d\n",
+ method_name, __LINE__, colCount);
+ for (int i=0; i<colCount; ++i)
+ {
+ trace_printf("%s@%d column %d is %s\n",
+ method_name, __LINE__, i,
+ sqlite3_column_name(prepStmt, i));
+ }
+ }
+
+ pnid = sqlite3_column_int(prepStmt, 0);
+ nodename = (const char *) sqlite3_column_text(prepStmt, 1);
+ excfirstcore = sqlite3_column_int(prepStmt, 2);
+ exclastcore = sqlite3_column_int(prepStmt, 3);
+ SetPNodeData( pnid
+ , nodename
+ , excfirstcore
+ , exclastcore
+ , pnodeConfig );
+ }
+ else if ( rc == SQLITE_DONE )
+ {
+ if ( TcTraceSettings & (TC_TRACE_NODE | TC_TRACE_REQUEST) )
+ {
+ trace_printf("%s@%d Finished processing logical nodes.\n",
+ method_name, __LINE__);
+ }
+ }
+ else
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] (%s) failed, error: %s\n"
+ , method_name, sqlStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+
+ // Destroy prepared statement object
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
+
+ TRACE_EXIT;
+ return( TCSUCCESS );
+}
+
+int CSqliteConfig::GetSNodes( int &count
+ , int max
+ , physical_node_configuration_t spareNodeConfig[] )
+{
+ const char method_name[] = "CSqliteConfig::GetSNodes";
+ TRACE_ENTRY;
+
+ if ( !IsInitialized() )
+ {
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST | TC_TRACE_INIT))
+ {
+ trace_printf( "%s@%d Database is not initialized for access!\n"
+ , method_name, __LINE__);
+ }
+ TRACE_EXIT;
+ return( TCNOTINIT );
+ }
+
+ int rc;
+ int pnid = -1;
+ int excfirstcore = -1;
+ int exclastcore = -1;
+ int snodeCount = 0;
+ const char *nodename = NULL;
+ const char *sqlStmt;
+ sqlite3_stmt *prepStmt = NULL;
+
+ // Prepare select spare nodes
+ sqlStmt = "select p.pNid, p.nodeName, p.excFirstCore, p.excLastCore,"
+ " s.spNid "
+ " from pnode p, snode s where p.pNid = s.pNid";
+
+ rc = sqlite3_prepare_v2( db_
+ , sqlStmt
+ , strlen(sqlStmt)+1
+ , &prepStmt
+ , NULL);
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] prepare (%s) failed, error: %s\n"
+ , method_name, sqlStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+
+ count = snodeCount;
+
+ // Process spare nodes
+ while ( 1 )
+ {
+ rc = sqlite3_step( prepStmt );
+ if ( rc == SQLITE_ROW )
+ { // Process row
+ if ( max == 0 )
+ {
+ snodeCount++;
+ continue;
+ }
+
+ int colCount = sqlite3_column_count(prepStmt);
+ if ( TcTraceSettings & (TC_TRACE_NODE | TC_TRACE_REQUEST) )
+ {
+ trace_printf("%s@%d sqlite3_column_count=%d\n",
+ method_name, __LINE__, colCount);
+ for (int i=0; i<colCount; ++i)
+ {
+ trace_printf("%s@%d column %d is %s\n",
+ method_name, __LINE__, i,
+ sqlite3_column_name(prepStmt, i));
+ }
+ }
+
+ if ( snodeCount < max )
+ {
+ pnid = sqlite3_column_int(prepStmt, 0);
+ nodename = (const char *) sqlite3_column_text(prepStmt, 1);
+ excfirstcore = sqlite3_column_int(prepStmt, 2);
+ exclastcore = sqlite3_column_int(prepStmt, 3);
+ if ( ! GetSNodeData( pnid
+ , nodename
+ , excfirstcore
+ , exclastcore
+ , spareNodeConfig[snodeCount] ) )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s], Error: Invalid node configuration\n"
+ , method_name);
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ snodeCount++;
+ }
+ else
+ {
+ count = snodeCount;
+ // Destroy prepared statement object
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
+ return( TCDBTRUNCATE );
+ }
+ }
+ else if ( rc == SQLITE_DONE )
+ {
+ count = snodeCount;
+ // Destroy prepared statement object
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
+
+ if ( TcTraceSettings & (TC_TRACE_NODE | TC_TRACE_REQUEST) )
+ {
+ trace_printf("%s@%d Finished processing spare nodes.\n",
+ method_name, __LINE__);
+ }
+
+ break;
+ }
+ else
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] (%s) failed, error: %s\n"
+ , method_name, sqlStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ }
+
+ TRACE_EXIT;
+ return( TCSUCCESS );
+}
+
+int CSqliteConfig::GetSNodeData( int pnid
+ , const char *nodename
+ , int excfirstcore
+ , int exclastcore
+ , physical_node_configuration_t &spareNodeConfig )
+{
+ const char method_name[] = "CSqliteConfig::GetSNodeData";
+ TRACE_ENTRY;
+
+ if ( !IsInitialized() )
+ {
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST | TC_TRACE_INIT))
+ {
+ trace_printf( "%s@%d Database is not initialized for access!\n"
+ , method_name, __LINE__);
+ }
+ TRACE_EXIT;
+ return( TCNOTINIT );
+ }
+
+ int rc;
+ const char *sqlStmt;
+ sqlite3_stmt *prepStmt = NULL;
+
+ if ( TcTraceSettings & (TC_TRACE_NODE | TC_TRACE_REQUEST) )
+ {
+ trace_printf( "%s@%d pnid=%d, name=%s, excluded cores=(%d:%d)\n"
+ , method_name, __LINE__
+ , pnid
+ , nodename
+ , excfirstcore
+ , exclastcore );
+ }
+
+ spareNodeConfig.pnid = pnid;
+ strncpy( spareNodeConfig.node_name
+ , nodename
+ , sizeof(spareNodeConfig.node_name) );
+ spareNodeConfig.excluded_first_core = excfirstcore;
+ spareNodeConfig.excluded_last_core = exclastcore;
+
+ // Select all spared nodes configured for this spare node
+ sqlStmt = "select p.pNid, s.spNid"
+ " from pnode p, snode s"
+ " where p.pNid = s.pNid and p.pNid = ?";
+
+ rc = sqlite3_prepare_v2( db_
+ , sqlStmt
+ , strlen(sqlStmt)+1
+ , &prepStmt
+ , NULL);
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] prepare (%s) failed, error: %s\n"
+ , method_name, sqlStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ else
+ { // Set pnid in prepared statement
+ rc = sqlite3_bind_int(prepStmt, 1, pnid );
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf),
+ "[%s] sqlite3_bind_int(pnid) failed, error: %s\n"
+ , method_name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ }
+
+ int spnid;
+ int sparedpnid;
+ int spareCount = 0;
+
+ // Process spare nodes
+ while ( 1 )
+ {
+ rc = sqlite3_step( prepStmt );
+ if ( rc == SQLITE_ROW )
+ { // Process row
+ int colCount = sqlite3_column_count(prepStmt);
+ if ( TcTraceSettings & (TC_TRACE_NODE | TC_TRACE_REQUEST) )
+ {
+ trace_printf("%s@%d sqlite3_column_count=%d\n",
+ method_name, __LINE__, colCount);
+ for (int i=0; i<colCount; ++i)
+ {
+ trace_printf("%s@%d column %d is %s\n",
+ method_name, __LINE__, i,
+ sqlite3_column_name(prepStmt, i));
+ }
+ }
+
+ spnid = sqlite3_column_int(prepStmt, 0);
+ sparedpnid = sqlite3_column_int(prepStmt, 1);
+ spareNodeConfig.spare_pnid[spareCount] = sparedpnid;
+ spareCount++;
+ }
+ else if ( rc == SQLITE_DONE )
+ {
+ spareNodeConfig.spare_count = spareCount;
+ // Destroy prepared statement object
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
+
+ if ( TcTraceSettings & (TC_TRACE_NODE | TC_TRACE_REQUEST) )
+ {
+ trace_printf("%s@%d Finished processing spared node set.\n",
+ method_name, __LINE__);
+ }
+
+ break;
+ }
+ else
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] (%s) failed, error: %s\n"
+ , method_name, sqlStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ }
+
+ TRACE_EXIT;
+ return( TCSUCCESS );
+}
+
+int CSqliteConfig::GetPersistProcess( const char *persistPrefix
+ , persist_configuration_t &persistConfig )
+{
+ const char method_name[] = "CSqliteConfig::GetPersistProcess";
+ TRACE_ENTRY;
+
+ if ( !IsInitialized() )
+ {
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST | TC_TRACE_INIT))
+ {
+ trace_printf( "%s@%d Database is not initialized for access!\n"
+ , method_name, __LINE__);
+ }
+ TRACE_EXIT;
+ return( TCNOTINIT );
+ }
+
+ int rc, rs;
+ char param[TC_PERSIST_KEY_MAX];
+ const char *persistKey;
+ const char *persistValue;
+ const char *sqlStmtStmt;
+ sqlite3_stmt *prepStmt = NULL;
+
+ if ( TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST) )
+ {
+ trace_printf( "%s@%d processkey=%s\n"
+ , method_name, __LINE__
+ , persistPrefix );
+ }
+
+ strncpy( persistConfig.persist_prefix
+ , persistPrefix
+ , sizeof(persistConfig.persist_prefix) );
+
+ snprintf( param, sizeof(param), "%s_%%", persistPrefix );
+
+ // Prepare select persistent process for the key
+ sqlStmtStmt = "select p.keyName, p.valueName"
+ " from monRegPersistData p"
+ " where p.keyName like ?";
+
+ rc = sqlite3_prepare_v2( db_
+ , sqlStmtStmt
+ , strlen(sqlStmtStmt)+1
+ , &prepStmt
+ , NULL);
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] prepare (%s) failed, error: %s\n"
+ , method_name, sqlStmtStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ else
+ { // Set key in prepared statement
+ rc = sqlite3_bind_text( prepStmt, 1, param, -1, SQLITE_STATIC );
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] sqlite3_bind_text(keyName) failed, error: %s\n"
+ , method_name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ }
+
+ while ( 1 )
+ {
+ rc = sqlite3_step( prepStmt );
+ if ( rc == SQLITE_ROW )
+ { // Process row
+ int colCount = sqlite3_column_count(prepStmt);
+ if ( TcTraceSettings & (TC_TRACE_PERSIST | TC_TRACE_REQUEST) )
+ {
+ trace_printf( "%s@%d sqlite3_column_count=%d\n"
+ , method_name, __LINE__, colCount);
+ for (int i=0; i<colCount; ++i)
+ {
+ trace_printf("%s@%d column %d is %s\n",
+ method_name, __LINE__, i,
+ sqlite3_column_name(prepStmt, i));
+ }
+ }
+
+ persistKey = (const char *) sqlite3_column_text(prepStmt, 0);
+ persistValue = (const char *) sqlite3_column_text(prepStmt, 1);
+
+ if ( TcTraceSettings & (TC_TRACE_PERSIST | TC_TRACE_REQUEST) )
+ {
+ trace_printf( "%s@%d monRegPersistData key=%s, value=%s\n"
+ , method_name, __LINE__, persistKey, persistValue);
+ }
+
+ // Parse the value based on the key
+ rs = SetPersistProcessData( persistKey
+ , persistValue
+ , persistConfig );
+ if ( rs != TCSUCCESS )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s], Error: Invalid persist key value in "
+ "configuration, key=%s, value=%s\n"
+ , method_name, persistKey, persistValue );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ }
+ else if ( rc == SQLITE_DONE )
+ {
+ if ( TcTraceSettings & (TC_TRACE_PERSIST | TC_TRACE_REQUEST) )
+ {
+ trace_printf("%s@%d Finished processing all rows.\n",
+ method_name, __LINE__);
+ }
+ break;
+ }
+ else
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] (%s) failed, error: %s\n"
+ , method_name, sqlStmtStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ }
+
+ TRACE_EXIT;
+ return( TCSUCCESS );
+}
+
+int CSqliteConfig::GetPersistProcessKeys( const char *persistProcessKeys )
+{
+ const char method_name[] = "CSqliteConfig::GetPersistProcessKeys";
+ TRACE_ENTRY;
+
+ if ( !IsInitialized() )
+ {
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST | TC_TRACE_INIT))
+ {
+ trace_printf( "%s@%d Database is not initialized for access!\n"
+ , method_name, __LINE__);
+ }
+ TRACE_EXIT;
+ return( TCNOTINIT );
+ }
+
+
+ int rc;
+
+ const char *sqlStmt;
+ sqlite3_stmt *prepStmt = NULL;
+ sqlStmt = "select p.valueName"
+ " from monRegPersistData p"
+ " where p.keyName = 'PERSIST_PROCESS_KEYS'";
+
+ rc = sqlite3_prepare_v2( db_
+ , sqlStmt
+ , strlen(sqlStmt)+1
+ , &prepStmt
+ , NULL);
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] prepare (%s) failed, error: %s\n"
+ , method_name, sqlStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+
+ // Process persistent process keys
+ rc = sqlite3_step( prepStmt );
+ if ( rc == SQLITE_ROW )
+ { // Process row
+ int colCount = sqlite3_column_count(prepStmt);
+
+ if ( TcTraceSettings & (TC_TRACE_PERSIST | TC_TRACE_REQUEST) )
+ {
+ trace_printf("%s@%d sqlite3_column_count=%d\n",
+ method_name, __LINE__, colCount);
+ for (int i=0; i<colCount; ++i)
+ {
+ trace_printf("%s@%d column %d is %s\n",
+ method_name, __LINE__, i,
+ sqlite3_column_name(prepStmt, i));
+ }
+ }
+
+ const unsigned char *value;
+
+ value = sqlite3_column_text(prepStmt, 0);
+ strncpy( (char *)persistProcessKeys, (const char *)value, TC_PERSIST_KEYS_VALUE_MAX );
+
+ }
+ else if ( rc == SQLITE_DONE )
+ {
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
+ return( TCDBNOEXIST );
+ }
+ else
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] (%s) failed, error: %s\n"
+ , method_name, sqlStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
+
+ TRACE_EXIT;
+ return( TCSUCCESS );
+}
+
+int CSqliteConfig::GetRegistryClusterSet( int &count
+ , int max
+ , registry_configuration_t registryConfig[] )
+{
+ const char method_name[] = "CSqliteConfig::GetRegistryClusterSet";
+ TRACE_ENTRY;
+
+ if ( !IsInitialized() )
+ {
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST | TC_TRACE_INIT))
+ {
+ trace_printf( "%s@%d Database is not initialized for access!\n"
+ , method_name, __LINE__);
+ }
+ TRACE_EXIT;
+ return( TCNOTINIT );
+ }
+
+ int rc;
+ const unsigned char *group;
+ const unsigned char *key;
+ const unsigned char *value;
+ int entryNum = 0;
+
+ count = 0;
+
+ if ( db_ == NULL )
+ {
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST | TC_TRACE_INIT))
+ {
+ trace_printf("%s@%d cannot initialize registry from database "
+ "since database open failed.\n", method_name,
+ __LINE__);
+ }
+
+ TRACE_EXIT;
+ return( TCNOTINIT );
+ }
+
+ // Read cluster configuration registry entries and populate in-memory
+ // structures.
+ const char *sqlStmt;
+ sqlStmt = "select k.keyName, d.dataValue "
+ " from monRegKeyName k, monRegClusterData d "
+ " where k.keyId = d.keyId";
+ sqlite3_stmt *prepStmt;
+
+ rc = sqlite3_prepare_v2( db_, sqlStmt, strlen(sqlStmt)+1, &prepStmt, NULL);
+ if( rc!=SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] prepare (%s) failed, error: %s\n"
+ , method_name, sqlStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+
+ while ( 1 )
+ {
+ rc = sqlite3_step(prepStmt);
+ if ( rc == SQLITE_ROW )
+ { // Process row
+ if ( max == 0 )
+ {
+ ++entryNum;
+ continue;
+ }
+
+ if ( entryNum < max )
+ {
+ group = (const unsigned char *) "CLUSTER";
+ key = sqlite3_column_text(prepStmt, 0);
+ value = sqlite3_column_text(prepStmt, 1);
+ if ( TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST) )
+ {
+ trace_printf( "%s@%d entry %d: group=%s key=%s, value=%s\n"
+ , method_name, __LINE__
+ , entryNum, group, key, value);
+ }
+ strncpy( registryConfig[entryNum].scope, (const char *)group, TC_REGISTRY_KEY_MAX );
+ strncpy( registryConfig[entryNum].key, (const char *)key, TC_REGISTRY_KEY_MAX );
+ strncpy( registryConfig[entryNum].value, (const char *)value, TC_REGISTRY_VALUE_MAX );
+ ++entryNum;
+ }
+ else
+ {
+ count = entryNum;
+ // Destroy prepared statement object
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
+ return( TCDBTRUNCATE );
+ }
+ }
+ else if ( rc == SQLITE_DONE )
+ {
+ count = entryNum;
+ break;
+ }
+ else
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] (%s) failed, error: %s\n"
+ , method_name, sqlStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ }
+
+ // Destroy prepared statement object
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
+
+ count =entryNum;
+
+ TRACE_EXIT;
+ return( TCSUCCESS );
+}
+
+int CSqliteConfig::GetRegistryProcessSet( int &count
+ , int max
+ , registry_configuration_t registryConfig[] )
+{
+ const char method_name[] = "CSqliteConfig::GetRegistryProcessSet";
+ TRACE_ENTRY;
+
+ if ( !IsInitialized() )
+ {
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST | TC_TRACE_INIT))
+ {
+ trace_printf( "%s@%d Database is not initialized for access!\n"
+ , method_name, __LINE__);
+ }
+ TRACE_EXIT;
+ return( TCNOTINIT );
+ }
+
+ int rc;
+ const unsigned char *group;
+ const unsigned char *key;
+ const unsigned char *value;
+ int entryNum = 0;
+
+ count = 0;
+
+ if ( db_ == NULL )
+ {
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST | TC_TRACE_INIT))
+ {
+ trace_printf("%s@%d cannot initialize registry from database "
+ "since database open failed.\n", method_name,
+ __LINE__);
+ }
+
+ TRACE_EXIT;
+ return( TCNOTINIT );
+ }
+
+ // Read process configuration registry entries and populate in-memory
+ // structures.
+ const char *sqlStmt;
+ sqlStmt = "select p.procName, k.keyName, d.dataValue"
+ " from monRegProcName p, monRegKeyName k, monRegProcData d"
+ " where p.procId = d.procId"
+ " and k.keyId = d.keyId";
+ sqlite3_stmt *prepStmt;
+
+ rc = sqlite3_prepare_v2( db_, sqlStmt, strlen(sqlStmt)+1, &prepStmt, NULL);
+ if( rc!=SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] prepare (%s) failed, error: %s\n"
+ , method_name, sqlStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+
+ while ( 1 )
+ {
+ rc = sqlite3_step(prepStmt);
+ if ( rc == SQLITE_ROW )
+ { // Process row
+ if ( max == 0 )
+ {
+ ++entryNum;
+ continue;
+ }
+
+ if ( entryNum < max )
+ {
+ group = sqlite3_column_text(prepStmt, 0);
+ key = sqlite3_column_text(prepStmt, 1);
+ value = sqlite3_column_text(prepStmt, 2);
+ if ( TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST) )
+ {
+ trace_printf( "%s@%d entry %d: group=%s key=%s, value=%s\n"
+ , method_name, __LINE__
+ , entryNum, group, key, value);
+ }
+ strncpy( registryConfig[entryNum].scope, (const char *)group, TC_REGISTRY_KEY_MAX );
+ strncpy( registryConfig[entryNum].key, (const char *)key, TC_REGISTRY_KEY_MAX );
+ strncpy( registryConfig[entryNum].value, (const char *)value, TC_REGISTRY_VALUE_MAX );
+ ++entryNum;
+ //
+ }
+ else
+ {
+ count = entryNum;
+ // Destroy prepared statement object
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
+ return( TCDBTRUNCATE );
+ }
+ }
+ else if ( rc == SQLITE_DONE )
+ {
+ count = entryNum;
+ break;
+ }
+ else
+ {
+ if ( TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST) )
+ {
+ trace_printf("%s@%d step failed, retrieving process registry"
+ " data, error=%s (%d)\n",
+ method_name, __LINE__, sqlite3_errmsg(db_), rc);
+ }
+
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] (%s) failed, error: %s\n"
+ , method_name, sqlStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ }
+
+ // Destroy prepared statement object
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
+
+ TRACE_EXIT;
+ return( TCSUCCESS );
+}
+
+int CSqliteConfig::GetUniqueString( int nid, int id, const char *uniqStr )
+{
+ const char method_name[] = "CSqliteConfig::GetUniqueString";
+ TRACE_ENTRY;
+
+ if ( !IsInitialized() )
+ {
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST | TC_TRACE_INIT))
+ {
+ trace_printf( "%s@%d Database is not initialized for access!\n"
+ , method_name, __LINE__);
+ }
+ TRACE_EXIT;
+ return( TCNOTINIT );
+ }
+
+ int rc;
+ const char *sqlStmt;
+ sqlite3_stmt *prepStmt;
+
+ // Read process configuration registry entries and populate in-memory
+ // structures.
+ sqlStmt = "select dataValue from monRegUniqueStrings where nid = ? and id = ?";
+ rc = sqlite3_prepare_v2( db_, sqlStmt, strlen(sqlStmt)+1, &prepStmt, NULL);
+
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] prepare (%s) failed, error: %s\n"
+ , method_name, sqlStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ else
+ {
+ rc = sqlite3_bind_int ( prepStmt, 1, nid );
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf),
+ "[%s] sqlite3_bind_int(nid) failed, error: %s\n"
+ , method_name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ rc = sqlite3_bind_int ( prepStmt, 2, id );
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf),
+ "[%s] sqlite3_bind_int(id) failed, error: %s\n"
+ , method_name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+
+ rc = sqlite3_step( prepStmt );
+
+ if ( rc == SQLITE_ROW )
+ {
+ const unsigned char *value;
+
+ value = sqlite3_column_text(prepStmt, 0);
+ strncpy( (char *)uniqStr, (const char *)value, TC_UNIQUE_STRING_VALUE_MAX );
+
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST))
+ {
+ trace_printf("%s@%d retrieved unique string (%d, %d), "
+ "value=%s\n", method_name, __LINE__,
+ nid, id, uniqStr);
+ }
+ }
+ else if ( rc == SQLITE_DONE )
+ {
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
+ return( TCDBNOEXIST );
+ }
+ else
+ {
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] (%s) failed, nid=%d, id=%d, error: %s\n"
+ , method_name, sqlStmt, nid, id,sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ }
+
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
+
+ TRACE_EXIT;
+ return( TCSUCCESS );
+}
+
+int CSqliteConfig::GetUniqueStringId( int nid
+ , const char *uniqStr
+ , int &id )
+{
+ const char method_name[] = "CSqliteConfig::GetUniqueStringId";
+ TRACE_ENTRY;
+
+ if ( !IsInitialized() )
+ {
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST | TC_TRACE_INIT))
+ {
+ trace_printf( "%s@%d Database is not initialized for access!\n"
+ , method_name, __LINE__);
+ }
+ TRACE_EXIT;
+ return( TCNOTINIT );
+ }
+
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST))
+ {
+ trace_printf( "%s@%d Getting unique string id: nid=%d string=%s\n"
+ , method_name, __LINE__, nid, uniqStr);
+ }
+
+ int rc;
+ const char * sqlStmt;
+ sqlStmt = "select id from monRegUniqueStrings where nid = ? and dataValue = ?";
+
+ sqlite3_stmt * prepStmt;
+ rc = sqlite3_prepare_v2( db_, sqlStmt, strlen(sqlStmt)+1, &prepStmt,
+ NULL);
+
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] prepare (%s) failed, error: %s\n"
+ , method_name, sqlStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ else
+ {
+ rc = sqlite3_bind_int( prepStmt, 1, nid );
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf),
+ "[%s] sqlite3_bind_int(nid) failed, error: %s\n"
+ , method_name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ rc = sqlite3_bind_text( prepStmt, 2, uniqStr, -1, SQLITE_STATIC );
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] sqlite3_bind_text(uniqStr) failed, error: %s\n"
+ , method_name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+
+ rc = sqlite3_step( prepStmt );
+
+ if ( rc == SQLITE_ROW )
+ { // Found string in database, return id
+ id = sqlite3_column_int (prepStmt, 0);
+
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST))
+ {
+ trace_printf("%s@%d found unique string id: nid=%d, id=%d\n",
+ method_name, __LINE__, nid, id);
+ }
+ }
+ else if ( rc == SQLITE_DONE )
+ {
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
+ return( TCDBNOEXIST );
+ }
+ else
+ {
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] (%s) failed, nid=%d, id=%d, error: %s\n"
+ , method_name, sqlStmt, nid, id,sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ }
+
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
+
+ TRACE_EXIT;
+ return( TCSUCCESS );
+}
+
+int CSqliteConfig::GetUniqueStringIdMax( int nid, int &id )
+{
+ const char method_name[] = "CSqliteConfig::GetUniqueStringIdMax";
+ TRACE_ENTRY;
+
+ if ( !IsInitialized() )
+ {
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST | TC_TRACE_INIT))
+ {
+ trace_printf( "%s@%d Database is not initialized for access!\n"
+ , method_name, __LINE__);
+ }
+ TRACE_EXIT;
+ return( TCNOTINIT );
+ }
+
+ int result = 0;
+ int rc;
+ const char *sqlStmt;
+ sqlStmt = "select max(id) from monRegUniqueStrings where nid=?";
+
+ sqlite3_stmt * prepStmt;
+ rc = sqlite3_prepare_v2( db_, sqlStmt, strlen(sqlStmt)+1, &prepStmt,
+ NULL);
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] prepare (%s) failed, error: %s\n"
+ , method_name, sqlStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ else
+ {
+ rc = sqlite3_bind_int( prepStmt, 1, nid );
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf),
+ "[%s] sqlite3_bind_int(nid) failed, error: %s\n"
+ , method_name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+
+ rc = sqlite3_step( prepStmt );
+
+ if ( rc == SQLITE_ROW )
+ {
+ result = sqlite3_column_int(prepStmt, 0);
+ id = result;
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST))
+ {
+ trace_printf("%s@%d found max(id)=%d for nid=%d in "
+ "monRegUniqueStrings\n", method_name, __LINE__,
+ result, nid);
+ }
+ }
+ else if ( rc == SQLITE_DONE )
+ {
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
+ return( TCDBNOEXIST );
+ }
+ else
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] (%s) failed, nid=%d, error: %s\n"
+ , method_name, sqlStmt, nid, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ }
+
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
+
+ TRACE_EXIT;
+ return( TCSUCCESS );
+}
+
+int CSqliteConfig::SaveLNodeData( int nid
+ , int pnid
+ , int firstCore
+ , int lastCore
+ , int processors
+ , int roles )
+{
+ const char method_name[] = "CSqliteConfig::SaveLNodeData";
+ TRACE_ENTRY;
+
+ if ( !IsInitialized() )
+ {
+ if (TcTraceSettings & (TC_TRACE_REGISTRY | TC_TRACE_REQUEST | TC_TRACE_INIT))
+ {
+ trace_printf( "%s@%d Database is not initialized for access!\n"
+ , method_name, __LINE__);
+ }
+ TRACE_EXIT;
+ return( TCNOTINIT );
+ }
+
+ if (TcTraceSettings & (TC_TRACE_NODE | TC_TRACE_REQUEST))
+ {
+ trace_printf( "%s@%d inserting into lnode values (lNid=%d, pNid=%d, "
+ "processors=%d, roles=%d, firstCore=%d, lastCore=%d)\n"
+ , method_name, __LINE__
+ , nid
+ , pnid
+ , processors
+ , roles
+ , firstCore
+ , lastCore );
+ }
+
+ int rc;
+ const char *sqlStmt;
+ sqlStmt = "insert into lnode values (?, ?, ?, ?, ?, ?)";
+
+ sqlite3_stmt *prepStmt = NULL;
+ rc = sqlite3_prepare_v2( db_, sqlStmt, strlen(sqlStmt)+1, &prepStmt, NULL);
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] prepare (%s) failed, error: %s\n"
+ , method_name, sqlStmt, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ else
+ {
+ rc = sqlite3_bind_int( prepStmt, 1, nid );
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf),
+ "[%s] sqlite3_bind_int(nid) failed, error: %s\n"
+ , method_name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ rc = sqlite3_bind_int( prepStmt, 2, pnid );
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf),
+ "[%s] sqlite3_bind_int(pnid) failed, error: %s\n"
+ , method_name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ rc = sqlite3_bind_int( prepStmt, 3, processors );
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf),
+ "[%s] sqlite3_bind_int(processors) failed, error: %s\n"
+ , method_name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ rc = sqlite3_bind_int( prepStmt, 4, roles );
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZE];
+ snprintf( buf, sizeof(buf),
+ "[%s] sqlite3_bind_int(roles) failed, error: %s\n"
+ , method_name, sqlite3_errmsg(db_) );
+ TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ TRACE_EXIT;
+ return( TCDBOPERROR );
+ }
+ rc = sqlite3_bind_int( prepStmt, 5, firstCore );
+ if ( rc != SQLITE_OK )
+ {
+ char buf[TC_LOG_BUF_SIZ
<TRUNCATED>
[13/50] [abbrv] incubator-trafodion git commit: Merge remote branch
'origin/master' into TRAFODION-2001
Posted by su...@apache.org.
Merge remote branch 'origin/master' into TRAFODION-2001
Conflicts:
install/installer/trafodion_install
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/ccd0b90e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/ccd0b90e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/ccd0b90e
Branch: refs/heads/master
Commit: ccd0b90e1ab5a5f6f9d4926474c1f1d474f26411
Parents: 83acf13 0b0665b
Author: Zalo Correa <za...@esgyn.com>
Authored: Tue Aug 23 10:40:01 2016 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Tue Aug 23 10:40:01 2016 -0700
----------------------------------------------------------------------
core/conn/jdbc_type2/native/CoreCommon.h | 2 +
core/conn/jdbc_type2/native/SQLMXConnection.cpp | 32 +-
core/conn/jdbc_type2/native/SrvrOthers.cpp | 9 +
core/sqf/conf/install_features | 2 +
core/sqf/sqenvcom.sh | 49 +--
core/sqf/sql/scripts/install_local_hadoop | 5 +-
core/sqf/src/seatrans/hbase-trx/Makefile | 39 ++-
.../sqf/src/seatrans/hbase-trx/pom.xml.apache11 | 2 +-
.../sqf/src/seatrans/hbase-trx/pom.xml.apache12 | 336 +++++++++++++++++++
core/sqf/src/seatrans/hbase-trx/pom.xml.cdh54 | 2 +-
core/sqf/src/seatrans/hbase-trx/pom.xml.cdh55 | 2 +-
core/sqf/src/seatrans/hbase-trx/pom.xml.cdh57 | 332 ++++++++++++++++++
core/sqf/src/seatrans/hbase-trx/pp.awk | 10 +-
.../hbase/client/PatchClientScanner.java.tmpl | 2 +-
.../transactional/SsccRegionEndpoint.java.tmpl | 25 +-
.../transactional/TrxRegionEndpoint.java.tmpl | 49 ++-
.../transactional/TrxRegionObserver.java.tmpl | 16 +-
.../CleanOldTransactionsChore.java.tmpl | 9 +-
.../transactional/KeyValueListScanner.java.tmpl | 14 +-
.../transactional/MemoryUsageChore.java.tmpl | 6 +-
.../transactional/TrxTransactionState.java.tmpl | 27 +-
core/sqf/src/seatrans/tm/hbasetmlib2/pom.xml | 2 +-
.../src/seatrans/tm/hbasetmlib2/pom.xml.apache | 4 +-
.../sqf/src/seatrans/tm/hbasetmlib2/pom.xml.hdp | 4 +-
.../java/org/trafodion/dtm/HBaseTxClient.java | 6 -
core/sql/comexe/ComTdb.h | 28 ++
core/sql/common/ComSecurityKey.cpp | 54 +++
core/sql/common/ComSecurityKey.h | 8 +
core/sql/executor/ExExeUtilGet.cpp | 6 +-
core/sql/generator/Generator.cpp | 94 +++++-
core/sql/generator/Generator.h | 7 +-
core/sql/nskgmake/Makerules.mk | 2 +-
core/sql/optimizer/NARoutine.cpp | 66 ++--
core/sql/optimizer/NARoutine.h | 2 +-
core/sql/optimizer/NATable.cpp | 93 +++--
core/sql/optimizer/NATable.h | 5 +-
core/sql/optimizer/NormRelExpr.cpp | 222 +++++++++---
core/sql/optimizer/OptLogRelExpr.cpp | 19 ++
core/sql/optimizer/RelExpr.h | 5 +
core/sql/pom.xml | 2 +-
core/sql/pom.xml.apache | 6 +-
core/sql/pom.xml.hdp | 2 +-
core/sql/regress/compGeneral/EXPECTED011.SB | 293 ++++++++++++++--
core/sql/regress/compGeneral/TEST011 | 29 ++
core/sql/regress/privs2/EXPECTED143 | Bin 59506 -> 60014 bytes
core/sql/regress/privs2/TEST129 | 2 +
core/sql/regress/privs2/TEST143 | 6 +
core/sql/sqlcat/TrafDDLdesc.cpp | 50 +++
core/sql/sqlcat/TrafDDLdesc.h | 142 +++++++-
core/sql/sqlcomp/CmpSeabaseDDL.h | 4 +
core/sql/sqlcomp/CmpSeabaseDDLtable.cpp | 71 +++-
core/sql/sqlcomp/PrivMgrCommands.cpp | 127 +++++++
core/sql/sqlcomp/PrivMgrCommands.h | 14 +-
core/sql/sqlcomp/PrivMgrDesc.h | 52 ++-
core/sql/sqlcomp/PrivMgrPrivileges.cpp | 207 +++++++++++-
core/sql/sqlcomp/PrivMgrPrivileges.h | 15 +-
core/sql/sqlcomp/PrivMgrRoles.cpp | 59 ++++
core/sql/sqlcomp/PrivMgrRoles.h | 4 +
core/sql/sqlcomp/nadefaults.cpp | 5 +
install/installer/traf_add_user | 2 -
install/installer/traf_apache_mods | 15 +-
install/installer/traf_cloudera_mods | 14 +-
install/installer/traf_config_check | 127 ++++---
install/installer/traf_getHadoopNodes | 45 ++-
install/installer/trafodion_install | 20 +-
65 files changed, 2534 insertions(+), 376 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ccd0b90e/install/installer/traf_add_user
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ccd0b90e/install/installer/traf_cloudera_mods
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ccd0b90e/install/installer/traf_config_check
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ccd0b90e/install/installer/trafodion_install
----------------------------------------------------------------------
[50/50] [abbrv] incubator-trafodion git commit: Merge
[TRAFODION-2001] PR-1077 Trafodion Elasticity enhancements
Posted by su...@apache.org.
Merge [TRAFODION-2001] PR-1077 Trafodion Elasticity enhancements
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/7643e58b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/7643e58b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/7643e58b
Branch: refs/heads/master
Commit: 7643e58b42ee3aed0b15ecd5433b116b56cc43e8
Parents: c9ff843 53148a7
Author: Suresh Subbiah <su...@apache.org>
Authored: Wed May 31 18:45:50 2017 +0000
Committer: Suresh Subbiah <su...@apache.org>
Committed: Wed May 31 18:45:50 2017 +0000
----------------------------------------------------------------------
.../export/include/common/evl_sqlog_eventnum.h | 125 +-
core/sqf/export/include/seabed/ms.h | 53 +-
core/sqf/monitor/linux/attach.cxx | 0
core/sqf/monitor/linux/clio.cxx | 119 +-
core/sqf/monitor/linux/cluster.cxx | 788 +-
core/sqf/monitor/linux/cluster.h | 31 +-
core/sqf/monitor/linux/clusterconf.cxx | 1154 +--
core/sqf/monitor/linux/clusterconf.h | 175 +-
core/sqf/monitor/linux/cmsh.cxx | 0
core/sqf/monitor/linux/cmsh.h | 0
core/sqf/monitor/linux/commaccept.cxx | 60 +-
core/sqf/monitor/linux/commaccept.h | 0
core/sqf/monitor/linux/config.cxx | 1061 +--
core/sqf/monitor/linux/config.h | 9 +-
core/sqf/monitor/linux/device.h | 0
core/sqf/monitor/linux/gentrap.cxx | 2 +-
core/sqf/monitor/linux/gentrap.h | 0
core/sqf/monitor/linux/healthcheck.cxx | 0
core/sqf/monitor/linux/healthcheck.h | 0
core/sqf/monitor/linux/internal.h | 113 +-
core/sqf/monitor/linux/lnode.cxx | 529 +-
core/sqf/monitor/linux/lnode.h | 40 +-
core/sqf/monitor/linux/lnodeconfig.cxx | 208 +-
core/sqf/monitor/linux/lnodeconfig.h | 67 +-
core/sqf/monitor/linux/lock.cxx | 0
core/sqf/monitor/linux/lock.h | 0
core/sqf/monitor/linux/macros.gmk | 0
core/sqf/monitor/linux/makefile | 127 +-
core/sqf/monitor/linux/mlio.cxx | 41 +-
core/sqf/monitor/linux/monclio.cxx | 0
core/sqf/monitor/linux/monitor.cxx | 25 +-
core/sqf/monitor/linux/monitor.h | 0
core/sqf/monitor/linux/monlogging.cxx | 74 +-
core/sqf/monitor/linux/monlogging.h | 5 -
core/sqf/monitor/linux/monprof.h | 0
core/sqf/monitor/linux/monrobsem.cxx | 0
core/sqf/monitor/linux/monsonar.cxx | 0
core/sqf/monitor/linux/monsonar.h | 0
core/sqf/monitor/linux/montest_readme.txt | 0
core/sqf/monitor/linux/montim.cxx | 28 +
core/sqf/monitor/linux/montrace.cxx | 1 +
core/sqf/monitor/linux/montrace.h | 3 +-
core/sqf/monitor/linux/monwdt.cxx | 0
core/sqf/monitor/linux/msgdef.h | 213 +-
core/sqf/monitor/linux/notice.cxx | 0
core/sqf/monitor/linux/notice.h | 0
core/sqf/monitor/linux/open.cxx | 0
core/sqf/monitor/linux/open.h | 0
core/sqf/monitor/linux/persistconfig.cxx | 567 ++
core/sqf/monitor/linux/persistconfig.h | 154 +
core/sqf/monitor/linux/phnode.cxx | 0
core/sqf/monitor/linux/phnode.h | 0
core/sqf/monitor/linux/pingpong.c | 0
core/sqf/monitor/linux/pkillall.cxx | 0
core/sqf/monitor/linux/pkillall.h | 0
core/sqf/monitor/linux/pnode.cxx | 839 +-
core/sqf/monitor/linux/pnode.h | 42 +-
core/sqf/monitor/linux/pnodeconfig.cxx | 339 +-
core/sqf/monitor/linux/pnodeconfig.h | 49 +-
core/sqf/monitor/linux/process.cxx | 429 +-
core/sqf/monitor/linux/process.h | 4 +
core/sqf/monitor/linux/procmon.cxx | 0
core/sqf/monitor/linux/procmon.h | 0
core/sqf/monitor/linux/props.cxx | 0
core/sqf/monitor/linux/props.h | 0
core/sqf/monitor/linux/pstartd.cxx | 821 +-
core/sqf/monitor/linux/pstartd.h | 32 +-
core/sqf/monitor/linux/redirector.cxx | 0
core/sqf/monitor/linux/redirector.h | 0
core/sqf/monitor/linux/replicate.cxx | 242 +-
core/sqf/monitor/linux/replicate.h | 31 +-
core/sqf/monitor/linux/reqattstartup.cxx | 0
core/sqf/monitor/linux/reqdump.cxx | 0
core/sqf/monitor/linux/reqevent.cxx | 5 +-
core/sqf/monitor/linux/reqexit.cxx | 2 +-
core/sqf/monitor/linux/reqget.cxx | 8 +-
core/sqf/monitor/linux/reqkill.cxx | 0
core/sqf/monitor/linux/reqmonstats.cxx | 0
core/sqf/monitor/linux/reqmount.cxx | 0
core/sqf/monitor/linux/reqnewproc.cxx | 63 +-
core/sqf/monitor/linux/reqnodeadd.cxx | 237 +
core/sqf/monitor/linux/reqnodedelete.cxx | 180 +
core/sqf/monitor/linux/reqnodedown.cxx | 0
core/sqf/monitor/linux/reqnodeinfo.cxx | 46 +-
core/sqf/monitor/linux/reqnodename.cxx | 123 +-
core/sqf/monitor/linux/reqnodeup.cxx | 0
core/sqf/monitor/linux/reqnotify.cxx | 0
core/sqf/monitor/linux/reqopen.cxx | 2 +-
core/sqf/monitor/linux/reqpnodeinfo.cxx | 12 +-
core/sqf/monitor/linux/reqprocinfo.cxx | 116 +-
core/sqf/monitor/linux/reqqueue.cxx | 494 +-
core/sqf/monitor/linux/reqqueue.h | 119 +-
core/sqf/monitor/linux/reqset.cxx | 0
core/sqf/monitor/linux/reqshutdown.cxx | 9 +-
core/sqf/monitor/linux/reqstartup.cxx | 0
core/sqf/monitor/linux/reqtmleader.cxx | 0
core/sqf/monitor/linux/reqtmsync.cxx | 0
core/sqf/monitor/linux/reqworker.cxx | 0
core/sqf/monitor/linux/reqworker.h | 0
core/sqf/monitor/linux/reqzoneinfo.cxx | 24 +-
core/sqf/monitor/linux/robsem.cxx | 0
core/sqf/monitor/linux/robsem.h | 0
core/sqf/monitor/linux/sdtimer.cxx | 0
core/sqf/monitor/linux/sdtimer.h | 0
core/sqf/monitor/linux/shell.cxx | 8432 +++++++++++-------
core/sqf/monitor/linux/sqliteconfig.cxx | 3383 +++++++
core/sqf/monitor/linux/sqliteconfig.h | 133 +
core/sqf/monitor/linux/system.cxx | 0
core/sqf/monitor/linux/system.h | 0
core/sqf/monitor/linux/test.cmd | 0
core/sqf/monitor/linux/test.sub | 0
core/sqf/monitor/linux/test1.sub | 0
core/sqf/monitor/linux/test10.sub.ln | 0
core/sqf/monitor/linux/test10a.sub.ln | 0
core/sqf/monitor/linux/test10b.sub.ln | 0
core/sqf/monitor/linux/test11.sub | 0
core/sqf/monitor/linux/test11.sub.ln | 0
core/sqf/monitor/linux/test12.sub | 0
core/sqf/monitor/linux/test12a.sub | 0
core/sqf/monitor/linux/test12b.sub | 0
core/sqf/monitor/linux/test2.cmd | 0
core/sqf/monitor/linux/test2.sub | 0
core/sqf/monitor/linux/test3.cmd | 0
core/sqf/monitor/linux/test3.sub | 0
core/sqf/monitor/linux/test3a.sub | 0
core/sqf/monitor/linux/test3b.sub | 0
core/sqf/monitor/linux/test4.cmd | 0
core/sqf/monitor/linux/test4.sub | 0
core/sqf/monitor/linux/test5.sub | 0
core/sqf/monitor/linux/test6.sub | 0
core/sqf/monitor/linux/test8-10.sub.sn | 0
core/sqf/monitor/linux/test8-8.sub.sn | 0
core/sqf/monitor/linux/test8.cmd | 0
core/sqf/monitor/linux/test8.sub | 0
core/sqf/monitor/linux/test8.sub.ln | 0
core/sqf/monitor/linux/test8.sub.sn | 0
core/sqf/monitor/linux/testall.cmd | 0
core/sqf/monitor/linux/testall.sub | 0
core/sqf/monitor/linux/testconf.cxx | 88 +-
core/sqf/monitor/linux/testpoint.h | 0
core/sqf/monitor/linux/tmsync.cxx | 12 +-
core/sqf/monitor/linux/tmsync.h | 0
core/sqf/monitor/linux/token.cxx | 0
core/sqf/monitor/linux/token.h | 0
core/sqf/monitor/linux/trafconf.cxx | 622 ++
core/sqf/monitor/linux/trafconfig.cxx | 410 +
core/sqf/monitor/linux/trafconfig.h | 286 +
core/sqf/monitor/linux/trafconfiglog.cxx | 121 +
core/sqf/monitor/linux/trafconfiglog.h | 44 +
core/sqf/monitor/linux/trafconfigtrace.cxx | 349 +
core/sqf/monitor/linux/trafconfigtrace.h | 103 +
core/sqf/monitor/linux/versmwdt.cxx | 0
core/sqf/monitor/linux/verspstartd.cxx | 0
core/sqf/monitor/linux/watchdog.cxx | 4 +-
core/sqf/monitor/linux/watchdog.h | 0
core/sqf/monitor/linux/wdtimer.cxx | 0
core/sqf/monitor/linux/wdtimer.h | 0
core/sqf/monitor/linux/zclient.cxx | 28 +-
core/sqf/monitor/linux/zootest.cxx | 7 +-
core/sqf/monitor/test/Makefile | 7 +-
core/sqf/monitor/test/dtmCtrl.cxx | 2 +-
core/sqf/monitor/test/montestutil.cxx | 28 +-
core/sqf/monitor/test/runtest | 8 +-
core/sqf/sql/scripts/bats/sqconfig.monitor | 65 +
core/sqf/sql/scripts/bats/sqconfig.seabed | 65 +
core/sqf/sql/scripts/bats/sqconfig.tm | 74 +
core/sqf/sql/scripts/createConfigDb | 128 +-
core/sqf/sql/scripts/gensq.pl | 1203 +--
core/sqf/sql/scripts/lobstart | 24 +-
core/sqf/sql/scripts/lobstop | 21 +-
core/sqf/sql/scripts/qmmstart | 4 +-
core/sqf/sql/scripts/qmmstop | 3 +-
core/sqf/sql/scripts/regensq.pl | 148 +
core/sqf/sql/scripts/showConfigDb | 338 +-
core/sqf/sql/scripts/sqcheck | 73 +-
core/sqf/sql/scripts/sqconfig | 81 -
core/sqf/sql/scripts/sqconfig.persist | 87 +
core/sqf/sql/scripts/sqconfig.sample | 288 +-
core/sqf/sql/scripts/sqconfigdb.pm | 325 +
core/sqf/sql/scripts/sqgen | 62 +-
core/sqf/sql/scripts/sqnodes.pm | 214 +-
core/sqf/sql/scripts/sqnodestatus | 5 +-
core/sqf/sql/scripts/sqpersist.pm | 478 +
core/sqf/sql/scripts/sqregen | 62 +
core/sqf/sql/scripts/sqstart | 41 +-
core/sqf/sql/scripts/sqsystem.pm | 0
core/sqf/sql/scripts/sqtrace | 0
core/sqf/src/seabed/src/labelmaps.cpp | 63 +-
core/sqf/src/seabed/src/ms.cpp | 7 +-
core/sqf/src/seabed/src/msmon.cpp | 18 +-
core/sqf/src/seabed/test/Makefile | 49 +-
core/sqf/src/seabed/test/README.txt | 6 +-
core/sqf/src/seabed/test/goall | 31 +-
core/sqf/src/seabed/test/gocleandb | 25 +
core/sqf/src/seabed/test/gocleanport | 2 +-
core/sqf/src/seabed/test/godb | 25 +
core/sqf/src/seabed/test/godb.pl | 82 +
core/sqf/src/seabed/test/gohost | 23 +-
core/sqf/src/seabed/test/gosetup | 15 +-
core/sqf/src/seabed/test/gosetupcl | 2 +-
core/sqf/src/seabed/test/gosetupcl3 | 2 +-
core/sqf/src/seabed/test/gosetupcl64 | 2 +-
core/sqf/src/seabed/test/t249ms.cpp | 38 +
core/sqf/src/seabed/test/t262ms.cpp | 1 +
core/sqf/src/seabed/test/t266ms.cpp | 1 +
.../transactional/TrxTransactionState.java.tmpl | 1 +
.../src/seatrans/tm/hbasetmlib2/idtmclicom.h | 8 +-
core/sqf/src/tm/Makefile | 4 +
core/sqf/src/tm/idtmsrv.cpp | 4 +-
core/sqf/tools/sqtools.sh | 23 +-
core/sql/common/Ipc.cpp | 2 +-
core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp | 2 +-
core/sql/sqlcomp/CmpSeabaseDDLrepos.cpp | 2 +-
core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp | 2 +-
core/sql/sqlcomp/CmpSeabaseDDLview.cpp | 4 +-
install/installer/addNode_step1 | 80 +-
install/installer/addNode_step2 | 105 +-
install/installer/bashrc_default | 2 +-
install/installer/traf_cloudera_mods | 2 +-
install/installer/traf_sqconfig | 4 +-
.../python-installer/scripts/traf_sqconfig.py | 10 +-
221 files changed, 20049 insertions(+), 8494 deletions(-)
----------------------------------------------------------------------
[30/50] [abbrv] incubator-trafodion git commit: Merge remote branch
'origin/master' into TRAFODION-2001
Posted by su...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9523fd2b/core/sqf/monitor/test/runtest
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9523fd2b/core/sqf/sql/scripts/bats/sqconfig.tm
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9523fd2b/core/sqf/sql/scripts/gensq.pl
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9523fd2b/core/sqf/sql/scripts/qmmstart
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9523fd2b/core/sqf/sql/scripts/sqcheck
----------------------------------------------------------------------
diff --cc core/sqf/sql/scripts/sqcheck
index 0412407,bdb3d94..c5825a8
--- a/core/sqf/sql/scripts/sqcheck
+++ b/core/sqf/sql/scripts/sqcheck
@@@ -248,9 -252,12 +248,9 @@@ let cmp_result=
let sq_up=0
if [[ -z $SQSCRIPTS_DIR ]]; then
- SQSCRIPTS_DIR=$MY_SQROOT/sql/scripts
+ SQSCRIPTS_DIR=$TRAF_HOME/sql/scripts
fi
-SQSCRIPT_FILE="$SQSCRIPTS_DIR/gomon.cold"
-STARTSSMP_FILE="$SQSCRIPTS_DIR/ssmpstart"
-STARTSSCP_FILE="$SQSCRIPTS_DIR/sscpstart"
if [ $check_node '>' -1 ]; then
getNodeStatus
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9523fd2b/core/sqf/sql/scripts/sqgen
----------------------------------------------------------------------
diff --cc core/sqf/sql/scripts/sqgen
index 2169e60,627194c..fd49ed8
--- a/core/sqf/sql/scripts/sqgen
+++ b/core/sqf/sql/scripts/sqgen
@@@ -26,12 -26,11 +26,12 @@@
function Usage {
script_name=`/bin/basename $0`
echo
- echo $script_name generates various Trafodion files in the $MY_SQROOT/sql/scripts directory.
+ echo $script_name generates various Trafodion files in the $TRAF_HOME/sql/scripts directory.
echo
- echo "Usage: $script_name {-ft | -perf | [sqconfig_filename] | -h}"
+ echo "Usage: $script_name [ -? | -h ] [<sqconfig_filename>]"
+ echo " -? Help"
echo " -h Help"
- echo " <sqconfig_filename> Name of the SQ config file (in $MY_SQROOT/sql/scripts directory)(defaults to 'sqconfig')"
- echo " [sqconfig_filename] Name of the SQ config file (in $TRAF_HOME/sql/scripts directory)(defaults to 'sqconfig')"
++ echo " <sqconfig_filename> Name of the SQ config file (in $TRAF_HOME/sql/scripts directory)(defaults to 'sqconfig')"
echo
exit 1;
}
@@@ -75,11 -74,10 +75,11 @@@ function GetSQcnfg
FT_FLAG=1
PERF_FLAG=0
SQCONFIG_FILE=sqconfig
+SQCONFIG_DB_FILE=sqconfig.db
- if [ -z $MY_SQROOT ]; then
+ if [ -z $TRAF_HOME ]; then
echo
- echo "The MY_SQROOT environment variable does not exist."
+ echo "The TRAF_HOME environment variable does not exist."
echo "Please ensure sqenv.sh has been sourced."
echo
exit 1;
@@@ -191,7 -166,8 +191,7 @@@ if [[ -n "$node_count" ]] && [[ "$node
fi
SQSCRIPT_FILE=./gomon
- SQESPENV_FILE=$MY_SQROOT/sql/scripts/tdm_arkesp.env
-SQCLUSTERCONF_FILE=$MPI_TMPDIR/cluster.conf
+ SQESPENV_FILE=$TRAF_HOME/sql/scripts/tdm_arkesp.env
echo
if [ -f $SQETC_DIR/ms.env ]; then
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9523fd2b/core/sqf/sql/scripts/sqnodestatus
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9523fd2b/core/sqf/sql/scripts/sqstart
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9523fd2b/core/sqf/sql/scripts/sqsystem.pm
----------------------------------------------------------------------
diff --cc core/sqf/sql/scripts/sqsystem.pm
index 384fc35,f44144b..f44144b
mode 100644,100755..100644
--- a/core/sqf/sql/scripts/sqsystem.pm
+++ b/core/sqf/sql/scripts/sqsystem.pm
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9523fd2b/core/sqf/tools/sqtools.sh
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9523fd2b/core/sql/common/Ipc.cpp
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9523fd2b/core/sql/qmscommon/QRLogger.cpp
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9523fd2b/install/installer/traf_cloudera_mods
----------------------------------------------------------------------
[23/50] [abbrv] incubator-trafodion git commit: Rebase fix - removed
dormant code
Posted by su...@apache.org.
Rebase fix - removed dormant code
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/8fcf71a3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/8fcf71a3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/8fcf71a3
Branch: refs/heads/master
Commit: 8fcf71a30929ff99319ce46cfa30ab06ce0759c3
Parents: 6fb4a50
Author: Zalo Correa <za...@esgyn.com>
Authored: Thu Oct 27 10:11:31 2016 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Thu Oct 27 10:11:31 2016 -0700
----------------------------------------------------------------------
install/installer/addNode_step2 | 15 ---------------
1 file changed, 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fcf71a3/install/installer/addNode_step2
----------------------------------------------------------------------
diff --git a/install/installer/addNode_step2 b/install/installer/addNode_step2
index 236bb1f..26ad9f1 100755
--- a/install/installer/addNode_step2
+++ b/install/installer/addNode_step2
@@ -363,21 +363,6 @@ $TRAF_PDSH rm -r $HOME/tmpTraf
}
-function copysqConfig {
-
-source $TRAF_CONFIG
-
-$TRAF_PDSH mkdir -p $HOME/tmpTraf
-sudo cp -r $SQ_ROOT/sql/scripts/sqconfig $HOME/tmpTraf
-sudo chown -R $(whoami).$(whoami) $HOME/tmpTraf
-$TRAF_PDCP -r $HOME/tmpTraf $HOME
-$TRAF_PDSH sudo cp -rf $HOME/tmpTraf/sqconfig $SQ_ROOT/sql/scripts 2>&1 > /dev/null
-$TRAF_PDSH sudo chown -R $TRAF_USER.trafodion $SQ_ROOT/sql/scripts 2>&1 > /dev/null
-$TRAF_PDSH rm -r $HOME/tmpTraf
-
-}
-
-
function printMessage {
source $TRAF_CONFIG
[41/50] [abbrv] incubator-trafodion git commit: Merge remote branch
'origin/master' into TRAFODION-2001
Posted by su...@apache.org.
Merge remote branch 'origin/master' into TRAFODION-2001
Conflicts:
core/sqf/monitor/linux/clio.cxx
core/sqf/monitor/linux/cluster.cxx
core/sqf/monitor/linux/cluster.h
core/sqf/monitor/linux/mlio.cxx
core/sqf/monitor/linux/msgdef.h
core/sqf/monitor/linux/reqqueue.cxx
core/sqf/src/seabed/src/labelmaps.cpp
core/sql/qmscommon/QRLogger.cpp
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/16ef85d9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/16ef85d9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/16ef85d9
Branch: refs/heads/master
Commit: 16ef85d98c0650614be7fbb5d04cfc22b89426dd
Parents: 5aa8799 b791f88
Author: Zalo Correa <za...@esgyn.com>
Authored: Mon May 1 18:09:54 2017 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Mon May 1 18:09:54 2017 -0700
----------------------------------------------------------------------
core/Makefile | 6 +-
core/conn/jdbcT4/.gitignore | 2 +
core/conn/jdbcT4/Makefile | 3 +-
core/conn/jdbcT4/pom.xml | 17 +-
.../jdbc/t4/TrafT4PooledConnectionManager.java | 7 +-
core/conn/jdbc_type2/.gitignore | 10 +-
core/conn/jdbc_type2/Makefile | 37 +-
core/conn/jdbc_type2/build.xml | 118 -
core/conn/jdbc_type2/native/Debug.cpp | 212 +-
core/conn/jdbc_type2/native/Debug.h | 40 +-
core/conn/jdbc_type2/native/JdbcDebug.cpp | 26 +-
core/conn/jdbc_type2/native/NskUtil.cpp | 2 +-
.../native/SQLMXCallableStatement.cpp | 16 +-
.../jdbc_type2/native/SQLMXCommonFunctions.cpp | 72 +-
core/conn/jdbc_type2/native/SQLMXConnection.cpp | 82 +-
.../jdbc_type2/native/SQLMXDatabaseMetaData.cpp | 70 +-
core/conn/jdbc_type2/native/SQLMXDriver.cpp | 38 +-
.../native/SQLMXPreparedStatement.cpp | 18 +-
core/conn/jdbc_type2/native/SQLMXResultSet.cpp | 16 +-
core/conn/jdbc_type2/native/SQLMXStatement.cpp | 38 +-
core/conn/jdbc_type2/pom.xml | 107 +
.../jdbc_type2/samples/CreateDataSource.java | 2 +-
.../jdbc_type2/samples/HoldCursorSample.java | 2 +-
.../conn/jdbc_type2/samples/ISO88591Sample.java | 2 +-
.../jdbc_type2/samples/JdbcRowSetSample.java | 4 +-
core/conn/jdbc_type2/samples/LobSample.java | 2 +-
.../jdbc_type2/samples/MultiThreadTest.java | 2 +-
core/conn/jdbc_type2/samples/T2Sample.java | 2 +-
.../jdbc_type2/samples/TestConnectionPool.java | 16 +-
.../jdbc_type2/samples/TransactionMode.java | 6 +-
.../src/main/java/JdbcMxLobAdmin.java | 2 +-
core/conn/jdbc_type2/src/main/java/JdbcT2.java | 2 +-
.../jdbc/t2/CachedPreparedStatement.java | 184 +
.../apache/trafodion/jdbc/t2/DataWrapper.java | 2402 +++
.../trafodion/jdbc/t2/DriverInfo.java-tmpl | 35 +
.../org/apache/trafodion/jdbc/t2/JdbcDebug.java | 209 +
.../apache/trafodion/jdbc/t2/JdbcDebugCfg.java | 28 +
.../org/apache/trafodion/jdbc/t2/Messages.java | 217 +
.../jdbc/t2/PreparedStatementManager.java | 569 +
.../apache/trafodion/jdbc/t2/ResultSetInfo.java | 51 +
.../org/apache/trafodion/jdbc/t2/SQLMXBlob.java | 905 +
.../jdbc/t2/SQLMXCallableStatement.java | 2181 +++
.../org/apache/trafodion/jdbc/t2/SQLMXClob.java | 1017 +
.../trafodion/jdbc/t2/SQLMXClobReader.java | 481 +
.../trafodion/jdbc/t2/SQLMXClobWriter.java | 486 +
.../trafodion/jdbc/t2/SQLMXConnection.java | 3509 ++++
.../jdbc/t2/SQLMXConnectionPoolDataSource.java | 282 +
.../SQLMXConnectionPoolDataSourceFactory.java | 109 +
.../trafodion/jdbc/t2/SQLMXDataLocator.java | 368 +
.../trafodion/jdbc/t2/SQLMXDataSource.java | 497 +
.../jdbc/t2/SQLMXDataSourceFactory.java | 110 +
.../jdbc/t2/SQLMXDatabaseMetaData.java | 5691 ++++++
.../org/apache/trafodion/jdbc/t2/SQLMXDesc.java | 479 +
.../apache/trafodion/jdbc/t2/SQLMXHandle.java | 115 +
.../trafodion/jdbc/t2/SQLMXJdbcRowSet.java | 5007 +++++
.../org/apache/trafodion/jdbc/t2/SQLMXLob.java | 456 +
.../trafodion/jdbc/t2/SQLMXLobInputStream.java | 497 +
.../trafodion/jdbc/t2/SQLMXLobOutputStream.java | 402 +
.../jdbc/t2/SQLMXMaxIdleTimeRunnable.java | 283 +
.../apache/trafodion/jdbc/t2/SQLMXMessages.java | 167 +
.../jdbc/t2/SQLMXParameterMetaData.java | 497 +
.../jdbc/t2/SQLMXPooledConnection.java | 276 +
.../jdbc/t2/SQLMXPooledConnectionManager.java | 370 +
.../jdbc/t2/SQLMXPreparedStatement.java | 5714 ++++++
.../trafodion/jdbc/t2/SQLMXResultSet.java | 5103 +++++
.../jdbc/t2/SQLMXResultSetMetaData.java | 709 +
.../trafodion/jdbc/t2/SQLMXStatement.java | 1778 ++
.../trafodion/jdbc/t2/SQLMXWeakConnection.java | 79 +
.../org/apache/trafodion/jdbc/t2/T2Driver.java | 391 +
.../apache/trafodion/jdbc/t2/T2Properties.java | 1336 ++
.../org/apache/trafodion/jdbc/t2/TBlob.java | 146 +
.../trafodion/jdbc/t2/TCallableStatement.java | 1100 ++
.../org/apache/trafodion/jdbc/t2/TClob.java | 154 +
.../apache/trafodion/jdbc/t2/TClobReader.java | 135 +
.../apache/trafodion/jdbc/t2/TClobWriter.java | 123 +
.../apache/trafodion/jdbc/t2/TConnection.java | 625 +
.../jdbc/t2/TConnectionPoolDataSource.java | 224 +
.../t2/TConnectionPoolDataSourceFactory.java | 71 +
.../apache/trafodion/jdbc/t2/TDataSource.java | 237 +
.../trafodion/jdbc/t2/TDataSourceFactory.java | 72 +
.../trafodion/jdbc/t2/TDatabaseMetaData.java | 2265 +++
.../org/apache/trafodion/jdbc/t2/TDriver.java | 233 +
.../apache/trafodion/jdbc/t2/TJdbcRowSet.java | 2412 +++
.../trafodion/jdbc/t2/TLobInputStream.java | 135 +
.../trafodion/jdbc/t2/TLobOutputStream.java | 108 +
.../trafodion/jdbc/t2/TParameterMetaData.java | 174 +
.../trafodion/jdbc/t2/TPooledConnection.java | 108 +
.../trafodion/jdbc/t2/TPreparedStatement.java | 515 +
.../apache/trafodion/jdbc/t2/TResultSet.java | 1661 ++
.../trafodion/jdbc/t2/TResultSetMetaData.java | 292 +
.../apache/trafodion/jdbc/t2/TStatement.java | 479 +
.../trafodion/jdbc/t2/WeakConnection.java | 120 +
.../jdbc/t2/CachedPreparedStatement.java | 184 -
.../java/org/trafodion/jdbc/t2/DataWrapper.java | 2402 ---
.../org/trafodion/jdbc/t2/DriverInfo.java-tmpl | 33 -
.../java/org/trafodion/jdbc/t2/JdbcDebug.java | 209 -
.../org/trafodion/jdbc/t2/JdbcDebugCfg.java | 28 -
.../java/org/trafodion/jdbc/t2/Messages.java | 217 -
.../jdbc/t2/PreparedStatementManager.java | 569 -
.../org/trafodion/jdbc/t2/ResultSetInfo.java | 51 -
.../java/org/trafodion/jdbc/t2/SQLMXBlob.java | 905 -
.../jdbc/t2/SQLMXCallableStatement.java | 2181 ---
.../java/org/trafodion/jdbc/t2/SQLMXClob.java | 1017 -
.../org/trafodion/jdbc/t2/SQLMXClobReader.java | 481 -
.../org/trafodion/jdbc/t2/SQLMXClobWriter.java | 486 -
.../org/trafodion/jdbc/t2/SQLMXConnection.java | 3509 ----
.../jdbc/t2/SQLMXConnectionPoolDataSource.java | 282 -
.../SQLMXConnectionPoolDataSourceFactory.java | 109 -
.../org/trafodion/jdbc/t2/SQLMXDataLocator.java | 368 -
.../org/trafodion/jdbc/t2/SQLMXDataSource.java | 497 -
.../jdbc/t2/SQLMXDataSourceFactory.java | 110 -
.../jdbc/t2/SQLMXDatabaseMetaData.java | 5687 ------
.../java/org/trafodion/jdbc/t2/SQLMXDesc.java | 479 -
.../java/org/trafodion/jdbc/t2/SQLMXHandle.java | 115 -
.../org/trafodion/jdbc/t2/SQLMXJdbcRowSet.java | 5007 -----
.../java/org/trafodion/jdbc/t2/SQLMXLob.java | 456 -
.../trafodion/jdbc/t2/SQLMXLobInputStream.java | 497 -
.../trafodion/jdbc/t2/SQLMXLobOutputStream.java | 402 -
.../jdbc/t2/SQLMXMaxIdleTimeRunnable.java | 283 -
.../org/trafodion/jdbc/t2/SQLMXMessages.java | 167 -
.../jdbc/t2/SQLMXParameterMetaData.java | 497 -
.../jdbc/t2/SQLMXPooledConnection.java | 276 -
.../jdbc/t2/SQLMXPooledConnectionManager.java | 370 -
.../jdbc/t2/SQLMXPreparedStatement.java | 5714 ------
.../org/trafodion/jdbc/t2/SQLMXResultSet.java | 5103 -----
.../jdbc/t2/SQLMXResultSetMetaData.java | 709 -
.../org/trafodion/jdbc/t2/SQLMXStatement.java | 1778 --
.../trafodion/jdbc/t2/SQLMXWeakConnection.java | 79 -
.../java/org/trafodion/jdbc/t2/T2Driver.java | 390 -
.../org/trafodion/jdbc/t2/T2Properties.java | 1336 --
.../main/java/org/trafodion/jdbc/t2/TBlob.java | 146 -
.../trafodion/jdbc/t2/TCallableStatement.java | 1100 --
.../main/java/org/trafodion/jdbc/t2/TClob.java | 154 -
.../java/org/trafodion/jdbc/t2/TClobReader.java | 135 -
.../java/org/trafodion/jdbc/t2/TClobWriter.java | 123 -
.../java/org/trafodion/jdbc/t2/TConnection.java | 625 -
.../jdbc/t2/TConnectionPoolDataSource.java | 224 -
.../t2/TConnectionPoolDataSourceFactory.java | 71 -
.../java/org/trafodion/jdbc/t2/TDataSource.java | 237 -
.../trafodion/jdbc/t2/TDataSourceFactory.java | 72 -
.../trafodion/jdbc/t2/TDatabaseMetaData.java | 2265 ---
.../java/org/trafodion/jdbc/t2/TDriver.java | 233 -
.../java/org/trafodion/jdbc/t2/TJdbcRowSet.java | 2412 ---
.../org/trafodion/jdbc/t2/TLobInputStream.java | 135 -
.../org/trafodion/jdbc/t2/TLobOutputStream.java | 108 -
.../trafodion/jdbc/t2/TParameterMetaData.java | 174 -
.../trafodion/jdbc/t2/TPooledConnection.java | 108 -
.../trafodion/jdbc/t2/TPreparedStatement.java | 515 -
.../java/org/trafodion/jdbc/t2/TResultSet.java | 1661 --
.../trafodion/jdbc/t2/TResultSetMetaData.java | 292 -
.../java/org/trafodion/jdbc/t2/TStatement.java | 479 -
.../org/trafodion/jdbc/t2/WeakConnection.java | 120 -
core/conn/odbc/src/odbc/nsksrvr/SrvrMain.cpp | 16 +-
core/conn/trafci/install/Installer.java-tmpl | 36 +-
core/conn/trafci/installer_pom.xml | 2 +-
core/conn/trafci/pom.xml | 2 +-
.../java/org/trafodion/ci/DatabaseQuery.java | 6 +-
.../java/org/trafodion/ci/QueryWrapper.java | 6 +-
.../trafci/src/main/resources/install_jar.xml | 2 +-
core/rest/pom.xml | 2 +-
.../main/java/org/trafodion/rest/Constants.java | 2 +-
core/sqf/conf/log4cxx.monitor.mon.config | 13 +-
core/sqf/conf/log4cxx.monitor.mon.snmp.config | 10 +-
core/sqf/conf/log4cxx.monitor.psd.config | 6 +-
core/sqf/conf/log4cxx.monitor.wdg.config | 10 +-
core/sqf/conf/log4cxx.monitor.wdg.snmp.config | 10 +-
core/sqf/conf/log4cxx.trafodion.lob.config | 49 -
.../sqf/conf/log4cxx.trafodion.masterexe.config | 25 +-
core/sqf/conf/log4cxx.trafodion.sql.config | 51 +
core/sqf/conf/log4cxx.trafodion.sscp.config | 14 +-
core/sqf/conf/log4cxx.trafodion.ssmp.config | 13 +-
core/sqf/conf/log4cxx.trafodion.tm.config | 9 +-
core/sqf/conf/log4cxx.trafodion.udr.config | 48 -
core/sqf/conf/log4j.hdfs.config | 56 -
core/sqf/conf/log4j.sql.config | 51 +
core/sqf/export/include/dtm/tm.h | 2 +-
core/sqf/export/include/seabed/ms.h | 7 -
core/sqf/monitor/linux/clio.cxx | 8 -
core/sqf/monitor/linux/cluster.cxx | 106 -
core/sqf/monitor/linux/cluster.h | 4 -
core/sqf/monitor/linux/getseq.cxx | 54 -
core/sqf/monitor/linux/internal.h | 1 -
core/sqf/monitor/linux/makefile | 2 -
core/sqf/monitor/linux/mlio.cxx | 2 -
core/sqf/monitor/linux/montim.cxx | 14 -
core/sqf/monitor/linux/msgdef.h | 2 -
core/sqf/monitor/linux/reqqueue.cxx | 7 -
core/sqf/monitor/linux/reqqueue.h | 14 -
core/sqf/monitor/linux/reqtmseqnum.cxx | 82 -
core/sqf/monitor/linux/testspx.cxx | 3 -
core/sqf/monitor/linux/testtm.cxx | 3 -
core/sqf/monitor/linux/zclient.cxx | 11 +
core/sqf/monitor/test/Makefile | 2 +-
core/sqf/monitor/test/runtest | 4 +-
core/sqf/monitor/test/tmSyncTest.cxx | 3 -
core/sqf/sql/scripts/analyzeMessageGuide.py | 3 +
core/sqf/sql/scripts/analyzeOptimizerTrace.py | 215 +
core/sqf/sql/scripts/analyzeULOG.py | 177 +
core/sqf/sql/scripts/hbcheck | 35 +
core/sqf/sql/scripts/install_local_hadoop | 4 +
core/sqf/sql/scripts/sqstart | 13 +
core/sqf/src/seabed/src/apictr.cpp | 1 -
core/sqf/src/seabed/src/labelmaps.cpp | 4 -
core/sqf/src/seabed/src/msmon.cpp | 153 +-
core/sqf/src/seabed/src/threadl.cpp | 38 +-
core/sqf/src/seabed/test/Makefile | 28 +-
core/sqf/src/seabed/test/goall | 26 +-
core/sqf/src/seabed/test/godb.pl | 22 +
.../hbase/client/transactional/TmDDL.java | 33 +-
.../transactional/SplitBalanceHelper.java | 11 +-
.../transactional/TrxRegionObserver.java.tmpl | 2 +-
.../sqf/src/seatrans/tm/hbasetmlib2/hbasetm.cpp | 18 +
core/sqf/src/seatrans/tm/hbasetmlib2/hbasetm.h | 2 +
.../tm/hbasetmlib2/javaobjectinterfacetm.cpp | 25 +
.../java/org/trafodion/dtm/HBaseTxClient.java | 578 +-
.../java/org/trafodion/dtm/HashMapArray.java | 27 +
.../main/java/org/trafodion/dtm/hbstatus.java | 299 +
core/sqf/src/tm/tm.cpp | 11 +-
core/sqf/src/tm/tminfo.cpp | 4 -
core/sqf/src/tm/tools/dtmci.cpp | 104 +-
core/sqf/tools/sqtools.sh | 2 +-
core/sql/arkcmp/CmpStatement.cpp | 23 +-
core/sql/bin/SqlciErrors.txt | 52 +-
core/sql/bin/SqlciMain.cpp | 5 +-
core/sql/bin/arkcmp.cpp | 12 +-
core/sql/bin/clitest.cpp | 63 +-
core/sql/bin/ex_esp_main.cpp | 9 +-
core/sql/cli/Cli.cpp | 11 +-
core/sql/cli/CliExpExchange.cpp | 13 +-
core/sql/cli/CliExtern.cpp | 2 +-
core/sql/cli/Statement.cpp | 14 +-
core/sql/cli/memorymonitor.cpp | 204 +-
core/sql/cli/memorymonitor.h | 12 +-
core/sql/cli/sqlcli.h | 11 +-
core/sql/clitest/blobtest.cpp | 5 +-
core/sql/clitest/blobtest.h | 5 +-
core/sql/comexe/CmpMessage.h | 10 +-
core/sql/comexe/ComTdb.h | 1 +
core/sql/comexe/ComTdbExeUtil.cpp | 76 +-
core/sql/comexe/ComTdbExeUtil.h | 88 +-
core/sql/common/CharType.cpp | 41 +-
core/sql/common/CharType.h | 7 +-
core/sql/common/ComMisc.cpp | 14 +-
core/sql/common/ComMisc.h | 7 +-
core/sql/common/ComSecurityKey.cpp | 118 +-
core/sql/common/ComSecurityKey.h | 18 +-
core/sql/common/ComSmallDefs.h | 5 +
core/sql/common/ComUser.cpp | 11 +
core/sql/common/ComUser.h | 1 +
core/sql/common/NAType.cpp | 18 +-
core/sql/common/NAType.h | 3 +
core/sql/common/OperTypeEnum.h | 2 +
core/sql/common/conversionLocale.cpp | 4 +-
core/sql/common/wstr.cpp | 41 +
core/sql/common/wstr.h | 11 +
core/sql/executor/ExComTdb.cpp | 8 +
core/sql/executor/ExExeUtil.h | 112 +-
core/sql/executor/ExExeUtilCli.cpp | 25 +-
core/sql/executor/ExExeUtilCli.h | 3 +-
core/sql/executor/ExExeUtilExplain.cpp | 20 +-
core/sql/executor/ExExeUtilGet.cpp | 757 +-
core/sql/executor/ExExeUtilGetStats.cpp | 578 +-
core/sql/executor/ExExeUtilMisc.cpp | 125 +
core/sql/executor/ExHbaseAccess.cpp | 18 +-
core/sql/executor/ExHbaseIUD.cpp | 33 +-
core/sql/executor/ExHdfsScan.cpp | 19 +-
core/sql/executor/ExStats.cpp | 838 +-
core/sql/executor/ExStats.h | 205 +-
core/sql/executor/ExUdr.cpp | 2 +-
core/sql/executor/HBaseClient_JNI.cpp | 3 +-
core/sql/executor/JavaObjectInterface.cpp | 36 +-
core/sql/executor/SwapSpace.cpp | 2 +-
core/sql/executor/cluster.cpp | 1 +
core/sql/executor/ex_sort.cpp | 4 +-
core/sql/executor/hiveHook.cpp | 66 +-
core/sql/exp/ExpHbaseDefs.h | 2 +
core/sql/exp/ExpLOB.cpp | 14 +-
core/sql/exp/ExpLOBaccess.cpp | 10 +-
core/sql/exp/ExpLOBprocess.cpp | 8 +-
core/sql/exp/exp_clause.cpp | 7 +
core/sql/exp/exp_clause.h | 3 +-
core/sql/exp/exp_clause_derived.h | 3 +-
core/sql/exp/exp_conv.cpp | 9 +-
core/sql/exp/exp_datetime.cpp | 12 +-
core/sql/exp/exp_fixup.cpp | 3 +-
core/sql/exp/exp_function.cpp | 90 +-
core/sql/exp/exp_function.h | 49 +-
core/sql/generator/GenExplain.cpp | 27 +-
core/sql/generator/GenFastTransport.cpp | 5 +-
core/sql/generator/GenItemFunc.cpp | 22 +-
core/sql/generator/GenPreCode.cpp | 59 +-
core/sql/generator/GenRelExeUtil.cpp | 185 +-
core/sql/generator/GenRelGrby.cpp | 10 +-
core/sql/generator/GenRelMisc.cpp | 14 +-
core/sql/generator/GenRelScan.cpp | 12 +-
core/sql/generator/GenRelUpdate.cpp | 5 +-
core/sql/generator/Generator.cpp | 8 +
core/sql/langman/LmLangManagerJava.cpp | 120 +-
core/sql/langman/LmLangManagerJava.h | 8 -
core/sql/optimizer/Analyzer.cpp | 6 +-
core/sql/optimizer/BindItemExpr.cpp | 107 +-
core/sql/optimizer/BindRelExpr.cpp | 158 +-
core/sql/optimizer/EncodedKeyValue.cpp | 8 +
core/sql/optimizer/ImplRule.cpp | 26 +-
core/sql/optimizer/IndexDesc.cpp | 35 +-
core/sql/optimizer/IndexDesc.h | 4 +-
core/sql/optimizer/ItemExpr.cpp | 38 +-
core/sql/optimizer/ItemExpr.h | 1 -
core/sql/optimizer/ItemFunc.h | 25 +-
core/sql/optimizer/NATable.cpp | 5034 ++---
core/sql/optimizer/NATable.h | 36 +-
core/sql/optimizer/NormRelExpr.cpp | 8 +
core/sql/optimizer/ObjectNames.cpp | 37 +-
core/sql/optimizer/ObjectNames.h | 4 +
core/sql/optimizer/OptHints.h | 3 +
core/sql/optimizer/OptLogRelExpr.cpp | 6 +-
core/sql/optimizer/RelExeUtil.cpp | 98 +-
core/sql/optimizer/RelExeUtil.h | 50 +-
core/sql/optimizer/RelExpr.cpp | 210 +-
core/sql/optimizer/RelScan.h | 41 +-
core/sql/optimizer/ScmCostMethod.cpp | 335 +-
core/sql/optimizer/SearchKey.cpp | 1 +
core/sql/optimizer/SearchKey.h | 7 +
core/sql/optimizer/SimpleScanOptimizer.cpp | 8 +-
core/sql/optimizer/SynthType.cpp | 84 +-
core/sql/optimizer/TableDesc.h | 6 +-
core/sql/optimizer/TransRule.cpp | 1 +
core/sql/optimizer/ValueDesc.cpp | 75 +
core/sql/optimizer/ValueDesc.h | 13 +
core/sql/optimizer/hiveHook.h | 24 +-
core/sql/optimizer/memo.cpp | 9 +-
core/sql/optimizer/opt.cpp | 81 +-
core/sql/optimizer/opt.h | 4 +-
core/sql/parser/AllStmtDDL.h | 1 +
core/sql/parser/BindStmtDDL.cpp | 23 +
core/sql/parser/ElemDDLNode.cpp | 6 +
core/sql/parser/ElemDDLNode.h | 6 +-
core/sql/parser/ParAll.cpp | 1 +
core/sql/parser/ParKeyWords.cpp | 3 +
core/sql/parser/SqlParserAux.cpp | 5 +
core/sql/parser/SqlParserAux.h | 1 +
core/sql/parser/SqlParserGlobalsCmn.h | 84 +-
core/sql/parser/SqlParserGlobalsEnum.h | 119 +
core/sql/parser/StmtDDLCleanupObjects.h | 2 +
core/sql/parser/StmtDDLMisc.cpp | 2 +
core/sql/parser/StmtDDLNode.cpp | 1 +
core/sql/parser/StmtDDLNode.h | 10 +
core/sql/parser/StmtDDLRegOrUnregHive.cpp | 97 +
core/sql/parser/StmtDDLRegOrUnregHive.h | 134 +
core/sql/parser/sqlparser.y | 759 +-
core/sql/qmscommon/QRLogger.cpp | 50 +-
core/sql/qmscommon/QRLogger.h | 3 +
core/sql/regress/charsets/EXPECTED004 | 6 +-
core/sql/regress/charsets/EXPECTED314 | 68 +
core/sql/regress/charsets/EXPECTED315 | 188 +
core/sql/regress/charsets/TEST314 | 12 +
core/sql/regress/charsets/TEST315 | 34 +
core/sql/regress/compGeneral/EXPECTED006.SB | 561 +-
core/sql/regress/compGeneral/EXPECTED045 | 2 +-
core/sql/regress/compGeneral/EXPECTEDTOK2 | 7 +-
core/sql/regress/compGeneral/TEST006 | 115 +
core/sql/regress/compGeneral/TEST045 | 2 +-
core/sql/regress/core/EXPECTED162 | 2 +-
core/sql/regress/core/EXPECTEDRTS | 1807 +-
core/sql/regress/core/FILTERRTS | 25 +-
core/sql/regress/core/TEST162 | 2 +-
core/sql/regress/core/TESTRTS | 1 +
core/sql/regress/executor/EXPECTED022.SB | 24 +-
core/sql/regress/executor/EXPECTED063 | 4 +-
core/sql/regress/executor/EXPECTED130 | 199 +-
core/sql/regress/executor/TEST022 | 3 +
core/sql/regress/executor/TEST130 | 37 +
core/sql/regress/hive/EXPECTED001 | 2 +-
core/sql/regress/hive/EXPECTED002 | 2 +-
core/sql/regress/hive/EXPECTED003 | 8 +-
core/sql/regress/hive/EXPECTED004 | 2 +-
core/sql/regress/hive/EXPECTED005 | 134 +-
core/sql/regress/hive/EXPECTED006 | 2 +-
core/sql/regress/hive/EXPECTED007 | 794 +-
core/sql/regress/hive/EXPECTED009 | 33 +-
core/sql/regress/hive/EXPECTED017 | 18 +-
core/sql/regress/hive/EXPECTED018 | 598 +-
core/sql/regress/hive/FILTER007 | 40 +
core/sql/regress/hive/TEST001 | 2 +-
core/sql/regress/hive/TEST002 | 2 +-
core/sql/regress/hive/TEST003 | 4 +-
core/sql/regress/hive/TEST004 | 2 +-
core/sql/regress/hive/TEST005 | 22 +-
core/sql/regress/hive/TEST006 | 2 +-
core/sql/regress/hive/TEST007 | 260 +-
core/sql/regress/hive/TEST009 | 5 +-
core/sql/regress/hive/TEST018 | 4 +-
core/sql/regress/privs1/EXPECTED120 | 145 +-
core/sql/regress/privs1/EXPECTED133 | Bin 27095 -> 27095 bytes
core/sql/regress/privs1/EXPECTED137 | 28 +
core/sql/regress/privs1/TEST120 | 36 +-
core/sql/regress/seabase/EXPECTED002 | 187 +-
core/sql/regress/seabase/EXPECTED003 | 114 +-
core/sql/regress/seabase/EXPECTED010 | 378 +-
core/sql/regress/seabase/EXPECTED011 | 18 +-
core/sql/regress/seabase/EXPECTED012 | 8 +-
core/sql/regress/seabase/EXPECTED016 | 14 +-
core/sql/regress/seabase/EXPECTED020 | 4 +-
core/sql/regress/seabase/EXPECTED025 | 49 +-
core/sql/regress/seabase/EXPECTED026 | 35 +-
core/sql/regress/seabase/EXPECTED027 | 106 +-
core/sql/regress/seabase/EXPECTED030 | 2 +-
core/sql/regress/seabase/EXPECTED031 | 295 +-
core/sql/regress/seabase/EXPECTED033 | 21 +-
core/sql/regress/seabase/TEST002 | 32 +-
core/sql/regress/seabase/TEST003 | 16 +-
core/sql/regress/seabase/TEST011 | 2 +
core/sql/regress/seabase/TEST025 | 10 +
core/sql/regress/seabase/TEST031 | 87 +-
core/sql/regress/seabase/TEST033 | 13 +-
core/sql/regress/tools/runallsb | 20 +
core/sql/regress/tools/runregr_privs1.ksh | 59 +-
core/sql/regress/tools/runregr_privs2.ksh | 59 +-
core/sql/regress/udr/EXPECTED001 | 14 +-
core/sql/regress/udr/EXPECTED107.SB | 10 +-
core/sql/regress/udr/TEST001 | 14 +-
core/sql/regress/udr/TEST107 | 10 +-
core/sql/runtimestats/SqlStats.cpp | 1 +
core/sql/sort/ScratchSpace.cpp | 14 +-
core/sql/sort/ScratchSpace.h | 5 +-
core/sql/sort/SortUtil.cpp | 4 +-
core/sql/sort/scratchfile_sq.cpp | 16 +-
core/sql/sqlci/Param.cpp | 38 +-
core/sql/sqlci/SqlciStats.cpp | 6 +-
core/sql/sqlci/sqlci_lex.ll | 1 +
core/sql/sqlci/sqlci_yacc.y | 2 +
core/sql/sqlcomp/CmpDDLCatErrorCodes.h | 30 +-
core/sql/sqlcomp/CmpDescribe.cpp | 162 +-
core/sql/sqlcomp/CmpMain.cpp | 10 +-
core/sql/sqlcomp/CmpMain.h | 3 +-
core/sql/sqlcomp/CmpSeabaseDDL.h | 68 +-
core/sql/sqlcomp/CmpSeabaseDDLcleanup.cpp | 214 +-
core/sql/sqlcomp/CmpSeabaseDDLcleanup.h | 9 +
core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp | 347 +-
core/sql/sqlcomp/CmpSeabaseDDLincludes.h | 1 +
core/sql/sqlcomp/CmpSeabaseDDLmd.h | 12 +-
core/sql/sqlcomp/CmpSeabaseDDLschema.cpp | 6 +-
core/sql/sqlcomp/CmpSeabaseDDLtable.cpp | 813 +-
core/sql/sqlcomp/CmpSeabaseDDLview.cpp | 34 +-
core/sql/sqlcomp/DefaultConstants.h | 30 +-
core/sql/sqlcomp/PrivMgr.cpp | 14 +-
core/sql/sqlcomp/PrivMgrCommands.cpp | 15 +-
core/sql/sqlcomp/PrivMgrDefs.h | 2 +
core/sql/sqlcomp/PrivMgrDesc.cpp | 4 +
core/sql/sqlcomp/PrivMgrPrivileges.cpp | 33 +-
core/sql/sqlcomp/PrivMgrPrivileges.h | 1 -
core/sql/sqlcomp/nadefaults.cpp | 58 +-
core/sql/sqlcomp/parser.cpp | 2 +-
core/sql/sqludr/SqlUdrPredefLogReader.cpp | 1 +
.../java/org/trafodion/sql/HBaseClient.java | 47 +-
.../java/org/trafodion/sql/HBulkLoadClient.java | 2 +-
.../main/java/org/trafodion/sql/HiveClient.java | 7 +-
.../org/trafodion/sql/udr/LmClassLoader.java | 327 +-
.../java/org/trafodion/sql/udr/LmUtility.java | 152 +-
.../org/trafodion/sql/udr/predef/JDBCUDR.java | 56 +-
core/sql/udrserv/udrserv.cpp | 32 +-
core/sql/ustat/hs_cli.cpp | 89 +-
core/sql/ustat/hs_cli.h | 3 -
core/sql/ustat/hs_globals.cpp | 526 +-
core/sql/ustat/hs_globals.h | 63 +-
core/sql/ustat/hs_la.cpp | 94 +-
core/sql/ustat/hs_la.h | 2 +
core/sql/ustat/hs_read.cpp | 12 +-
dcs/pom.xml | 6 +-
.../main/java/org/trafodion/dcs/Constants.java | 2 +-
.../serverHandler/ServerApiGetCatalogs.java | 2 +-
.../serverHandler/ServerApiSqlExecDirect.java | 2 +-
.../serverHandler/ServerApiSqlExecute.java | 2 +-
.../serverHandler/ServerApiSqlFetch.java | 2 +-
.../serverHandler/ServerApiSqlPrepare.java | 2 +-
.../org/trafodion/jdbc_test/JdbcCommon.java | 2 +-
.../src/asciidoc/_chapters/query_execution.adoc | 71 +-
.../src/asciidoc/_chapters/ddl_msgs.adoc | 111 +-
.../src/asciidoc/_chapters/enable_security.adoc | 19 +-
.../src/asciidoc/_chapters/introduction.adoc | 435 +-
.../src/asciidoc/_chapters/prepare.adoc | 110 +-
.../src/asciidoc/_chapters/quickstart.adoc | 485 +-
.../src/asciidoc/_chapters/requirements.adoc | 37 +-
.../src/asciidoc/_chapters/script_install.adoc | 599 +-
.../src/asciidoc/_chapters/script_remove.adoc | 50 +-
.../src/asciidoc/_chapters/script_upgrade.adoc | 286 +-
.../src/asciidoc/_chapters/olap_functions.adoc | 129 +-
.../sql_functions_and_expressions.adoc | 16663 ++++++++---------
.../_chapters/sql_language_elements.adoc | 6 +-
.../src/asciidoc/_chapters/sql_statements.adoc | 114 +-
.../site/resources/images/logos/egg-logo.png | Bin 7241 -> 9454 bytes
install/ambari-installer/mpack.json | 4 +-
.../2.1/configuration/trafodion-env.xml | 6 +-
.../TRAFODION/2.1/package/scripts/params.py | 8 +-
.../2.1/package/scripts/trafodionnode.py | 7 +
.../TRAFODION/2.1/service_advisor.py | 3 +-
install/installer/traf_hortonworks_mods | 6 +
.../configs/db_config_default.ini | 7 +-
install/python-installer/configs/mod_cfgs.json | 5 +-
install/python-installer/configs/prompt.json | 15 +-
install/python-installer/configs/version.json | 2 +-
install/python-installer/db_install.py | 27 +-
install/python-installer/db_uninstall.py | 25 +-
install/python-installer/discovery.py | 3 +-
install/python-installer/scripts/apache_mods.py | 3 +-
install/python-installer/scripts/common.py | 33 +-
install/python-installer/scripts/constants.py | 63 +
install/python-installer/scripts/copy_files.py | 37 +-
install/python-installer/scripts/dcs_setup.py | 38 +-
install/python-installer/scripts/hadoop_mods.py | 3 +-
install/python-installer/scripts/hdfs_cmds.py | 17 +-
install/python-installer/scripts/traf_check.py | 10 +-
.../python-installer/scripts/traf_discover.py | 26 +-
.../python-installer/scripts/traf_kerberos.py | 10 +-
install/python-installer/scripts/traf_ldap.py | 37 +-
.../python-installer/scripts/traf_package.py | 11 +-
install/python-installer/scripts/traf_setup.py | 66 +-
.../python-installer/scripts/traf_sqconfig.py | 8 +-
install/python-installer/scripts/traf_start.py | 8 +-
install/python-installer/scripts/traf_user.py | 98 +-
install/python-installer/scripts/wrapper.py | 63 +-
tests/phx/phoenix_test.py | 2 +-
.../org/trafodion/phoenix/end2end/BaseTest.java | 2 +-
523 files changed, 80695 insertions(+), 73964 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/16ef85d9/core/sqf/export/include/seabed/ms.h
----------------------------------------------------------------------
diff --cc core/sqf/export/include/seabed/ms.h
index 51be6c4,e00bac9..2fbed77
--- a/core/sqf/export/include/seabed/ms.h
+++ b/core/sqf/export/include/seabed/ms.h
@@@ -427,10 -418,11 +427,9 @@@ typedef enum
MS_ReqType_Stfsd,
MS_ReqType_TmLeader,
MS_ReqType_TmReady,
- MS_ReqType_TmSeqNum,
MS_ReqType_TmSync,
MS_ReqType_TransInfo,
- MS_ReqType_MonStats,
- MS_ReqType_ZoneInfo,
- MS_ReqType_TmRestarted
+ MS_ReqType_ZoneInfo
} MS_Mon_REQTYPE;
typedef enum {
MS_ProcessType_Undefined = 0,
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/16ef85d9/core/sqf/monitor/linux/clio.cxx
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/clio.cxx
index c4afaf5,b05a874..c4c2690
--- a/core/sqf/monitor/linux/clio.cxx
+++ b/core/sqf/monitor/linux/clio.cxx
@@@ -2300,9 -2245,9 +2294,8 @@@ const char * Local_IO_To_Monitor::reqTy
"Stfsd",
"TmLeader",
"TmReady",
- "TmSeqNum",
"TmSync",
"TransInfo",
- "MonStats",
"ZoneInfo",
"invalid"
};
@@@ -2311,20 -2256,18 +2304,19 @@@ const char * Local_IO_To_Monitor::reply
"Generic",
"Dump",
"Get",
+ "MonStats",
+ "Mount",
"NewProcess",
"NodeInfo",
- "PhysicalNodeInfo",
- "ProcessInfo",
+ "NodeName",
"Open",
"OpenInfo",
- "TmSync",
- "TransInfo",
+ "PNodeInfo",
+ "ProcessInfo",
"Stfsd",
"Startup",
- "TmSeqNum",
- "Mount",
- "MonStats",
+ "TmSync",
+ "TransInfo",
"ZoneInfo",
"invalid"
};
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/16ef85d9/core/sqf/monitor/linux/cluster.cxx
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/cluster.cxx
index c07e691,647f7c9..641ac76
--- a/core/sqf/monitor/linux/cluster.cxx
+++ b/core/sqf/monitor/linux/cluster.cxx
@@@ -497,13 -473,10 +477,11 @@@ CCluster::CCluster (void
TmSyncPNid (-1),
CurNodes (0),
CurProcs (0),
- cfgPNodes_ (-1),
+ configPNodesCount_ (-1),
+ configPNodesMax_ (-1),
NodeMap (NULL),
- LastTmSeqNum (-1),
- TmLeaderNid (0), // nid 0 is the defacto leader.
+ TmLeaderNid (-1),
tmReadyCount_(0),
- TmSeqAssigned (NULL ),
minRecvCount_(4096),
recvBuffer_(NULL),
recvBuffer2_(NULL),
@@@ -531,10 -504,10 +509,6 @@@
,verifierNum_(0)
{
int i;
-- char buffer[32];
-- char fname[MAX_PROCESS_PATH];
-- FILE *ini;
--
const char method_name[] = "CCluster::CCluster";
TRACE_ENTRY;
@@@ -632,47 -598,19 +606,18 @@@
// build the node objects & Sync collision assignment arrays
// these buffers will be used in ShareWithPeers in AllGather
// operation to get TMSync data as well as Replication data.
- recvBuffer_ = new struct sync_buffer_def[NumNodes];
- recvBuffer2_ = new struct sync_buffer_def[NumNodes];
+ // Allocate the maximum allowed so that we pay the price only once.
+ // This wastes a bit of memory but reduces complexity when
+ // adding and deleting nodes. Usage is based on GetConfigPNodesMax()
+ // the maximum number that can be configured.
+ recvBuffer_ = new struct sync_buffer_def[GetConfigPNodesMax()];
+ recvBuffer2_ = new struct sync_buffer_def[GetConfigPNodesMax()];
- TmSeqAssigned = new int [GetConfigPNodesMax()];
-
- // Read initialization file
- snprintf(fname, sizeof(fname), "%s/monitor.ini",getenv("MPI_TMPDIR"));
- ini = fopen(fname, "r");
- if( ini )
- {
- for (i=0; i<=MyPNID; i++)
- {
- fgets(buffer,32,ini);
- LastTmSeqNum = atol( &buffer[13] );
- }
- fclose(ini);
- }
- if( LastTmSeqNum == -1 )
- {
- LastTmSeqNum = 0;
- char buf[MON_STRING_BUF_SIZE];
- snprintf(buf, sizeof(buf), "[CCluster::CCluster], Error= No monitor.ini found, setting to defaults. \n");
- mon_log_write(MON_CLUSTER_CLUSTER_2, SQ_LOG_ERR, buf);
- }
- if (trace_settings & TRACE_INIT)
- trace_printf("%s@%d" " - Initialized LastTmSeqNum=" "%d" "\n", method_name, __LINE__, LastTmSeqNum);
-
TRACE_EXIT;
}
CCluster::~CCluster (void)
{
-- int ini=-1;
-- long pos=0;
-- char buf[32];
-- char fname[MAX_PROCESS_PATH];
--
const char method_name[] = "CCluster::~CCluster";
TRACE_ENTRY;
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/16ef85d9/core/sqf/monitor/linux/cluster.h
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/cluster.h
index 4d429fd,35ac496..3b8ba20
mode 100644,100755..100644
--- a/core/sqf/monitor/linux/cluster.h
+++ b/core/sqf/monitor/linux/cluster.h
@@@ -212,13 -206,10 +211,11 @@@ protected
private:
int CurNodes; // Current # of nodes in the cluster
int CurProcs; // Current # if processes alive in MPI_COMM_WORLD
- int cfgPNodes_; // # of physical nodes configured
+ int configPNodesCount_; // # of physical nodes configured
+ int configPNodesMax_; // max # of physical nodes that can be configured
int *NodeMap; // Mapping of Node ranks to COMM_WORLD ranks
- int LastTmSeqNum; // Last used TM cluster seq. number
int TmLeaderNid; // Nid of currently assigned TM Leader node
int tmReadyCount_; // # of DTM processes ready for transactions
- int *TmSeqAssigned; // TM seq. # collision assignment array
size_t minRecvCount_; // minimum size of receive buffer for allgather
// Pointer to array of "sync_buffer_def" structures. Used by
@@@ -349,7 -340,7 +346,6 @@@
void setNewComm(int nid);
void setNewSock(int nid);
- void CoordinateTmSeqNumber( int nid );
-
unsigned long long EnsureAndGetSeqNum(cluster_state_def_t nodestate[]);
void SetupCommWorld( void );
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/16ef85d9/core/sqf/monitor/linux/internal.h
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/16ef85d9/core/sqf/monitor/linux/makefile
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/makefile
index da236fe,4b0c7aa..a933bdc
mode 100644,100755..100644
--- a/core/sqf/monitor/linux/makefile
+++ b/core/sqf/monitor/linux/makefile
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/16ef85d9/core/sqf/monitor/linux/mlio.cxx
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/mlio.cxx
index 95cb899,033b635..61803f8
--- a/core/sqf/monitor/linux/mlio.cxx
+++ b/core/sqf/monitor/linux/mlio.cxx
@@@ -113,9 -109,9 +113,8 @@@ const int SQ_LocalIOToClient::serviceRe
sizeof(REQTYPE) + sizeof( Stfsd_def ), // ReqType_Stfsd
sizeof(REQTYPE) + sizeof( TmLeader_def ), // ReqType_TmLeader
sizeof(REQTYPE) + sizeof( TmReady_def ), // ReqType_TmReady
- sizeof(REQTYPE) + sizeof( int ), // ReqType_TmSeqNum
sizeof(REQTYPE) + sizeof( TmSync_def ), // ReqType_TmSync
sizeof(REQTYPE) + sizeof( TransInfo_def ), // ReqType_TransInfo
- sizeof(REQTYPE) + sizeof( MonStats_def ), // ReqType_MonStats
sizeof(REQTYPE) + sizeof( ZoneInfo_def ), // ReqType_ZoneInfo
sizeof(REQTYPE) + sizeof( NodeName_def ) // ReqType_NodeName
};
@@@ -127,19 -123,18 +126,18 @@@ const int SQ_LocalIOToClient::serviceRe
sizeof(REPLYTYPE) + sizeof( Generic_reply_def ), // ReplyType_Generic
sizeof(REPLYTYPE) + sizeof( Dump_reply_def ), // ReplyType_Dump
sizeof(REPLYTYPE) + sizeof( Get_reply_def ), // ReplyType_Get
+ sizeof(REPLYTYPE) + sizeof( MonStats_reply_def ), // ReplyType_MonStats
+ sizeof(REPLYTYPE) + sizeof( Mount_reply_def ), // ReplyType_Mount
sizeof(REPLYTYPE) + sizeof( NewProcess_reply_def ), // ReplyType_NewProcess
sizeof(REPLYTYPE) + sizeof( NodeInfo_reply_def ), // ReplyType_NodeInfo
- sizeof(REPLYTYPE) + sizeof( PNodeInfo_reply_def ), // ReplyType_PNodeInfo
- sizeof(REPLYTYPE) + sizeof( ProcessInfo_reply_def ), // ReplyType_ProcessInfo
sizeof(REPLYTYPE) + sizeof( Open_reply_def ), // ReplyType_Open
sizeof(REPLYTYPE) + sizeof( OpenInfo_reply_def ), // ReplyType_OpenInfo
- sizeof(REPLYTYPE) + sizeof( TmSync_reply_def ), // ReplyType_TmSync
- sizeof(REPLYTYPE) + sizeof( TransInfo_reply_def ), // ReplyType_TransInfo
+ sizeof(REPLYTYPE) + sizeof( PNodeInfo_reply_def ), // ReplyType_PNodeInfo
+ sizeof(REPLYTYPE) + sizeof( ProcessInfo_reply_def ), // ReplyType_ProcessInfo
sizeof(REPLYTYPE) + sizeof( Stfsd_reply_def ), // ReplyType_Stfsd
sizeof(REPLYTYPE) + sizeof( Startup_reply_def ), // ReplyType_Startup
- sizeof(REPLYTYPE) + sizeof( int ), // ReplyType_TmSeqNum
- sizeof(REPLYTYPE) + sizeof( Mount_reply_def ), // ReplyType_Mount
- sizeof(REPLYTYPE) + sizeof( MonStats_reply_def ), // ReplyType_MonStats
+ sizeof(REPLYTYPE) + sizeof( TmSync_reply_def ), // ReplyType_TmSync
+ sizeof(REPLYTYPE) + sizeof( TransInfo_reply_def ), // ReplyType_TransInfo
sizeof(REPLYTYPE) + sizeof( ZoneInfo_reply_def ), // ReplyType_ZoneInfo
sizeof(REPLYTYPE) + sizeof( NodeName_reply_def ) // ReplyType_NodeName
};
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/16ef85d9/core/sqf/monitor/linux/montim.cxx
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/16ef85d9/core/sqf/monitor/linux/msgdef.h
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/msgdef.h
index 259cd5d,d7d6089..9562b35
mode 100644,100755..100644
--- a/core/sqf/monitor/linux/msgdef.h
+++ b/core/sqf/monitor/linux/msgdef.h
@@@ -254,10 -252,11 +254,9 @@@ typedef enum
ReqType_Stfsd, // process stfsd request
ReqType_TmLeader, // request to become the TM leader
ReqType_TmReady, // request to indicate TM ready for transactions
- ReqType_TmSeqNum, // request the next TM cluster sequence number
ReqType_TmSync, // request to sync data across all TM's in cluster
ReqType_TransInfo, // request transaction enlistment information
- ReqType_MonStats, // get monitor statistics
ReqType_ZoneInfo, // zone information request
- ReqType_NodeName, // change node name request
ReqType_Invalid // marks the end of the request
// types, add any new request types
@@@ -272,21 -271,20 +271,20 @@@ typedef enum
ReplyType_Generic=100, // general reply across message types
ReplyType_Dump, // reply with dump info
ReplyType_Get, // reply with configuration key/value pairs
+ ReplyType_MonStats, // reply with monitor statistics
+ ReplyType_Mount, // reply with mount info
ReplyType_NewProcess, // reply with new process information
ReplyType_NodeInfo, // reply with info on list of nodes
- ReplyType_PNodeInfo, // reply with info on list of physical nodes
- ReplyType_ProcessInfo, // reply with info on list of processes
+ ReplyType_NodeName, // reply with results
ReplyType_Open, // reply with open server information
ReplyType_OpenInfo, // reply with list of opens for a process
- ReplyType_TmSync, // reply from unsolicited TmSync message
- ReplyType_TransInfo, // reply with transaction enlistment process list
+ ReplyType_PNodeInfo, // reply with info on list of physical nodes
+ ReplyType_ProcessInfo, // reply with info on list of processes
ReplyType_Stfsd, // reply with stfsd info
ReplyType_Startup, // reply with startup info
- ReplyType_TmSeqNum, // reply with the next TM cluster sequence number
- ReplyType_Mount, // reply with mount info
- ReplyType_MonStats, // reply with monitor statistics
+ ReplyType_TmSync, // reply from unsolicited TmSync message
+ ReplyType_TransInfo, // reply with transaction enlistment process list
ReplyType_ZoneInfo, // reply with info on list of zones
- ReplyType_NodeName, // reply with results
ReplyType_Invalid // marks the end of the reply types,
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/16ef85d9/core/sqf/monitor/linux/reqqueue.cxx
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/reqqueue.cxx
index e681e34,907173c..19b8313
--- a/core/sqf/monitor/linux/reqqueue.cxx
+++ b/core/sqf/monitor/linux/reqqueue.cxx
@@@ -3997,10 -3648,11 +3992,9 @@@ const bool CReqQueue::reqConcurrent[]
false, // ReqType_Stfsd
false, // ReqType_TmLeader
false, // ReqType_TmReady,
- false, // ReqType_TmSeqNum
false, // ReqType_TmSync
false, // ReqType_TransInfo
- false, // ReqType_MonStats
false, // ReqType_ZoneInfo
- false, // ReqType_NodeName
false // ReqType_Invalid
};
@@@ -4037,9 -3703,9 +4031,8 @@@ const char * CReqQueue::svcReqType[] =
"Stfsd",
"TmLeader",
"TmReady",
- "TmSeqNum",
"TmSync",
"TransInfo",
- "MonStats",
"ZoneInfo"
};
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/16ef85d9/core/sqf/monitor/linux/reqqueue.h
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/reqqueue.h
index f4bf099,6e2426c..71a0fff
mode 100644,100755..100644
--- a/core/sqf/monitor/linux/reqqueue.h
+++ b/core/sqf/monitor/linux/reqqueue.h
@@@ -1281,11 -1169,10 +1268,10 @@@ private
RQER CExtShutdownReq
RQES CExtStartupReq
RQET CExtTmLeaderReq
- RQEU CExtTmSeqNumReq
RQEV CExtTmSyncReq
RQEW CExtZoneInfoReq
- RQEX (unused)
- RQEY (unused)
+ RQEX CExtNodeAddReq
+ RQEY CExtNodeDeleteReq
RQEZ CExtNodeNameReq
RQE_ CExtNullReq
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/16ef85d9/core/sqf/monitor/linux/zclient.cxx
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/16ef85d9/core/sqf/monitor/test/Makefile
----------------------------------------------------------------------
diff --cc core/sqf/monitor/test/Makefile
index f4d1f96,325d0a4..8f75993
--- a/core/sqf/monitor/test/Makefile
+++ b/core/sqf/monitor/test/Makefile
@@@ -27,8 -27,6 +27,8 @@@ FLAGS = $(CFLAGS
#FLAGS+= -fdiagnostics-show-option
FLAGS+= -Wall -Wextra
- LIBS+= -lsqlite3
++LIBS+= -L$(LIBEXPDIR) -L$(ZOOKEEPER_DIR)/lib -lsqlite3 -ltrafconfig
+
INCLUDES = -I$(INCEXPDIR) -I../linux
MONOUTDIR = ../linux/$(OUTDIR)
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/16ef85d9/core/sqf/monitor/test/runtest
----------------------------------------------------------------------
diff --cc core/sqf/monitor/test/runtest
index 4622ab1,f2d0142..9c08949
--- a/core/sqf/monitor/test/runtest
+++ b/core/sqf/monitor/test/runtest
@@@ -51,8 -51,8 +51,8 @@@ function Usag
echo " 2 - Multi-Node"
echo " 3 - Registry"
echo " 4 - Death Notice"
-- echo " 5 - Persistent Process"
-- echo " 6 - DTM Process"
++ echo " 5 - Persistent Process (FAILS-TBD)"
++ echo " 6 - DTM Process (FAILS-TBD)"
echo " 7 - SPX Process"
echo " 8 - Process Create"
echo " 9 - Node down before startup"
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/16ef85d9/core/sqf/sql/scripts/sqstart
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/16ef85d9/core/sqf/src/seabed/src/labelmaps.cpp
----------------------------------------------------------------------
diff --cc core/sqf/src/seabed/src/labelmaps.cpp
index 2a1cb81,133f1d8..cba798c
--- a/core/sqf/src/seabed/src/labelmaps.cpp
+++ b/core/sqf/src/seabed/src/labelmaps.cpp
@@@ -371,9 -355,9 +371,8 @@@ static const char *ga_ms_mon_req_type_l
"MS_ReqType_Stfsd",
"MS_ReqType_TmLeader",
"MS_ReqType_TmReady",
- "MS_ReqType_TmSeqNum",
"MS_ReqType_TmSync",
"MS_ReqType_TransInfo",
- "MS_ReqType_MonStats",
"MS_ReqType_ZoneInfo",
SB_LABEL_END
};
@@@ -409,9 -387,9 +408,8 @@@ static const char *ga_ms_mon_req_type_s
"Stfsd",
"TmLeader",
"TmReady",
- "TmSeqNum",
"TmSync",
"TransInfo",
- "MonStats",
"ZoneInfo",
SB_LABEL_END
};
@@@ -461,20 -439,18 +459,19 @@@ static const char *ga_sb_msmon_reply_ty
"Generic",
"Dump",
"Get",
+ "MonStats",
+ "Mount",
"NewProcess",
"NodeInfo",
- "PNodeInfo",
- "ProcessInfo",
+ "NodeName",
"Open",
"OpenInfo",
- "TmSync",
- "TransInfo",
+ "PNodeInfo",
+ "ProcessInfo",
"Stfsd",
"Startup",
- "TmSeqNum",
- "Mount",
- "MonStats",
+ "TmSync",
+ "TransInfo",
"ZoneInfo",
SB_LABEL_END
};
@@@ -595,9 -562,9 +592,8 @@@ static const char *ga_sb_utrace_api_mon
"ReqType_Stfsd",
"ReqType_TmLeader",
"ReqType_TmReady",
- "ReqType_TmSeqNum",
"ReqType_TmSync",
"ReqType_TransInfo",
- "ReqType_MonStats",
"ReqType_ZoneInfo",
SB_LABEL_END
};
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/16ef85d9/core/sqf/src/seabed/src/msmon.cpp
----------------------------------------------------------------------
diff --cc core/sqf/src/seabed/src/msmon.cpp
index 174fba5,d4dae3b..696375d
--- a/core/sqf/src/seabed/src/msmon.cpp
+++ b/core/sqf/src/seabed/src/msmon.cpp
@@@ -3652,13 -3609,13 +3609,11 @@@ void msg_mon_init()
SB_util_static_assert(static_cast<int>(MS_Mon_State_Unknown) ==
static_cast<int>(State_Unknown)); // sw fault
-- SB_util_static_assert(static_cast<int>(MS_Mon_State_Initializing) ==
-- static_cast<int>(State_Initializing)); // sw fault
++ SB_util_static_assert(static_cast<int>(MS_Mon_State_Takeover) ==
++ static_cast<int>(State_Takeover)); // sw fault
SB_util_static_assert(static_cast<int>(MS_Mon_ShutdownLevel_Undefined) ==
static_cast<int>(ShutdownLevel_Undefined)); // sw fault
-- SB_util_static_assert(static_cast<int>(MS_Mon_ShutdownLevel_Normal) ==
-- static_cast<int>(ShutdownLevel_Normal)); // sw fault
SB_util_static_assert(static_cast<int>(MS_Mon_ShutdownLevel_Abrupt) ==
static_cast<int>(ShutdownLevel_Abrupt)); // sw fault
@@@ -3674,48 -3631,8 +3629,8 @@@
SB_util_static_assert(static_cast<int>(MS_MsgType_Change) ==
static_cast<int>(MsgType_Change)); // sw fault
- SB_util_static_assert(static_cast<int>(MS_MsgType_Close) ==
- static_cast<int>(MsgType_Close)); // sw fault
- SB_util_static_assert(static_cast<int>(MS_MsgType_Event) ==
- static_cast<int>(MsgType_Event)); // sw fault
- SB_util_static_assert(static_cast<int>(MS_MsgType_NodeAdded) ==
- static_cast<int>(MsgType_NodeAdded)); // sw fault
- SB_util_static_assert(static_cast<int>(MS_MsgType_NodeChanged) ==
- static_cast<int>(MsgType_NodeChanged)); // sw fault
- SB_util_static_assert(static_cast<int>(MS_MsgType_NodeDeleted) ==
- static_cast<int>(MsgType_NodeDeleted)); // sw fault
- SB_util_static_assert(static_cast<int>(MS_MsgType_NodeDown) ==
- static_cast<int>(MsgType_NodeDown)); // sw fault
- SB_util_static_assert(static_cast<int>(MS_MsgType_NodeJoining) ==
- static_cast<int>(MsgType_NodeJoining)); // sw fault
- SB_util_static_assert(static_cast<int>(MS_MsgType_NodePrepare) ==
- static_cast<int>(MsgType_NodePrepare)); // sw fault
- SB_util_static_assert(static_cast<int>(MS_MsgType_NodeQuiesce) ==
- static_cast<int>(MsgType_NodeQuiesce)); // sw fault
- SB_util_static_assert(static_cast<int>(MS_MsgType_NodeUp) ==
- static_cast<int>(MsgType_NodeUp)); // sw fault
- SB_util_static_assert(static_cast<int>(MS_MsgType_Open) ==
- static_cast<int>(MsgType_Open)); // sw fault
- SB_util_static_assert(static_cast<int>(MS_MsgType_ProcessCreated) ==
- static_cast<int>(MsgType_ProcessCreated)); // sw fault
- SB_util_static_assert(static_cast<int>(MS_MsgType_ProcessDeath) ==
- static_cast<int>(MsgType_ProcessDeath)); // sw fault
-- SB_util_static_assert(static_cast<int>(MS_MsgType_ReintegrationError) ==
- static_cast<int>(MsgType_ReintegrationError)); // sw fault
- SB_util_static_assert(static_cast<int>(MS_MsgType_Service) ==
- static_cast<int>(MsgType_Service)); // sw fault
- SB_util_static_assert(static_cast<int>(MS_MsgType_SpareUp) ==
- static_cast<int>(MsgType_SpareUp)); // sw fault
- SB_util_static_assert(static_cast<int>(MS_MsgType_Shutdown) ==
- static_cast<int>(MsgType_Shutdown)); // sw fault
- SB_util_static_assert(static_cast<int>(MS_MsgType_TmRestarted) ==
- static_cast<int>(MsgType_TmRestarted)); // sw fault
- SB_util_static_assert(static_cast<int>(MS_MsgType_TmSyncAbort) ==
- static_cast<int>(MsgType_TmSyncAbort)); // sw fault
- SB_util_static_assert(static_cast<int>(MS_MsgType_TmSyncCommit) ==
- static_cast<int>(MsgType_TmSyncCommit)); // sw fault
- static_cast<int>(MS_MsgType_ReintegrationError)); // sw fault
+ SB_util_static_assert(static_cast<int>(MS_MsgType_UnsolicitedMessage) ==
+ static_cast<int>(MsgType_UnsolicitedMessage)); // sw fault
SB_util_static_assert(static_cast<int>(MS_ReqType_Close) ==
static_cast<int>(ReqType_Close)); // sw fault
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/16ef85d9/core/sqf/src/seabed/test/Makefile
----------------------------------------------------------------------
diff --cc core/sqf/src/seabed/test/Makefile
index a8b4948,0a12ab3..f13d1e4
--- a/core/sqf/src/seabed/test/Makefile
+++ b/core/sqf/src/seabed/test/Makefile
@@@ -23,15 -23,15 +23,15 @@@ CHK = $(OUTDIR) tcheck testfile
PROGS = t2 t3 t4 t5 t6 t9 t14 t15 t16 t17 t18 t19 \
t20 t21 t22 t23 t24 t25 t27 \
t30 t31 t32 t35 t36 t37 t38 t39 \
-- t40 t41 t42 t43 t44 t45 t48 t49 \
-- t50 t51 t52 t53 t54 t55 t56 t57 t58 \
++ t40 t41 t42 t43 t44 t48 t49 \
++ t50 t51 t52 t56 t57 t58 \
t61 t62 t63 t64 t65 t66 t67 t68 t69 \
t70 t71 t72 t73 t74 t75 t76 t77 t78 t79 \
t80 t83 t84 t85 t86 t88 \
-- t91 t92 t93 t94 t95 t96 t98 \
++ t91 t92 t93 t94 t96 t98 \
t100 t101 t102 t103 t104 t105 \
t115 t118 \
-- t124 t126 t127 t128 t129 \
++ t124 t127 t128 t129 \
t130 t131 t132 t133 t135 t137 t138 t139 \
t141 t142 t145 t149 \
t151 t152 t153 t155 t156 t157 \
@@@ -43,11 -43,11 +43,11 @@@
t210 t212 t213 t214 t215 t216 t217 t219 \
t220 t221 t222 t226 t227 t228 \
t231 t233 t234 t235 t238 \
-- t240 t241 t242 t245 t246 t249 \
-- t250 t253 \
++ t240 t241 t242 t245 t246 \
++ t253 \
t261 t262 t266 \
t277 t279 \
-- t280 t281 t282 t284 t285 \
++ t280 t281 t282 t284 \
tcheck tsock ttee
PROGSI = t2fs t3ms t4ms \
t5ms t6ms t9thread t14ms \
@@@ -58,19 -58,19 +58,19 @@@
t30cli t30srv t31fs t32fsx \
t35ms t36ms t37fs t38fs t39fs \
t40fs t41cli t41srv t42cli t42srv t43ms t44ms \
-- t45fs t48fs t49cli t49srv \
-- t50fs t51ms t52ms t53fs t54fs t55fs t56fs t57ms t58ms \
++ t48fs t49cli t49srv \
++ t50fs t51ms t52ms t56fs t57ms t58ms \
t61ms t62fs t63ms t64ms \
t65fs t66ms t67fs t68ms t69ms \
t70cli t70srv t71ms t72fs t73ms t74ms \
t75ms t76fs t77fs t78fs t79fs \
t80fs t83fs t84fs t85ms t86ms t88ms \
-- t91ms t92ms t93ms t94fs t95fs t96ms t98ms \
++ t91ms t92ms t93ms t94fs t96ms t98ms \
t100ms t101fs t102fs t103fs t104ms \
t105ms \
t115ms t118ms \
t124fs \
-- t126fs t127ms t128fs t129ms \
++ t127ms t128fs t129ms \
t130map t131ms t132ms t133cli t133srv \
t135ms t137ms t138ms t139cl \
t141ms t142cli t142srv \
@@@ -95,12 -95,12 +95,12 @@@
t233ms t234ms \
t235ms t238ms \
t240ms t241ms t242fs \
-- t245ms t246ms t249ms \
-- t250ms t253ms \
++ t245ms t246ms \
++ t253ms \
t261ms t262ms \
t266ms \
t277fs t279ms \
-- t280fs t281ms t282ms t284cli t284srv t285fs
++ t280fs t281ms t282ms t284cli t284srv
###########################################################################
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/16ef85d9/core/sqf/src/seabed/test/goall
----------------------------------------------------------------------
diff --cc core/sqf/src/seabed/test/goall
index b963689,9317568..aa9dac6
--- a/core/sqf/src/seabed/test/goall
+++ b/core/sqf/src/seabed/test/goall
@@@ -78,20 -79,20 +78,20 @@@ go42 $cluster $verbos
go43 $cluster $verbose
go43 $cluster $verbose -breaklisten
go44 $cluster $verbose
--go45 $cluster $verbose
--go45 $cluster $verbose -nowait
++#go45 $cluster $verbose
++#go45 $cluster $verbose -nowait
go48 $cluster $verbose
go49 $cluster $verbose
go50 $cluster $verbose
go50 $cluster $verbose -nowait
go51 $cluster $verbose
go52 $cluster $verbose
--go53 $cluster $verbose
--go53 $cluster $verbose -nowait
--go54 $cluster $verbose
--go54 $cluster $verbose -nowait
--go55 $cluster $verbose
--go55 $cluster $verbose -nowait
++#go53 $cluster $verbose
++#go53 $cluster $verbose -nowait
++#go54 $cluster $verbose
++#go54 $cluster $verbose -nowait
++#go55 $cluster $verbose
++#go55 $cluster $verbose -nowait
go56 $cluster $verbose
go57 $cluster $verbose
go58 $cluster $verbose
@@@ -131,7 -132,7 +131,7 @@@ go91 $cluster $verbos
go92 $cluster $verbose
go93 $cluster $verbose
go94 $cluster $verbose
--go95 $cluster $verbose
++#go95 $cluster $verbose
go96 $cluster $verbose
go98 $cluster $verbose
go100 $cluster $verbose
@@@ -144,7 -145,7 +144,7 @@@ go115 $cluster $verbos
go118 $cluster $verbose
go118 $cluster $verbose -nowait
go124 $cluster $verbose -maxcp 2 -maxsp 4
--go126 $cluster $verbose
++#go126 $cluster $verbose
go127 $cluster $verbose
go128 $cluster $verbose
go129 $cluster $verbose
@@@ -250,13 -251,13 +250,13 @@@ go233 $cluster $verbos
go234 $cluster $verbose -maxsp 10
go235 $cluster $verbose
go238
--go240 $cluster $verbose
++#go240 $cluster $verbose
go241 $cluster $verbose
go242 $cluster $verbose
go245 $cluster $verbose
go246 $cluster $verbose
--go249 $cluster $verbose
--go250 $cluster $verbose
++#go249 $cluster $verbose
++#go250 $cluster $verbose
go253 $cluster $verbose
go261 $cluster $verbose
go262 $cluster $verbose
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/16ef85d9/core/sqf/src/seabed/test/godb.pl
----------------------------------------------------------------------
diff --cc core/sqf/src/seabed/test/godb.pl
index b3fd3a3,0000000..5939634
mode 100755,000000..100755
--- a/core/sqf/src/seabed/test/godb.pl
+++ b/core/sqf/src/seabed/test/godb.pl
@@@ -1,60 -1,0 +1,82 @@@
+#!/usr/bin/perl
+# @@@ START COPYRIGHT @@@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# @@@ END COPYRIGHT @@@
+#
+use strict;
+
+use sqconfigdb;
+
+my $count = @ARGV[0];
+
+sqconfigdb::openDb();
+
+my $first_core = 0;
+my $first_excl = -1;
+my $last_core = 0;
+my $last_excl = -1;
+my $name_inx;
+my $num_proc = 0;
+my $node_name;
+my $nid;
+my $pnid;
+my $role_set = 7;
+open(CONF, "<nmap.conf");
+my @node_names;
+my $ninx = 0;
+while (<CONF>) {
+ $node_names[$ninx] = $_;
+ $ninx++;
+}
+for $nid (0..$count-1) {
+ $pnid = $nid;
+ $name_inx = $pnid + 1;
+ $node_name = "n${name_inx}";
+ if ($ninx > 0) {
+ if ($nid < $ninx) {
+ $node_name = $node_names[$nid];
+ $node_name =~ s/^\s+|\s+$//g;
+ }
+ }
+ sqconfigdb::addDbPNode($pnid, $node_name, $first_excl, $last_excl);
+ sqconfigdb::addDbLNode($nid, $pnid, $num_proc, $role_set, $first_core, $last_core);
+}
++sqconfigdb::addDbPersistData( "PERSIST_PROCESS_KEYS", "DTM,PSD,WDG" );
++sqconfigdb::addDbPersistData( "DTM_PROCESS_NAME", "\$TM%nid+" );
++sqconfigdb::addDbPersistData( "DTM_PROCESS_TYPE", "DTM" );
++sqconfigdb::addDbPersistData( "DTM_PROGRAM_NAME", "tm" );
++sqconfigdb::addDbPersistData( "DTM_REQUIRES_DTM", "N" );
++sqconfigdb::addDbPersistData( "DTM_STDOUT", "stdout_DTM%nid" );
++sqconfigdb::addDbPersistData( "DTM_PERSIST_RETRIES", "2,30" );
++sqconfigdb::addDbPersistData( "DTM_PERSIST_ZONES", "%zid" );
++sqconfigdb::addDbPersistData( "PSD_PROCESS_NAME", "\$PSD%nid+" );
++sqconfigdb::addDbPersistData( "PSD_PROCESS_TYPE", "PSD" );
++sqconfigdb::addDbPersistData( "PSD_PROGRAM_NAME", "pstartd" );
++sqconfigdb::addDbPersistData( "PSD_REQUIRES_DTM", "N" );
++sqconfigdb::addDbPersistData( "PSD_STDOUT", "stdout_PSD%nid" );
++sqconfigdb::addDbPersistData( "PSD_PERSIST_RETRIES", "10,60" );
++sqconfigdb::addDbPersistData( "PSD_PERSIST_ZONES", "%zid" );
++sqconfigdb::addDbPersistData( "WDG_PROCESS_NAME", "\$WDG%nid+" );
++sqconfigdb::addDbPersistData( "WDG_PROCESS_TYPE", "WDG" );
++sqconfigdb::addDbPersistData( "WDG_PROGRAM_NAME", "sqwatchdog" );
++sqconfigdb::addDbPersistData( "WDG_REQUIRES_DTM", "N" );
++sqconfigdb::addDbPersistData( "WDG_STDOUT", "stdout_WDG%nid" );
++sqconfigdb::addDbPersistData( "WDG_PERSIST_RETRIES", "10,60" );
++sqconfigdb::addDbPersistData( "WDG_PERSIST_ZONES", "%zid" );
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/16ef85d9/core/sqf/tools/sqtools.sh
----------------------------------------------------------------------
[38/50] [abbrv] incubator-trafodion git commit: Trafodion
configuration API changes - new library files
Posted by su...@apache.org.
Trafodion configuration API changes - new library files
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/fd1c115f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/fd1c115f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/fd1c115f
Branch: refs/heads/master
Commit: fd1c115fd734dde18976d49b47fea3e9056a6027
Parents: 04040d3
Author: Zalo Correa <za...@esgyn.com>
Authored: Fri Feb 24 17:15:46 2017 -0800
Committer: Zalo Correa <za...@esgyn.com>
Committed: Fri Feb 24 17:15:46 2017 -0800
----------------------------------------------------------------------
core/sqf/monitor/linux/sqliteconfig.cxx | 3136 +++++++++++++++++++++++
core/sqf/monitor/linux/sqliteconfig.h | 133 +
core/sqf/monitor/linux/trafconfig.cxx | 403 +++
core/sqf/monitor/linux/trafconfig.h | 286 +++
core/sqf/monitor/linux/trafconfiglog.cxx | 121 +
core/sqf/monitor/linux/trafconfiglog.h | 44 +
core/sqf/monitor/linux/trafconfigtrace.cxx | 349 +++
core/sqf/monitor/linux/trafconfigtrace.h | 103 +
8 files changed, 4575 insertions(+)
----------------------------------------------------------------------
[07/50] [abbrv] incubator-trafodion git commit: Merge pull request
#10 from zcorrea/amanda
Posted by su...@apache.org.
Merge pull request #10 from zcorrea/amanda
addNode_step1 can be run more than once now
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/d96e648b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/d96e648b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/d96e648b
Branch: refs/heads/master
Commit: d96e648bfe0319c10f0bbbb245ce95693250e13f
Parents: 3f37b56 4363341
Author: Amanda <am...@esgyn.com>
Authored: Thu Aug 11 15:14:56 2016 -0700
Committer: GitHub <no...@github.com>
Committed: Thu Aug 11 15:14:56 2016 -0700
----------------------------------------------------------------------
install/installer/addNode_step1 | 22 ++++++++++++----------
install/installer/addNode_step2 | 4 ++--
2 files changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
[08/50] [abbrv] incubator-trafodion git commit: Fix to sqlci abort on
added node.
Posted by su...@apache.org.
Fix to sqlci abort on added node.
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/bcda47cb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/bcda47cb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/bcda47cb
Branch: refs/heads/master
Commit: bcda47cb88791ca6b2508873f6e28bf2fa6a408b
Parents: 3f37b56
Author: Zalo Correa <za...@esgyn.com>
Authored: Thu Aug 11 15:38:22 2016 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Thu Aug 11 15:38:22 2016 -0700
----------------------------------------------------------------------
core/sql/qmscommon/QRLogger.cpp | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/bcda47cb/core/sql/qmscommon/QRLogger.cpp
----------------------------------------------------------------------
diff --git a/core/sql/qmscommon/QRLogger.cpp b/core/sql/qmscommon/QRLogger.cpp
index 364c0d2..a4d2e15 100644
--- a/core/sql/qmscommon/QRLogger.cpp
+++ b/core/sql/qmscommon/QRLogger.cpp
@@ -153,26 +153,23 @@ void getMyNidSuffix(char stringNidSuffix[])
myPhandle.decompose();
char processName[MS_MON_MAX_PROCESS_NAME + 1];
-
memset(processName, 0, sizeof(processName));
memcpy(processName, myPhandle.getPhandleString(), myPhandle.getPhandleStringLen());
- memset(processName, 0, sizeof(processName));
- memcpy(processName, myPhandle.getPhandleString(), myPhandle.getPhandleStringLen());
-
-
MS_Mon_Process_Info_Type procInfo;
Int32 rc = 0;
Int32 myNid = 0;
- do
- {
- rc = msg_mon_get_process_info_detail(processName, &procInfo);
- myNid = procInfo.nid;
-
- } while ((rc == XZFIL_ERR_OK) && (procInfo.parent_nid != -1) && (procInfo.parent_pid != -1));
+ rc = msg_mon_get_process_info_detail(processName, &procInfo);
+ if (rc != 0) {
+ // at least let the logging proceed
+ myNid = 9999;
+ }
+ else {
+ myNid = procInfo.nid;
+ }
snprintf (stringNidSuffix, 5+sizeof(Int32), "_%d.log", myNid);
}
[48/50] [abbrv] incubator-trafodion git commit: Fix to SQL regression
core (test116) and other fixes.
Posted by su...@apache.org.
Fix to SQL regression core (test116) and other fixes.
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/b1f77f43
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/b1f77f43
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/b1f77f43
Branch: refs/heads/master
Commit: b1f77f431b3ffc5ad983f9201adf5ecc38190452
Parents: f7f6952
Author: Zalo Correa <za...@esgyn.com>
Authored: Tue May 23 22:04:02 2017 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Tue May 23 22:04:02 2017 -0700
----------------------------------------------------------------------
.../export/include/common/evl_sqlog_eventnum.h | 1 +
core/sqf/monitor/linux/cluster.cxx | 25 +++++++++++---
core/sqf/monitor/linux/monitor.cxx | 2 +-
core/sqf/monitor/linux/monlogging.cxx | 4 +--
core/sqf/monitor/linux/msgdef.h | 1 +
core/sqf/monitor/linux/zclient.cxx | 35 +++++++++++---------
core/sqf/monitor/linux/zootest.cxx | 8 ++---
core/sqf/sql/scripts/gensq.pl | 6 ++++
core/sqf/sql/scripts/sqconfig.persist | 4 +--
core/sqf/sql/scripts/sqtrace | 0
core/sqf/src/seabed/test/goall | 2 +-
.../src/seatrans/tm/hbasetmlib2/idtmclicom.h | 20 ++++++-----
core/sqf/src/tm/idtmsrv.cpp | 10 +++---
13 files changed, 75 insertions(+), 43 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b1f77f43/core/sqf/export/include/common/evl_sqlog_eventnum.h
----------------------------------------------------------------------
diff --git a/core/sqf/export/include/common/evl_sqlog_eventnum.h b/core/sqf/export/include/common/evl_sqlog_eventnum.h
index 8c17d24..3b8954b 100644
--- a/core/sqf/export/include/common/evl_sqlog_eventnum.h
+++ b/core/sqf/export/include/common/evl_sqlog_eventnum.h
@@ -190,6 +190,7 @@
#define MON_CLUSTER_SETKEEPALIVESOCKOPT_2 101014502
#define MON_CLUSTER_SETKEEPALIVESOCKOPT_3 101014503
#define MON_CLUSTER_SETKEEPALIVESOCKOPT_4 101014504
+#define MON_CLUSTER_HARDNODEUP_1 101014601
#define MON_CLUSTER_NO_LICENSE_VERIFIERS 101015001
/* Module: monitor.cxx = 02 */
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b1f77f43/core/sqf/monitor/linux/cluster.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/cluster.cxx b/core/sqf/monitor/linux/cluster.cxx
index 641ac76..45f43de 100644
--- a/core/sqf/monitor/linux/cluster.cxx
+++ b/core/sqf/monitor/linux/cluster.cxx
@@ -756,7 +756,7 @@ void CCluster::HardNodeDown (int pnid, bool communicate_state)
rename(port_fname, temp_fname);
}
- if (node->GetState() != State_Down || node->isInQuiesceState())
+ if (node->GetState() != State_Down || !node->isInQuiesceState())
{
snprintf(buf, sizeof(buf),
"[CCluster::HardNodeDown], Node %s (%d) is going down.\n",
@@ -1356,7 +1356,11 @@ int CCluster::HardNodeUp( int pnid, char *node_name )
rc = ZClient->WatchNode( node->GetName() );
if ( rc != ZOK )
{
- abort();
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s], Unable to set node watch on %s, pnid%d\n"
+ , method_name, node->GetName(), node->GetPNid() );
+ mon_log_write(MON_CLUSTER_HARDNODEUP_1, SQ_LOG_ERR, buf);
}
}
}
@@ -4547,7 +4551,13 @@ int CCluster::AllgatherSock( int nbytes, void *sbuf, char *rbuf, int tag, MPI_St
clock_gettime(CLOCK_REALTIME, ¤tTime);
if (currentTime.tv_sec < peer->znodeFailedTime.tv_sec)
{
- continue;
+ // Failsafe
+ peer->p_timeout_count++;
+
+ if ( peer->p_timeout_count < sv_epoll_retry_count )
+ {
+ continue;
+ }
}
if (trace_settings & (TRACE_INIT | TRACE_RECOVERY))
{
@@ -4558,11 +4568,16 @@ int CCluster::AllgatherSock( int nbytes, void *sbuf, char *rbuf, int tag, MPI_St
, currentTime.tv_sec
, peer->znodeFailedTime.tv_sec);
}
-
}
else
{
- continue;
+ // Failsafe
+ peer->p_timeout_count++;
+
+ if ( peer->p_timeout_count < sv_epoll_retry_count )
+ {
+ continue;
+ }
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b1f77f43/core/sqf/monitor/linux/monitor.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/monitor.cxx b/core/sqf/monitor/linux/monitor.cxx
index a1fafbe..d159b11 100755
--- a/core/sqf/monitor/linux/monitor.cxx
+++ b/core/sqf/monitor/linux/monitor.cxx
@@ -788,7 +788,7 @@ void CMonitor::CreateZookeeperClient( void )
string zkQuorumHosts;
stringstream zkQuorumPort;
char *env;
- char hostsStr[MPI_MAX_PROCESSOR_NAME * 3] = { 0 };
+ char hostsStr[MAX_PROCESSOR_NAME * 3] = { 0 };
char *tkn = NULL;
int zport;
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b1f77f43/core/sqf/monitor/linux/monlogging.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/monlogging.cxx b/core/sqf/monitor/linux/monlogging.cxx
index 322f297..d5a63f9 100755
--- a/core/sqf/monitor/linux/monlogging.cxx
+++ b/core/sqf/monitor/linux/monlogging.cxx
@@ -119,8 +119,8 @@ CMonLog::CMonLog( const char *log4cxxConfig
logFileType_ = SBX_LOG_TYPE_LOGFILE;
// Log4cxx logging
- char hostname[MPI_MAX_PROCESSOR_NAME] = {'\0'};
- gethostname(hostname, MPI_MAX_PROCESSOR_NAME);
+ char hostname[MAX_PROCESSOR_NAME] = {'\0'};
+ gethostname(hostname, MAX_PROCESSOR_NAME);
char logFileSuffix[MAX_FILE_NAME];
if (myNid_ != -1)
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b1f77f43/core/sqf/monitor/linux/msgdef.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/msgdef.h b/core/sqf/monitor/linux/msgdef.h
index 9562b35..44445bf 100644
--- a/core/sqf/monitor/linux/msgdef.h
+++ b/core/sqf/monitor/linux/msgdef.h
@@ -87,6 +87,7 @@
#define MAX_PROCESS_NAME MAX_KEY_NAME
#define MAX_PROCESS_NAME_STR 12
#define MAX_PROCESS_PATH 256
+#define MAX_PROCESSOR_NAME 128
#define MAX_REASON_TEXT 256
#define MAX_ROLEBUF_SIZE 84
#define MAX_SEARCH_PATH BUFSIZ
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b1f77f43/core/sqf/monitor/linux/zclient.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/zclient.cxx b/core/sqf/monitor/linux/zclient.cxx
index e01d39c..ae2b15b 100644
--- a/core/sqf/monitor/linux/zclient.cxx
+++ b/core/sqf/monitor/linux/zclient.cxx
@@ -58,7 +58,7 @@
using namespace std;
-extern char Node_name[MPI_MAX_PROCESSOR_NAME];
+extern char Node_name[MAX_PROCESSOR_NAME];
extern int MyPNID;
extern int MyNid;
extern int MyPid;
@@ -442,8 +442,9 @@ void CZClient::CheckCluster( void )
{
char buf[MON_STRING_BUF_SIZE];
snprintf( buf, sizeof(buf)
- , "[%s], GetZNodeData() failed!\n"
- , method_name );
+ , "[%s], GetZNodeData(%s) failed!\n"
+ , method_name
+ , monZnode.c_str() );
mon_log_write(MON_ZCLIENT_CHECKCLUSTER_2, SQ_LOG_ERR, buf);
}
else
@@ -613,7 +614,7 @@ int CZClient::GetZNodeData( string &monZnode, string &nodeName, int &pnid )
char pnidStr[8] = { 0 };
char *tkn = NULL;
- char zkData[MPI_MAX_PROCESSOR_NAME];
+ char zkData[MAX_PROCESSOR_NAME];
int rc = -1;
int zkDataLen = sizeof(zkData);
Stat stat;
@@ -683,8 +684,8 @@ void CZClient::HandleExpiredZNode( void )
if ( IsCheckCluster() )
{
- char pathStr[MPI_MAX_PROCESSOR_NAME] = { 0 };
- char nodeName[MPI_MAX_PROCESSOR_NAME] = { 0 };
+ char pathStr[MAX_PROCESSOR_NAME] = { 0 };
+ char nodeName[MAX_PROCESSOR_NAME] = { 0 };
char *tkn = NULL;
char *tknStart = pathStr;
char *tknLast = NULL;
@@ -889,8 +890,8 @@ int CZClient::MakeClusterZNodes( void )
default:
char buf[MON_STRING_BUF_SIZE];
snprintf( buf, sizeof(buf)
- , "[%s], zoo_exists() failed with error %s\n"
- , method_name, ZooErrorStr(rc) );
+ , "[%s], zoo_exists(%s) failed with error %s\n"
+ , method_name, rootDir.c_str(), ZooErrorStr(rc) );
mon_log_write(MON_ZCLIENT_CHECKCLUSTERZNODES_1, SQ_LOG_ERR, buf);
if (rc) return(rc); // Return the error
break;
@@ -923,8 +924,8 @@ int CZClient::MakeClusterZNodes( void )
default:
char buf[MON_STRING_BUF_SIZE];
snprintf( buf, sizeof(buf)
- , "[%s], zoo_exists() failed with error %s\n"
- , method_name, ZooErrorStr(rc) );
+ , "[%s], zoo_exists(%s) failed with error %s\n"
+ , method_name, instanceDir.c_str( ), ZooErrorStr(rc) );
mon_log_write(MON_ZCLIENT_CHECKCLUSTERZNODES_2, SQ_LOG_ERR, buf);
break;
}
@@ -957,8 +958,8 @@ int CZClient::MakeClusterZNodes( void )
default:
char buf[MON_STRING_BUF_SIZE];
snprintf( buf, sizeof(buf)
- , "[%s], zoo_exists() failed with error %s\n"
- , method_name, ZooErrorStr(rc) );
+ , "[%s], zoo_exists(%s) failed with error %s\n"
+ , method_name, clusterDir.c_str( ), ZooErrorStr(rc) );
mon_log_write(MON_ZCLIENT_CHECKCLUSTERZNODES_3, SQ_LOG_ERR, buf);
break;
}
@@ -1222,7 +1223,7 @@ int CZClient::SetZNodeWatch( string &monZnode )
const char method_name[] = "CZClient::SetZNodeWatch";
TRACE_ENTRY;
- char zkData[MPI_MAX_PROCESSOR_NAME];
+ char zkData[MAX_PROCESSOR_NAME];
int rc = -1;
int zkDataLen = sizeof(zkData);
Stat stat;
@@ -1504,7 +1505,8 @@ void CZClient::WatchCluster( void )
{
char buf[MON_STRING_BUF_SIZE];
snprintf( buf, sizeof(buf)
- , "[%s], GetZNodeData() failed!\n"
+ , "[%s], GetZNodeData(%s) failed!\n"
+ , monZnode.c_str()
, method_name );
mon_log_write(MON_ZCLIENT_WATCHCLUSTER_2, SQ_LOG_ERR, buf);
@@ -1559,8 +1561,9 @@ int CZClient::WatchNode( const char *nodeName )
{
char buf[MON_STRING_BUF_SIZE];
snprintf( buf, sizeof(buf)
- , "[%s], SetZNodeWatch() failed!\n"
- , method_name );
+ , "[%s], SetZNodeWatch(%s) failed!\n"
+ , method_name
+ , monZnode.c_str() );
mon_log_write(MON_ZCLIENT_WATCHNODE_1, SQ_LOG_ERR, buf);
}
else
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b1f77f43/core/sqf/monitor/linux/zootest.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/zootest.cxx b/core/sqf/monitor/linux/zootest.cxx
index 7a4620b..67ab345 100644
--- a/core/sqf/monitor/linux/zootest.cxx
+++ b/core/sqf/monitor/linux/zootest.cxx
@@ -45,7 +45,7 @@ using namespace std;
bool debugFlag = true;
bool ZClientEnabled = true;
-char Node_name[MPI_MAX_PROCESSOR_NAME] = {'\0'};
+char Node_name[MAX_PROCESSOR_NAME] = {'\0'};
char MyPNidStr[8];
int MyPNID = -1;
int MyNid = -1;
@@ -86,7 +86,7 @@ void CreateZookeeperClient( void )
string zkQuorumHosts;
stringstream zkQuorumPort;
char *env;
- char hostsStr[MPI_MAX_PROCESSOR_NAME*3] = { 0 };
+ char hostsStr[MAX_PROCESSOR_NAME*3] = { 0 };
char *tkn = NULL;
int zport;
@@ -190,7 +190,7 @@ int main( int argc, char *argv[], char *envp[] )
TRACE_ENTRY;
char *env;
- char MyName[MPI_MAX_PROCESSOR_NAME];
+ char MyName[MAX_PROCESSOR_NAME];
trace_settings |= TRACE_INIT;
@@ -214,7 +214,7 @@ int main( int argc, char *argv[], char *envp[] )
sigaddset( &newset,SIGTERM );
sigprocmask( SIG_BLOCK,&newset,&oldset );
- gethostname(Node_name, MPI_MAX_PROCESSOR_NAME);
+ gethostname(Node_name, MAX_PROCESSOR_NAME);
sprintf( MyName,"zooclient" );
MyPid = getpid();
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b1f77f43/core/sqf/sql/scripts/gensq.pl
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/gensq.pl b/core/sqf/sql/scripts/gensq.pl
index 3bc8ae4..1def252 100755
--- a/core/sqf/sql/scripts/gensq.pl
+++ b/core/sqf/sql/scripts/gensq.pl
@@ -418,6 +418,12 @@ sub generateRMS {
printRMSCheckScript(1, "cast(tokenstr('Status:', variable_info) as varchar(10)) status \n");
printRMSCheckScript(1, "from table(statistics(null, ?));\n");
+ for ($i=0; $i < $gdNumNodes; $i++) {
+
+ my $l_string = sprintf("execute rms_check using 'RMS_CHECK=%d' ;\n", $i);
+ printRMSCheckScript(1, $l_string);
+ }
+
printRMSScript(1, "\n");
printScript(1, "rmsstart\n");
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b1f77f43/core/sqf/sql/scripts/sqconfig.persist
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/sqconfig.persist b/core/sqf/sql/scripts/sqconfig.persist
index 4de7fd8..90f1393 100644
--- a/core/sqf/sql/scripts/sqconfig.persist
+++ b/core/sqf/sql/scripts/sqconfig.persist
@@ -43,11 +43,11 @@ DTM_STDOUT = stdout_DTM%nid
DTM_PERSIST_RETRIES = 2,30
DTM_PERSIST_ZONES = %zid
-TMID_PROCESS_NAME = $TMID
+TMID_PROCESS_NAME = $TSID0
TMID_PROCESS_TYPE = TMID
TMID_PROGRAM_NAME = idtmsrv
TMID_REQUIRES_DTM = N
-TMID_STDOUT = stdout_TMID
+TMID_STDOUT = stdout_TSID0
TMID_PERSIST_RETRIES = 2,30
TMID_PERSIST_ZONES = %zid+
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b1f77f43/core/sqf/sql/scripts/sqtrace
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/sqtrace b/core/sqf/sql/scripts/sqtrace
old mode 100755
new mode 100644
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b1f77f43/core/sqf/src/seabed/test/goall
----------------------------------------------------------------------
diff --git a/core/sqf/src/seabed/test/goall b/core/sqf/src/seabed/test/goall
index aa9dac6..a637056 100755
--- a/core/sqf/src/seabed/test/goall
+++ b/core/sqf/src/seabed/test/goall
@@ -255,7 +255,7 @@ go241 $cluster $verbose
go242 $cluster $verbose
go245 $cluster $verbose
go246 $cluster $verbose
-#go249 $cluster $verbose
+go249 $cluster $verbose
#go250 $cluster $verbose
go253 $cluster $verbose
go261 $cluster $verbose
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b1f77f43/core/sqf/src/seatrans/tm/hbasetmlib2/idtmclicom.h
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/tm/hbasetmlib2/idtmclicom.h b/core/sqf/src/seatrans/tm/hbasetmlib2/idtmclicom.h
index 4823e00..5277bbb 100644
--- a/core/sqf/src/seatrans/tm/hbasetmlib2/idtmclicom.h
+++ b/core/sqf/src/seatrans/tm/hbasetmlib2/idtmclicom.h
@@ -417,13 +417,13 @@ static int do_get_servers(MS_Mon_Process_Info_Type **ppp_pi,
int lv_ferr;
int lv_tmpcount;
- lv_ferr = msg_mon_get_process_info_type(MS_ProcessType_Generic,
+ lv_ferr = msg_mon_get_process_info_type(MS_ProcessType_TMID,
pp_count,
0, // max
NULL); // info
if (lv_ferr == XZFIL_ERR_OK) {
*ppp_pi = new MS_Mon_Process_Info_Type[*pp_count];
- lv_ferr = msg_mon_get_process_info_type(MS_ProcessType_Generic,
+ lv_ferr = msg_mon_get_process_info_type(MS_ProcessType_TMID,
&lv_tmpcount,
*pp_count, // max
*ppp_pi); // info
@@ -448,12 +448,16 @@ static int do_get_servers2(MS_Mon_Process_Info_Type *pp_pi,
lv_scount = 0;
for (lv_inx = 0; lv_inx < pv_count; lv_inx++) {
lp_sname = pp_pi[lv_inx].process_name;
- if (memcmp(lp_sname, "$TMID", 5) == 0) {
- if (gv_verbose)
- printf("cli: sname=%s\n", lp_sname);
- assert(lv_scount < pv_max);
- ppp_snames[lv_scount] = lp_sname;
- lv_scount++;
+ if (gv_verbose)
+ printf("cli(%d): sname=%s\n", getpid(), lp_sname);
+ if (memcmp(lp_sname, "$TSID", 5) == 0) {
+ if (isdigit(lp_sname[5])) {
+ if (gv_verbose)
+ printf("cli: sname=%s\n", lp_sname);
+ assert(lv_scount < pv_max);
+ ppp_snames[lv_scount] = lp_sname;
+ lv_scount++;
+ }
}
}
return lv_scount;
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/b1f77f43/core/sqf/src/tm/idtmsrv.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/tm/idtmsrv.cpp b/core/sqf/src/tm/idtmsrv.cpp
index 1751e08..be80dcf 100644
--- a/core/sqf/src/tm/idtmsrv.cpp
+++ b/core/sqf/src/tm/idtmsrv.cpp
@@ -368,7 +368,7 @@ void do_init(int pv_argc, char **ppp_argv) {
gv_verbose = true;
}
if (lv_attach)
- lv_ferr = msg_init_attach(&pv_argc, &ppp_argv, false, (char *) "$TMID");
+ lv_ferr = msg_init_attach(&pv_argc, &ppp_argv, false, (char *) "$TSID0");
else
lv_ferr = msg_init(&pv_argc, &ppp_argv);
assert(lv_ferr == XZFIL_ERR_OK);
@@ -378,8 +378,9 @@ void do_init(int pv_argc, char **ppp_argv) {
if (lv_delay_s != NULL) {
gv_time_refresh_delay = 100 * (atoi(lv_delay_s));
}
-
- printf("TM_IDTMSRV_REFRESH_DELAY_SECONDS is %s. Setting gv_time_refresh_delay to %d \n", lv_delay_s, gv_time_refresh_delay);
+ if (gv_verbose){
+ printf("TM_IDTMSRV_REFRESH_DELAY_SECONDS is %s. Setting gv_time_refresh_delay to %d \n", lv_delay_s, gv_time_refresh_delay);
+ }
if (gv_shook)
msg_debug_hook("s", "s");
@@ -702,7 +703,8 @@ int main(int pv_argc, char *pa_argv[]) {
}
}
- printf("server %s shutting down\n", ga_name);
+ if (gv_verbose)
+ printf("server %s shutting down\n", ga_name);
lv_ferr = msg_mon_process_shutdown();
assert(lv_ferr == XZFIL_ERR_OK);
[36/50] [abbrv] incubator-trafodion git commit: Trafodion
configuration API changes - new library files
Posted by su...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/fd1c115f/core/sqf/monitor/linux/sqliteconfig.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/sqliteconfig.h b/core/sqf/monitor/linux/sqliteconfig.h
new file mode 100644
index 0000000..fdf9e67
--- /dev/null
+++ b/core/sqf/monitor/linux/sqliteconfig.h
@@ -0,0 +1,133 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef SQLITECONFIG_H_
+#define SQLITECONFIG_H_
+
+#include <stdlib.h>
+#include <sqlite3.h>
+#include "trafconfig.h"
+
+#define MAX_PROCESS_PATH 256
+
+#define SQLITE_DB_ACCESS_ERROR 101900101
+
+class CSqliteConfig
+{
+public:
+
+ CSqliteConfig( void );
+ ~CSqliteConfig( void );
+
+ int Close( void );
+ int AddRegistryKey( const char *key );
+ int AddRegistryProcess( const char *name );
+ int AddRegistryClusterData( const char *key, const char *dataValue );
+ int AddRegistryProcessData( const char *procName
+ , const char *key
+ , const char *dataValue );
+ int AddUniqueString( int nid, int id, const char *uniqStr );
+ int DeleteNodeData( int pnid );
+ int DeleteUniqueString( int nid );
+ int GetNode( int nid
+ , node_configuration_t &nodeConfig );
+ int GetNode( const char *name
+ , node_configuration_t &nodeConfig );
+ int GetNodes( int &count
+ , int max
+ , node_configuration_t nodeConfig[] );
+ int GetPNode( int pnid
+ , physical_node_configuration_t &pnodeConfig );
+ int GetPNode( const char *name
+ , physical_node_configuration_t &pnodeConfig );
+ int GetSNodes( int &count
+ , int max
+ , physical_node_configuration_t pNodeConfig[] );
+ int GetPersistProcess( const char *persistPrefix
+ , persist_configuration_t &persistConfig );
+ int GetPersistProcessKeys( const char *persistProcessKeys );
+ int GetRegistryClusterSet( int &count
+ , int max
+ , registry_configuration_t registryConfig[] );
+ int GetRegistryProcessSet( int &count
+ , int max
+ , registry_configuration_t registryConfig[] );
+ int GetUniqueString( int nid, int id, const char *uniqStr );
+ int GetUniqueStringId( int nid
+ , const char *uniqStr
+ , int &id );
+ int GetUniqueStringIdMax( int nid, int &id );
+ int Initialize( void );
+ inline bool IsInitialized( void ) { return ( (db_ != NULL) ); }
+ int SaveLNodeData( int nid
+ , int pnid
+ , int firstCore
+ , int lastCore
+ , int processors
+ , int roles );
+ int SavePNodeData( const char *name
+ , int pnid
+ , int excludedFirstCore
+ , int excludedLastCore );
+ int UpdatePNodeConfig( int pnid
+ , const char *name
+ , int excludedFirstCore
+ , int excludedLastCore );
+
+protected:
+private:
+ int GetSNodeData( int pnid
+ , const char *nodename
+ , int excfirstcore
+ , int exclastcore
+ , physical_node_configuration_t &spareNodeConfig );
+ void SetLNodeData( int nid
+ , int pnid
+ , const char *nodename
+ , int excfirstcore
+ , int exclastcore
+ , int firstcore
+ , int lastcore
+ , int processors
+ , int roles
+ , node_configuration_t &nodeConfig );
+ void SetPNodeData( int pnid
+ , const char *nodename
+ , int excfirstcore
+ , int exclastcore
+ , physical_node_configuration_t &pnodeConfig );
+ int SetPersistProcessData( const char *persistkey
+ , const char *persistvalue
+ , persist_configuration_t &persistConfig );
+ int UpdatePNodeData( int pnid
+ , const char *name
+ , int excludedFirstCore
+ , int excludedLastCore );
+
+ sqlite3 *db_;
+};
+
+
+#endif /* SQLITECONFIG_H_ */
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/fd1c115f/core/sqf/monitor/linux/trafconfig.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/trafconfig.cxx b/core/sqf/monitor/linux/trafconfig.cxx
new file mode 100644
index 0000000..f89eda1
--- /dev/null
+++ b/core/sqf/monitor/linux/trafconfig.cxx
@@ -0,0 +1,403 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+//
+///////////////////////////////////////////////////////////////////////////////
+
+using namespace std;
+
+#include "sqliteconfig.h"
+#include "trafconfigtrace.h"
+#include "trafconfig.h"
+
+bool TcTraceEnabled = false;
+
+CTrafConfigTrace TrafConfigTrace;
+CSqliteConfig SqliteConfig;
+
+///////////////////////////////////////////////////////////////////////////////
+// Trafodion Configuration
+///////////////////////////////////////////////////////////////////////////////
+
+TC_Export int tc_close( void )
+{
+ int rc = SqliteConfig.Close();
+
+ if (TcTraceEnabled)
+ {
+ TrafConfigTrace.TraceClose();
+ }
+
+ return( rc );
+}
+
+TC_Export const char *tc_errmsg( int err )
+{
+ switch (err)
+ {
+ case TCSUCCESS:
+ return "Successful operation";
+ case TCNOTIMPLEMENTED:
+ return "Not implemented";
+ case TCNOTINIT:
+ return "Database not open";
+ case TCALREADYINIT:
+ return "Database already opened";
+ case TCDBOPERROR:
+ return "Database operation failed";
+ case TCDBNOEXIST:
+ return "Database operation yielded non-existent data";
+ case TCDBTRUNCATE:
+ return "Database operation returned less data than available";
+ case TCDBCORRUPT:
+ return "Internal processing error or database corruption";
+ default:
+ break;
+ }
+ return "Error undefined!";
+}
+
+TC_Export int tc_initialize( bool traceEnabled )
+{
+ TcTraceEnabled = traceEnabled;
+ if (TcTraceEnabled)
+ {
+ TrafConfigTrace.TraceInit( TcTraceEnabled, "0", NULL );
+ }
+
+ int rc = SqliteConfig.Initialize();
+
+ return( rc );
+}
+
+
+TC_Export int tc_delete_node( int nid
+ , const char *node_name )
+{
+ int rc = TCDBOPERROR;
+ node_configuration_t nodeConfig;
+
+ if (node_name)
+ {
+ rc = SqliteConfig.GetNode( node_name, nodeConfig );
+ if ( rc != TCSUCCESS)
+ {
+ return( rc );
+ }
+ }
+ else
+ {
+ rc = SqliteConfig.GetNode( nid, nodeConfig );
+ if ( rc != TCSUCCESS)
+ {
+ return( rc );
+ }
+ }
+
+ if ( nodeConfig.nid != -1)
+ {
+ rc = SqliteConfig.DeleteNodeData( nodeConfig.pnid );
+ }
+
+ return( rc );
+}
+
+TC_Export int tc_get_node( const char *node_name
+ , node_configuration_t *node_config )
+{
+ int rc = TCDBOPERROR;
+
+ rc = SqliteConfig.GetNode( node_name, *node_config );
+
+ return( rc );
+}
+
+TC_Export int tc_put_node( node_configuration_t *node_config )
+{
+ int rc = TCDBOPERROR;
+
+ rc = SqliteConfig.SaveLNodeData( node_config->nid
+ , node_config->pnid
+ , node_config->first_core
+ , node_config->last_core
+ , node_config->processors
+ , node_config->roles );
+
+ return( rc );
+}
+
+TC_Export int tc_get_pnode( const char *node_name
+ , physical_node_configuration_t *pnode_config )
+{
+ int rc = TCDBOPERROR;
+
+ rc = SqliteConfig.GetPNode( node_name, *pnode_config );
+
+ return( rc );
+}
+
+TC_Export int tc_put_pnode( physical_node_configuration_t *pnode_config )
+{
+ int rc = TCDBOPERROR;
+
+ rc = SqliteConfig.SavePNodeData( pnode_config->node_name
+ , pnode_config->pnid
+ , pnode_config->excluded_first_core
+ , pnode_config->excluded_last_core );
+
+ return( rc );
+}
+
+TC_Export int tc_get_nodes( int *count
+ , int max
+ , node_configuration_t *node_config )
+{
+ int rc = TCDBOPERROR;
+
+ if ( node_config == NULL )
+ {
+ max = 0;
+ }
+
+ rc = SqliteConfig.GetNodes( *count, max, node_config );
+
+ return( rc );
+}
+
+TC_Export int tc_get_snodes( int *scount
+ , int max
+ , physical_node_configuration_t *pnode_config )
+{
+ int rc = TCDBOPERROR;
+
+ if ( pnode_config == NULL )
+ {
+ max = 0;
+ }
+
+ rc = SqliteConfig.GetSNodes( *scount, max, pnode_config );
+
+ return( rc );
+}
+
+TC_Export int tc_delete_persist_keys( void )
+{
+ int rc = TCNOTIMPLEMENTED;
+
+ //
+
+ return( rc );
+}
+
+TC_Export int tc_get_persist_keys( const char *persist_keys )
+{
+ int rc = TCDBOPERROR;
+
+ rc = SqliteConfig.GetPersistProcessKeys( persist_keys );
+
+ return( rc );
+}
+
+TC_Export int tc_put_persist_keys( const char *persist_keys )
+{
+ int rc = TCNOTIMPLEMENTED;
+
+ //
+
+ return( rc );
+}
+
+TC_Export int tc_delete_persist_process( const char *persist_key_prefix )
+{
+ int rc = TCNOTIMPLEMENTED;
+
+ //
+
+ return( rc );
+}
+
+TC_Export int tc_get_persist_process( const char *persist_key_prefix
+ , persist_configuration_t *persist_config )
+{
+ int rc = TCDBOPERROR;
+
+ rc = SqliteConfig.GetPersistProcess( persist_key_prefix, *persist_config );
+
+ return( rc );
+}
+
+TC_Export int tc_put_persist_process( const char *persist_key_prefix
+ , persist_configuration_t *persist_config )
+{
+ int rc = TCNOTIMPLEMENTED;
+
+ //
+
+ return( rc );
+}
+
+TC_Export int tc_get_registry_cluster_set( int *count
+ , int max
+ , registry_configuration_t *registry_config )
+{
+ int rc = TCDBOPERROR;
+
+ rc = SqliteConfig.GetRegistryClusterSet( *count, max, registry_config );
+
+ return( rc );
+}
+
+TC_Export int tc_get_registry_process_set( int *count
+ , int max
+ , registry_configuration_t *registry_config )
+{
+ int rc = TCDBOPERROR;
+
+ rc = SqliteConfig.GetRegistryProcessSet( *count, max, registry_config );
+
+ return( rc );
+}
+
+TC_Export int tc_get_registry_key( const char *key )
+{
+ int rc = TCNOTIMPLEMENTED;
+
+ //rc = SqliteConfig.GetRegistryKey( key );
+
+ return( rc );
+}
+
+TC_Export int tc_put_registry_key( const char *key )
+{
+ int rc = TCDBOPERROR;
+
+ rc = SqliteConfig.AddRegistryKey( key );
+
+ return( rc );
+}
+
+TC_Export int tc_get_registry_process( const char *process_name )
+{
+ int rc = TCNOTIMPLEMENTED;
+
+ //rc = SqliteConfig.GetRegistryProcess( process_name );
+
+ return( rc );
+}
+
+TC_Export int tc_put_registry_process( const char *process_name )
+{
+ int rc = TCDBOPERROR;
+
+ rc = SqliteConfig.AddRegistryProcess( process_name );
+
+ return( rc );
+}
+
+TC_Export int tc_get_registry_cluster_data( const char *key
+ , const char *data )
+{
+ int rc = TCNOTIMPLEMENTED;
+
+ //rc = SqliteConfig.GetRegistryClusterData( key, data );
+
+ return( rc );
+}
+
+TC_Export int tc_put_registry_cluster_data( const char *key
+ , const char *data )
+{
+ int rc = TCDBOPERROR;
+
+ rc = SqliteConfig.AddRegistryClusterData( key, data );
+
+ return( rc );
+}
+
+TC_Export int tc_get_registry_process_data( const char *process_name
+ , const char *key
+ , const char *data )
+{
+ int rc = TCNOTIMPLEMENTED;
+
+ //rc = SqliteConfig.GetRegistryProcessData( process_name, key, data );
+
+ return( rc );
+}
+
+TC_Export int tc_put_registry_process_data( const char *process_name
+ , const char *key
+ , const char *data )
+{
+ int rc = TCDBOPERROR;
+
+ rc = SqliteConfig.AddRegistryProcessData( process_name, key, data );
+
+ return( rc );
+}
+
+TC_Export int tc_delete_unique_strings( int nid )
+{
+ int rc = TCDBOPERROR;
+
+ rc = SqliteConfig.DeleteUniqueString( nid );
+
+ return( rc );
+}
+
+
+TC_Export int tc_get_unique_string( int nid, int id, const char *unique_string )
+{
+ int rc = TCDBOPERROR;
+
+ rc = SqliteConfig.GetUniqueString( nid, id, unique_string );
+
+ return( rc );
+}
+
+TC_Export int tc_put_unique_string( int nid, int id, const char *unique_string )
+{
+ int rc = TCDBOPERROR;
+
+ rc = SqliteConfig.AddUniqueString( nid, id, unique_string );
+
+ return( rc );
+}
+
+TC_Export int tc_get_unique_string_id( int nid, const char *unique_string, int *id )
+{
+ int rc = TCDBOPERROR;
+
+ rc = SqliteConfig.GetUniqueStringId( nid, unique_string, *id );
+
+ return( rc );
+}
+
+TC_Export int tc_get_unique_string_id_max( int nid, int *id )
+{
+ int rc = TCDBOPERROR;
+
+ rc = SqliteConfig.GetUniqueStringIdMax( nid, *id );
+
+ return( rc );
+}
+
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/fd1c115f/core/sqf/monitor/linux/trafconfig.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/trafconfig.h b/core/sqf/monitor/linux/trafconfig.h
new file mode 100644
index 0000000..0ef0693
--- /dev/null
+++ b/core/sqf/monitor/linux/trafconfig.h
@@ -0,0 +1,286 @@
+/**********************************************************************
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+********************************************************************/
+#ifndef TRAFCONFIG_H_
+#define TRAFCONFIG_H_
+
+//
+// On Windows, this would actually do something like:
+// #define TRAF_Export __declspec(dllexport)
+//
+#define TC_Export
+
+#ifdef USE_TRAFCONF_DIAGS
+#define TC_DIAG_UNUSED __attribute__((warn_unused_result))
+#else
+#define TC_DIAG_UNUSED
+#endif
+
+#ifdef USE_TRAFCONF_DEPRECATED
+#define TC_DIAG_DEPRECATED __attribute__((deprecated))
+#else
+#define TC_DIAG_DEPRECATED
+#endif
+
+#define TC_REGISTRY_KEY_MAX 64
+#define TC_REGISTRY_VALUE_MAX 4096
+#define TC_PERSIST_PROCESSOR_NAME_MAX 128
+#define TC_PERSIST_ROLES_MAX 128
+#define TC_PERSIST_KEY_MAX 64
+#define TC_PERSIST_VALUE_MAX 64
+#define TC_PERSIST_KEYS_VALUE_MAX 4096
+#define TC_NODES_MAX 256
+#define TC_SPARE_NODES_MAX 256
+#define TC_UNIQUE_STRING_VALUE_MAX 4096
+
+#define PERSIST_PROCESS_KEYS "PERSIST_PROCESS_KEYS"
+#define PERSIST_PROCESS_NAME_KEY "PROCESS_NAME"
+#define PERSIST_PROCESS_TYPE_KEY "PROCESS_TYPE"
+#define PERSIST_PROGRAM_NAME_KEY "PROGRAM_NAME"
+#define PERSIST_REQUIRES_DTM "REQUIRES_DTM"
+#define PERSIST_STDOUT_KEY "STDOUT"
+#define PERSIST_RETRIES_KEY "PERSIST_RETRIES"
+#define PERSIST_ZONES_KEY "PERSIST_ZONES"
+
+enum TC_ERRORS {
+ TCSUCCESS = 0, // Successful operation
+ TCNOTIMPLEMENTED = -1,// Not implemented
+ TCNOTINIT = -2, // Database not open
+ TCALREADYINIT = -3, // Database already opened
+ TCDBOPERROR = -4, // Database operation failed
+ TCDBNOEXIST = -5, // Database operation yielded non-existent data
+ TCDBTRUNCATE = -6, // Database operation returned less data than available
+ TCDBCORRUPT = -7, // Internal processing error or database corruption
+};
+
+typedef struct node_configuration_s
+{
+ int nid; // Node Id (logical)
+ int pnid; // Physical Node ID
+ char node_name[TC_PERSIST_PROCESSOR_NAME_MAX]; // hostname
+ int excluded_first_core; // First or only core assigned
+ int excluded_last_core; // Last core assigned or -1
+ int first_core; // First or only core assigned
+ int last_core; // Last core assigned or -1
+ int processors; // Number logical processors
+ int roles; // Role assigment
+} node_configuration_t;
+
+typedef struct physical_node_configuration_s
+{
+ int pnid; // Physical Node ID
+ char node_name[TC_PERSIST_PROCESSOR_NAME_MAX]; // hostname
+ int excluded_first_core; // First or only core assigned
+ int excluded_last_core; // Last core assigned or -1
+ int spare_count; // Number of entries in spare_pnid[]
+ int spare_pnid[TC_SPARE_NODES_MAX]; // list of pnids for which this node can be a spare
+} physical_node_configuration_t;
+
+typedef struct registry_configuration_s
+{
+ char scope[TC_REGISTRY_KEY_MAX];
+ char key[TC_REGISTRY_KEY_MAX];
+ char value[TC_REGISTRY_VALUE_MAX];
+} registry_configuration_t;
+
+typedef struct persist_configuration_s
+{
+ char persist_prefix[TC_PERSIST_KEY_MAX]; // DTM, TMID, or ... (PERSIST_PROCESS_KEYS)
+ char process_name[TC_PERSIST_VALUE_MAX]; // Process name {<prefix>[<format>]}
+ char process_type[TC_PERSIST_VALUE_MAX]; // DTM, TMID, PERSIST, ...
+ char program_name[TC_PERSIST_VALUE_MAX]; // Program executable name (no path in name)
+ char std_out[TC_PERSIST_VALUE_MAX]; // STDOUT {<prefix>[<format>]}
+ bool requires_DTM; // True when process requires transaction support
+ int persist_retries; // Process create retries
+ int persist_window; // Process create retries window (seconds)
+ char persist_zones[TC_PERSIST_VALUE_MAX]; // Process creation zones {<format>}
+} persist_configuration_t;
+
+
+TC_Export int tc_close( void )
+TC_DIAG_UNUSED;
+
+TC_Export const char *tc_errmsg( int err )
+TC_DIAG_UNUSED;
+
+TC_Export int tc_initialize( bool traceEnabled )
+TC_DIAG_UNUSED;
+
+
+TC_Export int tc_delete_node( int nid
+ , const char *node_name )
+TC_DIAG_UNUSED;
+
+TC_Export int tc_get_node( const char *node_name
+ , node_configuration_t *node_config )
+TC_DIAG_UNUSED;
+
+TC_Export int tc_put_node( node_configuration_t *node_config )
+TC_DIAG_UNUSED;
+
+
+TC_Export int tc_get_pnode( const char *node_name
+ , physical_node_configuration_t *pnode_config )
+TC_DIAG_UNUSED;
+
+TC_Export int tc_put_pnode( physical_node_configuration_t *pnode_config )
+TC_DIAG_UNUSED;
+
+//
+// Call this to get all configured logical nodes
+//
+// count: is number of node_config array entries returned
+// max: is size of the node_config array
+// node_config: is array of logical node configuration entries
+//
+// if count would be greater than max, an error is returned
+// if node_config is null, max is ignored and
+// number of node_config entries is returned in count
+//
+TC_Export int tc_get_nodes( int *count
+ , int max
+ , node_configuration_t *node_config )
+TC_DIAG_UNUSED;
+
+//
+// Call this to get all configured spare nodes
+//
+// count: is number of pnode_config array entries returned
+// max: is size of the pnode_config array
+// pnode_config: is array of spare node configuration entries
+//
+// if count would be greater than max, an error is returned
+// if pnode_config is null, max is ignored and
+// number of pnode_config array entries is returned in count
+//
+TC_Export int tc_get_snodes( int *count
+ , int max
+ , physical_node_configuration_t *pnode_config )
+TC_DIAG_UNUSED;
+
+
+TC_Export int tc_delete_persist_keys( void )
+TC_DIAG_UNUSED;
+
+TC_Export int tc_get_persist_keys( const char *persist_keys )
+TC_DIAG_UNUSED;
+
+TC_Export int tc_put_persist_keys( const char *persist_keys )
+TC_DIAG_UNUSED;
+
+
+TC_Export int tc_delete_persist_process( const char *persist_key_prefix )
+TC_DIAG_UNUSED;
+
+TC_Export int tc_get_persist_process( const char *persist_key_prefix
+ , persist_configuration_t *persist_config )
+TC_DIAG_UNUSED;
+
+TC_Export int tc_put_persist_process( const char *persist_key_prefix
+ , persist_configuration_t *persist_config )
+TC_DIAG_UNUSED;
+
+
+//
+// Call this to get all cluster scope configuration registry entries
+//
+// count: is number of registry_config array entries returned
+// max: is size of the registry_config array
+// registry_configuration: is the array of cluster registry entries
+//
+// if count would be greater than max, an error is returned
+// if registry_config is null, max is ignored and
+// number of registry entries is returned in count
+//
+TC_Export int tc_get_registry_cluster_set( int *count
+ , int max
+ , registry_configuration_t *registry_config )
+TC_DIAG_UNUSED;
+
+//
+// Call this to get all process scope configuration registry entries
+//
+// count: is number of registry_config array entries returned
+// max: is size of the registry_config array
+// registry_configuration: is the array of process registry entries
+//
+// if count would be greater than max, an error is returned
+// if registry_config is null, max is ignored and
+// number of registry entries entries is returned in count
+//
+TC_Export int tc_get_registry_process_set( int *count
+ , int max
+ , registry_configuration_t *registry_config )
+TC_DIAG_UNUSED;
+
+
+TC_Export int tc_get_registry_key( const char *key )
+TC_DIAG_UNUSED;
+
+TC_Export int tc_put_registry_key( const char *key )
+TC_DIAG_UNUSED;
+
+
+TC_Export int tc_get_registry_process( const char *process_name )
+TC_DIAG_UNUSED;
+
+TC_Export int tc_put_registry_process( const char *process_name )
+TC_DIAG_UNUSED;
+
+
+TC_Export int tc_get_registry_cluster_data( const char *key
+ , const char *data )
+TC_DIAG_UNUSED;
+
+TC_Export int tc_put_registry_cluster_data( const char *key
+ , const char *data )
+TC_DIAG_UNUSED;
+
+
+TC_Export int tc_get_registry_process_data( const char *process_name
+ , const char *key
+ , const char *data )
+TC_DIAG_UNUSED;
+
+TC_Export int tc_put_registry_process_data( const char *process_name
+ , const char *key
+ , const char *data )
+TC_DIAG_UNUSED;
+
+
+TC_Export int tc_delete_unique_strings( int nid )
+TC_DIAG_UNUSED;
+
+TC_Export int tc_get_unique_string( int nid, int id, const char *unique_string );
+TC_DIAG_UNUSED;
+
+TC_Export int tc_put_unique_string( int nid, int id, const char *unique_string )
+TC_DIAG_UNUSED;
+
+
+TC_Export int tc_get_unique_string_id( int nid, const char *unique_string, int *id );
+TC_DIAG_UNUSED;
+
+TC_Export int tc_get_unique_string_id_max( int nid, int *id );
+TC_DIAG_UNUSED;
+
+#endif // TRAFCONFIG_H_
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/fd1c115f/core/sqf/monitor/linux/trafconfiglog.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/trafconfiglog.cxx b/core/sqf/monitor/linux/trafconfiglog.cxx
new file mode 100644
index 0000000..99b9183
--- /dev/null
+++ b/core/sqf/monitor/linux/trafconfiglog.cxx
@@ -0,0 +1,121 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+//
+///////////////////////////////////////////////////////////////////////////////
+
+//#include <iostream>
+
+using namespace std;
+
+#include <assert.h>
+#include <pthread.h>
+#include <time.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <linux/unistd.h>
+#include "trafconfigtrace.h"
+#include "trafconfiglog.h"
+
+#define gettid() syscall(__NR_gettid)
+
+pthread_mutex_t TcLogMutex = PTHREAD_MUTEX_INITIALIZER;
+
+const char *LogLevelStr( int severity )
+{
+ const char *str;
+
+ switch (severity)
+ {
+ case TC_LOG_EMERG:
+ str = "FATAL";
+ break;
+ case TC_LOG_ALERT:
+ str = "WARN";
+ break;
+ case TC_LOG_CRIT:
+ str = "FATAL";
+ break;
+ case TC_LOG_ERR:
+ str = "ERROR";
+ break;
+ case TC_LOG_WARNING:
+ str = "WARN";
+ break;
+ case TC_LOG_NOTICE:
+ str = "INFO";
+ break;
+ case TC_LOG_INFO:
+ str = "INFO";
+ break;
+ case TC_LOG_DEBUG:
+ str = "DEBUG";
+ break;
+ default:
+ str = "INFO";
+ }
+
+ return( str );
+}
+
+int TcLogWrite(int eventType, int severity, char *msg)
+{
+ int status;
+
+ char eventTimeFmt[20];
+ struct timeval eventTime;
+
+ status = pthread_mutex_lock(&TcLogMutex);
+ assert(status == 0);
+
+ gettimeofday(&eventTime, NULL);
+ struct tm *ltime = localtime(&eventTime.tv_sec);
+ sprintf( eventTimeFmt
+ , "%04d-%02d-%02d %02d:%02d:%02d"
+ , ltime->tm_year+1900
+ , ltime->tm_mon+1
+ , ltime->tm_mday
+ , ltime->tm_hour
+ , ltime->tm_min
+ , ltime->tm_sec );
+
+ fprintf( stderr
+ , "%s,, %s, TRAFCONFIG,,, PIN: %u,,,, TID: %ld, Message ID: %d, %s\n"
+ , eventTimeFmt
+ , LogLevelStr(severity)
+ , getpid()
+ , gettid()
+ , eventType
+ , msg );
+
+ status = pthread_mutex_unlock(&TcLogMutex);
+ assert(status == 0);
+
+ if (TcTraceSettings & TC_TRACE_LOG_MSG)
+ {
+ trace_printf("Log Event: %d, %s\n(%s)\n",
+ eventType, LogLevelStr(severity), msg);
+ }
+
+ return(0);
+}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/fd1c115f/core/sqf/monitor/linux/trafconfiglog.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/trafconfiglog.h b/core/sqf/monitor/linux/trafconfiglog.h
new file mode 100644
index 0000000..f1817aa
--- /dev/null
+++ b/core/sqf/monitor/linux/trafconfiglog.h
@@ -0,0 +1,44 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef TRAFCONFIGLOG_H_
+#define TRAFCONFIGLOG_H_
+
+using namespace std;
+
+#define TC_LOG_BUF_SIZE 256
+
+#define TC_LOG_EMERG 0 /* system is unusable */
+#define TC_LOG_ALERT 1 /* action must be taken immediately */
+#define TC_LOG_CRIT 2 /* critical conditions */
+#define TC_LOG_ERR 3 /* error conditions */
+#define TC_LOG_WARNING 4 /* warning conditions */
+#define TC_LOG_NOTICE 5 /* normal but significant condition */
+#define TC_LOG_INFO 6 /* informational */
+#define TC_LOG_DEBUG 7 /* debug-level messages */
+
+int TcLogWrite(int event_type, int severity, char *evl_buf);
+
+#endif
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/fd1c115f/core/sqf/monitor/linux/trafconfigtrace.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/trafconfigtrace.cxx b/core/sqf/monitor/linux/trafconfigtrace.cxx
new file mode 100644
index 0000000..170b446
--- /dev/null
+++ b/core/sqf/monitor/linux/trafconfigtrace.cxx
@@ -0,0 +1,349 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+using namespace std;
+
+#include "trafconfigtrace.h"
+
+#define TC_PROCESS_PATH_MAX 256
+
+const char *CTrafConfigTrace::strTraceEnable_ = "TC_TRACE_ENABLE";
+const char *CTrafConfigTrace::strTraceFile_ = "TC_TRACE_FILE";
+const char *CTrafConfigTrace::strTraceFileFb_ = "TC_TRACE_FILE_FB";
+
+const CTrafConfigTrace::TraceArea_t CTrafConfigTrace::traceAreaList_[] =
+{
+ {"TC_TRACE_REQUEST", TC_TRACE_REQUEST},
+ {"TC_TRACE_NODE", TC_TRACE_NODE},
+ {"TC_TRACE_PERSIST", TC_TRACE_PERSIST},
+ {"TC_TRACE_REGISTRY", TC_TRACE_REGISTRY},
+ {"TC_TRACE_INIT", TC_TRACE_INIT},
+ {"TC_TRACE_LOG_MSG", TC_TRACE_LOG_MSG},
+ {"TC_TRACE_ENTRY_EXIT", TC_TRACE_ENTRY_EXIT}
+};
+
+// Global trace flags
+long TcTraceSettings = 0;
+
+CTrafConfigTrace::CTrafConfigTrace()
+ : tracingEnabled_(false)
+ , traceSettingsSaved_(0)
+ , traceFileFb_(0)
+ , traceFileBase_(NULL)
+{
+ numTraceAreas_ = sizeof(traceAreaList_)/sizeof(TraceArea_t);
+}
+
+const char *CTrafConfigTrace::GetEnvStr(const char *key)
+{
+ const char *value;
+ value = getenv(key);
+ return value;
+}
+
+void CTrafConfigTrace::GetEnvInt(const char *key, int &val)
+{
+ const char *p = GetEnvStr(key);
+ if (p != NULL)
+ {
+ val = atoi(p);
+ }
+}
+
+bool CTrafConfigTrace::GetEnvBool(const char *key)
+{
+ const char *p = GetEnvStr(key);
+ bool val = false;
+ if (p != NULL)
+ {
+ val = atoi(p);
+ }
+ return val;
+}
+
+void CTrafConfigTrace::TraceClose( void )
+{
+ trace_close();
+}
+
+void CTrafConfigTrace::TraceInit( bool traceEnabled
+ , const char *traceLevel
+ , const char *pfname)
+{
+ char trace_file_name[TC_PROCESS_PATH_MAX];
+ char hostname[TC_PROCESS_PATH_MAX];
+
+ tracingEnabled_ = traceEnabled;
+
+ if (gethostname(hostname,sizeof(hostname)) == -1)
+ {
+ sprintf( hostname,"TC");
+ }
+
+ // Format default trace file name and remove any existing trace file.
+ if( getenv("SQ_VIRTUAL_NODES") )
+ {
+ sprintf( trace_file_name,"%s/trafconfig.trace.%d.%s"
+ , getenv("MPI_TMPDIR")
+ , getpid()
+ , hostname);
+ }
+ else
+ {
+ sprintf( trace_file_name,"%s/trafconfig.trace.%s"
+ , getenv("MPI_TMPDIR")
+ , hostname);
+ }
+
+ remove(trace_file_name);
+
+ if (pfname == NULL)
+ { // Caller did not specify a trace file name, get name from
+ // environment variable if specified.
+ pfname = GetEnvStr(strTraceFile_);
+ }
+
+ if (pfname != NULL)
+ { // User specified trace file name
+
+ // Save the base trace file name for possible use later
+ traceFileBase_ = new char[strlen(pfname) + 1];
+ strcpy(traceFileBase_, pfname);
+
+ if ((strcmp(pfname, "STDOUT") == 0)
+ || strcmp(pfname, "STDERR") == 0)
+ {
+ strcpy(trace_file_name, pfname);
+ }
+ else // Make user specified file name unique per node
+ {
+ sprintf(trace_file_name,"%s/%s.%d.%s"
+ , getenv("MPI_TMPDIR")
+ , pfname
+ , getpid()
+ , hostname);
+ }
+ }
+
+ // Get any trace settings that were specified via environment variables
+ const char *value;
+
+ for (int i=0; i<numTraceAreas_; i++)
+ {
+ value = getenv(traceAreaList_[i].id);
+ if (value != NULL)
+ {
+ if (atoi(value) != 0)
+ // set the enabled flag for this trace area
+ TcTraceSettings |= traceAreaList_[i].bitFlag;
+ }
+ }
+
+ // Get environment variable specifying whether tracing is enabled
+ tracingEnabled_ = GetEnvBool(strTraceEnable_);
+ // Get environment variable value for trace buffer size if specified
+ GetEnvInt(strTraceFileFb_, traceFileFb_);
+
+ // Convert the user specified trace level string to a number. The
+ // number can be specified as a decimal, octal or hexadecimal
+ // constant. Combine these flags with current TcTraceSettings that
+ // may have been set via environment variables.
+ long trace_flags;
+ trace_flags = strtol(traceLevel, NULL, 0);
+ if (errno != ERANGE)
+ {
+ TcTraceSettings |= trace_flags;
+ }
+
+ // If any trace settings were specified initialize the trace file
+ if (TcTraceSettings != 0 || tracingEnabled_)
+ {
+ traceSettingsSaved_ = TcTraceSettings;
+
+ if (pfname != NULL)
+ {
+ trace_init(trace_file_name,
+ false, // don't append pid to file name
+ "trafconfig", // prefix
+ false);
+ if (traceFileFb_ > 0)
+ {
+ trace_set_mem(traceFileFb_);
+ }
+ }
+ }
+}
+
+
+void CTrafConfigTrace::TraceHelpBool( const char *key
+ , const char *value
+ , const char *key_cmp
+ , bool &value_ret )
+{
+ if ((key != NULL) && (strcasecmp(key, key_cmp) == 0))
+ {
+ value_ret = atoi(value);
+ }
+}
+
+void CTrafConfigTrace::TraceHelpInt( const char *key
+ , const char *value
+ , const char *key_cmp
+ , int &value_ret )
+{
+ if ((key != NULL) && (strcasecmp(key, key_cmp) == 0))
+ {
+ value_ret = atoi(value);
+ }
+}
+
+const char *CTrafConfigTrace::TraceHelpStr( const char *key
+ , const char *value
+ , const char *key_cmp )
+{
+ if ((key != NULL) && (strcasecmp(key, key_cmp) == 0))
+ {
+ return value;
+ }
+ return NULL;
+}
+
+
+void CTrafConfigTrace::TraceChange(const char *key, const char *value)
+{
+ bool trace_was_enabled = tracingEnabled_;
+ const char *pfname;
+ int old_fb = traceFileFb_;
+
+ if (key == NULL)
+ return;
+
+ // Restore saved trace settings in case trace flags get modified
+ TcTraceSettings = traceSettingsSaved_;
+
+ // Compare the key with each of the trace flag strings. When
+ // there is an equal compare, assign the value to the appropriate flag.
+ for (int i=0; i<numTraceAreas_; i++)
+ {
+ if (strcasecmp(key, traceAreaList_[i].id) == 0)
+ {
+ if (atoi(value) != 0)
+ {
+ // set the enabled flag for this trace area
+ TcTraceSettings |= traceAreaList_[i].bitFlag;
+ }
+ else // clear the enabled flag for this trace area
+ {
+ TcTraceSettings &= ~traceAreaList_[i].bitFlag;
+ }
+ break;
+ }
+ }
+ // Save current trace settings
+ traceSettingsSaved_ = TcTraceSettings;
+
+
+ // Check if tracing is being enabled/disabled
+ TraceHelpBool(key, value, strTraceEnable_, tracingEnabled_);
+ // Check if trace file buffer size is being specified
+ TraceHelpInt(key, value, strTraceFileFb_, traceFileFb_);
+
+ // Check if trace file base name is being specified
+ pfname = TraceHelpStr(key, value, strTraceFile_);
+ if (pfname != NULL)
+ { // Save trace file base name
+ delete [] traceFileBase_;
+ traceFileBase_ = new char[strlen(pfname) + 1];
+ strcpy(traceFileBase_, pfname);
+ }
+
+ if (!trace_was_enabled && tracingEnabled_)
+ {
+ char fname[TC_PROCESS_PATH_MAX];
+ char hostname[TC_PROCESS_PATH_MAX];
+ if (gethostname(hostname,sizeof(hostname)) == -1)
+ {
+ sprintf( hostname,"TC");
+ }
+
+ // Formulate trace file name
+ if (traceFileBase_ != NULL)
+ { // User specified trace file name
+ if ((strcmp(traceFileBase_, "STDOUT") == 0)
+ || strcmp(traceFileBase_, "STDERR") == 0)
+ {
+ strcpy(fname, traceFileBase_);
+ }
+ else
+ { // Make user specified file name unique per node
+ sprintf( fname,"%s/%s.%d.%s"
+ , getenv("MPI_TMPDIR")
+ , traceFileBase_
+ , getpid()
+ , hostname);
+ }
+ }
+ else
+ { // No user specified trace file name, use default
+ if( getenv("SQ_VIRTUAL_NODES") )
+ {
+ sprintf( fname,"%s/trafconfig.trace.%d.%s"
+ , getenv("MPI_TMPDIR")
+ , getpid()
+ , hostname);
+ }
+ else
+ {
+ sprintf( fname,"%s/trafconfig.trace.%s"
+ , getenv("MPI_TMPDIR")
+ , hostname);
+ }
+ }
+
+ // Tracing was disabled and is now enabled, initialize trace
+ trace_init(fname,
+ false, // don't append pid to file name
+ hostname, // prefix
+ false);
+ }
+ if (trace_was_enabled && !tracingEnabled_)
+ {
+ // Tracing was enabled and now is disabled, flush trace. Save
+ // current trace settings.
+ trace_flush();
+
+ TcTraceSettings = 0;
+ }
+
+ // If a new trace file buffer size was specified, set it
+ if ((traceFileFb_ > 0) && (old_fb != traceFileFb_))
+ trace_set_mem(traceFileFb_);
+}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/fd1c115f/core/sqf/monitor/linux/trafconfigtrace.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/trafconfigtrace.h b/core/sqf/monitor/linux/trafconfigtrace.h
new file mode 100644
index 0000000..9a3d42b
--- /dev/null
+++ b/core/sqf/monitor/linux/trafconfigtrace.h
@@ -0,0 +1,103 @@
+/**********************************************************************
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+********************************************************************/
+#ifndef TRAFCONFIGTRACE_H_
+#define TRAFCONFIGTRACE_H_
+
+#include "seabed/trace.h"
+
+// All request processing
+#define TC_TRACE_REQUEST 0x00001
+// Node configuration processing
+#define TC_TRACE_NODE 0x00002
+// Persist configuration processing
+#define TC_TRACE_PERSIST 0x00004
+// Registry configuration processing
+#define TC_TRACE_REGISTRY 0x00008
+// Initialization/shutdown information
+#define TC_TRACE_INIT 0x00010
+// Event messages logged (error,informational,critical,etc.)
+#define TC_TRACE_LOG_MSG 0x00020
+// Entry and exit from methods/functions
+#define TC_TRACE_ENTRY_EXIT 0x00040
+
+#define TRACE_ENTRY \
+ if (TcTraceSettings & TC_TRACE_ENTRY_EXIT) trace_printf("%s@%d\n", method_name, __LINE__)
+
+#define TRACE_EXIT \
+ if (TcTraceSettings & TC_TRACE_ENTRY_EXIT) trace_printf("%s@%d - Exit\n", method_name, __LINE__)
+
+extern long TcTraceSettings;
+
+class CTrafConfigTrace
+{
+public:
+ CTrafConfigTrace();
+ virtual ~CTrafConfigTrace() {}
+
+ void TraceChange( const char *key, const char *value );
+ void TraceClose( void );
+ void TraceInit( bool traceEnabled
+ , const char *traceLevel
+ , const char *pfname);
+
+private:
+
+ const char *GetEnvStr( const char *key );
+ void GetEnvInt( const char *key, int &val );
+ bool GetEnvBool( const char *key );
+ void TraceHelpBool( const char *key
+ , const char *value
+ , const char *key_cmp
+ , bool &value_ret );
+ void TraceHelpInt( const char *key
+ , const char *value
+ , const char *key_cmp
+ , int &value_ret );
+ const char *TraceHelpStr( const char *key
+ , const char *value
+ , const char *key_cmp );
+
+ // The number of trace areas held in "traceAreaList"
+ int numTraceAreas_;
+ bool tracingEnabled_;
+
+ // Save area for retaining prior trace settings if tracing is
+ // disabled. These are used to restore the values when tracing
+ // is re-enabled.
+ long traceSettingsSaved_;
+
+ // Optional size of trace file buffer.
+ int traceFileFb_;
+ char *traceFileBase_;
+
+ // Array of strings defining various trace areas and the
+ // trace bit flag associated with that area
+ typedef struct {const char *id; long bitFlag;} TraceArea_t;
+ static const TraceArea_t traceAreaList_[];
+
+ static const char *strTraceEnable_;
+ static const char *strTraceFile_;
+ static const char *strTraceFileFb_;
+};
+
+#endif // TRAFCONFIG_H_
[46/50] [abbrv] incubator-trafodion git commit: Fixed persistent
process restart on node up. Fixed rmscheck,
missing code from last merge. Changed sqgen to source in node section from
'sqconfig.file' and persist section from 'sqconfig.persist' file and c
Posted by su...@apache.org.
Fixed persistent process restart on node up.
Fixed rmscheck, missing code from last merge.
Changed sqgen to source in node section from 'sqconfig.file' and persist section from 'sqconfig.persist' file and changed bash and and python install scripts to account for this change.
Fixed logic to account for name change of TMID process.
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/363df1f9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/363df1f9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/363df1f9
Branch: refs/heads/master
Commit: 363df1f97c2e081a38a8f9c3ab106b583b2948b6
Parents: 23bb89a
Author: Zalo Correa <za...@esgyn.com>
Authored: Tue May 16 17:14:54 2017 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Tue May 16 17:14:54 2017 -0700
----------------------------------------------------------------------
core/sqf/monitor/linux/clusterconf.cxx | 1 +
core/sqf/monitor/linux/lnodeconfig.cxx | 3 +-
core/sqf/monitor/linux/lnodeconfig.h | 2 +
core/sqf/monitor/linux/makefile | 4 +
core/sqf/monitor/linux/persistconfig.cxx | 78 +++
core/sqf/monitor/linux/persistconfig.h | 7 +-
core/sqf/monitor/linux/pstartd.cxx | 599 +++++++------------
core/sqf/monitor/linux/pstartd.h | 34 +-
core/sqf/monitor/linux/trafconf.cxx | 8 +
core/sqf/sql/scripts/gensq.pl | 22 +-
core/sqf/sql/scripts/sqconfig | 68 +--
core/sqf/sql/scripts/sqgen | 2 +-
.../src/seatrans/tm/hbasetmlib2/idtmclicom.h | 14 +-
core/sqf/src/tm/Makefile | 4 +
install/installer/addNode_step2 | 6 -
install/installer/traf_sqconfig | 4 -
.../python-installer/scripts/traf_sqconfig.py | 4 -
17 files changed, 345 insertions(+), 515 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/363df1f9/core/sqf/monitor/linux/clusterconf.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/clusterconf.cxx b/core/sqf/monitor/linux/clusterconf.cxx
index 74dd69d..1316b02 100644
--- a/core/sqf/monitor/linux/clusterconf.cxx
+++ b/core/sqf/monitor/linux/clusterconf.cxx
@@ -453,6 +453,7 @@ bool CClusterConfig::LoadPersistConfig( void )
for (pkit = pkeysVector.begin(); pkit < pkeysVector.end(); pkit++ )
{
memset( &persistConfig, 0, sizeof(persist_configuration_t) );
+ memset( &persistConfigInfo, 0, sizeof(persistConfigInfo_t) );
strncpy( persistConfig.persist_prefix
, pkit->c_str()
, sizeof(persistConfig.persist_prefix));
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/363df1f9/core/sqf/monitor/linux/lnodeconfig.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/lnodeconfig.cxx b/core/sqf/monitor/linux/lnodeconfig.cxx
index 34df543..77c2360 100644
--- a/core/sqf/monitor/linux/lnodeconfig.cxx
+++ b/core/sqf/monitor/linux/lnodeconfig.cxx
@@ -50,6 +50,7 @@ CLNodeConfig::CLNodeConfig( CPNodeConfig *pnodeConfig
, lnodeConfigInfo_t &lnodeConfigInfo
)
: nid_(lnodeConfigInfo.nid)
+ , zid_(pnodeConfig->GetPNid())
, coreMask_(lnodeConfigInfo.coreMask)
, firstCore_(lnodeConfigInfo.firstCore)
, lastCore_(lnodeConfigInfo.lastCore)
@@ -86,7 +87,7 @@ const char *CLNodeConfig::GetName( void )
int CLNodeConfig::GetPNid( void )
{
- return( pnodeConfig_->GetPNid( ) );
+ return( pnodeConfig_->GetPNid() );
}
CLNodeConfigContainer::CLNodeConfigContainer( void )
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/363df1f9/core/sqf/monitor/linux/lnodeconfig.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/lnodeconfig.h b/core/sqf/monitor/linux/lnodeconfig.h
index 37185c8..e32c08f 100644
--- a/core/sqf/monitor/linux/lnodeconfig.h
+++ b/core/sqf/monitor/linux/lnodeconfig.h
@@ -92,6 +92,7 @@ public:
inline CLNodeConfig *GetNext( void ) { return( next_); }
inline CLNodeConfig *GetNextP( void ) { return( nextP_); }
inline int GetNid( void ) { return( nid_ ); }
+ inline int GetZid( void ) { return( zid_ ); }
int GetPNid( void );
CPNodeConfig *GetPNodeConfig( void ) { return(pnodeConfig_); }
@@ -101,6 +102,7 @@ public:
protected:
private:
int nid_; // Logical Node Identifier
+ int zid_; // Zone Identifier
cpu_set_t coreMask_; // mask of SMP processor cores used by logical node
int firstCore_; // First SMP processor core used by logical node
int lastCore_; // Last SMP processor core used by logical node
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/363df1f9/core/sqf/monitor/linux/makefile
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/makefile b/core/sqf/monitor/linux/makefile
index a933bdc..b8c034a 100644
--- a/core/sqf/monitor/linux/makefile
+++ b/core/sqf/monitor/linux/makefile
@@ -256,6 +256,10 @@ PSTARTDOBJS += $(OUTDIR)/lock.o
PSTARTDOBJS += $(OUTDIR)/monlogging.o
PSTARTDOBJS += $(OUTDIR)/verspstartd.o
PSTARTDOBJS += $(OUTDIR)/CommonLogger.o
+PSTARTDOBJS += $(OUTDIR)/clusterconf.o
+PSTARTDOBJS += $(OUTDIR)/lnodeconfig.o
+PSTARTDOBJS += $(OUTDIR)/pnodeconfig.o
+PSTARTDOBJS += $(OUTDIR)/persistconfig.o
MEMLOGOBJS = $(OUTDIR)/monmemlog.o
MEMLOGOBJS += $(OUTDIR)/versmemlog.o
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/363df1f9/core/sqf/monitor/linux/persistconfig.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/persistconfig.cxx b/core/sqf/monitor/linux/persistconfig.cxx
index 485c6a4..c7572c3 100644
--- a/core/sqf/monitor/linux/persistconfig.cxx
+++ b/core/sqf/monitor/linux/persistconfig.cxx
@@ -191,8 +191,10 @@ const char *FormatZidString( FormatZid_t type )
CPersistConfig::CPersistConfig( persistConfigInfo_t &persistConfigInfo )
: persistPrefix_(persistConfigInfo.persistPrefix)
+ , processName_("")
, processNamePrefix_(persistConfigInfo.processNamePrefix)
, processNameFormat_(persistConfigInfo.processNameFormat)
+ , stdoutFile_("")
, stdoutPrefix_(persistConfigInfo.stdoutPrefix)
, stdoutFormat_(persistConfigInfo.stdoutFormat)
, programName_(persistConfigInfo.programName)
@@ -294,6 +296,44 @@ const char *CPersistConfig::GetProcessName( int nid )
return( processName_.c_str() );
}
+const char *CPersistConfig::GetStdoutFile( int nid )
+{
+ const char method_name[] = "CPersistConfig::GetStdoutFile";
+ TRACE_ENTRY;
+
+ char nidStr[MAX_PROCESS_NAME];
+
+ switch (stdoutNidFormat_)
+ {
+ case Nid_ALL:
+ case Nid_RELATIVE:
+ if (nid == -1)
+ {
+ stdoutFile_ = stdoutPrefix_;
+ }
+ else
+ {
+ sprintf( nidStr, "%d", nid );
+ stdoutFile_ = stdoutPrefix_ + nidStr;
+ }
+ break;
+ case Nid_Undefined:
+ stdoutFile_ = stdoutPrefix_;
+ }
+
+ if ( trace_settings & (TRACE_REQUEST | TRACE_PROCESS))
+ {
+ trace_printf( "%s@%d stdout prefix=%s, file=%s, format=%s\n"
+ , method_name, __LINE__
+ , stdoutPrefix_.c_str()
+ , stdoutFile_.c_str()
+ , FormatNidString(stdoutNidFormat_));
+ }
+
+ TRACE_EXIT;
+ return( stdoutFile_.c_str() );
+}
+
bool CPersistConfig::IsPersistConfig( const char *processName, int nid )
{
const char method_name[] = "CPersistConfig:IsPersistConfig";
@@ -311,6 +351,44 @@ bool CPersistConfig::IsPersistConfig( const char *processName, int nid )
return( match );
}
+bool CPersistConfig::IsZoneMatch( int zid )
+{
+ const char method_name[] = "CPersistConfig:IsZoneMatch";
+ TRACE_ENTRY;
+
+ bool match = false;
+
+ switch (stdoutNidFormat_)
+ {
+ case Zid_ALL:
+ if (zid == -1)
+ {
+ match = false;
+ }
+ else
+ {
+ match = true;
+ }
+ break;
+ case Zid_RELATIVE:
+ if (zid == -1)
+ {
+ match = false;
+ }
+ else
+ {
+ match = true;
+ }
+ break;
+ case Zid_Undefined:
+ match = true;
+ break;
+ }
+
+ TRACE_EXIT;
+ return( match );
+}
+
CPersistConfigContainer::CPersistConfigContainer( void )
: persistsCount_(0)
, head_(NULL)
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/363df1f9/core/sqf/monitor/linux/persistconfig.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/persistconfig.h b/core/sqf/monitor/linux/persistconfig.h
index 0614b7e..1a5ac43 100644
--- a/core/sqf/monitor/linux/persistconfig.h
+++ b/core/sqf/monitor/linux/persistconfig.h
@@ -110,10 +110,11 @@ public:
inline CPersistConfig *GetNext( void ){ return( next_); }
inline const char *GetPersistPrefix( void ) { return( persistPrefix_.c_str() ); }
- const char *GetProcessName( int nid );
+ const char *GetProcessName( int nid );
inline const char *GetProcessNamePrefix( void ) { return( processNamePrefix_.c_str() ); }
inline const char *GetProcessNameFormat( void ) { return( processNameFormat_.c_str() ); }
inline FormatNid_t GetProcessNameNidFormat( void ) { return( processNameNidFormat_ ); }
+ const char *GetStdoutFile( int nid );
inline const char *GetStdoutPrefix( void ) { return( stdoutPrefix_.c_str() ); }
inline const char *GetStdoutFormat( void ) { return( stdoutFormat_.c_str() ); }
inline FormatNid_t GetStdoutNidFormat( void ) { return( stdoutNidFormat_ ); }
@@ -124,7 +125,8 @@ public:
inline bool GetRequiresDTM( void ) { return ( requiresDTM_ ); }
inline int GetPersistRetries( void ) { return ( persistRetries_ ); }
inline int GetPersistWindow( void ) { return ( persistWindow_ ); }
- inline bool IsPersistConfig( const char *processName, int nid );
+ bool IsPersistConfig( const char *processName, int nid );
+ bool IsZoneMatch( int zid );
protected:
private:
@@ -132,6 +134,7 @@ private:
string processName_;
string processNamePrefix_;
string processNameFormat_;
+ string stdoutFile_;
string stdoutPrefix_;
string stdoutFormat_;
string programName_;
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/363df1f9/core/sqf/monitor/linux/pstartd.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pstartd.cxx b/core/sqf/monitor/linux/pstartd.cxx
index 63ac28e..f3388d8 100644
--- a/core/sqf/monitor/linux/pstartd.cxx
+++ b/core/sqf/monitor/linux/pstartd.cxx
@@ -34,6 +34,7 @@
#include "msgdef.h"
#include "seabed/trace.h"
#include "montrace.h"
+#include "clusterconf.h"
#include "pstartd.h"
@@ -42,6 +43,7 @@ char ga_ms_su_c_port[MPI_MAX_PORT_NAME] = {0}; // connection port - not used
long trace_settings = 0;
int MyPNID = -1;
+int MyZid = -1;
int MyNid = -1;
int MyPid = -1;
int gv_ms_su_nid = -1; // Local IO nid to make compatible w/ Seabed
@@ -50,6 +52,7 @@ SB_Verif_Type gv_ms_su_verif = -1;
bool tracing = false;
bool shuttingDown = false;
+CClusterConfig ClusterConfig; // Trafodion Configuration objects
CMonUtil monUtil;
CPStartD *pStartD;
CMonLog *MonLog = NULL;
@@ -57,6 +60,8 @@ CMonLog *MonLog = NULL;
DEFINE_EXTERN_COMP_DOVERS(pstartd)
DEFINE_EXTERN_COMP_PRINTVERS(pstartd)
+const char *ProcessTypeString( PROCESSTYPE type );
+
const char *MessageTypeString( MSGTYPE type )
{
const char *str = NULL;
@@ -136,65 +141,6 @@ const char *MessageTypeString( MSGTYPE type )
return( str );
}
-const char *ProcessTypeString( PROCESSTYPE type )
-{
- const char *str;
-
- switch( type )
- {
- case ProcessType_TSE:
- str = "TSE";
- break;
- case ProcessType_DTM:
- str = "DTM";
- break;
- case ProcessType_ASE:
- str = "ASE";
- break;
- case ProcessType_Generic:
- str = "Generic";
- break;
- case ProcessType_Watchdog:
- str = "Watchdog";
- break;
- case ProcessType_AMP:
- str = "AMP";
- break;
- case ProcessType_Backout:
- str = "Backout";
- break;
- case ProcessType_VolumeRecovery:
- str = "VolumeRecovery";
- break;
- case ProcessType_MXOSRVR:
- str = "MXOSRVR";
- break;
- case ProcessType_SPX:
- str = "SPX";
- break;
- case ProcessType_SSMP:
- str = "SSMP";
- break;
- case ProcessType_PSD:
- str = "PSD";
- break;
- case ProcessType_SMS:
- str = "SMS";
- break;
- case ProcessType_TMID:
- str = "TMID";
- break;
- case ProcessType_PERSIST:
- str = "PERSIST";
- break;
- default:
- str = "Undefined";
- break;
- }
-
- return( str );
-}
-
void InitLocalIO( void )
{
gp_local_mon_io = new Local_IO_To_Monitor( -1 );
@@ -252,13 +198,6 @@ void localIONoticeCallback(struct message_def *recv_msg, int )
method_name, __LINE__, recv_msg->u.request.u.up.nid,
recv_msg->u.request.u.up.node_name);
}
- CNodeUpReq * reqNodeUp;
- reqNodeUp = new CNodeUpReq(recv_msg->u.request.u.up.nid,
- recv_msg->u.request.u.up.node_name,
- true);
-
- pStartD->enqueueReq( reqNodeUp );
- pStartD->CLock::wakeOne();
break;
case MsgType_ProcessDeath:
@@ -860,59 +799,58 @@ void CMonUtil::processArgs( int argc, char *argv[] )
pnid_ = atoi(argv[2]);
nid_ = atoi(argv[3]);
pid_ = atoi(argv[4]);
+ zid_ = atoi(argv[8]);
gv_ms_su_verif = verifier_ = atoi(argv[9]);
strncpy( processName_, argv[5], sizeof(processName_) );
processName_[sizeof(processName_)-1] = '\0';
}
+CNodeUpReq::CNodeUpReq(int nid, char nodeName[], bool requiresDTM)
+ : nid_(nid)
+ , requiresDTM_(requiresDTM)
+ {
+ strncpy(nodeName_, nodeName, sizeof(nodeName_));
+ nodeName_[sizeof(nodeName_)-1] = '\0';
+
+ CLNodeConfig *lnodeConfig = ClusterConfig.GetLNodeConfig( nid );
+ zid_ = lnodeConfig->GetZid();
+ }
+
void CNodeUpReq::performRequest()
{
const char method_name[] = "CNodeUpReq::performRequest";
char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "Received 'Node Up' event for node %d, "
- "requires DTM flag=%d\n", nid_, requiresDTM_);
+ snprintf( buf, sizeof(buf)
+ , "Received 'Node Up' event for node %d, "
+ "requires DTM flag=%d\n"
+ , nid_, requiresDTM_);
monproc_log_write( MONUTIL_PERFORM_REQUEST_1, SQ_LOG_INFO, buf );
- // [ todo: need to check if nid_ is any one of the logical nodes in
- // the physical node ]
- if ( nid_ == MyPNID )
+ if ( zid_ == MyZid )
{
if ( tracing )
{
trace_printf("%s@%d invoking startProcs(%d, %d)\n",
method_name, __LINE__, nid_, requiresDTM_);
}
- pStartD->startProcs(nid_, requiresDTM_);
+ pStartD->startProcs( requiresDTM_ );
}
else
{
if ( tracing )
{
- trace_printf("%s@%d Ignoring node up for for node %d (%s), my node is %d\n", method_name, __LINE__, nid_, nodeName_, MyPNID );
+ trace_printf( "%s@%d Ignoring node up for for node %s, nid=%d, "
+ ", zid=%d, MyZid=%d\n"
+ , method_name, __LINE__
+ , nodeName_, nid_, zid_, MyZid );
}
}
}
CPStartD::CPStartD()
- :trafConfigInitialized_(false)
{
- const char method_name[] = "CPStartD::CPStartD";
-
- int rc = tc_initialize( tracing );
- if ( rc )
- {
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf)
- , "[%s], Can't initialize configuration!\n"
- , method_name );
- monproc_log_write( PSTARTD_PSTARTD_1, SQ_LOG_CRIT, buf );
- }
- else
- {
- trafConfigInitialized_ = true;
- }
}
CPStartD::~CPStartD()
@@ -942,359 +880,243 @@ void CPStartD::enqueueReq(CRequest * req)
workQ_.push_back ( req );
}
-void CPStartD::waitForEvent( void )
+bool CPStartD::loadConfiguration( void )
{
- CAutoLock autoLock(getLocker());
- wait();
-}
+ if ( ClusterConfig.IsConfigReady() )
+ {
+ // It was previously loaded, remove the old configuration
+ ClusterConfig.Clear();
+ }
+ if ( ClusterConfig.Initialize() )
+ {
+ if ( ! ClusterConfig.LoadConfig() )
+ {
+ printf("[%s], Failed to load cluster configuration.\n", MyName);
+ abort();
+ }
+ }
+ else
+ {
+ printf( "[%s] Warning: No cluster.conf found\n",MyName);
+ abort();
+ }
+
+ return true;
+}
-void CPStartD::startProcess( const char *pName
- , const char *prefix
- , persist_configuration_t &persistConfig )
+void CPStartD::startProcess( CPersistConfig *persistConfig )
{
const char method_name[] = "CPStartD::startProcess";
- PROCESSTYPE progType = ProcessType_Undefined;
+ PROCESSTYPE procType = ProcessType_Undefined;
int progArgC = 0;
+ string procName;
string progArgs;
string progStdout;
string progProgram;
char newProcName[MAX_PROCESS_PATH];
- int progNid = MyNid;
bool result;
int newNid;
int newPid;
- int okMask = 0;
int argBegin[MAX_ARGS];
int argLen[MAX_ARGS];
- string value = persistConfig.process_type;
- okMask |= 0x1;
- if (value.compare("DTM") == 0)
- progType = ProcessType_DTM;
- else if (value.compare("GENERIC") == 0)
- progType = ProcessType_Generic;
- else if (value.compare("PERSIST") == 0)
- progType = ProcessType_PERSIST;
- else if (value.compare("PSD") == 0)
- progType = ProcessType_PSD;
- else if (value.compare("SPX") == 0)
- progType = ProcessType_SPX;
- else if (value.compare("SSMP") == 0)
- progType = ProcessType_SSMP;
- else if (value.compare("SMS") == 0)
- progType = ProcessType_SMS;
- else if (value.compare("TMID") == 0)
- progType = ProcessType_TMID;
- else if (value.compare("WDG") == 0)
- progType = ProcessType_Watchdog;
-
- okMask |= 0x2;
- progStdout = persistConfig.std_out;
- okMask |= 0x4;
- progProgram = persistConfig.program_name;
-
- if ( okMask & 0x7 )
- {
- if ( tracing )
- {
- trace_printf("%s@%d Will start process: nid=%d, type=%s, name=%s, "
- "prog=%s, stdout=%s, argc=%d, args=%s\n",
- method_name, __LINE__, progNid,
- ProcessTypeString(progType), pName, progProgram.c_str(),
- progStdout.c_str(), progArgC, progArgs.c_str());
- }
+ procName = persistConfig->GetProcessName( MyNid );
+ procType = persistConfig->GetProcessType();
+ progStdout = persistConfig->GetStdoutFile( MyNid );
+ progProgram = persistConfig->GetProgramName();
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "Starting process %s on nid=%d, program="
- "%s, type=%d\n", pName, progNid, progProgram.c_str(), progType);
- monproc_log_write( PSTARTD_START_PROCESS_1, SQ_LOG_INFO, buf );
-
- result = monUtil.requestNewProcess(progNid,
- progType, pName,
- progProgram.c_str(), "",
- progStdout.c_str(),
- progArgC, progArgs.c_str(),
- argBegin, argLen,
- newNid, newPid, newProcName);
- if ( tracing )
- {
- trace_printf("%s@%d requestNewProcess returned: %d\n",
- method_name, __LINE__, result);
- }
- }
-
-}
-
-bool CPStartD::seapilotDisabled ( void )
-{
- const char method_name[] = "CPStartD::seapilotDisabled";
-
- bool disabled = false;
-
- struct Get_reply_def * regData;
- monUtil.requestGet (ConfigType_Cluster, "", "SQ_SEAPILOT_SUSPENDED", false,
- regData);
- if ( regData->num_returned == 1 )
+ if ( tracing )
{
- disabled = strcmp(regData->list[0].value, "1") == 0;
+ trace_printf( "%s@%d Will start process: nid=%d, type=%s, name=%s, "
+ "prog=%s, stdout=%s, argc=%d, args=%s\n"
+ , method_name, __LINE__, MyNid
+ , ProcessTypeString(procType), procName.c_str()
+ , progProgram.c_str(), progStdout.c_str()
+ , progArgC, progArgs.c_str());
}
+
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "Starting process %s on nid=%d, program=%s, type=%s\n"
+ , procName.c_str(), MyNid, progProgram.c_str()
+ , ProcessTypeString(procType));
+ monproc_log_write( PSTARTD_START_PROCESS_1, SQ_LOG_INFO, buf );
+
+ result = monUtil.requestNewProcess( MyNid
+ , procType
+ , procName.c_str()
+ , progProgram.c_str()
+ , ""
+ , progStdout.c_str()
+ , progArgC
+ , progArgs.c_str()
+ , argBegin
+ , argLen
+ , newNid
+ , newPid
+ , newProcName);
if ( tracing )
{
- trace_printf("%s@%d regData->num_returned=%d, regData->list[0].value=%s\n", method_name, __LINE__, regData->num_returned, regData->list[0].value);
- trace_printf("%s@%d Registry: seapilotDisabled=%d\n",
- method_name, __LINE__, disabled);
+ trace_printf("%s@%d requestNewProcess returned: %d\n",
+ method_name, __LINE__, result);
}
- free(regData);
-
- return disabled;
}
-void CPStartD::startProcs ( int nid, bool requiresDTM )
+void CPStartD::startProcs ( bool requiresDTM )
{
const char method_name[] = "CPStartD::startProcs";
/*
-1. cache configuation database to find all persistent data.
-2. for each persistent process:
- a) ask monitor if process is currently running
- b) if not running, start it on the logical node using process
- definition from the database.
+ 1. use persist configuration objects
+ 2. for each persistent configuration object:
+ a) determine if the process type is candidate for restart in this nid
+ b) ask monitor if process is currently running in this nid
+ c) if not running, start it
*/
- list<pair<string,string> > procsToStart;
- list<string> prefixToStart;
- list<string> keys;
- map<string,string> persistDataMap;
- persist_configuration_t persistConfig;
+ bool foundConfig = false;
+ CPersistConfig *persistConfig;
+ string procName = "";
-
- // Get persistent process keys
- int rc;
- char persistProcessKeys[TC_PERSIST_KEYS_VALUE_MAX];
- rc = tc_get_persist_keys( persistProcessKeys );
- if ( rc )
+ persistConfig = ClusterConfig.GetFirstPersistConfig();
+ if (persistConfig)
{
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf)
- , "[%s] Persist keys configuration does not exist!\n"
- , method_name );
- monproc_log_write( PSTARTD_STARTPROCS_1, SQ_LOG_CRIT, buf );
-
- return; // no keys, no work
- }
-
- if ( strlen( persistProcessKeys ) )
- {
- processKeys( persistProcessKeys, keys );
- }
-
- // Get persistent process configuration for each key
- list<string>::iterator keyIt;
- for (keyIt = keys.begin(); keyIt != keys.end(); ++keyIt)
- {
- string procName = "";
- string procType = "";
- string zones = "";
- string prefix = (*keyIt);
- rc = tc_get_persist_process( prefix.c_str(), &persistConfig );
- if ( rc )
- {
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf)
- , "[%s] Persist configuration for %s does not exist!\n"
- , method_name, prefix.c_str() );
- monproc_log_write( PSTARTD_STARTPROCS_2, SQ_LOG_ERR, buf );
- continue;
- }
-
- if ( tracing )
- {
- trace_printf( "%s@%d Persist Prefix =%s\n"
- "\t\tProcess Name = %s\n"
- "\t\tProcess Type = %s\n"
- "\t\tProgram Name = %s\n"
- "\t\tSTDOUT = %s\n"
- "\t\tRequires DTM = %s\n"
- "\t\tPersist Retries = %d\n"
- "\t\tPersist Window = %d\n"
- "\t\tPersist Zones = %s\n"
- , method_name, __LINE__
- , persistConfig.persist_prefix
- , persistConfig.process_name
- , persistConfig.process_type
- , persistConfig.program_name
- , persistConfig.std_out
- , persistConfig.requires_DTM ? "Y" : "N"
- , persistConfig.persist_retries
- , persistConfig.persist_window
- , persistConfig.persist_zones );
- }
-
- procName = persistConfig.process_name;
-
- if ( persistConfig.requires_DTM && !requiresDTM )
+ for ( ; persistConfig; persistConfig = persistConfig->GetNext() )
{
if ( tracing )
{
- trace_printf("%s@%d Persist type %s NOT targeted for restart DTM not ready\n",
- method_name, __LINE__, persistConfig.persist_prefix );
+ trace_printf( "%s@%d Persist Prefix =%s\n"
+ "\t\tProcess Name = %s\n"
+ "\t\tProcess Type = %s\n"
+ "\t\tProgram Name = %s\n"
+ "\t\tSTDOUT = %s\n"
+ "\t\tRequires DTM = %s\n"
+ "\t\tPersist Retries = %d\n"
+ "\t\tPersist Window = %d\n"
+ "\t\tPersist Zones = %s\n"
+ , method_name, __LINE__
+ , persistConfig->GetPersistPrefix()
+ , persistConfig->GetProcessName( MyNid )
+ , ProcessTypeString(persistConfig->GetProcessType())
+ , persistConfig->GetProgramName()
+ , persistConfig->GetStdoutFile( MyNid )
+ , persistConfig->GetRequiresDTM() ? "Y" : "N"
+ , persistConfig->GetPersistRetries()
+ , persistConfig->GetPersistWindow()
+ , persistConfig->GetZoneFormat() );
}
- continue;
- }
- else if ( persistConfig.requires_DTM && requiresDTM )
- {
- if ( tracing )
+
+ switch (persistConfig->GetProcessType())
{
- trace_printf("%s@%d Persist type %s NOT targeted for restart DTM ready\n",
- method_name, __LINE__, persistConfig.persist_prefix );
- }
- continue;
- }
-
- procType = persistConfig.process_type;
- zones = persistConfig.persist_zones;
+ case ProcessType_TMID:
+ case ProcessType_PERSIST:
+ case ProcessType_SSMP:
+ if ( persistConfig->GetRequiresDTM() && !requiresDTM )
+ {
+ if ( tracing )
+ {
+ trace_printf("%s@%d Persist type %s NOT targeted for restart DTM not ready\n",
+ method_name, __LINE__, persistConfig->GetPersistPrefix() );
+ }
+ break;
+ }
+ else if ( !persistConfig->GetRequiresDTM() && requiresDTM )
+ {
+ if ( tracing )
+ {
+ trace_printf("%s@%d Persist type %s NOT targeted for restart DTM ready\n",
+ method_name, __LINE__, persistConfig->GetPersistPrefix() );
+ }
+ break;
+ }
- if ( tracing )
- {
- trace_printf("%s@%d Persist %s process type %s targeted for restart\n",
- method_name, __LINE__,
- prefix.c_str(), persistConfig.process_type );
- }
+ procName = persistConfig->GetProcessName( MyNid );
-
- if ((procName.length() != 0) && (zones.length() != 0))
- {
- int procNid = -1;
- int procPid = -1;
-
- if (zoneMatch(zones.c_str()))
- {
- if (!monUtil.requestProcInfo(procName.c_str(), procNid, procPid))
- { // Save this process name
- procsToStart.push_back(pair<string,string>(procName, prefix));
+ if ( tracing )
+ {
+ trace_printf( "%s@%d Persist %s process type %s targeted for restart\n"
+ , method_name, __LINE__
+ , persistConfig->GetPersistPrefix()
+ , ProcessTypeString(persistConfig->GetProcessType()) );
}
- else
+
+ if (procName.length() != 0)
{
- if ( procNid != -1)
+ int procNid = -1;
+ int procPid = -1;
+
+ if (persistConfig->IsZoneMatch( MyZid ))
{
- char buf[MON_STRING_BUF_SIZE];
- snprintf( buf, sizeof(buf), "Not starting process %s "
- "because it is already running\n",
- procName.c_str());
- monproc_log_write( PSTARTD_STARTPROCS_3, SQ_LOG_INFO, buf );
-
- if ( tracing )
+ if ( ! monUtil.requestProcInfo( procName.c_str()
+ , procNid
+ , procPid))
+ { // Process does not exist, so start it
+ startProcess( persistConfig );
+ }
+ else
{
- trace_printf("%s@%d %s", method_name, __LINE__,
- buf);
+ if ( procNid != -1)
+ {
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf), "Not starting process %s "
+ "because it is already running\n",
+ procName.c_str());
+ monproc_log_write( PSTARTD_STARTPROCS_1, SQ_LOG_INFO, buf );
+
+ if ( tracing )
+ {
+ trace_printf( "%s@%d %s"
+ , method_name, __LINE__, buf);
+ }
+ }
}
}
+ else
+ {
+ char buf[MON_STRING_BUF_SIZE];
+ snprintf( buf, sizeof(buf)
+ , "[%s] Zone does not match for persist type %s"
+ ", zone format=%s, MyZid=%d\n"
+ , method_name
+ , persistConfig->GetPersistPrefix()
+ , persistConfig->GetZoneFormat()
+ , MyZid );
+ monproc_log_write( PSTARTD_STARTPROCS_2, SQ_LOG_CRIT, buf );
+ }
}
+ break;
+ case ProcessType_DTM:
+ case ProcessType_PSD:
+ case ProcessType_Watchdog:
+ default:
+ // Skip these, they are managed by DTM Lead and monitor processes
+ if ( tracing )
+ {
+ trace_printf("%s@%d Persist type %s NOT targeted for restart\n",
+ method_name, __LINE__, persistConfig->GetPersistPrefix() );
+ }
+ break;
}
}
}
-
- list<pair<string,string> >::iterator it;
- for ( it = procsToStart.begin(); it != procsToStart.end(); ++it)
- {
- const char * procName = (*it).first.c_str();
- const char * prefix = (*it).second.c_str();
-
- if ( tracing )
- {
- trace_printf("%s@%d Will start process %s for zone %d\n",
- method_name, __LINE__, procName, nid);
- }
- startProcess( procName, prefix, persistConfig );
- }
- procsToStart.clear();
-}
-
-void CPStartD::processKeys(const char *keys, list<string> &keyList)
-{
- char *keyDup = strdup(keys);
- char *k = keyDup;
- for (;;)
- {
- char *kComma = index(k, ',');
- if (kComma == NULL)
- {
- keyList.push_back(k);
- break;
- }
- else
- {
- *kComma = '\0';
- keyList.push_back(k);
- k = &kComma[1];
- }
- }
- free(keyDup);
-}
-
-void CPStartD::replaceNid(char *str)
-{
- for (;;)
+ if (!foundConfig)
{
- // 1234
- char *p = strstr(str, "%nid");
- if (p == NULL)
- break;
- char tail[1000];
- if (p[4] == '+')
- strcpy(tail, &p[5]);
- else
- strcpy(tail, &p[4]);
- sprintf(p, "%d", MyNid);
- strcat(p, tail);
+ printf ("[%s] Persistent process configuration does not exist\n", MyName);
}
}
-void CPStartD::replaceZid(char *str)
-{
- for (;;) {
- // 1234
- char *p = strstr(str, "%zid");
- if (p == NULL)
- break;
- char tail[1000];
- if (p[4] == '+')
- strcpy(tail, &p[5]);
- else
- strcpy(tail, &p[4]);
- sprintf(p, "%d", MyNid);
- strcat(p, tail);
- }
-}
-
-bool CPStartD::zoneMatch ( const char *zones )
+void CPStartD::waitForEvent( void )
{
- bool ret;
- int zone;
- const char *z = zones;
- for (;;)
- {
- const char *zComma = index(z, ',');
- if (zComma == NULL)
- {
- sscanf(z, "%d", &zone);
- ret = (zone == MyNid);
- break;
- }
- else
- {
- sscanf(z, "%d", &zone);
- ret = (zone == MyNid);
- if (ret)
- break;
- z = &zComma[1];
- }
- }
- return ret;
+ CAutoLock autoLock(getLocker());
+ wait();
}
+//
+// To enable tracing, add the following to sql/scripts/mon.env file:
+// PSD_TRACE=1
+//
void TraceInit( int & argc, char **& argv )
{
char traceFileName[MAX_PROCESS_PATH];
@@ -1389,6 +1211,7 @@ int main (int argc, char *argv[])
monUtil.processArgs (argc, argv);
MyName = monUtil.getProcName();
gv_ms_su_nid = MyPNID = monUtil.getPNid();
+ MyZid = monUtil.getZid();
MyNid = monUtil.getNid();
MyPid = monUtil.getPid();
@@ -1396,6 +1219,12 @@ int main (int argc, char *argv[])
pStartD = new CPStartD;
+ if ( !pStartD->loadConfiguration() )
+ {
+ trace_printf("%s@%d Exiting!\n", method_name, __LINE__);
+ exit (1);
+ }
+
InitLocalIO( );
gp_local_mon_io->set_cb(localIONoticeCallback, "notice");
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/363df1f9/core/sqf/monitor/linux/pstartd.h
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/pstartd.h b/core/sqf/monitor/linux/pstartd.h
index 81c60ed..e697638 100644
--- a/core/sqf/monitor/linux/pstartd.h
+++ b/core/sqf/monitor/linux/pstartd.h
@@ -46,6 +46,7 @@ class CMonUtil
int getNid() { return nid_; }
int getPid() { return pid_; }
int getPNid() { return pnid_; }
+ int getZid() { return zid_; }
const char *getProcName() { return processName_; }
bool getTrace() { return trace_; }
int getVerifier() { return verifier_; }
@@ -80,6 +81,7 @@ class CMonUtil
private:
char processName_[MAX_PROCESS_PATH]; // current process name
int pnid_; // current process physical node id
+ int zid_; // current process node id
int nid_; // current process node id
int pid_; // current process process id
Verifier_t verifier_; // current process verifier
@@ -99,18 +101,14 @@ class CRequest
class CNodeUpReq: public CRequest
{
public:
- CNodeUpReq(int nid, char nodeName[], bool requiresDTM)
- : nid_(nid), requiresDTM_(requiresDTM)
- {
- strncpy(nodeName_, nodeName, sizeof(nodeName_));
- nodeName_[sizeof(nodeName_)-1] = '\0';
- }
+ CNodeUpReq(int nid, char nodeName[], bool requiresDTM);
virtual ~CNodeUpReq() {}
void performRequest();
private:
int nid_;
+ int zid_;
bool requiresDTM_;
char nodeName_[MPI_MAX_PROCESSOR_NAME];
};
@@ -133,32 +131,16 @@ class CPStartD : public CLock
typedef enum { NodeUp } pStartD_t;
void enqueueReq(CRequest * req);
-
CRequest * getReq( void );
-
int getReqCount( void );
-
- void waitForEvent( void ) ;
-
- void startProcess( const char *pName
- , const char *prefix
- , persist_configuration_t &persistConfig );
-
- void startProcs ( int nid, bool requiresDTM );
-
- bool seapilotDisabled ( void );
-
- bool zoneMatch ( const char *zones );
-
+ bool loadConfiguration( void );
+ void startProcess( CPersistConfig *persistConfig );
+ void startProcs ( bool requiresDTM );
+ void waitForEvent( void );
private:
- void processKeys(const char *keys, list<string> &keyList);
- void replaceNid(char *str);
- void replaceZid(char *str);
list<CRequest *> workQ_;
-
- bool trafConfigInitialized_;
};
#endif
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/363df1f9/core/sqf/monitor/linux/trafconf.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/trafconf.cxx b/core/sqf/monitor/linux/trafconf.cxx
index 7128967..9fff70a 100644
--- a/core/sqf/monitor/linux/trafconf.cxx
+++ b/core/sqf/monitor/linux/trafconf.cxx
@@ -40,6 +40,7 @@ using namespace std;
#include <mpi.h>
#include "msgdef.h"
+#include "montrace.h"
#include "sqevlog/evl_sqlog_writer.h"
#include "clusterconf.h"
@@ -590,6 +591,13 @@ int main( int argc, char *argv[] )
}
}
+ char *env;
+ env = getenv("TC_TRACE_ENABLE");
+ if ( env && *env == '1' )
+ {
+ trace_settings |= TRACE_TRAFCONFIG;
+ }
+
if ( !ClusterConfig.Initialize() )
{
printf( "Failed to initialize 'sqconfig.db'!\n" );
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/363df1f9/core/sqf/sql/scripts/gensq.pl
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/gensq.pl b/core/sqf/sql/scripts/gensq.pl
index ffeddaf..3bc8ae4 100755
--- a/core/sqf/sql/scripts/gensq.pl
+++ b/core/sqf/sql/scripts/gensq.pl
@@ -436,7 +436,7 @@ sub printSQShellCommand {
sub processNodes {
my $bNodeSpecified = 0;
- while (<SRC>) {
+ while (<>) {
next if (/^$/);
next if (/^#/);
if (/^_virtualnodes/) {
@@ -502,7 +502,7 @@ sub processNodes {
sub processPersist {
my $err = 0;
- while (<SRC>) {
+ while (<>) {
if (/^begin persist/) {
}
elsif (/^end persist/) {
@@ -541,7 +541,7 @@ sub printZoneList {
}
sub processFloatingIp {
- while (<SRC>) {
+ while (<>) {
if (/^process/) {
@this_line = split(/;/, $_);
if($#this_line >= 2) {
@@ -632,9 +632,6 @@ sub printInitLinesAuxFiles {
sub openFiles {
- open (SRC,"<$infile")
- or die("unable to open $infile");
-
open (SQS,">$coldscriptFileName")
or die("unable to open $coldscriptFileName");
@@ -694,7 +691,6 @@ sub endGame {
print "Generated SSCP Startup file: $startSSCP\n";
print "Generated SSCP Stop file: $stopSSCP\n";
- close(SRC);
close(SQS);
close(SQSH);
@@ -731,11 +727,11 @@ sub endGame {
sub doInit {
- $infile=@ARGV[0];
- $scriptFileName=@ARGV[1];
- $g_HostName=$ARGV[2];
- $g_FTFlag=$ARGV[3];
- $g_PERFFlag=$ARGV[4];
+ $scriptFileName= shift(@ARGV);
+ $g_HostName= shift(@ARGV);
+ $g_FTFlag= shift(@ARGV);
+ $g_PERFFlag= shift(@ARGV);
+ # remaining args are input files
$startIDTM="idtmstart";
@@ -769,7 +765,7 @@ doInit();
openFiles;
-while (<SRC>) {
+while (<>) {
if (/^begin node/) {
processNodes;
printInitialLines;
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/363df1f9/core/sqf/sql/scripts/sqconfig
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/sqconfig b/core/sqf/sql/scripts/sqconfig
index 4de7fd8..93a552f 100644
--- a/core/sqf/sql/scripts/sqconfig
+++ b/core/sqf/sql/scripts/sqconfig
@@ -19,69 +19,7 @@
#
# @@@ END COPYRIGHT @@@
-begin persist
-
-#
-# The following PROCESS_TYPEs are persistent and have special process management:
-# DTM
-# TMID
-# SSMP
-# PSD
-# WDG
-#
-# Generic persistent processes are of PROCESS_TYPE:
-# PERSIST
-#
-
-PERSIST_PROCESS_KEYS = DTM,TMID,SSCP,SSMP,PSD,WDG
-
-DTM_PROCESS_NAME = $TM%nid+
-DTM_PROCESS_TYPE = DTM
-DTM_PROGRAM_NAME = tm
-DTM_REQUIRES_DTM = N
-DTM_STDOUT = stdout_DTM%nid
-DTM_PERSIST_RETRIES = 2,30
-DTM_PERSIST_ZONES = %zid
-
-TMID_PROCESS_NAME = $TMID
-TMID_PROCESS_TYPE = TMID
-TMID_PROGRAM_NAME = idtmsrv
-TMID_REQUIRES_DTM = N
-TMID_STDOUT = stdout_TMID
-TMID_PERSIST_RETRIES = 2,30
-TMID_PERSIST_ZONES = %zid+
-
-SSCP_PROCESS_NAME = $ZSC%nid+
-SSCP_PROCESS_TYPE = PERSIST
-SSCP_PROGRAM_NAME = mxsscp
-SSCP_REQUIRES_DTM = Y
-SSCP_STDOUT = stdout_ZSC%nid
-SSCP_PERSIST_RETRIES = 10,60
-SSCP_PERSIST_ZONES = %zid
-
-SSMP_PROCESS_NAME = $ZSM%nid+
-SSMP_PROCESS_TYPE = SSMP
-SSMP_PROGRAM_NAME = mxssmp
-SSMP_REQUIRES_DTM = Y
-SSMP_STDOUT = stdout_ZSM%nid
-SSMP_PERSIST_RETRIES = 10,60
-SSMP_PERSIST_ZONES = %zid
-
-PSD_PROCESS_NAME = $PSD%nid+
-PSD_PROCESS_TYPE = PSD
-PSD_PROGRAM_NAME = pstartd
-PSD_REQUIRES_DTM = N
-PSD_STDOUT = stdout_PSD%nid
-PSD_PERSIST_RETRIES = 10,60
-PSD_PERSIST_ZONES = %zid
-
-WDG_PROCESS_NAME = $WDG%nid+
-WDG_PROCESS_TYPE = WDG
-WDG_PROGRAM_NAME = sqwatchdog
-WDG_REQUIRES_DTM = N
-WDG_STDOUT = stdout_WDG%nid
-WDG_PERSIST_RETRIES = 10,60
-WDG_PERSIST_ZONES = %zid
-
-end persist
+begin node
+_virtualnodes 2
+end node
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/363df1f9/core/sqf/sql/scripts/sqgen
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/sqgen b/core/sqf/sql/scripts/sqgen
index fd49ed8..f953717 100755
--- a/core/sqf/sql/scripts/sqgen
+++ b/core/sqf/sql/scripts/sqgen
@@ -231,7 +231,7 @@ sqlite3 -init createConfigDb $SQCONFIG_DB_FILE <<eof
.quit
eof
-./gensq.pl $SQCONFIG_FILE $SQSCRIPT_FILE `hostname` $FT_FLAG $PERF_FLAG
+./gensq.pl $SQSCRIPT_FILE `hostname` $FT_FLAG $PERF_FLAG $SQCONFIG_FILE $TRAF_HOME/sql/scripts/sqconfig.persist
sq_stat=$?
if [[ $sq_stat != 0 ]]; then
exit $sq_stat;
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/363df1f9/core/sqf/src/seatrans/tm/hbasetmlib2/idtmclicom.h
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/tm/hbasetmlib2/idtmclicom.h b/core/sqf/src/seatrans/tm/hbasetmlib2/idtmclicom.h
index 7cc264e..4823e00 100644
--- a/core/sqf/src/seatrans/tm/hbasetmlib2/idtmclicom.h
+++ b/core/sqf/src/seatrans/tm/hbasetmlib2/idtmclicom.h
@@ -448,14 +448,12 @@ static int do_get_servers2(MS_Mon_Process_Info_Type *pp_pi,
lv_scount = 0;
for (lv_inx = 0; lv_inx < pv_count; lv_inx++) {
lp_sname = pp_pi[lv_inx].process_name;
- if (memcmp(lp_sname, "$TSID", 5) == 0) {
- if (isdigit(lp_sname[5])) {
- if (gv_verbose)
- printf("cli: sname=%s\n", lp_sname);
- assert(lv_scount < pv_max);
- ppp_snames[lv_scount] = lp_sname;
- lv_scount++;
- }
+ if (memcmp(lp_sname, "$TMID", 5) == 0) {
+ if (gv_verbose)
+ printf("cli: sname=%s\n", lp_sname);
+ assert(lv_scount < pv_max);
+ ppp_snames[lv_scount] = lp_sname;
+ lv_scount++;
}
}
return lv_scount;
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/363df1f9/core/sqf/src/tm/Makefile
----------------------------------------------------------------------
diff --git a/core/sqf/src/tm/Makefile b/core/sqf/src/tm/Makefile
index 4151b24..ff5686e 100644
--- a/core/sqf/src/tm/Makefile
+++ b/core/sqf/src/tm/Makefile
@@ -131,6 +131,7 @@ IDSRVOBJS = $(OUTDIR)/idtmsrv.o \
ALLOBJS = $(LIBSTMOBJS) \
$(LIBSXATMOBJS) \
$(TMOBJS) \
+ $(IDSRVOBJS) \
$(LIBXARMOBJS) \
CFILES = `ls *.c`
@@ -190,6 +191,9 @@ setup:
clean:
$(RM) $(LIBEXPDIR)/libsxatmlib.so $(LIBEXPDIR)/libxarm.so $(LIBEXPDIR)/libstmlib.so *.gcda *.gcno *.gcov
$(RM) $(BINEXPDIR)/tm
+ $(RM) $(BINEXPDIR)/idtmsrv
+ $(RM) $(OUTDIR)/tm
+ $(RM) $(OUTDIR)/idtmsrv
$(RM) $(ALLOBJS)
$(RM) $(CDEPFILES)
cd $(HBASE_TRX_LOC); make clean
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/363df1f9/install/installer/addNode_step2
----------------------------------------------------------------------
diff --git a/install/installer/addNode_step2 b/install/installer/addNode_step2
index 9a28cbb..58df373 100755
--- a/install/installer/addNode_step2
+++ b/install/installer/addNode_step2
@@ -379,11 +379,6 @@ sudo su $TRAF_USER --login --command "cd $TRAF_HOME/sql/scripts; sqregen -config
}
-function rmsStart {
-
-sudo su $TRAF_USER --login --command "cd $SQ_ROOT/sql/scripts; rmsstart"
-}
-
function dcsStart {
sudo su $TRAF_USER --login --command "cd $TRAF_HOME/sql/scripts; dcsstart"
@@ -428,7 +423,6 @@ copySqcert
addUpNodes
sqRegen
copysqConfig
-rmsStart
dcsStart
cleanUp
printMessage
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/363df1f9/install/installer/traf_sqconfig
----------------------------------------------------------------------
diff --git a/install/installer/traf_sqconfig b/install/installer/traf_sqconfig
index 09fe04c..31315c2 100755
--- a/install/installer/traf_sqconfig
+++ b/install/installer/traf_sqconfig
@@ -78,10 +78,6 @@ done
echo "end node" >> $sqconfig
-# The following sed is dependent on the nunber of lines in the copyright,
-# as they are excluded. If the copyright gets larger this needs to change.
-sed '1,20d' $LOCAL_WORKDIR/sqconfig_persist.txt >> $sqconfig
-
sudo cp $sqconfig $UNTAR_DIR
sudo cp $sqconfig $TRAF_USER_DIR/sqconfig
sudo chown $TRAF_USER.$TRAF_GROUP $TRAF_USER_DIR/sqconfig
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/363df1f9/install/python-installer/scripts/traf_sqconfig.py
----------------------------------------------------------------------
diff --git a/install/python-installer/scripts/traf_sqconfig.py b/install/python-installer/scripts/traf_sqconfig.py
index 05c7a54..2895079 100755
--- a/install/python-installer/scripts/traf_sqconfig.py
+++ b/install/python-installer/scripts/traf_sqconfig.py
@@ -57,10 +57,6 @@ def run():
with open(sqconfig_file, 'w') as f:
f.writelines(lines)
- # append the current persist section to the Trafodion configuration file
- run_cmd('echo "sed \'1,20d\' %s >> %s"' % (sqconfig_persist_file, sqconfig_file))
- run_cmd('sed \'1,20d\' %s >> %s' % (sqconfig_persist_file, sqconfig_file))
-
print 'sqconfig generated successfully!'
run_cmd('sqgen')
[49/50] [abbrv] incubator-trafodion git commit: Fixes addressing
multiple failure in SQL Regressions (core 116).
Posted by su...@apache.org.
Fixes addressing multiple failure in SQL Regressions (core 116).
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/53148a77
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/53148a77
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/53148a77
Branch: refs/heads/master
Commit: 53148a772fc60d27154aad41e8a2ba8bfca0027e
Parents: b1f77f4
Author: Zalo Correa <za...@esgyn.com>
Authored: Thu May 25 17:07:11 2017 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Thu May 25 17:07:11 2017 -0700
----------------------------------------------------------------------
core/sqf/src/seabed/src/ms.cpp | 7 +++----
core/sqf/src/seabed/src/msmon.cpp | 2 ++
core/sqf/src/seatrans/tm/hbasetmlib2/idtmclicom.h | 6 ++++--
core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp | 2 +-
core/sql/sqlcomp/CmpSeabaseDDLrepos.cpp | 2 +-
core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp | 2 +-
core/sql/sqlcomp/CmpSeabaseDDLview.cpp | 4 ++--
7 files changed, 14 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/53148a77/core/sqf/src/seabed/src/ms.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/seabed/src/ms.cpp b/core/sqf/src/seabed/src/ms.cpp
index f887547..28db69b 100644
--- a/core/sqf/src/seabed/src/ms.cpp
+++ b/core/sqf/src/seabed/src/ms.cpp
@@ -1391,11 +1391,11 @@ SB_THROWS_FATAL {
true, // args
&lv_cmdline,
lv_cmdline.size());
-#if 0
+
#ifdef SQ_PHANDLE_VERIFIER
- sprintf(&lv_line, "msg_init - p-id=%d/%d" PFVY ", tid=%ld, pname=%s, cmdline=%s, %s\n",
+ snprintf(&lv_line, sizeof(lv_line), "msg_init - p-id=%d/%d" PFVY ", tid=%ld, pname=%s, cmdline=%s, %s\n",
#else
- sprintf(&lv_line, "msg_init - p-id=%d/%d, tid=%ld, pname=%s, cmdline=%s, %s\n",
+ snprintf(&lv_line, sizeof(lv_line), "msg_init - p-id=%d/%d, tid=%ld, pname=%s, cmdline=%s, %s\n",
#endif
gv_ms_su_nid,
gv_ms_su_pid,
@@ -1406,7 +1406,6 @@ SB_THROWS_FATAL {
ga_ms_su_pname,
&lv_cmdline,
ms_seabed_vers());
-#endif
// setup timer module
sb_timer_init();
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/53148a77/core/sqf/src/seabed/src/msmon.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/seabed/src/msmon.cpp b/core/sqf/src/seabed/src/msmon.cpp
index 696375d..2e6a487 100644
--- a/core/sqf/src/seabed/src/msmon.cpp
+++ b/core/sqf/src/seabed/src/msmon.cpp
@@ -7145,6 +7145,8 @@ int msg_mon_send_process_info(const char *pp_where,
pp_msg->u.request.u.process_info.target_verifier = pv_verif;
#endif
pp_msg->u.request.u.process_info.type = static_cast<PROCESSTYPE>(pv_ptype);
+ ms_util_string_clear(pp_msg->u.request.u.process_info.target_process_pattern,
+ sizeof(pp_msg->u.request.u.process_info.target_process_pattern));
if (pp_name == NULL) {
ms_util_string_clear(pp_msg->u.request.u.process_info.target_process_name,
sizeof(pp_msg->u.request.u.process_info.target_process_name));
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/53148a77/core/sqf/src/seatrans/tm/hbasetmlib2/idtmclicom.h
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/tm/hbasetmlib2/idtmclicom.h b/core/sqf/src/seatrans/tm/hbasetmlib2/idtmclicom.h
index 5277bbb..53da50d 100644
--- a/core/sqf/src/seatrans/tm/hbasetmlib2/idtmclicom.h
+++ b/core/sqf/src/seatrans/tm/hbasetmlib2/idtmclicom.h
@@ -328,6 +328,8 @@ static int do_cli_open(JNIEnv *j_env, SB_Phandle_Type *pp_phandle, int *pp_oid)
int lv_hash;
int lv_scount;
+ if (gv_verbose)
+ printf("cli: do_cli_open() pid=%d\n", getpid());
lv_ferr = do_get_servers(&lp_pi, &lv_count);
if (lv_ferr == XZFIL_ERR_OK) {
lv_scount = do_get_servers2(lp_pi, lv_count, MAX_P, lp_snames);
@@ -448,8 +450,8 @@ static int do_get_servers2(MS_Mon_Process_Info_Type *pp_pi,
lv_scount = 0;
for (lv_inx = 0; lv_inx < pv_count; lv_inx++) {
lp_sname = pp_pi[lv_inx].process_name;
- if (gv_verbose)
- printf("cli(%d): sname=%s\n", getpid(), lp_sname);
+ if (gv_verbose)
+ printf("cli(%d): sname=%s\n", getpid(), lp_sname?lp_sname:"");
if (memcmp(lp_sname, "$TSID", 5) == 0) {
if (isdigit(lp_sname[5])) {
if (gv_verbose)
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/53148a77/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
index fa61ab4..398bcb2 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
@@ -530,7 +530,7 @@ short CmpSeabaseDDL::processDDLandCreateDescs(
exprNode = parser.parseDML((const char*)gluedQuery, strlen(gluedQuery),
CharInfo::ISO88591);
- NADELETEBASIC(gluedQuery, STMTHEAP);
+ NADELETEBASICARRAY(gluedQuery, STMTHEAP);
if (! exprNode)
return resetCQDs(hbaseSerialization, hbVal, -1);
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/53148a77/core/sql/sqlcomp/CmpSeabaseDDLrepos.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLrepos.cpp b/core/sql/sqlcomp/CmpSeabaseDDLrepos.cpp
index 20af639..55ea7d2 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLrepos.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLrepos.cpp
@@ -107,7 +107,7 @@ short CmpSeabaseDDL::createRepos(ExeCliInterface * cliInterface)
param_[1] = SEABASE_REPOS_SCHEMA;
str_sprintf(queryBuf, gluedQuery, param_[0], param_[1]);
- NADELETEBASIC(gluedQuery, STMTHEAP);
+ NADELETEBASICARRAY(gluedQuery, STMTHEAP);
if (beginXnIfNotInProgress(cliInterface, xnWasStartedHere))
goto label_error;
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/53148a77/core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp b/core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp
index 67148e1..2ee9892 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp
@@ -1671,7 +1671,7 @@ short CmpSeabaseDDL::createLibmgrProcs(ExeCliInterface * cliInterface)
strlen(SEABASE_LIBMGR_LIBRARY) + gluedQuerySize + 200];
str_sprintf(queryBuf, gluedQuery, param_[0], param_[1], param_[2], param_[3], param_[4]);
- NADELETEBASIC(gluedQuery, STMTHEAP);
+ NADELETEBASICARRAY(gluedQuery, STMTHEAP);
cliRC = cliInterface->executeImmediate(queryBuf);
if (cliRC < 0)
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/53148a77/core/sql/sqlcomp/CmpSeabaseDDLview.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLview.cpp b/core/sql/sqlcomp/CmpSeabaseDDLview.cpp
index e90596f..0b8a690 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLview.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLview.cpp
@@ -1494,7 +1494,7 @@ short CmpSeabaseDDL::createMetadataViews(ExeCliInterface * cliInterface)
}
else
{
- NADELETEBASIC(gluedQuery, STMTHEAP);
+ NADELETEBASICARRAY(gluedQuery, STMTHEAP);
continue;
}
@@ -1504,7 +1504,7 @@ short CmpSeabaseDDL::createMetadataViews(ExeCliInterface * cliInterface)
param_[10], param_[11], param_[12], param_[13], param_[14],
param_[15], param_[16], param_[17], param_[18]);
- NADELETEBASIC(gluedQuery, STMTHEAP);
+ NADELETEBASICARRAY(gluedQuery, STMTHEAP);
NABoolean xnWasStartedHere = FALSE;
if (beginXnIfNotInProgress(cliInterface, xnWasStartedHere))
[31/50] [abbrv] incubator-trafodion git commit: Merge remote branch
'origin/master' into TRAFODION-2001
Posted by su...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9523fd2b/core/sqf/monitor/linux/shell.cxx
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/shell.cxx
index bc4fc74,30be688..1fc5449
mode 100644,100755..100644
--- a/core/sqf/monitor/linux/shell.cxx
+++ b/core/sqf/monitor/linux/shell.cxx
@@@ -207,168 -163,15 +207,168 @@@ MonCwd::MonCwd(): cwdChanged_(false
}
else
{
- env = getenv("MY_SQROOT");
- sprintf( mpirunOutFileName, "./monitor.mpirun.out" );
- sprintf( mpirunErrFileName, "./monitor.mpirun.err" );
++ env = getenv("TRAF_HOME");
+ if ( env )
+ {
+ string monWdir;
+
+ monWdir = env;
+ monWdir.append("/sql/scripts" );
+ if ( trace_settings & TRACE_SHELL_CMD )
+ trace_printf("%s@%d [%s] Monitor working directory: %s\n",
+ method_name, __LINE__, MyName, monWdir.c_str());
+
+
+ if ( getcwd( savedDir_, sizeof( savedDir_ )) != NULL )
+ {
+ chdir( monWdir.c_str() );
+ cwdChanged_ = true;
+ if ( trace_settings & TRACE_SHELL_CMD )
+ {
+ trace_printf("%s@%d [%s] Monitor working directory: %s\n",
+ method_name, __LINE__, MyName, monWdir.c_str());
+ trace_printf("%s@%d [%s] Saved Monitor working directory: %s\n",
+ method_name, __LINE__, MyName, savedDir_);
+ }
+ }
+
+ }
}
+}
- if ( trace_settings & TRACE_SHELL_CMD)
+MonCwd::~MonCwd()
+{
+ const char method_name[] = "MonCwd::~MonCwd";
+
+ if ( cwdChanged_ )
+ { // restore working directory
+ chdir( savedDir_ );
+ if ( trace_settings & TRACE_SHELL_CMD )
+ {
+ trace_printf("%s@%d [%s] Restored saved working directory: %s\n",
+ method_name, __LINE__, MyName, savedDir_);
+ }
+ }
+}
+
+// functions
+
+const char *RoleTypeString( ZoneType type )
+{
+ const char *str;
+
+ switch( type )
{
- printf( "mpirunOutFileName=%s\n", mpirunOutFileName );
- printf( "mpirunErrFileName=%s\n", mpirunErrFileName );
+ case ZoneType_Edge:
+ str = "connection";
+ break;
+ case ZoneType_Excluded:
+ str = "excluded";
+ break;
+ case ZoneType_Aggregation:
+ str = "aggregation";
+ break;
+ case ZoneType_Storage:
+ str = "storage";
+ break;
+ case ZoneType_Frontend:
+ str = "connection,aggregation";
+ break;
+ case ZoneType_Backend:
+ str = "aggregation,storage";
+ break;
+ case ZoneType_Any:
+ str = "connection,aggregation,storage";
+ break;
+ default:
+ str = "Undefined";
+ break;
+ }
+
+ return( str );
+}
+
+const char *StateString( STATE state )
+{
+ const char *str;
+
+ switch( state )
+ {
+ case State_Up:
+ str = "Up";
+ break;
+ case State_Down:
+ str = "Down";
+ break;
+ case State_Stopped:
+ str = "Stopped";
+ break;
+ case State_Shutdown:
+ str = "Shutdown";
+ break;
+ case State_Merged:
+ str = "Merged";
+ break;
+ case State_Joining:
+ str = "Joining";
+ break;
+ default:
+ str = "Unknown";
+ }
+
+ return( str );
+}
+
+const char *ZoneTypeString( ZoneType type )
+{
+ const char *str;
+
+ switch( type )
+ {
+ case ZoneType_Edge:
+ str = "Edge";
+ break;
+ case ZoneType_Excluded:
+ str = "Excluded";
+ break;
+ case ZoneType_Aggregation:
+ str = "Aggregation";
+ break;
+ case ZoneType_Storage:
+ str = "Storage";
+ break;
+ case ZoneType_Frontend:
+ str = "Frontend";
+ break;
+ case ZoneType_Backend:
+ str = "Backend";
+ break;
+ case ZoneType_Any:
+ str = "Any";
+ break;
+ default:
+ str = "Undefined";
+ break;
+ }
+
+ return( str );
+}
+
+char *ErrorMsg (int error_code)
+{
+ int rc;
+ int length;
+ static char buffer[MPI_MAX_ERROR_STRING];
+
+ rc = MPI_Error_string (error_code, buffer, &length);
+ if (rc != MPI_SUCCESS)
+ {
+ sprintf(buffer,"MPI_Error_string: Invalid error code (%d)\n", error_code);
+ length = strlen(buffer);
}
+ buffer[length] = '\0';
+
+ return buffer;
}
bool init_pnode_map( void )
@@@ -1767,195 -1723,190 +1767,195 @@@ bool find_process( char *process_name
}
gp_local_mon_io->release_msg(msg);
+ return ret;
}
-void exec_cmd (char *cmd, char delimiter)
+void get_event (int event_id)
{
- bool debug;
- bool nowait;
- bool startup_process;
- char *cmd_tail = cmd;
- char token[MAX_TOKEN];
- char name[MAX_PROCESS_NAME];
- char infile[MAX_PROCESS_PATH];
- char outfile[MAX_PROCESS_PATH];
- int nid;
- int pid;
- PROCESSTYPE process_type;
- int priority;
- const char method_name[] = "exec_cmd";
+ bool done = false;
+ int count;
+ MPI_Status status;
+ const char method_name[] = "get_event";
- // setup defaults
- name[0] = '\0'; // The monitor will assign name if null
- nid = -1;
- process_type = ProcessType_Generic;
- nowait = false;
- debug = false;
- priority = 0;
- infile[0] = '\0'; // The monitor's default infile is used
- outfile[0] = '\0'; // The monitor's default outfile is used
- if (*cmd && delimiter == '{')
- {
- startup_process = false;
- }
- else
+ if ( trace_settings & TRACE_SHELL_CMD )
+ trace_printf("%s@%d [%s] waiting for event %d message.\n",
+ method_name, __LINE__, MyName, event_id);
+ do
{
- startup_process = true;
- }
+ gp_local_mon_io->wait_for_event( &msg );
+ assert( msg );
+ status.MPI_TAG = msg->reply_tag;
+ count = sizeof( *msg );
- // parse options
- if (delimiter == '{')
- {
- delimiter = ' ';
- while (*cmd_tail && delimiter != '}')
+ if ((status.MPI_TAG == EVENT_TAG ) &&
+ (count == sizeof (struct message_def) ) &&
+ (msg->u.request.type == ReqType_Notice ) &&
+ (msg->type == MsgType_Event ) )
{
- cmd_tail = get_token (cmd_tail, token, &delimiter);
- normalize_case (token);
- if (strcmp (token, "in") == 0)
- {
- cmd_tail = get_token (cmd_tail, infile, &delimiter, MAX_PROCESS_PATH-1);
- }
- else if (strcmp (token, "name") == 0)
- {
- cmd_tail = get_token (cmd_tail, name, &delimiter, MAX_PROCESS_NAME-1);
- }
- else if (strcmp (token, "nid") == 0)
+ printf("[%s] Event %d (%s) received\n",
+ MyName,
+ msg->u.request.u.event_notice.event_id,
+ msg->u.request.u.event_notice.data);
+ if (event_id == -1
+ || event_id == msg->u.request.u.event_notice.event_id)
{
- cmd_tail = get_token (cmd_tail, token, &delimiter);
- nid = atoi (token);
+ done = true;
}
- else if (strcmp (token, "nowait") == 0)
+ else
{
- nowait = true;
+ sleep(1);
}
- else if (strcmp (token, "out") == 0)
+ }
+ else
+ {
+ printf("[%s] Invalid Event received - msgtype=%d, noreply=%d, reqtype=%d\n",
+ MyName, msg->type, msg->noreply, msg->u.request.type);
+ done = true;
+ }
+
+ gp_local_mon_io->release_msg( msg );
+ }
+ while (!done);
+}
+
+void get_persist_process_attributes( CPersistConfig *persistConfig
+ , int nid
+ , PROCESSTYPE &processType
+ , char *processName
+ , char *outfile
+ , char *persistRetries
+ , char *persistZones )
+{
+ const char method_name[] = "get_persist_process_attributes";
+ char zoneStr[MAX_PERSIST_VALUE_STR];
+
+ processType = persistConfig->GetProcessType();
+
+ switch (persistConfig->GetZoneZidFormat())
+ {
+ case Zid_ALL:
+ for (int i = 0; i < LNodesConfigMax; i++)
+ {
+ if ( i == 0 )
{
- cmd_tail = get_token (cmd_tail, outfile, &delimiter, MAX_PROCESS_PATH-1);
+ sprintf( zoneStr, "%d", i );
+ strcpy( persistZones, zoneStr );
}
- else if (strcmp (token, "pri") == 0)
+ else
{
- cmd_tail = get_token (cmd_tail, token, &delimiter);
- priority = atoi (token);
+ sprintf( zoneStr, ",%d", i );
+ strcat( persistZones, zoneStr );
}
- else if (strcmp (token, "debug") == 0)
- {
- debug = true;
- }
- else if (strcmp (token, "type") == 0)
- {
- cmd_tail = get_token (cmd_tail, token, &delimiter);
- normalize_case (token);
- if (strcmp (token, "dtm") == 0)
- {
- process_type = ProcessType_DTM;
- }
- else if (strcmp (token, "tse") == 0)
- {
- process_type = ProcessType_TSE;
- }
- else if (strcmp (token, "ase") == 0)
- {
- process_type = ProcessType_ASE;
- }
- else if (strcmp (token, "amp") == 0)
- {
- process_type = ProcessType_AMP;
- }
- else if (strcmp (token, "bo") == 0)
- {
- process_type = ProcessType_Backout;
- }
- else if (strcmp (token, "vr") == 0)
- {
- process_type = ProcessType_VolumeRecovery;
- }
- else if (strcmp (token, "cs") == 0)
- {
- process_type = ProcessType_MXOSRVR;
- }
- else if (strcmp (token, "sms") == 0)
- {
- process_type = ProcessType_SMS;
- }
- else if (strcmp (token, "spx") == 0)
- {
- process_type = ProcessType_SPX;
- }
- else if (strcmp (token, "ssmp") == 0)
- {
- process_type = ProcessType_SSMP;
- }
- else
- {
- printf ("[%s] Invalid process type!\n",MyName);
- delimiter = ' ';
- break;
- }
- }
- else
- {
- printf ("[%s] Invalid exec options syntax!\n", MyName);
- delimiter = ' ';
- break;
- }
- }
- if (*cmd_tail == '\0')
- {
- printf ("[%s] Invalid exec syntax!\n", MyName);
- }
- else if (delimiter == '}')
- {
- startup_process = true;
}
+ break;
+ case Zid_RELATIVE:
+ sprintf( zoneStr, "%d", nid );
+ strcpy( persistZones, zoneStr );
+ break;
+ default:
+ printf ("[%s] Invalid persist zone zid format!\n", MyName);
+ break;
}
- // start process
- if (startup_process)
+ if ( nid == -1 )
{
- pid = start_process ( &nid,
- process_type,
- name,
- debug,
- priority,
- nowait,
- infile,
- outfile,
- cmd_tail );
- if (pid > 0)
- {
- if (!nowait && !debug)
- {
- get_server_death (nid, pid);
- LastNid = LastPid = -1;
- }
- if (process_type == ProcessType_DTM)
- {
- DTMexists = true;
- }
- }
- else
+ sprintf( processName, "%s"
+ , persistConfig->GetProcessNamePrefix() );
+ sprintf( outfile, "%s"
+ , persistConfig->GetStdoutPrefix() );
+ }
+ else
+ {
+ sprintf( processName, "%s%d"
+ , persistConfig->GetProcessNamePrefix()
+ , nid );
+ sprintf( outfile, "%s%d"
+ , persistConfig->GetStdoutPrefix()
+ , nid );
+ }
+ sprintf( persistRetries, "%d,%d"
+ , persistConfig->GetPersistRetries()
+ , persistConfig->GetPersistWindow() );
+
+ if ( trace_settings & TRACE_SHELL_CMD )
+ trace_printf( "%s@%d Persist process Nid=%d, "
+ "processName=%s, type=%s, stdout=%s, "
+ "persistRetries=%s, persistZones=%s\n"
+ , method_name, __LINE__
+ , nid, processName
+ , ProcessTypeString(persistConfig->GetProcessType())
+ , outfile
+ , persistRetries
+ , persistZones );
+}
+
+int get_pnid_by_nid( int nid )
+{
+ int pnid;
+
+ CPNodeConfig *pnodeConfig;
+ CLNodeConfig *lnodeConfig;
+
+ lnodeConfig = ClusterConfig.GetLNodeConfig( nid );
+ if ( !lnodeConfig )
+ {
+ return( -1 );
+ }
+ pnodeConfig = lnodeConfig->GetPNodeConfig();
+ if ( !pnodeConfig )
+ {
+ return( -1 );
+ }
+ pnid = pnodeConfig->GetPNid();
+
+ return( pnid );
+}
+
+int get_pnid_by_node_name( char *node_name )
+{
+ CPNodeConfig *pnodeConfig;
+
+ pnodeConfig = ClusterConfig.GetFirstPNodeConfig();
+ for ( ; pnodeConfig; pnodeConfig = pnodeConfig->GetNext() )
+ {
- if ( strcmp( node_name, pnodeConfig->GetName() ) == 0 )
++ if ( CPNodeConfigContainer::hostnamecmp( node_name, pnodeConfig->GetName() ) == 0 )
{
- if ( trace_settings & TRACE_SHELL_CMD )
- trace_printf("%s@%d [%s] Exec failed!\n",
- method_name, __LINE__, MyName);
+ return( pnodeConfig->GetPNid() );
}
}
+
+ return( -1 );
}
-void exit_process (void)
+bool get_node_state( int nid, char *node_name, int &pnid, STATE &state, bool &integrating )
{
- int count;
+ bool rs = false;
+ int count;
MPI_Status status;
- const char method_name[] = "exit_process";
- if ( trace_settings & TRACE_SHELL_CMD )
- trace_printf("%s@%d [%s] sending exit process message.\n",
- method_name, __LINE__, MyName);
+ if ( nid > -1 )
+ {
+ pnid = get_pnid_by_nid( nid );
+ if ( pnid == -1 )
+ {
+ printf( "[%s] Invalid node, nid=%d\n", MyName, nid );
+ return( rs );
+ }
+ }
+ else if ( node_name )
+ {
+ pnid = get_pnid_by_node_name( node_name );
+ if ( pnid == -1 )
+ {
+ printf( "[%s] Invalid node=%s\n", MyName, node_name );
+ return( rs );
+ }
+ }
+ else
+ {
+ printf( "[%s] Internal error - invalid node=%s, nid=%d\n", MyName, node_name, nid );
+ return( rs );
+ }
if ( gp_local_mon_io->acquire_msg( &msg ) != 0 )
{ // Could not acquire a message buffer
@@@ -2414,29 -2545,6 +2414,29 @@@ void cancel_notice( _TM_Txid_External t
gp_local_mon_io->release_msg(msg);
}
+int copy_config_db( char *node_name )
+{
+ // copy sqconfig.db
+ char msgString[MAX_BUFFER] = { 0 };
+ char cmd[256];
+ int error = 0;
+
+ sprintf(cmd, "pdcp -p -w %s %s/sql/scripts/sqconfig.db %s/sql/scripts/.", node_name,
- getenv("MY_SQROOT"), getenv("MY_SQROOT") );
++ getenv("TRAF_HOME"), getenv("TRAF_HOME") );
+
+ error = system(cmd);
+
+ if (error != 0)
+ {
+ sprintf( msgString, "[%s] Unable to copy sqconfig.db to node %s.\n"
+ , MyName, node_name);
+ write_startup_log( msgString );
+ printf( "Unable to copy sqconfig.db to node %s.\n", node_name);
+ return( -1 );
+ }
+
+ return( 0 );
+}
void request_notice( int nid,int pid, _TM_Txid_External trans_id )
{
@@@ -2550,31 -2657,10 +2550,31 @@@ int get_first_nid( char *node_name
pnodeConfig = ClusterConfig.GetFirstPNodeConfig();
for ( ; pnodeConfig; pnodeConfig = pnodeConfig->GetNext() )
{
- if ( strcmp( node_name, pnodeConfig->GetName() ) == 0 )
+ if ( CPNodeConfigContainer::hostnamecmp( node_name, pnodeConfig->GetName() ) == 0 )
{
- return( 0 );
- }
+ lnodeConfig = pnodeConfig->GetFirstLNodeConfig();
+ if ( lnodeConfig )
+ {
+ return( lnodeConfig->GetNid() );
+ }
+ break;
+ }
+ }
+
+ return( -1 );
+}
+
+int get_node_name( char *node_name )
+{
+ CPNodeConfig *pnodeConfig;
+
+ pnodeConfig = ClusterConfig.GetFirstPNodeConfig();
+ for ( ; pnodeConfig; pnodeConfig = pnodeConfig->GetNext() )
+ {
- if ( strcmp( node_name, pnodeConfig->GetName() ) == 0 )
++ if ( CPNodeConfigContainer::hostnamecmp( node_name, pnodeConfig->GetName() ) == 0 )
+ {
+ return( 0 );
+ }
}
return( -1 );
@@@ -3575,2426 -4255,72 +3575,2462 @@@ void node_info( int nid
return;
}
- // send set request to monitor
- msg->type = MsgType_Service;
- msg->noreply = false;
- msg->reply_tag = REPLY_TAG;
- msg->u.request.type = ReqType_Set;
- msg->u.request.u.set.nid = MyNid;
- msg->u.request.u.set.pid = MyPid;
- msg->u.request.u.set.verifier = MyVerifier;
- msg->u.request.u.set.process_name[0] = 0;
- msg->u.request.u.set.type = type;
- STRCPY(msg->u.request.u.set.group,name);
- STRCPY(msg->u.request.u.set.key,token);
- STRCPY(msg->u.request.u.set.value,cmd_tail);
-
- gp_local_mon_io->send_recv( msg );
- count = sizeof( *msg );
- status.MPI_TAG = msg->reply_tag;
-
- if ((status.MPI_TAG == REPLY_TAG) &&
- (count == sizeof (struct message_def)))
+ bool needBanner = true;
+ bool getMoreInfo = false;
+ do
{
- if ((msg->type == MsgType_Service) &&
- (msg->u.reply.type == ReplyType_Generic))
- {
- if (msg->u.reply.u.generic.return_code != MPI_SUCCESS)
- {
- printf ("[%s] Set failed, error=%s\n", MyName,
- ErrorMsg(msg->u.reply.u.generic.return_code));
- }
- }
- else
+ msg->type = MsgType_Service;
+ msg->noreply = false;
+ msg->reply_tag = REPLY_TAG;
+ msg->u.request.type = ReqType_NodeInfo;
+ msg->u.request.u.node_info.nid = MyNid;
+ msg->u.request.u.node_info.pid = MyPid;
+ msg->u.request.u.node_info.target_nid = nid;
+ if ( !getMoreInfo )
{
- printf
- ("[%s] Invalid MsgType(%d)/ReplyType(%d) for Set message\n",
- MyName, msg->type, msg->u.reply.type);
+ msg->u.request.u.node_info.continuation = false;
}
- }
- else
- {
- printf ("[%s] Set reply message invalid\n", MyName);
- }
-
- gp_local_mon_io->release_msg(msg);
-}
+
+ gp_local_mon_io->send_recv( msg );
+ count = sizeof( *msg );
+ status.MPI_TAG = msg->reply_tag;
-void show_cmd (char *cmd, char delimiter)
-{
- int i;
- int count;
- int nid = MonitorNid;
- int num_returned = 0;
- bool next=false;
+ getMoreInfo = false;
+ if ((status.MPI_TAG == REPLY_TAG) &&
+ (count == sizeof (struct message_def)))
+ {
+ if ((msg->type == MsgType_Service) &&
+ (msg->u.reply.type == ReplyType_NodeInfo))
+ {
+ if (msg->u.reply.u.node_info.return_code == MPI_SUCCESS)
+ {
+ if (msg->u.reply.u.node_info.num_returned)
+ {
+ if (needBanner)
+ {
+ printf ("[%s] Logical Nodes = %d\n",MyName,msg->u.reply.u.node_info.num_nodes);
+ printf ("[%s] Physical Nodes = %d\n",MyName,msg->u.reply.u.node_info.num_pnodes);
+ printf ("[%s] Spare Nodes = %d\n",MyName,msg->u.reply.u.node_info.num_spares);
+ printf ("[%s] Available Spares = %d\n",MyName,msg->u.reply.u.node_info.num_available_spares);
+ printf ("[%s] NID Type State Processors #Procs\n", MyName);
+ printf ("[%s] PNID State #Cores MemFree SwapFree CacheFree Name\n", MyName);
+ printf ("[%s] --- ----------- -------- ---------- -------- -------- --------- --------\n", MyName);
+ needBanner = false;
+ }
+
+ for (i=0; i < msg->u.reply.u.node_info.num_returned; i++)
+ {
+ if ( last_nid != -1 )
+ {
+ if ( (msg->u.reply.u.node_info.node[i].pnid !=
+ msg->u.reply.u.node_info.node[i+1].pnid) ||
+ i == (msg->u.reply.u.node_info.num_returned - 1) )
+ {
+ display_pnode = true;
+ }
+ }
+ else
+ {
+ display_pnode = true;
+ }
+ if ( msg->u.reply.u.node_info.node[i].nid != -1 )
+ {
+ // Display logical node info
+ last_nid = msg->u.reply.u.node_info.node[i].nid;
+ switch( msg->u.reply.u.node_info.node[i].state )
+ {
+ case State_Up:
+ NodeState[i]=true;
+ break;
+ case State_Down:
+ NodeState[i]=false;
+ break;
+ default:
+ NodeState[i]=false;
+ }
+ if ( msg->u.reply.u.node_info.node[i].state == State_Down )
+ {
+ // "[%s] NID Type State \n"
+ // "[%s] --- ----------- -------- ---------- -------- -------- --------- --------\n"
+ printf ("[%s] %3.3d %-11s %-8s\n",
+ MyName,
+ msg->u.reply.u.node_info.node[i].nid,
+ ZoneTypeString( msg->u.reply.u.node_info.node[i].type ),
+ StateString( msg->u.reply.u.node_info.node[i].state ) );
+ }
+ else
+ {
+ // "[%s] NID Type State Processors #Procs\n");
+ // "[%s] --- ----------- -------- ---------- -------- -------- --------- --------\n"
+ printf ("[%s] %3.3d %-11s %-8s %8d %8d\n",
+ MyName,
+ msg->u.reply.u.node_info.node[i].nid,
+ ZoneTypeString( msg->u.reply.u.node_info.node[i].type ),
+ StateString( msg->u.reply.u.node_info.node[i].state ),
+ msg->u.reply.u.node_info.node[i].processors,
+ msg->u.reply.u.node_info.node[i].process_count );
+ }
+ }
+ if ( display_pnode )
+ {
+ // Display physical node info
+ display_pnode = false;
+ StateString( msg->u.reply.u.node_info.node[i].pstate );
+ if ( msg->u.reply.u.node_info.node[i].pstate == State_Down )
+ {
+ // "[%s] PNID State \n"
+ // "[%s] --- ----------- -------- ---------- -------- -------- --------- --------\n"
+ printf ("[%s] %3.3d %-8s %s\n",
+ MyName,
+ msg->u.reply.u.node_info.node[i].pnid,
+ StateString( msg->u.reply.u.node_info.node[i].pstate ),
+ msg->u.reply.u.node_info.node[i].node_name );
+ }
+ else
+ {
+ // "[%s] PNID State #Cores MemFree SwapFree CacheFree Name \n"
+ // "[%s] --- ----------- -------- ---------- -------- -------- --------- --------\n"
+ printf ("[%s] %3.3d %-8s %2d %8d %8d %8d %s\n",
+ MyName,
+ msg->u.reply.u.node_info.node[i].pnid,
+ msg->u.reply.u.node_info.node[i].spare_node?"Spare":StateString( msg->u.reply.u.node_info.node[i].pstate ),
+ msg->u.reply.u.node_info.node[i].cores,
+ msg->u.reply.u.node_info.node[i].memory_free,
+ msg->u.reply.u.node_info.node[i].swap_free,
+ msg->u.reply.u.node_info.node[i].cache_free,
+ msg->u.reply.u.node_info.node[i].node_name );
+ }
+ }
+ }
+ getMoreInfo = (msg->u.reply.u.node_info.num_returned == MAX_NODE_LIST);
+ if (getMoreInfo)
+ { // Since we got the maximum number of node info
+ // entries there may be additional node info
+ // entries to retrieve. Populate the request.
+ msg->u.request.u.node_info.last_nid =
+ msg->u.reply.u.node_info.last_nid;
+ msg->u.request.u.node_info.last_pnid =
+ msg->u.reply.u.node_info.last_pnid;
+ msg->u.request.u.node_info.continuation = true;
+ }
+ }
+ }
+ else
+ {
+ printf ("[%s] NodeInfo failed, error=%s\n", MyName,
+ ErrorMsg(msg->u.reply.u.node_info.return_code));
+ }
+ }
+ else
+ {
+ printf
+ ("[%s] Invalid MsgType(%d)/ReplyType(%d) for NodeInfo message\n",
+ MyName, msg->type, msg->u.reply.type);
+ }
+ }
+ else
+ {
+ printf ("[%s] NodeInfo reply message invalid\n", MyName);
+ }
+ }
+ while (getMoreInfo);
+
+ gp_local_mon_io->release_msg(msg);
+}
+
+int node_up( int nid, char *node_name, bool nowait )
+{
+ const char method_name[] = "node_up";
+ bool integrating = false;
+ int pnid;
+ int rc = -1;
+ char msgString[MAX_BUFFER] = { 0 };
+
+ // If this is a real cluster
+ if ( nid == -1 )
+ {
+ // Get current physical state of all nodes
+ if ( !update_cluster_state( true, false ) )
+ {
+ return( rc ) ;
+ }
+ NodeState_t nodeState;
+ // Check physical state of the target node
+ if ( get_pnode_state( node_name, nodeState ) )
+ {
+ if ( nodeState != StateUp )
+ {
+ sprintf( msgString, "[%s] Node %s is not available.", MyName, node_name);
+ write_startup_log( msgString );
+ printf("[%s] Node %s is not available.\n", MyName, node_name);
+ return( rc ) ;
+ }
+ }
+ STATE state;
+ // Check monitors state of the target node
+ if ( !get_node_state( nid, node_name, pnid, state, integrating ) )
+ {
+ return( rc ) ;
+ }
+ if ( integrating )
+ {
+ sprintf( msgString, "[%s] Node up in progress! Try again when node re-integration completes.", MyName);
+ write_startup_log( msgString );
+ printf ("[%s] Node up in progress! Try again when node re-integration completes.\n", MyName );
+ return( rc ) ;
+ }
+ if ( state != State_Down )
+ {
+ sprintf( msgString, "[%s] Node %s is not in down state! (state=%s)", MyName, node_name, StateString(state) );
+ write_startup_log( msgString );
+ printf ("[%s] Node %s is not in down state! (state=%s)\n", MyName, node_name, StateString(state) );
+ return( rc ) ;
+ }
+
+ if ( SpareNodeColdStandby )
+ {
+ // Check monitors state of all logical nodes of the spare set.
+ // There must be at least one logical node down that is associated.
+ // with the spare set or the command is rejected (cold standby).
+ // Otherwise, the spare node comes up and it becomes a hot standby
+ // which is not currenly supported.
+ STATE spare_set_state = State_Up;
+ if ( !get_spare_set_state( node_name, spare_set_state ) )
+ {
+ return( rc ) ;
+ }
+ if ( spare_set_state != State_Down )
+ {
+ sprintf( msgString, "[%s] No nodes in the down state for spare node activation on %s!", MyName, node_name );
+ write_startup_log( msgString );
+ printf ("[%s] No nodes in the down state for spare node activation on %s!\n", MyName, node_name );
+ return( rc ) ;
+ }
+ }
+
+ // remove shared segment on the node
+ char cmd[256];
- sprintf(cmd, "pdsh -w %s \"sqipcrm %s >> $MY_SQROOT/logs/node_up_%s.log\"", node_name, node_name, node_name);
++ sprintf(cmd, "pdsh -w %s \"sqipcrm %s >> $TRAF_HOME/logs/node_up_%s.log\"", node_name, node_name, node_name);
+ system(cmd);
+
+ // Start a monitor process on the node
+ if ( start_monitor( node_name, false, true ) )
+ {
+ sprintf( msgString, "[%s] Unable to start monitor process in node %s.", MyName, node_name );
+ write_startup_log( msgString );
+ printf ("[%s] Unable to start monitor process in node %s.\n", MyName, node_name );
+ return( rc ) ;
+ }
+ }
+ else
+ {
+ STATE state;
+ if ( !get_node_state( nid, NULL, pnid, state, integrating ) )
+ {
+ return( rc ) ;
+ }
+ if ( state != State_Down )
+ {
+ sprintf( msgString, "[%s] Node is not in down state! (nid=%d, state=%s)", MyName, nid, StateString(state) );
+ write_startup_log( msgString );
+ printf ("[%s] Node is not in down state! (nid=%d, state=%s)\n", MyName, nid, StateString(state) );
+ return( rc ) ;
+ }
+ }
+ if ( trace_settings & TRACE_SHELL_CMD )
+ trace_printf ("%s@%d [%s] sending up node message.\n",
+ method_name, __LINE__, MyName);
+
+ assert(gp_local_mon_io);
+ if ( gp_local_mon_io->acquire_msg( &msg ) != 0 )
+ { // Could not acquire a message buffer
+ sprintf( msgString, "[%s] Unable to acquire message buffer.", MyName);
+ write_startup_log( msgString );
+ printf ("[%s] Unable to acquire message buffer.\n", MyName);
+ return( rc ) ;
+ }
+
+ msg->type = MsgType_Service;
+ msg->u.request.type = ReqType_NodeUp;
+ msg->u.request.u.up.nid = nid;
+
+ // If this is a real cluster
+ if ( nid == -1 )
+ {
+ if ( trace_settings & TRACE_SHELL_CMD )
+ trace_printf( "%s@%d [%s] %s node up successful, rtn=%d\n ",
+ method_name, __LINE__, MyName, node_name,
+ msg->u.reply.u.generic.return_code );
+
+ sprintf( msgString, "[%s] Node %s is merging to existing cluster.",
+ MyName, node_name);
+ write_startup_log( msgString );
+ printf ("[%s] %s - Node %s is merging to existing cluster.\n",
+ MyName, time_string(), node_name );
+
+ if ( ! nowait )
+ {
+ struct sigaction int_act, old_act;
+ int_act.sa_sigaction = interrupt_handler;
+ sigemptyset(&int_act.sa_mask);
+ sigaddset (&int_act.sa_mask, SIGINT);
+ int_act.sa_flags = SA_SIGINFO;
+ sigaction (SIGINT, &int_act, &old_act);
+
+ nodePending = true;
+ nodePendingPnid = pnid;
+ STRCPY(nodePendingName, node_name);
+
+ nodePendingLock.lock();
+ nodePendingLock.wait();
+ nodePendingLock.unlock();
+
+ sigaction (SIGINT, &old_act, NULL);
+
+ nodePending = false;
+ }
+ rc = MPI_SUCCESS;
+ }
+ else
+ {
+ msg->noreply = true;
+ STRCPY( msg->u.request.u.up.node_name, Node[nid] );
+ gp_local_mon_io->send( msg );
+ rc = 0;
+ }
+
+ gp_local_mon_io->release_msg( msg );
+
+ if ( nid != -1 && get_pnid( nid ) == MyPNid )
+ {
+ // this process is no longer valid in the monitor and needs to be restarted.
+ sleep(1);
+ exit(0);
+ }
+
+ return( rc ) ;
+}
+
+void persist_config( char *prefix )
+{
+ bool foundConfig = false;
+ char persist_config_buf[MAX_VALUE_SIZE_INT];
+ char process_name_str[MAX_TOKEN];
+ char process_type_str[MAX_TOKEN];
+ char program_name_str[MAX_TOKEN];
+ char requires_dtm_str[MAX_TOKEN];
+ char stdout_str[MAX_TOKEN];
+ char persist_retries_str[MAX_TOKEN];
+ char persist_zones_str[MAX_TOKEN];
+ CPersistConfig *persistConfig;
+
+ persistConfig = ClusterConfig.GetFirstPersistConfig();
+ if (persistConfig)
+ {
+ for ( ; persistConfig; persistConfig = persistConfig->GetNext() )
+ {
+ if (*prefix == '\0' ||
+ strcasecmp( prefix, persistConfig->GetPersistPrefix()) == 0)
+ {
+ foundConfig = true;
+ snprintf( process_name_str, sizeof(process_name_str)
+ , "%s_%s=%s%s"
+ , persistConfig->GetPersistPrefix()
+ , PERSIST_PROCESS_NAME_KEY
+ , persistConfig->GetProcessNamePrefix()
+ , persistConfig->GetProcessNameFormat()
+ );
+ snprintf( process_type_str, sizeof(process_type_str)
+ , "%s_%s=%s"
+ , persistConfig->GetPersistPrefix()
+ , PERSIST_PROCESS_TYPE_KEY
+ , PersistProcessTypeString(persistConfig->GetProcessType())
+ );
+ snprintf( program_name_str, sizeof(program_name_str)
+ , "%s_%s=%s"
+ , persistConfig->GetPersistPrefix()
+ , PERSIST_PROGRAM_NAME_KEY
+ , persistConfig->GetProgramName()
+ );
+ snprintf( requires_dtm_str, sizeof(requires_dtm_str)
+ , "%s_%s=%s"
+ , persistConfig->GetPersistPrefix()
+ , PERSIST_REQUIRES_DTM
+ , persistConfig->GetRequiresDTM()?"Y":"N"
+ );
+ snprintf( stdout_str, sizeof(stdout_str)
+ , "%s_%s=%s%s"
+ , persistConfig->GetPersistPrefix()
+ , PERSIST_STDOUT_KEY
+ , persistConfig->GetStdoutPrefix()
+ , persistConfig->GetStdoutFormat()
+ );
+ snprintf( persist_retries_str, sizeof(persist_retries_str)
+ , "%s_%s=%d,%d"
+ , persistConfig->GetPersistPrefix()
+ , PERSIST_RETRIES_KEY
+ , persistConfig->GetPersistRetries()
+ , persistConfig->GetPersistWindow()
+ );
+ snprintf( persist_zones_str, sizeof(persist_zones_str)
+ , "%s_%s=%s"
+ , persistConfig->GetPersistPrefix()
+ , PERSIST_ZONES_KEY
+ , persistConfig->GetZoneFormat()
+ );
+ snprintf( persist_config_buf, sizeof(persist_config_buf)
+ , "%s\n%s\n%s\n%s\n%s\n%s\n%s\n"
+ , process_name_str
+ , process_type_str
+ , program_name_str
+ , requires_dtm_str
+ , stdout_str
+ , persist_retries_str
+ , persist_zones_str
+ );
+ if (strcasecmp( prefix, persistConfig->GetPersistPrefix()) == 0)
+ {
+ printf ("%s", persist_config_buf);
+ break;
+ }
+ if (persistConfig->GetNext())
+ {
+ printf ("%s\n", persist_config_buf);
+ }
+ else
+ {
+ printf ("%s", persist_config_buf);
+ }
+ }
+ }
+ }
+ if (!foundConfig)
+ {
+ printf ("[%s] Persistent process configuration does not exist\n", MyName);
+ }
+}
+
+void persist_config_keys( void )
+{
+ char persist_config_str[MAX_TOKEN];
+ CPersistConfig *persistConfig;
+
+ persistConfig = ClusterConfig.GetFirstPersistConfig();
+ if (persistConfig)
+ {
+ snprintf( persist_config_str, sizeof(persist_config_str)
+ , "%s=", PERSIST_PROCESS_KEYS );
+ for ( ; persistConfig; persistConfig = persistConfig->GetNext() )
+ {
+ strcat( persist_config_str, persistConfig->GetPersistPrefix() );
+ if ( persistConfig->GetNext() )
+ {
+ strcat( persist_config_str, "," );
+ }
+ }
+ printf ("%s\n", persist_config_str);
+ }
+ else
+ {
+ printf ("[%s] Configuration keys for persistent process do not exist\n", MyName);
+ }
+}
+
+void persist_info( char *prefix )
+{
+ bool foundConfig = false;
+ bool usePattern = false;
+ char process_name_str[MAX_TOKEN];
+ CPersistConfig *persistConfig;
+
+ persistConfig = ClusterConfig.GetFirstPersistConfig();
+ if (persistConfig)
+ {
+ for ( ; persistConfig; persistConfig = persistConfig->GetNext() )
+ {
+ if (*prefix == '\0' ||
+ strcasecmp( prefix, persistConfig->GetPersistPrefix()) == 0)
+ {
+ if (strlen(persistConfig->GetProcessNameFormat()) != 0)
+ {
+ // Build pattern string
+ usePattern = true;
+ snprintf( process_name_str, sizeof(process_name_str)
+ , "\%s[0-9]+"
+ , persistConfig->GetProcessNamePrefix()
+ );
+ }
+ else
+ {
+ usePattern = false;
+ snprintf( process_name_str, sizeof(process_name_str)
+ , "\%s"
+ , persistConfig->GetProcessNamePrefix()
+ );
+ }
+ //printf ("[%s] Persist process info for: %s\n", MyName, prefix);
+ get_proc_info( -1
+ , -1
+ , process_name_str
+ , ProcessType_Undefined
+ , usePattern
+ , foundConfig ? false : true
+ );
+ foundConfig = true;
+ if (strcasecmp( prefix, persistConfig->GetPersistPrefix()) == 0)
+ {
+ break;
+ }
+ }
+ }
+ }
+ if (!foundConfig)
+ {
+ printf ("[%s] Persistent process configuration does not exist\n", MyName);
+ }
+}
+
+bool persist_process_kill( CPersistConfig *persistConfig )
+{
+ const char method_name[] = "persist_process_kill";
+ bool integrating = false;
+ bool rs = false;
+ char processName[MAX_PROCESS_NAME];
+ char outfile[MAX_PROCESS_PATH];
+ char persistRetries[MAX_PERSIST_VALUE_STR];
+ char persistZones[MAX_VALUE_SIZE_INT];
+ int nid;
+ int pnid;
+ int lnodesCount = 0;
+ PROCESSTYPE process_type;
+ STATE nodeState;
+
+ nid = -1;
+ processName[0] = '\0'; // The monitor will assign name if null
+ outfile[0] = '\0'; // The monitor's default outfile is used
+ process_type = ProcessType_Undefined;
+
+ if ( trace_settings & TRACE_SHELL_CMD )
+ trace_printf( "%s@%d Persist process prefix=%s, name format=%s\n "
+ , method_name, __LINE__
+ , persistConfig->GetPersistPrefix()
+ , FormatNidString(persistConfig->GetProcessNameNidFormat()) );
+
+ switch (persistConfig->GetProcessNameNidFormat())
+ {
+ case Nid_ALL:
+ for (int i = 0; i < LNodesConfigMax && lnodesCount < NumLNodes; i++)
+ {
+ // Check monitors state of the target node
+ rs = get_node_state( i, NULL, pnid, nodeState, integrating );
+ if ( rs == false || nodeState != State_Up || integrating )
+ {
+ continue;
+ }
+ get_persist_process_attributes( persistConfig
+ , i
+ , process_type
+ , processName
+ , outfile
+ , persistRetries
+ , persistZones );
+ if ( !find_process( processName ) )
+ {
+ printf( "Persistent process %s does not exist\n", processName);
+ continue;
+ }
+ lnodesCount++;
+ kill_process( -1, -1, processName, true );
+ }
+ break;
+
+ case Nid_RELATIVE:
+ nid = 0;
+ get_persist_process_attributes( persistConfig
+ , nid
+ , process_type
+ , processName
+ , outfile
+ , persistRetries
+ , persistZones );
+ if ( !find_process( processName ) )
+ {
+ printf( "Persistent process %s does not exist\n", processName);
+ break;
+ }
+ kill_process( -1, -1, processName, true );
+ break;
+ case Nid_Undefined:
+ nid = 0;
+ get_persist_process_attributes( persistConfig
+ , -1
+ , process_type
+ , processName
+ , outfile
+ , persistRetries
+ , persistZones );
+ if ( !find_process( processName ) )
+ {
+ printf( "Persistent process %s does not exist\n", processName);
+ break;
+ }
+ kill_process( -1, -1, processName, true );
+ break;
+ default:
+ return(false);
+ }
+ return(true);
+}
+
+bool persist_process_start( CPersistConfig *persistConfig )
+{
+ const char method_name[] = "persist_process_start";
+ bool integrating = false;
+ bool rs = false;
+ bool debug = false;
+ bool nowait = false;
+ char processName[MAX_PROCESS_NAME];
+ char infile[MAX_PROCESS_PATH];
+ char outfile[MAX_PROCESS_PATH];
+ char persistRetries[MAX_PERSIST_VALUE_STR];
+ char persistZones[MAX_VALUE_SIZE_INT];
+ int nid;
+ int pid;
+ int pnid;
+ int lnodesCount = 0;
+ PROCESSTYPE process_type;
+ int priority;
+ STATE nodeState;
+
+ nid = -1;
+ priority = 0;
+ processName[0] = '\0'; // The monitor will assign name if null
+ infile[0] = '\0'; // The monitor's default infile is used
+ outfile[0] = '\0'; // The monitor's default outfile is used
+ process_type = ProcessType_Undefined;
+
+ if ( trace_settings & TRACE_SHELL_CMD )
+ trace_printf( "%s@%d Persist process prefix=%s, name format=%s\n "
+ , method_name, __LINE__
+ , persistConfig->GetPersistPrefix()
+ , FormatNidString(persistConfig->GetProcessNameNidFormat()) );
+
+ switch (persistConfig->GetProcessNameNidFormat())
+ {
+ case Nid_ALL:
+ for (int i = 0; i < LNodesConfigMax && lnodesCount < NumLNodes; i++)
+ {
+ // Check monitors state of the target node
+ rs = get_node_state( i, NULL, pnid, nodeState, integrating );
+ if ( rs == false || nodeState != State_Up || integrating )
+ {
+ continue;
+ }
+ lnodesCount++;
+ get_persist_process_attributes( persistConfig
+ , i
+ , process_type
+ , processName
+ , outfile
+ , persistRetries
+ , persistZones );
+ if ( find_process( processName ) )
+ {
+ printf( "Persistent process %s already exists\n", processName);
+ continue;
+ }
+ pid = start_process( &i
+ , process_type
+ , processName
+ , debug
+ , priority
+ , nowait
+ , infile
+ , outfile
+ , (char *)persistConfig->GetProgramName() );
+ if (pid > 0)
+ {
+ printf( "Persistent process %s created\n", processName);
+ if (process_type == ProcessType_DTM)
+ {
+ DTMexists = true;
+ }
+ }
+ else
+ {
+ if ( trace_settings & TRACE_SHELL_CMD )
+ trace_printf("%s@%d [%s] persistexec failed!\n",
+ method_name, __LINE__, MyName);
+ }
+ }
+ break;
+
+ case Nid_RELATIVE:
+ nid = 0;
+ get_persist_process_attributes( persistConfig
+ , nid
+ , process_type
+ , processName
+ , outfile
+ , persistRetries
+ , persistZones );
+ if ( find_process( processName ) )
+ {
+ printf( "Persistent process %s already exists\n", processName);
+ break;
+ }
+ pid = start_process( &nid
+ , process_type
+ , processName
+ , debug
+ , priority
+ , nowait
+ , infile
+ , outfile
+ , (char *)persistConfig->GetProgramName() );
+ if (pid > 0)
+ {
+ printf( "Persistent process %s created\n", processName);
+ if (process_type == ProcessType_DTM)
+ {
+ DTMexists = true;
+ }
+ }
+ else
+ {
+ if ( trace_settings & TRACE_SHELL_CMD )
+ trace_printf("%s@%d [%s] persistexec failed!\n",
+ method_name, __LINE__, MyName);
+ }
+ break;
+ case Nid_Undefined:
+ nid = 0;
+ get_persist_process_attributes( persistConfig
+ , -1
+ , process_type
+ , processName
+ , outfile
+ , persistRetries
+ , persistZones );
+ if ( find_process( processName ) )
+ {
+ printf( "Persistent process %s already exists\n", processName);
+ break;
+ }
+ pid = start_process( &nid
+ , process_type
+ , processName
+ , debug
+ , priority
+ , nowait
+ , infile
+ , outfile
+ , (char *)persistConfig->GetProgramName() );
+ if (pid > 0)
+ {
+ printf( "Persistent process %s created\n", processName);
+ if (process_type == ProcessType_DTM)
+ {
+ DTMexists = true;
+ }
+ }
+ else
+ {
+ if ( trace_settings & TRACE_SHELL_CMD )
+ trace_printf("%s@%d [%s] persistexec failed!\n",
+ method_name, __LINE__, MyName);
+ }
+ break;
+ default:
+ return(false);
+ }
+ return(true);
+}
+
+void process_startup (int nid,char *port)
+{
+ struct message_def *saved_msg = msg;
+ const char method_name[] = "process_startup";
+
+ port = port; //warning
+ if ( trace_settings & TRACE_SHELL_CMD )
+ trace_printf ("%s@%d [%s] process_startup, nid: %d, MyNid: %d, lio: "
+ "%p\n", method_name, __LINE__, MyName, nid, MyNid,
+ (void *)gp_local_mon_io );
+
+ gp_local_mon_io->iv_pid = MyPid;
+ gp_local_mon_io->init_comm();
+
+ if ( trace_settings & TRACE_SHELL_CMD )
+ trace_printf ("%s@%d [%s] processing startup.\n", method_name,
+ __LINE__, MyName);
+
+
+ if ( gp_local_mon_io->acquire_msg( &msg ) != 0 )
+ { // Could not acquire a message buffer
+ printf ("[%s] Unable to acquire message buffer.\n", MyName);
+ return;
+ }
+
+ msg->type = MsgType_Service;
+ msg->noreply = true;
+ msg->u.request.type = ReqType_Startup;
+ msg->u.request.u.startup.nid = MyNid;
+ msg->u.request.u.startup.pid = MyPid;
+ msg->u.request.u.startup.verifier = MyVerifier;
+ msg->u.request.u.startup.paired = false;
+ STRCPY (msg->u.request.u.startup.process_name, MyName);
+ STRCPY (msg->u.request.u.startup.port_name, MyPort);
+ msg->u.request.u.startup.os_pid = getpid ();
+ msg->u.request.u.startup.event_messages = true;
+ msg->u.request.u.startup.system_messages = true;
+ msg->u.request.u.startup.startup_size = sizeof(msg->u.request.u.startup);
+ if ( trace_settings & TRACE_SHELL_CMD )
+ trace_printf ("%s@%d [%s] sending startup reply to monitor.\n",
+ method_name, __LINE__, MyName);
+ gp_local_mon_io->send( msg );
+
+ if ( trace_settings & TRACE_SHELL_CMD )
+ trace_printf ("%s@%d [%s] Startup completed\n", method_name,
+ __LINE__, MyName);
+ msg = saved_msg;
+}
+
+// Keep string location in sync with PROCESSTYPE typedef in msgdef.h
+const char * processTypeStr [] = {"???", "TSE", "DTM", "ASE", "GEN", "WDG", "AMP", "BO", "VR", "CS", "SPX", "SSMP", "PSD", "SMS", "TMID", "PERS"};
+
+void show_proc_info( void )
+{
+ int i;
+ int j;
+ char filename[MAX_PROCESS_PATH];
+
+ for (i = 0; i < msg->u.reply.u.process_info.num_processes; i++)
+ {
+ // find just the filename in the program path
+ filename[0] ='\0';
+ for (j = strlen (msg->u.reply.u.process_info.process[i].program); j >= 0; j--)
+ {
+ if (msg->u.reply.u.process_info.process[i].program[j] == '/')
+ {
+ msg->u.reply.u.process_info.process[i].program[j] = '\0';
+ strcpy (filename, &msg->u.reply.u.process_info.process[i].program[j + 1]);
+ break;
+ }
+ else if ( j == 0 )
+ {
+ strcpy (filename, msg->u.reply.u.process_info.process[i].program );
+ }
+ }
+ printf("[%s] %3.3d,%8.8d ",
+ MyName,
+ msg->u.reply.u.process_info.process[i].nid,
+ msg->u.reply.u.process_info.process[i].pid
+ );
+ if (msg->u.reply.u.process_info.process[i].type >= ProcessType_Invalid)
+ {
+ msg->u.reply.u.process_info.process[i].type
+ = ProcessType_Undefined;
+ }
+ printf("%3.3d %-4s %c%c%c%c%c%c%c %-11s %-11s %-15s\n",
+ msg->u.reply.u.process_info.process[i].priority,
+ processTypeStr[msg->u.reply.u.process_info.process[i].type],
+ (msg->u.reply.u.process_info.process[i].event_messages?'E':'-'),
+ (msg->u.reply.u.process_info.process[i].system_messages?'S':'-'),
+ (msg->u.reply.u.process_info.process[i].pending_replication?'R':'-'),
+ (msg->u.reply.u.process_info.process[i].pending_delete?'D':'-'),
+ (msg->u.reply.u.process_info.process[i].state==State_Up?'A':'U'),
+ (msg->u.reply.u.process_info.process[i].opened?'O':'-'),
+ (msg->u.reply.u.process_info.process[i].paired?'P':
+ (msg->u.reply.u.process_info.process[i].backup?'B':'-')
+ ),
+ msg->u.reply.u.process_info.process[i].process_name,
+ (msg->u.reply.u.process_info.process[i].parent_nid==-1?
+ "NONE":msg->u.reply.u.process_info.process[i].parent_name
+ ),
+ filename
+ );
+ }
+}
+
+//==========================
+//==========================
+//=================================================================
+
+char *remove_white_space (char *cmd)
+{
+ char *ptr = cmd;
+
+ while (ptr && *ptr && (*ptr == ' ' || *ptr == '\t' || *ptr == ','))
+ {
+ ptr++;
+ }
+
+ return ptr;
+}
+
+void remove_trailing_white_space (char *buf)
+{
+ int i = strlen(buf);
+ while (i >= 1 && buf[i-1] == ' ')
+ {
+ --i;
+ }
+ buf[i] = '\0';
+}
+
+void send_set_req( ConfigType type, char *name, char *key, char *value )
+{
+ int count;
+ MPI_Status status;
+
+ if ( gp_local_mon_io->acquire_msg( &msg ) != 0 )
+ { // Could not acquire a message buffer
+ printf ("[%s] Unable to acquire message buffer.\n", MyName);
+ return;
+ }
+
+ // send set request to monitor
+ msg->type = MsgType_Service;
+ msg->noreply = false;
+ msg->reply_tag = REPLY_TAG;
+ msg->u.request.type = ReqType_Set;
+ msg->u.request.u.set.nid = MyNid;
+ msg->u.request.u.set.pid = MyPid;
+ msg->u.request.u.set.verifier = MyVerifier;
+ msg->u.request.u.set.process_name[0] = 0;
+ msg->u.request.u.set.type = type;
+ STRCPY(msg->u.request.u.set.group,name);
+ STRCPY(msg->u.request.u.set.key,key);
+ STRCPY(msg->u.request.u.set.value,value);
+
+ gp_local_mon_io->send_recv( msg );
+ count = sizeof( *msg );
+ status.MPI_TAG = msg->reply_tag;
+
+ if ((status.MPI_TAG == REPLY_TAG) &&
+ (count == sizeof (struct message_def)))
+ {
+ if ((msg->type == MsgType_Service) &&
+ (msg->u.reply.type == ReplyType_Generic))
+ {
+ if (msg->u.reply.u.generic.return_code != MPI_SUCCESS)
+ {
+ printf ("[%s] Set failed, error=%s\n", MyName,
+ ErrorMsg(msg->u.reply.u.generic.return_code));
+ }
+ }
+ else
+ {
+ printf( "[%s] Invalid MsgType(%d)/ReplyType(%d) for Set message\n"
+ , MyName, msg->type, msg->u.reply.type);
+ }
+ }
+ else
+ {
+ printf ("[%s] Set reply message invalid\n", MyName);
+ }
+
+ gp_local_mon_io->release_msg(msg);
+}
+
+void shutdown (ShutdownLevel level)
+{
+ int count;
+ MPI_Status status;
+ const char method_name[] = "shutdown";
+
+ if (find_DTM())
+ {
+ DTMexists = true;
+ }
+ else
+ {
+ DTMexists = false;
+ }
+
+ if ( trace_settings & TRACE_SHELL_CMD )
+ trace_printf ("%s@%d [%s] sending shutdown message.\n", method_name,
+ __LINE__, MyName);
+
+ if ( gp_local_mon_io->acquire_msg( &msg ) != 0 )
+ { // Could not acquire a message buffer
+ printf ("[%s] Unable to acquire message buffer.\n", MyName);
+ return;
+ }
+
+ msg->type = MsgType_Service;
+ msg->noreply = false;
+ msg->reply_tag = REPLY_TAG;
+ msg->u.request.type = ReqType_Shutdown;
+ msg->u.request.u.shutdown.nid = MyNid;
+ msg->u.request.u.shutdown.pid = MyPid;
+ msg->u.request.u.shutdown.level = level;
+
+ gp_local_mon_io->send_recv( msg );
+ count = sizeof( *msg );
+ status.MPI_TAG = msg->reply_tag;
+
+ if ((status.MPI_TAG == REPLY_TAG) &&
+ (count == sizeof (struct message_def)))
+ {
+ if ((msg->type == MsgType_Service) &&
+ (msg->u.reply.type == ReplyType_Generic))
+ {
+ if (msg->u.reply.u.generic.return_code == MPI_SUCCESS)
+ {
+ struct message_def *saved_msg = msg;
+ exit_process();
+ msg = saved_msg;
+ Started = false;
+ if (gp_local_mon_io)
+ {
+ delete gp_local_mon_io;
+ gp_local_mon_io = NULL;
+ }
+ ShutdownClean = true;
+ if ( trace_settings & TRACE_SHELL_CMD )
+ trace_printf ("%s@%d [%s] Shutdown successful.\n",
+ method_name, __LINE__, MyName);
+ }
+ else
+ {
+ printf ("[%s] Shutdown failed, error=%s\n", MyName,
+ ErrorMsg(msg->u.reply.u.generic.return_code));
+ }
+ }
+ else
+ {
+ printf
+ ("[%s] Invalid MsgType(%d)/ReplyType(%d) for Shutdown message\n",
+ MyName, msg->type, msg->u.reply.type);
+ }
+ }
+ else
+ {
+ printf ("[%s] Shutdown reply invalid.\n", MyName);
+ }
+ if (gp_local_mon_io)
+ gp_local_mon_io->release_msg(msg);
+}
+
+int start_process (int *nid, PROCESSTYPE type, char *name, bool debug, int priority,
+ bool , char *infile, char *outfile, char *cmd_tail)
+{
+ int count;
+ char delimiter;
+ char token[MAX_TOKEN];
+ char program[MAX_PROCESS_PATH];
+ char path[MAX_SEARCH_PATH];
+ char ldpath[MAX_SEARCH_PATH];
+ MPI_Status status;
+ const char method_name[] = "start_process";
+
+ LastNid = LastPid = -1;
+ if (debug && *nid != 0)
+ {
+ if (*nid == -1)
+ {
+ *nid = 0;
+ }
+ else
+ {
+ printf ("[%s] Debug mode supported only for nid=0\n", MyName);
+ return LastPid;
+ }
+ }
+
+
+ if ( gp_local_mon_io->acquire_msg( &msg ) != 0 )
+ { // Could not acquire a message buffer
+ printf ("[%s] Unable to acquire message buffer.\n", MyName);
+ return LastPid;
+ }
+
+ cmd_tail = get_token (cmd_tail, token, &delimiter);
+ strcpy (program, Wdir);
+ cd_cmd (token, program);
+
+ count = 0;
+ while (*cmd_tail && count < MAX_ARGS)
+ {
+ cmd_tail = get_token (cmd_tail, token, &delimiter, MAX_TOKEN,
+ false /* equal is not a delim */);
+ strncpy (msg->u.request.u.new_process.argv[count], token,
+ MAX_ARG_SIZE - 1);
+ msg->u.request.u.new_process.argv[count][MAX_ARG_SIZE - 1] = '\0';
+ count++;
+ }
+ msg->u.request.u.new_process.argc = count;
+ if ( trace_settings & TRACE_SHELL_CMD )
+ trace_printf( "%s@%d [%s] starting process %s.\n"
+ , method_name, __LINE__, MyName, name );
+ if ( trace_settings & TRACE_SHELL_CMD )
+ {
+ trace_printf("%s@%d - Program='%s' argc=%d\n"
+ , method_name, __LINE__
+ , program, count);
+ int i = 0;
+ while (i < count)
+ {
+ trace_printf("%s@%d - argv[%d]=%s\n"
+ , method_name, __LINE__
+ , i, msg->u.request.u.new_process.argv[i]);
+ i++;
+ }
+ }
+ strcpy( path, Path );
+ if (strlen (path) + strlen (Wdir) + 1 > MAX_SEARCH_PATH - 1)
+ {
+ strcpy (path, Wdir);
+ printf ("[%s] Warning: Path set to current working director\n",MyName);
+ }
+ else
+ {
+ strncat (path, ":", MAX_SEARCH_PATH-1);
+ strncat (path, Wdir, MAX_SEARCH_PATH-1);
+ }
+
+ strcpy( ldpath, LDpath );
+ if (strlen (ldpath) + strlen (Wdir) + 1 > MAX_SEARCH_PATH - 1)
+ {
+ strcpy (ldpath, Wdir);
+ printf ("[%s] Warning: LD_LIBRARY_PATH set to current working director\n",MyName);
+ }
+ else
+ {
+ strncat (ldpath, ":", MAX_SEARCH_PATH-1);
+ strncat (ldpath, Wdir, MAX_SEARCH_PATH-1);
+ }
+
+ msg->type = MsgType_Service;
+ msg->noreply = false;
+ msg->reply_tag = REPLY_TAG;
+ msg->u.request.type = ReqType_NewProcess;
+ msg->u.request.u.new_process.nid = *nid;
+ msg->u.request.u.new_process.type = type;
+ msg->u.request.u.new_process.priority = priority;
+ msg->u.request.u.new_process.backup = 0;
+ msg->u.request.u.new_process.unhooked = true;
+// msg->u.request.u.new_process.nowait = nowait;
+ msg->u.request.u.new_process.nowait = false;
+ msg->u.request.u.new_process.tag = 0;
+ msg->u.request.u.new_process.debug = (debug ? 1 : 0);
+ STRCPY (msg->u.request.u.new_process.process_name, name);
+ STRCPY (msg->u.request.u.new_process.path, path);
+ STRCPY (msg->u.request.u.new_process.ldpath, ldpath);
+ STRCPY (msg->u.request.u.new_process.program, program);
+ STRCPY (msg->u.request.u.new_process.infile, infile);
+ STRCPY (msg->u.request.u.new_process.outfile, outfile);
+ if ( trace_settings & TRACE_SHELL_CMD )
+ trace_printf ("%s@%d [%s] send req to monitor with tag: %d, count: "
+ "%d.\n", method_name, __LINE__,MyName, REPLY_TAG, count);
+
+ gp_local_mon_io->send_recv(msg);
+ count = sizeof( *msg );
+ status.MPI_TAG = msg->reply_tag;
+
+ if ( trace_settings & TRACE_SHELL_CMD )
+ trace_printf ( "%s@%d [%s] reply from monitor with tag: %d, count: "
+ "%d.\n", method_name, __LINE__, MyName,
+ status.MPI_TAG, count);
+
+ if ((status.MPI_TAG == REPLY_TAG) &&
+ (count == sizeof (struct message_def)))
+ {
+ if ((msg->type == MsgType_Service) &&
+ (msg->u.reply.type == ReplyType_NewProcess))
+ {
+ if (msg->u.reply.u.new_process.return_code == MPI_SUCCESS)
+ {
+ LastNid = msg->u.reply.u.new_process.nid;
+ LastPid = msg->u.reply.u.new_process.pid;
+ if ( trace_settings & TRACE_SHELL_CMD )
+ trace_printf (
+ "%s@%d [%s] Started process successfully. Nid=%d, "
+ "Pid=%d, Process_name=%s, Verifier=%d,rtn=%d\n",
+ method_name, __LINE__,
+ MyName, msg->u.reply.u.new_process.nid,
+ msg->u.reply.u.new_process.pid,
+ msg->u.reply.u.new_process.process_name,
+ msg->u.reply.u.new_process.verifier,
+ msg->u.reply.u.new_process.return_code);
+ *nid = msg->u.reply.u.new_process.nid;
+ }
+ else
+ {
+ printf ("[%s] NewProcess failed to spawn, error=%s\n", MyName,
+ ErrorMsg(msg->u.reply.u.new_process.return_code));
+ }
+ }
+ else
+ {
+ printf("[%s] Invalid MsgType(%d)/ReplyType(%d) for NewProcess message\n",
+ MyName, msg->type, msg->u.reply.type);
+ }
+ }
+ else
+ {
+ printf ("[%s] NewProcess reply message invalid\n", MyName);
+ }
+
+ gp_local_mon_io->release_msg(msg);
+ return LastPid;
+}
+
+bool start_monitor( char *cmd_tail, bool warmstart, bool reintegrate )
+{
+ bool status = false;
+
+ int i;
+ int rc = MPI_SUCCESS;
+ int idx;
+ char *argv[100];
+ char token[MAX_TOKEN];
+ char delimiter;
+ char *env;
+ char home[MAX_PROCESS_PATH];
+ char nodelist[MAX_NODES*MPI_MAX_PROCESSOR_NAME];
+ char np[6];
+ char path[MAX_SEARCH_PATH];
+ char sqroot[MAX_PROCESS_PATH];
+ pid_t os_pid;
+ const char method_name[] = "start_monitor";
+ // Set working directory for monitor if needed
+ MonCwd monCwd;
+
+ // Ensure that we are on a node that is part of the configuration
+ char mynode[MPI_MAX_PROCESSOR_NAME];
-
+ gethostname(mynode, MPI_MAX_PROCESSOR_NAME);
++
++ //JIRA: TRAFODION-1854, hostname contains upper case letters
++ //change all char in mynode to lowercase
++ //since cluster config strings will all be in lowercase, see CTokenizer::NormalizeCase()
++ if(!VirtualNodes) // for VirtualNodes, it use same gethostname, so do not tolower
++ {
++ char *tmpptr = mynode;
++ while ( *tmpptr )
++ {
++ *tmpptr = tolower( *tmpptr );
++ tmpptr++;
++ }
++ }
++#if 1
++ bool nodeInConfig = false;
++ for ( i = 0; i < ClusterConfig.GetPNodesConfigMax(); i++ )
++ {
++ if ( CPNodeConfigContainer::hostnamecmp( mynode, PNode[i]) == 0 )
++ {
++ nodeInConfig = true;
++ break;
++ }
++ }
++ if ( !nodeInConfig )
++ {
++ printf ("[%s] Cannot start monitor from node '%s' since it is not member of the cluster configuration or 'hostname' string does not match configuration string.\n", MyName, mynode);
++ printf ("[%s] Configuration node names:\n", MyName);
++ for ( i = 0; i < NumNodes; i++ )
++ {
++ printf ("[%s] '%s'\n", MyName, PNode[i]);
++ }
++ return true;
++ }
++#else
++ // TODO: Need to evaluate the proper way to handle JIRA:TRAFODION-1854
++ // with the real elasticity implementation
+ CPNodeConfig *pnodeConfig = ClusterConfig.GetPNodeConfig( mynode );
+ if ( !pnodeConfig )
+ {
+ printf ("[%s] Cannot start monitor from node '%s' since it is not member of the cluster configuration or 'hostname' string does not match configuration string.\n", MyName, mynode);
+ printf ("[%s] Configuration node names:\n", MyName);
+ CPNodeConfig *pnodeConfig = ClusterConfig.GetFirstPNodeConfig();
+ while (pnodeConfig)
+ {
+ printf ("[%s] '%s'\n", MyName, pnodeConfig->GetName());
+ pnodeConfig = pnodeConfig->GetNext();
+ }
+ return true;
+ }
++#endif
+
+ if (gp_local_mon_io)
+ { // Ensure the monitor port name file does not exist. We use the
+ // file name's existence to indicate whether or not the monitor
+ // has started.
+ if ( !reintegrate )
+ {
+ // We are re-integrating another monitor, so don't remove this
+ // monitor's port file as it will have to initiate re-integration
+ unlink(gp_local_mon_io->mon_port_fname());
+ }
+ }
+
+ // setup arguments to process
+ idx=0;
+ argv[idx] = (char *) "mpirun";
+ argv[idx+1] = (char *) "-disable-auto-cleanup";
+ idx++;
+ argv[idx+1] = (char *) "-demux";
+ argv[idx+2] = (char *) "select";
+ idx+=2;
+ argv[idx+1] = (char *) "-env";
+ argv[idx+2] = (char *) "SQ_IC";
+ argv[idx+3] = (char *) "TCP";
+ idx+=3;
+ argv[idx+1] = (char *) "-env";
+ argv[idx+2] = (char *) "MPI_ERROR_LEVEL";
+ argv[idx+3] = (char *) "2";
+ idx+=3;
+ if (Measure == 1)
+ {
+ argv[idx+1] = (char *) "-env";
+ argv[idx+2] = (char *) "SQ_MEASURE";
+ argv[idx+3] = (char *) "1";
+ idx+=3;
+ }
+ else if (Measure == 2)
+ {
+ argv[idx+1] = (char *) "-env";
+ argv[idx+2] = (char *) "SQ_MEASURE";
+ argv[idx+3] = (char *) "2";
+ idx+=3;
+ }
+ env=getenv("SQ_PIDMAP");
+ if (env && *env == '1')
+ {
+ argv[idx+1] = (char *) "-env";
+ argv[idx+2] = (char *) "SQ_PIDMAP";
+ argv[idx+3] = (char *) "1";
+ idx+=3;
+ }
+ env=getenv("SQ_SEAMONSTER");
+ if (env && *env == '1')
+ {
+ argv[idx+1] = (char *) "-env";
+ argv[idx+2] = (char *) "SQ_SEAMONSTER";
+ argv[idx+3] = (char *) "1";
+ idx+=3;
+ }
+ argv[idx+1] = (char *) "-env";
+ argv[idx+2] = (char *) "MPI_TMPDIR";
+ env = getenv ("HOME");
+ strcpy (home, (env?env:""));
+ env = getenv ("MPI_TMPDIR");
+ strcpy (path, (env?env:home));
+ argv[idx+3] = path;
+ idx+=3;
+ argv[idx+1] = (char *) "-env";
- argv[idx+2] = (char *) "MY_SQROOT";
- env=getenv("MY_SQROOT");
++ argv[idx+2] = (char *) "TRAF_HOME";
++ env=getenv("TRAF_HOME");
+ strcpy (sqroot, (env?env:""));
+ argv[idx+3] = sqroot;
+ idx+=3;
+
+ // argv[idx+1] = (char *) "-e";
+ // argv[idx+2] = (char *) "MPI_MALLOCLIB=1";
+ // idx+=2;
+ // add env from properties file
+ // do it here so that variables can be overwritten
+ char **xvals = NULL;
+ MON_Props xprops(true);
+ xprops.load("shell.env");
+ MON_Smap_Enum xenum(&xprops);
+ int xsize = xprops.size();
+ int xinx;
+ if (xsize > 0) {
+ printf("[%s] - Warning using shell.env\n",MyName);
+ xvals = new char*[2*xsize];
+ xinx = 0;
+ while (xenum.more())
+ {
+ char *xkey = xenum.next();
+ const char *xvalue = xprops.get(xkey);
+ xvals[xinx] = new char[strlen(xkey)+1];
+ xvals[xinx+1] = new char[strlen(xvalue)+1];
+ strcpy(xvals[xinx], xkey);
+ strcpy(xvals[xinx+1], xvalue);
+ argv[idx+1] = (char *) "-env";
+ argv[idx+2] = xvals[xinx];
+ argv[idx+3] = xvals[xinx+1];
+ idx+=3;
+ xinx+=2;
+ }
+ }
+
+ // Refresh the current cluster state
+ if ( !VirtualNodes )
+ {
+ NodeState_t nodeState;
+ if ( reintegrate )
+ {
+ strcpy( nodelist, cmd_tail );
+ }
+ else
+ {
+ if ( !update_cluster_state( true ) )
+ {
+ if (xvals != NULL)
+ {
+ for (xinx = 0; xinx < xsize; xinx++)
+ delete [] xvals[xinx];
+ delete [] xvals;
+ }
+ return true;
+ }
+ bool copiedToList =false;
+ for(i=0,nodelist[0]='\0'; i < ClusterConfig.GetPNodesConfigMax(); i++)
+ {
+ if (copiedToList)
+ {
+ copiedToList =false;
+ strcat(nodelist, ",");
+ }
+ if ( strlen(PNode[i]) == 0 ) continue;
+ if ( get_pnode_state( PNode[i], nodeState ) )
+ {
+ if ( nodeState == StateUp )
+ {
+ copiedToList =true;
+ strcat(nodelist,PNode[i]);
+ }
+ }
+ }
+ }
+ }
+ CurNodes = NumNodes - NumDown;
+ argv[idx+1] = (char *) "-np";
+ if ( reintegrate )
+ {
+ // Re-integrating one monitor process only
+ sprintf( np,"%d",1 );
+ }
+ else
+ {
+ sprintf(np,"%d",CurNodes);
+ }
+ argv[idx+2] = np;
+ idx+=2;
+ if (!VirtualNodes) {
+ argv[idx+1] = (char *) "-hosts";
+ argv[idx+2] = nodelist;
+ idx+=2;
+ }
+
+ char fname[MAX_PROCESS_PATH];
+ // find absoute path to monitor from path
+ env=getenv("PATH");
+ char monpath[PATH_MAX+1];
+ strncpy(monpath, env, PATH_MAX);
+ monpath[PATH_MAX] = '\0';
+ char *monbeg = monpath;
+ char *monend;
+ struct stat monstatbuf;
+ int monstaterr;
+ do
+ {
+ monend = strchr(monbeg, ':');
+ if (monend != NULL)
+ *monend = '\0';
+ if (*monbeg == '/')
+ sprintf(fname, "%s/monitor", monbeg);
+ else // transform relative-to-absolute
+ sprintf(fname, "%s/%s/monitor", getenv("PWD"), monbeg);
+
+ monstaterr = lstat(fname, &monstatbuf);
+ if (monstaterr == 0)
+ {
+ if ( S_ISREG(monstatbuf.st_mode) && !access(fname, X_OK))
+ { // Should be allowed to execute this program
+ break;
+ }
+ }
+ monbeg = &monend[1];
+ } while (monend != NULL);
+
+ if (monend == NULL)
+ {
+ if (xvals != NULL)
+ {
+ for (xinx = 0; xinx < xsize; xinx++)
+ delete [] xvals[xinx];
+ delete [] xvals;
+ }
+ // log error and quit
+ printf ("[%s] Cannot find valid monitor executable in PATH.\n", MyName);
+ return true;
+ }
+
+ argv[idx+1]=fname;
+ idx++;
+
+ if (warmstart)
+ {
+ argv[idx+1] = (char *) "WARM";
+ }
+ else
+ {
+ argv[idx+1] = (char *) "COLD";
+ }
+ idx++;
+ if ( reintegrate )
+ {
+ // NEW monitor argv1 argv2 argv3 argv4 argv5:
+ // monitor -integrate <creator-monitor-port> <creator-shell-pid> <creator_shell_verifier>
+ argv[idx+1] = (char *) "-integrate";
+ char mon_port[MPI_MAX_PORT_NAME];
+ strcpy( mon_port, gp_local_mon_io->mon_port() );
+ argv[idx+2] = mon_port;
+ char creator_shell_pid[MPI_MAX_PORT_NAME];
+ sprintf( creator_shell_pid, "%d", MyPid );
+ argv[idx+3] = creator_shell_pid;
+ char creator_shell_verifier[MPI_MAX_PORT_NAME];
+ sprintf( creator_shell_verifier, "%d", MyVerifier );
+ argv[idx+4] = creator_shell_verifier;
+ idx+=4;
+ argv[idx+1] = NULL;
+ }
+ else
+ {
+ cmd_tail = get_token (cmd_tail, token, &delimiter);
+ if ( isdigit(*token) )
+ {
+ argv[idx+1] = token;
+ argv[idx+2] = NULL;
+ }
+ else if (strcmp (normalize_case (token), "trace") == 0)
+ {
+ argv[idx+1] = (char *) "TRACEFILE";
+ if (isdigit (*cmd_tail))
+ {
+ argv[idx+2] = cmd_tail;
+ argv[idx+3] = NULL;
+ }
+ else
+ {
+ argv[idx+2] = NULL;
+ }
+ }
+ else
+ {
+ argv[idx+1] = NULL;
+ }
+ }
+
+ if ( trace_settings & TRACE_SHELL_CMD )
+ {
+ trace_printf("%s@%d" " - Program='" "%s" "' argc=" "%d" "\n", method_name, __LINE__, argv[0], idx);
+ i = 1;
+ while (argv[i] != NULL)
+ {
+ trace_printf("%s@%d" " - argv[" "%d" "]=" "%s" "\n", method_name, __LINE__, i, argv[i]);
+ i++;
+ }
+ }
+
+ os_pid = fork ();
+ if (os_pid)
+ {
+ // I'm the parent
+ if (os_pid == -1)
+ {
+ if ( trace_settings & TRACE_SHELL_CMD )
+ trace_printf ("%s@%d [%s] Monitor fork() failed, errno=%d\n",
+ method_name, __LINE__, MyName, errno);
+ rc = MPI_ERR_SPAWN;
+ }
+ else
+ {
+ rc = MPI_SUCCESS;
+ }
+
+ // Wait for mpirun to finish, get status
+ int mpirunStatus;
+ pid_t child;
+ bool done = false;
+ do
+ {
+ child = waitpid(os_pid, &mpirunStatus, WNOHANG);
+ if (child == os_pid)
+ {
+ // mpirun completed
+ if (WIFEXITED(mpirunStatus))
+ {
+ // If mpirun exit status is not zero mpirun had an
+ // error trying to start the monitor. Set "failure"
+ // status this start_monitor function.
+ status = WEXITSTATUS(mpirunStatus) != 0;
+ if (status)
+ {
+ rc = MPI_ERR_SPAWN;
+ }
+ }
+ else
+ {
+ printf("[%s]Unexpected mpirun status=%d\n", MyName,
+ mpirunStatus);
+ }
+ done = true;
+ }
+ else if (child == 0)
+ { // mpirun has not yet changed state, delay.
+ // do not wait for mpirun to complete when using mpich!
+ done = true;
+ }
+ else
+ {
+ if ( trace_settings & TRACE_SHELL_CMD )
+ {
+ if (child == -1)
+ {
+ trace_printf("[%s] waiting for mpirun: %s (%d)\n",
+ MyName, strerror(errno), errno);
+ }
+ else
+ {
+ trace_printf("[%s] waiting for mpirun pid=%d but got "
+ "pid=%d\n", MyName, os_pid, child);
+ }
+ }
+ done = true;
+ }
+ } while (not done);
+ }
+ else
+ {
+ // I'm the child process
+ close(0);
+ // remap mpirun stdout and stderr
+ RedirectFd(1, mpirunOutFileName);
+ RedirectFd(2, mpirunErrFileName);
+
+ if (execvp ("mpirun", argv) == -1)
+ {
+ printf("[%s] - Error trying to execvp 'mpirun' with program=monitor: %s (%d)\n",MyName, strerror(errno), errno);
+ }
+ }
+ if (xvals != NULL)
+ {
+ for (xinx = 0; xinx < xsize; xinx++)
+ delete [] xvals[xinx];
+ delete [] xvals;
+ }
+
+ if (rc == MPI_SUCCESS && !reintegrate )
+ {
+ strcpy(MyName,"SHELL");
+
+ gv_ms_su_nid = MyNid;
+ if ( trace_settings & TRACE_SHELL_CMD )
+ trace_printf ("%s@%d [%s] Local IO nid = %d\n",
+ method_name, __LINE__, MyName, MyNid);
+
+ gp_local_mon_io = new Local_IO_To_Monitor( -1 );
+ assert (gp_local_mon_io);
+ SetCallbacks();
+
+ // We always need to attach to our monitor first
+ int portFileStatus;
+
+ gp_local_mon_io->iv_monitor_down = true;
+ gp_local_mon_io->iv_pid = -1;
+ if ( gp_local_mon_io->wait_for_monitor( portFileStatus ) )
+ {
+ sleep(1);
+ Attached = attach( MyNid, MyName, (char *) "shell");
+ if ( Attached )
+ {
+ gp_local_mon_io->iv_pid = MyPid;
+
+ if ( trace_settings & TRACE_SHELL_CMD )
+ trace_printf ("%s@%d [%s] Monitor started successfully\n",
+ method_name, __LINE__, MyName);
+ }
+ else
+ {
+ printf("[%s] Unable to communicate with monitor\n",MyName);
+ status = true;
+ }
+ }
+ else
+ {
+ if ( portFileStatus == ENOENT )
+ {
+ printf("[%s] Unable to communicate with monitor because "
+ "monitor port file %s is missing.\n", MyName,
+ gp_local_mon_io->mon_port_fname() );
+ }
+ else
+ {
+ printf("[%s] Unable to communicate with monitor because "
+ "monitor port file %s is not accessible (%s).\n",
+ MyName, gp_local_mon_io->mon_port_fname(),
+ strerror( portFileStatus ));
+ }
+ status = true;
+ }
+ }
+ else
+ {
+ if ( !reintegrate )
+ {
+ status = true;
+ }
+ }
+
+ return status;
+}
+
+char *timer ( bool start )
+{
+ static char timestr[18] = "dd:hh:mm:ss.xxxxx";
+ static double base_time;
+ int days, hours, mins;
+ double seconds;
+
+ if ( start )
+ {
+ base_time = MPI_Wtime ();
+ }
+ else
+ {
+ seconds = MPI_Wtime () - base_time;
+ mins = (int) (seconds / 60.0);
+ seconds = seconds - (mins * 60.0);
+ hours = mins / 60;
+ mins = mins - (hours * 60);
+ days = hours / 24;
+ hours = hours - (days * 24);
+
+ sprintf (timestr, "%2.2d:%2.2d:%2.2d:%7.5f", days, hours, mins, seconds);
+ }
+ return timestr;
+}
+
+char *time_string( void )
+{
+ static char timestr[22] = "mm/dd/yyyy - hh:mm:ss";
+ time_t mytime = time(NULL);
+ struct tm *tmp = localtime( &mytime );
+
+ strftime( timestr, sizeof(timestr), "%m/%d/%Y-%H:%M:%S", tmp );
+ return( timestr ) ;
+}
+
+void write_startup_log( char *msg )
+{
+ char fname[PATH_MAX];
+ char msgString[MAX_BUFFER] = { 0 };
+
- char *tmpDir = getenv( "MY_SQROOT" );
++ char *tmpDir = getenv( "TRAF_HOME" );
+ if ( tmpDir )
+ {
+ snprintf( fname, sizeof(fname), "%s/sql/scripts/startup.log", tmpDir );
+ }
+ else
+ {
+ snprintf( fname, sizeof(fname), "./startup.log" );
+ }
+
+ int processMapFd = open( fname
+ , O_WRONLY | O_APPEND | O_CREAT
+ , S_IRUSR | S_IWUSR );
+ if ( processMapFd == -1 )
+ { // File open error
+ printf( "[%s] Error= Can't open %s, %s (%d).\n"
+ , MyName, fname, strerror(errno), errno);
+ return;
+ }
+
+ static char timestr[30] = "Thu May 31 15:04:00 PDT 2012:";
+ time_t mytime = time(NULL);
+ struct tm *tmp = localtime( &mytime );
+ strftime( timestr, sizeof(timestr), "%a %b %e %T %Z %Y:", tmp );
+
+ sprintf( msgString, "%s %s\n",timestr, msg );
+ write( processMapFd, msgString, strlen(msgString));
+ close( processMapFd );
+}
+
+char *cd_cmd (char *cmd_tail, char *wdir)
+{
+ int i;
+ int length = (int) strlen (cmd_tail);
+ char *ptr;
+
+ normalize_slashes (cmd_tail);
+
+ if (wdir != Wdir)
+ {
+ strcpy (wdir, Wdir);
+ }
+
+ if (length == 2 && cmd_tail[0] == '.' && cmd_tail[1] == '.')
+ {
+ for (i = (int) strlen (wdir); i >= 0; i--)
+ {
+ if (wdir[i] == '/')
+ {
+ wdir[i] = '\0';
+ strcat (wdir, &cmd_tail[2]);
+ break;
+ }
+ }
+ }
+ else if (length > 2 && cmd_tail[0] == '.' && cmd_tail[1] == '.'
+ && cmd_tail[2] == '/')
+ {
+ ptr = cmd_tail;
+ i = (int) strlen (wdir);
+ while (ptr[0] == '.' && ptr[1] == '.')
+ {
+ for (; i >= 0; i--)
+ {
+ if (wdir[i] == '/')
+ {
+ wdir[i] = '\0';
+ ptr = &ptr[2];
+ break;
+ }
+ }
+ if (ptr[0] == '/' && ptr[1] == '.')
+ {
+ ptr++;
+ }
+ }
+ if (ptr[0] == '\0' || ptr[0] == '/')
+ {
+ strcat (wdir, ptr);
+ }
+ else
+ {
+ printf ("[%s] Invalid wdir syntax!\n", MyName);
+ }
+ }
+ else if (cmd_tail[0] == '/')
+ {
+ strcpy (wdir, cmd_tail);
+ }
+ else if (length > 1 && cmd_tail[0] == '.' && cmd_tail[1] == '/')
+ {
+ if (wdir[strlen (wdir) - 1] != '/')
+ {
+ strcat (wdir, "/");
+ }
+ strcat (wdir, &cmd_tail[2]);
+ }
+ else if (cmd_tail[0] == '.')
+ {
+ if (length != 1)
+ {
+ printf ("[%s] Invalid wdir syntax!\n", MyName);
+ }
+ }
+ else if (length == 2 && cmd_tail[1] == ':')
+ {
+ strcpy (wdir, cmd_tail);
+ strcat (wdir, "/");
+ }
+ else if (length > 1 && cmd_tail[1] == ':' && cmd_tail[2] == '/')
+ {
+ strcpy (wdir, cmd_tail);
+ }
+ else if (length > 2 && cmd_tail[1] == '/' && cmd_tail[2] == '/')
+ {
+ strcpy (wdir, cmd_tail);
+ }
+ else
+ {
+ if (wdir[strlen (wdir) - 1] != '/')
+ {
+ strcat (wdir, "/");
+ }
+ strcat (wdir, cmd_tail);
+ }
+
+ return wdir;
+}
+
+void dump_cmd (char *cmd_tail, char delimiter)
+{
<TRUNCATED>
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9523fd2b/core/sqf/monitor/linux/zclient.cxx
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9523fd2b/core/sqf/monitor/linux/zootest.cxx
----------------------------------------------------------------------
[45/50] [abbrv] incubator-trafodion git commit: Restored nodeAdd
scripts to support new node add logic. Fixed 'shell node add' logic in
Trafodion Configuration library module.
Posted by su...@apache.org.
Restored nodeAdd scripts to support new node add logic.
Fixed 'shell node add' logic in Trafodion Configuration library module.
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/23bb89af
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/23bb89af
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/23bb89af
Branch: refs/heads/master
Commit: 23bb89af18a639663df14b03b86f8a12e347bd0b
Parents: c8f07c1
Author: Zalo Correa <za...@esgyn.com>
Authored: Tue May 9 16:25:56 2017 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Tue May 9 16:25:56 2017 -0700
----------------------------------------------------------------------
core/sqf/monitor/linux/reqnodeadd.cxx | 4 +-
core/sqf/monitor/linux/sqliteconfig.cxx | 369 ++++++++++++++++---
core/sqf/monitor/linux/trafconfig.cxx | 17 +-
core/sqf/monitor/linux/trafconfigtrace.cxx | 2 +-
core/sqf/sql/scripts/sqconfig | 11 +-
.../transactional/TrxTransactionState.java.tmpl | 13 +-
install/installer/addNode_step1 | 80 +---
install/installer/addNode_step2 | 111 +++---
8 files changed, 403 insertions(+), 204 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/23bb89af/core/sqf/monitor/linux/reqnodeadd.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/reqnodeadd.cxx b/core/sqf/monitor/linux/reqnodeadd.cxx
index 8ecccc3..760e5a2 100644
--- a/core/sqf/monitor/linux/reqnodeadd.cxx
+++ b/core/sqf/monitor/linux/reqnodeadd.cxx
@@ -131,8 +131,8 @@ void CExtNodeAddReq::performRequest()
strncpy( lnodeConfigInfo.nodename
, msg_->u.request.u.node_add.node_name
, sizeof(lnodeConfigInfo.nodename) );
- lnodeConfigInfo.lastCore = msg_->u.request.u.node_add.first_core;
- lnodeConfigInfo.firstCore = msg_->u.request.u.node_add.last_core;
+ lnodeConfigInfo.firstCore = msg_->u.request.u.node_add.first_core;
+ lnodeConfigInfo.lastCore = msg_->u.request.u.node_add.last_core;
lnodeConfigInfo.processor = msg_->u.request.u.node_add.processors;
clusterConfig->SetCoreMask( lnodeConfigInfo.lastCore
, lnodeConfigInfo.firstCore
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/23bb89af/core/sqf/monitor/linux/sqliteconfig.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/sqliteconfig.cxx b/core/sqf/monitor/linux/sqliteconfig.cxx
index f69e402..ea7ca1f 100644
--- a/core/sqf/monitor/linux/sqliteconfig.cxx
+++ b/core/sqf/monitor/linux/sqliteconfig.cxx
@@ -106,6 +106,10 @@ int CSqliteConfig::AddRegistryKey( const char *key )
, "[%s] sqlite3_bind_text(:key) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -119,6 +123,10 @@ int CSqliteConfig::AddRegistryKey( const char *key )
, "[%s] (%s) failed, key=%s, error: %s\n"
, method_name, sqlStmt, key, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -128,7 +136,6 @@ int CSqliteConfig::AddRegistryKey( const char *key )
{
sqlite3_finalize( prepStmt );
}
-
TRACE_EXIT;
return( TCSUCCESS );
}
@@ -184,6 +191,10 @@ int CSqliteConfig::AddRegistryProcess( const char *name )
, "[%s] sqlite3_bind_text(:name) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -197,6 +208,10 @@ int CSqliteConfig::AddRegistryProcess( const char *name )
, "[%s] (%s) failed, name=%s, error: %s\n"
, method_name, sqlStmt, name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -206,7 +221,6 @@ int CSqliteConfig::AddRegistryProcess( const char *name )
{
sqlite3_finalize( prepStmt );
}
-
TRACE_EXIT;
return( TCSUCCESS );
}
@@ -266,6 +280,10 @@ int CSqliteConfig::AddRegistryClusterData( const char *key
, "[%s] sqlite3_bind_text(:dataValue) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -279,6 +297,10 @@ int CSqliteConfig::AddRegistryClusterData( const char *key
, "[%s] sqlite3_bind_text(:key) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -292,6 +314,10 @@ int CSqliteConfig::AddRegistryClusterData( const char *key
, "[%s] (%s) failed, key=%s, error: %s\n"
, method_name, sqlStmt, key, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -301,7 +327,6 @@ int CSqliteConfig::AddRegistryClusterData( const char *key
{
sqlite3_finalize( prepStmt );
}
-
TRACE_EXIT;
return( TCSUCCESS );
}
@@ -367,6 +392,10 @@ int CSqliteConfig::AddRegistryProcessData( const char *procName
, "[%s] sqlite3_bind_text(:procName) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -381,6 +410,10 @@ int CSqliteConfig::AddRegistryProcessData( const char *procName
, "[%s] sqlite3_bind_text(:dataValue) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -394,6 +427,10 @@ int CSqliteConfig::AddRegistryProcessData( const char *procName
, "[%s] sqlite3_bind_text(:key) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -407,6 +444,10 @@ int CSqliteConfig::AddRegistryProcessData( const char *procName
, "[%s] (%s) failed, key=%s, proc=%s, error: %s\n"
, method_name, sqlStmt, key, procName, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -416,7 +457,6 @@ int CSqliteConfig::AddRegistryProcessData( const char *procName
{
sqlite3_finalize( prepStmt );
}
-
TRACE_EXIT;
return( TCSUCCESS );
}
@@ -473,6 +513,10 @@ int CSqliteConfig::AddUniqueString( int nid
"[%s] sqlite3_bind_int(nid) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -484,6 +528,10 @@ int CSqliteConfig::AddUniqueString( int nid
"[%s] sqlite3_bind_int(id) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -495,6 +543,10 @@ int CSqliteConfig::AddUniqueString( int nid
, "[%s] sqlite3_bind_text(uniqStr) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -507,6 +559,10 @@ int CSqliteConfig::AddUniqueString( int nid
, "[%s] (%s) failed, nid=%d, id=%d, error: %s\n"
, method_name, sqlStmt, nid, id, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -516,7 +572,6 @@ int CSqliteConfig::AddUniqueString( int nid
{
sqlite3_finalize( prepStmt );
}
-
TRACE_EXIT;
return( TCSUCCESS );
}
@@ -607,6 +662,10 @@ int CSqliteConfig::DeleteNodeData( int pnid )
"[%s] sqlite3_bind_int(pnid) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt1 != NULL )
+ {
+ sqlite3_finalize( prepStmt1 );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -620,6 +679,10 @@ int CSqliteConfig::DeleteNodeData( int pnid )
, "[%s] (%s) failed, pNid=%d, error: %s\n"
, method_name, sqlStmt1, pnid, sqlite3_errmsg(db_));
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ if ( prepStmt1 != NULL )
+ {
+ sqlite3_finalize( prepStmt1 );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -637,6 +700,10 @@ int CSqliteConfig::DeleteNodeData( int pnid )
, "[%s] prepare (%s) failed, error=%s\n"
, method_name, sqlStmt2, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ if ( prepStmt1 != NULL )
+ {
+ sqlite3_finalize( prepStmt1 );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -650,6 +717,14 @@ int CSqliteConfig::DeleteNodeData( int pnid )
"[%s] sqlite3_bind_int(pnid) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt1 != NULL )
+ {
+ sqlite3_finalize( prepStmt1 );
+ }
+ if ( prepStmt2 != NULL )
+ {
+ sqlite3_finalize( prepStmt2 );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -663,6 +738,14 @@ int CSqliteConfig::DeleteNodeData( int pnid )
, "[%s] (%s) failed, pNid=%d, error: %s\n"
, method_name, sqlStmt2, pnid, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ if ( prepStmt1 != NULL )
+ {
+ sqlite3_finalize( prepStmt1 );
+ }
+ if ( prepStmt2 != NULL )
+ {
+ sqlite3_finalize( prepStmt2 );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -676,7 +759,6 @@ int CSqliteConfig::DeleteNodeData( int pnid )
{
sqlite3_finalize( prepStmt2 );
}
-
TRACE_EXIT;
return( TCSUCCESS );
}
@@ -731,6 +813,10 @@ int CSqliteConfig::DeleteUniqueString( int nid )
"[%s] sqlite3_bind_int(nid) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmtA != NULL )
+ {
+ sqlite3_finalize( prepStmtA );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -744,6 +830,10 @@ int CSqliteConfig::DeleteUniqueString( int nid )
, "[%s] (%s) failed, pNid=%d, error: %s\n"
, method_name, sqlStmtA, nid, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ if ( prepStmtA != NULL )
+ {
+ sqlite3_finalize( prepStmtA );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -753,7 +843,6 @@ int CSqliteConfig::DeleteUniqueString( int nid )
{
sqlite3_finalize( prepStmtA );
}
-
TRACE_EXIT;
return( TCSUCCESS );
}
@@ -766,6 +855,7 @@ int CSqliteConfig::Initialize( void )
if ( IsInitialized() )
{
// Already initialized
+ TRACE_EXIT;
return( TCALREADYINIT );
}
@@ -871,7 +961,7 @@ int CSqliteConfig::GetNode( int nid
sqlStmt = "select p.pNid, l.lNid, p.nodeName, l.firstCore, l.lastCore,"
" p.excFirstCore, p.excLastCore, l.processors, l.roles"
" from pnode p, lnode l where p.pNid = l.pNid"
- " and l.nid = ?";
+ " and l.lNid = ?";
rc = sqlite3_prepare_v2( db_
, sqlStmt
@@ -898,6 +988,10 @@ int CSqliteConfig::GetNode( int nid
"[%s] sqlite3_bind_int(nid) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -941,7 +1035,6 @@ int CSqliteConfig::GetNode( int nid
}
else if ( rc == SQLITE_DONE )
{
- // Destroy prepared statement object
if ( prepStmt != NULL )
{
sqlite3_finalize( prepStmt );
@@ -952,6 +1045,7 @@ int CSqliteConfig::GetNode( int nid
trace_printf("%s@%d Finished processing logical nodes.\n",
method_name, __LINE__);
}
+ TRACE_EXIT;
return( TCDBNOEXIST );
}
else
@@ -961,16 +1055,18 @@ int CSqliteConfig::GetNode( int nid
, "[%s] (%s) failed, error: %s\n"
, method_name, sqlStmt, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
- // Destroy prepared statement object
if ( prepStmt != NULL )
{
sqlite3_finalize( prepStmt );
}
-
TRACE_EXIT;
return( TCSUCCESS );
}
@@ -1036,6 +1132,10 @@ int CSqliteConfig::GetNode( const char *name
, "[%s] sqlite3_bind_text(name) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -1079,7 +1179,6 @@ int CSqliteConfig::GetNode( const char *name
}
else if ( rc == SQLITE_DONE )
{
- // Destroy prepared statement object
if ( prepStmt != NULL )
{
sqlite3_finalize( prepStmt );
@@ -1090,7 +1189,7 @@ int CSqliteConfig::GetNode( const char *name
trace_printf("%s@%d Finished processing logical nodes.\n",
method_name, __LINE__);
}
-
+ TRACE_EXIT;
return( TCDBNOEXIST );
}
else
@@ -1100,6 +1199,10 @@ int CSqliteConfig::GetNode( const char *name
, "[%s] (%s) failed, error: %s\n"
, method_name, sqlStmt, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -1109,7 +1212,6 @@ int CSqliteConfig::GetNode( const char *name
{
sqlite3_finalize( prepStmt );
}
-
TRACE_EXIT;
return( TCSUCCESS );
}
@@ -1218,29 +1320,22 @@ int CSqliteConfig::GetNodes( int &count
else
{
count = nodeCount;
- // Destroy prepared statement object
if ( prepStmt != NULL )
{
sqlite3_finalize( prepStmt );
}
+ TRACE_EXIT;
return( TCDBTRUNCATE );
}
}
else if ( rc == SQLITE_DONE )
{
count = nodeCount;
- // Destroy prepared statement object
- if ( prepStmt != NULL )
- {
- sqlite3_finalize( prepStmt );
- }
-
if ( TcTraceSettings & (TC_TRACE_NODE | TC_TRACE_REQUEST) )
{
trace_printf("%s@%d Finished processing logical nodes.\n",
method_name, __LINE__);
}
-
break;
}
else
@@ -1250,11 +1345,19 @@ int CSqliteConfig::GetNodes( int &count
, "[%s] (%s) failed, error: %s\n"
, method_name, sqlStmt, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
}
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCSUCCESS );
}
@@ -1313,6 +1416,10 @@ int CSqliteConfig::GetPNode( int pNid
"[%s] sqlite3_bind_int(pNid) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -1346,12 +1453,6 @@ int CSqliteConfig::GetPNode( int pNid
}
else if ( rc == SQLITE_DONE )
{
- // Destroy prepared statement object
- if ( prepStmt != NULL )
- {
- sqlite3_finalize( prepStmt );
- }
-
if ( TcTraceSettings & (TC_TRACE_NODE | TC_TRACE_REQUEST) )
{
trace_printf("%s@%d Finished processing logical nodes.\n",
@@ -1365,10 +1466,18 @@ int CSqliteConfig::GetPNode( int pNid
, "[%s] (%s) failed, error: %s\n"
, method_name, sqlStmt, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCSUCCESS );
}
@@ -1426,6 +1535,10 @@ int CSqliteConfig::GetPNode( const char *name
, "[%s] sqlite3_bind_text(name) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -1471,16 +1584,18 @@ int CSqliteConfig::GetPNode( const char *name
, "[%s] (%s) failed, error: %s\n"
, method_name, sqlStmt, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
- // Destroy prepared statement object
if ( prepStmt != NULL )
{
sqlite3_finalize( prepStmt );
}
-
TRACE_EXIT;
return( TCSUCCESS );
}
@@ -1577,6 +1692,10 @@ int CSqliteConfig::GetSNodes( int &count
, "[%s], Error: Invalid node configuration\n"
, method_name);
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -1585,29 +1704,22 @@ int CSqliteConfig::GetSNodes( int &count
else
{
count = snodeCount;
- // Destroy prepared statement object
if ( prepStmt != NULL )
{
sqlite3_finalize( prepStmt );
}
+ TRACE_EXIT;
return( TCDBTRUNCATE );
}
}
else if ( rc == SQLITE_DONE )
{
count = snodeCount;
- // Destroy prepared statement object
- if ( prepStmt != NULL )
- {
- sqlite3_finalize( prepStmt );
- }
-
if ( TcTraceSettings & (TC_TRACE_NODE | TC_TRACE_REQUEST) )
{
trace_printf("%s@%d Finished processing spare nodes.\n",
method_name, __LINE__);
}
-
break;
}
else
@@ -1617,11 +1729,19 @@ int CSqliteConfig::GetSNodes( int &count
, "[%s] (%s) failed, error: %s\n"
, method_name, sqlStmt, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
}
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCSUCCESS );
}
@@ -1697,6 +1817,10 @@ int CSqliteConfig::GetSNodeData( int pnid
"[%s] sqlite3_bind_int(pnid) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -1733,18 +1857,11 @@ int CSqliteConfig::GetSNodeData( int pnid
else if ( rc == SQLITE_DONE )
{
spareNodeConfig.spare_count = spareCount;
- // Destroy prepared statement object
- if ( prepStmt != NULL )
- {
- sqlite3_finalize( prepStmt );
- }
-
if ( TcTraceSettings & (TC_TRACE_NODE | TC_TRACE_REQUEST) )
{
trace_printf("%s@%d Finished processing spared node set.\n",
method_name, __LINE__);
}
-
break;
}
else
@@ -1754,11 +1871,19 @@ int CSqliteConfig::GetSNodeData( int pnid
, "[%s] (%s) failed, error: %s\n"
, method_name, sqlStmt, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
}
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCSUCCESS );
}
@@ -1830,6 +1955,10 @@ int CSqliteConfig::GetPersistProcess( const char *persistPrefix
, "[%s] sqlite3_bind_text(keyName) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -1864,8 +1993,8 @@ int CSqliteConfig::GetPersistProcess( const char *persistPrefix
// Parse the value based on the key
rs = SetPersistProcessData( persistKey
- , persistValue
- , persistConfig );
+ , persistValue
+ , persistConfig );
if ( rs != TCSUCCESS )
{
char buf[TC_LOG_BUF_SIZE];
@@ -1874,6 +2003,10 @@ int CSqliteConfig::GetPersistProcess( const char *persistPrefix
"configuration, key=%s, value=%s\n"
, method_name, persistKey, persistValue );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -1894,11 +2027,19 @@ int CSqliteConfig::GetPersistProcess( const char *persistPrefix
, "[%s] (%s) failed, error: %s\n"
, method_name, sqlStmtStmt, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
}
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCSUCCESS );
}
@@ -1974,6 +2115,7 @@ int CSqliteConfig::GetPersistProcessKeys( const char *persistProcessKeys )
{
sqlite3_finalize( prepStmt );
}
+ TRACE_EXIT;
return( TCDBNOEXIST );
}
else
@@ -1983,6 +2125,10 @@ int CSqliteConfig::GetPersistProcessKeys( const char *persistProcessKeys )
, "[%s] (%s) failed, error: %s\n"
, method_name, sqlStmt, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -1991,7 +2137,6 @@ int CSqliteConfig::GetPersistProcessKeys( const char *persistProcessKeys )
{
sqlite3_finalize( prepStmt );
}
-
TRACE_EXIT;
return( TCSUCCESS );
}
@@ -2085,11 +2230,11 @@ int CSqliteConfig::GetRegistryClusterSet( int &count
else
{
count = entryNum;
- // Destroy prepared statement object
if ( prepStmt != NULL )
{
sqlite3_finalize( prepStmt );
}
+ TRACE_EXIT;
return( TCDBTRUNCATE );
}
}
@@ -2105,19 +2250,21 @@ int CSqliteConfig::GetRegistryClusterSet( int &count
, "[%s] (%s) failed, error: %s\n"
, method_name, sqlStmt, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
}
- // Destroy prepared statement object
+ count =entryNum;
+
if ( prepStmt != NULL )
{
sqlite3_finalize( prepStmt );
}
-
- count =entryNum;
-
TRACE_EXIT;
return( TCSUCCESS );
}
@@ -2218,6 +2365,7 @@ int CSqliteConfig::GetRegistryProcessSet( int &count
{
sqlite3_finalize( prepStmt );
}
+ TRACE_EXIT;
return( TCDBTRUNCATE );
}
}
@@ -2240,17 +2388,19 @@ int CSqliteConfig::GetRegistryProcessSet( int &count
, "[%s] (%s) failed, error: %s\n"
, method_name, sqlStmt, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
}
- // Destroy prepared statement object
if ( prepStmt != NULL )
{
sqlite3_finalize( prepStmt );
}
-
TRACE_EXIT;
return( TCSUCCESS );
}
@@ -2300,6 +2450,10 @@ int CSqliteConfig::GetUniqueString( int nid, int id, const char *uniqStr )
"[%s] sqlite3_bind_int(nid) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -2311,6 +2465,10 @@ int CSqliteConfig::GetUniqueString( int nid, int id, const char *uniqStr )
"[%s] sqlite3_bind_int(id) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -2337,6 +2495,7 @@ int CSqliteConfig::GetUniqueString( int nid, int id, const char *uniqStr )
{
sqlite3_finalize( prepStmt );
}
+ TRACE_EXIT;
return( TCDBNOEXIST );
}
else
@@ -2350,6 +2509,10 @@ int CSqliteConfig::GetUniqueString( int nid, int id, const char *uniqStr )
, "[%s] (%s) failed, nid=%d, id=%d, error: %s\n"
, method_name, sqlStmt, nid, id,sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -2359,7 +2522,6 @@ int CSqliteConfig::GetUniqueString( int nid, int id, const char *uniqStr )
{
sqlite3_finalize( prepStmt );
}
-
TRACE_EXIT;
return( TCSUCCESS );
}
@@ -2416,6 +2578,10 @@ int CSqliteConfig::GetUniqueStringId( int nid
"[%s] sqlite3_bind_int(nid) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -2427,6 +2593,10 @@ int CSqliteConfig::GetUniqueStringId( int nid
, "[%s] sqlite3_bind_text(uniqStr) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -2449,6 +2619,7 @@ int CSqliteConfig::GetUniqueStringId( int nid
{
sqlite3_finalize( prepStmt );
}
+ TRACE_EXIT;
return( TCDBNOEXIST );
}
else
@@ -2462,6 +2633,10 @@ int CSqliteConfig::GetUniqueStringId( int nid
, "[%s] (%s) failed, nid=%d, id=%d, error: %s\n"
, method_name, sqlStmt, nid, id,sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -2471,7 +2646,6 @@ int CSqliteConfig::GetUniqueStringId( int nid
{
sqlite3_finalize( prepStmt );
}
-
TRACE_EXIT;
return( TCSUCCESS );
}
@@ -2520,6 +2694,10 @@ int CSqliteConfig::GetUniqueStringIdMax( int nid, int &id )
"[%s] sqlite3_bind_int(nid) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -2543,6 +2721,7 @@ int CSqliteConfig::GetUniqueStringIdMax( int nid, int &id )
{
sqlite3_finalize( prepStmt );
}
+ TRACE_EXIT;
return( TCDBNOEXIST );
}
else
@@ -2552,6 +2731,10 @@ int CSqliteConfig::GetUniqueStringIdMax( int nid, int &id )
, "[%s] (%s) failed, nid=%d, error: %s\n"
, method_name, sqlStmt, nid, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -2561,7 +2744,6 @@ int CSqliteConfig::GetUniqueStringIdMax( int nid, int &id )
{
sqlite3_finalize( prepStmt );
}
-
TRACE_EXIT;
return( TCSUCCESS );
}
@@ -2626,6 +2808,10 @@ int CSqliteConfig::SaveLNodeData( int nid
"[%s] sqlite3_bind_int(nid) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -2637,6 +2823,10 @@ int CSqliteConfig::SaveLNodeData( int nid
"[%s] sqlite3_bind_int(pnid) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -2648,6 +2838,10 @@ int CSqliteConfig::SaveLNodeData( int nid
"[%s] sqlite3_bind_int(processors) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -2659,6 +2853,10 @@ int CSqliteConfig::SaveLNodeData( int nid
"[%s] sqlite3_bind_int(roles) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -2670,6 +2868,10 @@ int CSqliteConfig::SaveLNodeData( int nid
"[%s] sqlite3_bind_int(firsCore) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -2681,6 +2883,10 @@ int CSqliteConfig::SaveLNodeData( int nid
"[%s] sqlite3_bind_int(lastCore) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -2697,6 +2903,10 @@ int CSqliteConfig::SaveLNodeData( int nid
, method_name, sqlStmt, sqlite3_errmsg(db_)
, nid, pnid, processors, roles, firstCore, lastCore );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -2706,7 +2916,6 @@ int CSqliteConfig::SaveLNodeData( int nid
{
sqlite3_finalize( prepStmt );
}
-
TRACE_EXIT;
return( TCSUCCESS );
}
@@ -2767,6 +2976,10 @@ int CSqliteConfig::SavePNodeData( const char *name
"[%s] sqlite3_bind_int(pnid) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -2778,6 +2991,10 @@ int CSqliteConfig::SavePNodeData( const char *name
, "[%s] sqlite3_bind_text(name) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -2789,6 +3006,10 @@ int CSqliteConfig::SavePNodeData( const char *name
"[%s] sqlite3_bind_int(excludedFirstCore) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -2800,6 +3021,10 @@ int CSqliteConfig::SavePNodeData( const char *name
"[%s] sqlite3_bind_int(excludedLastCore) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -2815,6 +3040,10 @@ int CSqliteConfig::SavePNodeData( const char *name
, method_name, sqlStmt, sqlite3_errmsg(db_)
, pnid, name, excludedFirstCore, excludedLastCore );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -2824,7 +3053,6 @@ int CSqliteConfig::SavePNodeData( const char *name
{
sqlite3_finalize( prepStmt );
}
-
TRACE_EXIT;
return( TCSUCCESS );
}
@@ -3065,6 +3293,10 @@ int CSqliteConfig::UpdatePNodeData( int pnid
, "[%s] sqlite3_bind_text(name) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -3078,6 +3310,10 @@ int CSqliteConfig::UpdatePNodeData( int pnid
"[%s] sqlite3_bind_int(excludedFirstCore) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -3091,6 +3327,10 @@ int CSqliteConfig::UpdatePNodeData( int pnid
"[%s] sqlite3_bind_int(excludedLastCore) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -3104,6 +3344,10 @@ int CSqliteConfig::UpdatePNodeData( int pnid
"[%s] sqlite3_bind_int(:pNid) failed, error: %s\n"
, method_name, sqlite3_errmsg(db_) );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_CRIT, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -3120,6 +3364,10 @@ int CSqliteConfig::UpdatePNodeData( int pnid
, method_name, sqlStmt, sqlite3_errmsg(db_)
, name, excludedFirstCore, excludedLastCore, pnid );
TcLogWrite( SQLITE_DB_ACCESS_ERROR, TC_LOG_ERR, buf );
+ if ( prepStmt != NULL )
+ {
+ sqlite3_finalize( prepStmt );
+ }
TRACE_EXIT;
return( TCDBOPERROR );
}
@@ -3129,7 +3377,6 @@ int CSqliteConfig::UpdatePNodeData( int pnid
{
sqlite3_finalize( prepStmt );
}
-
TRACE_EXIT;
return( TCSUCCESS );
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/23bb89af/core/sqf/monitor/linux/trafconfig.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/trafconfig.cxx b/core/sqf/monitor/linux/trafconfig.cxx
index f89eda1..5194800 100644
--- a/core/sqf/monitor/linux/trafconfig.cxx
+++ b/core/sqf/monitor/linux/trafconfig.cxx
@@ -135,12 +135,19 @@ TC_Export int tc_put_node( node_configuration_t *node_config )
{
int rc = TCDBOPERROR;
- rc = SqliteConfig.SaveLNodeData( node_config->nid
+ rc = SqliteConfig.SavePNodeData( node_config->node_name
, node_config->pnid
- , node_config->first_core
- , node_config->last_core
- , node_config->processors
- , node_config->roles );
+ , node_config->excluded_first_core
+ , node_config->excluded_last_core );
+ if (rc == TCSUCCESS)
+ {
+ rc = SqliteConfig.SaveLNodeData( node_config->nid
+ , node_config->pnid
+ , node_config->first_core
+ , node_config->last_core
+ , node_config->processors
+ , node_config->roles );
+ }
return( rc );
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/23bb89af/core/sqf/monitor/linux/trafconfigtrace.cxx
----------------------------------------------------------------------
diff --git a/core/sqf/monitor/linux/trafconfigtrace.cxx b/core/sqf/monitor/linux/trafconfigtrace.cxx
index 170b446..c8868da 100644
--- a/core/sqf/monitor/linux/trafconfigtrace.cxx
+++ b/core/sqf/monitor/linux/trafconfigtrace.cxx
@@ -188,7 +188,7 @@ void CTrafConfigTrace::TraceInit( bool traceEnabled
{
traceSettingsSaved_ = TcTraceSettings;
- if (pfname != NULL)
+ if (strlen( trace_file_name))
{
trace_init(trace_file_name,
false, // don't append pid to file name
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/23bb89af/core/sqf/sql/scripts/sqconfig
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/sqconfig b/core/sqf/sql/scripts/sqconfig
index 85f7eb7..4de7fd8 100644
--- a/core/sqf/sql/scripts/sqconfig
+++ b/core/sqf/sql/scripts/sqconfig
@@ -19,24 +19,20 @@
#
# @@@ END COPYRIGHT @@@
-begin node
-_virtualnodes 2
-end node
+begin persist
#
-# The folling process types are persistent and have special process management:
+# The following PROCESS_TYPEs are persistent and have special process management:
# DTM
# TMID
# SSMP
# PSD
# WDG
#
-# Generic persistent processes are of process type:
+# Generic persistent processes are of PROCESS_TYPE:
# PERSIST
#
-begin persist
-
PERSIST_PROCESS_KEYS = DTM,TMID,SSCP,SSMP,PSD,WDG
DTM_PROCESS_NAME = $TM%nid+
@@ -88,3 +84,4 @@ WDG_PERSIST_RETRIES = 10,60
WDG_PERSIST_ZONES = %zid
end persist
+
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/23bb89af/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/TrxTransactionState.java.tmpl
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/TrxTransactionState.java.tmpl b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/TrxTransactionState.java.tmpl
index 6ec061d..46351d7 100644
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/TrxTransactionState.java.tmpl
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/regionserver/transactional/TrxTransactionState.java.tmpl
@@ -76,6 +76,7 @@ import org.apache.hadoop.hbase.regionserver.ScannerContext;
#endif
#ifdef CDH5.7 APACHE1.2
import org.apache.hadoop.hbase.HBaseConfiguration;
+import org.apache.hadoop.conf.Configuration;
#endif
import org.apache.hadoop.hbase.regionserver.wal.WALEdit;
import org.apache.hadoop.hbase.util.Bytes;
@@ -90,7 +91,9 @@ import org.apache.hadoop.io.DataInputBuffer;
public class TrxTransactionState extends TransactionState {
static java.lang.reflect.Constructor c1_0 = null;
-
+#ifdef CDH5.7 APACHE1.2
+ static Configuration config = HBaseConfiguration.create();
+#endif
static {
String version = VersionInfo.getVersion();// the hbase version string, eg. "0.6.3-dev"
LOG.info("Got info of Class ScanQueryMatcher for HBase version :" + version);
@@ -694,7 +697,7 @@ public class TrxTransactionState extends TransactionState {
//Store.ScanInfo scaninfo = new Store.ScanInfo(null, 0, 1, HConstants.FOREVER, false, 0, Cell.COMPARATOR);
#ifdef CDH5.7 APACHE1.2
- ScanInfo scaninfo = new ScanInfo(HBaseConfiguration.create(), null, 0, 1, HConstants.FOREVER,KeepDeletedCells.FALSE, 0, KeyValue.COMPARATOR);
+ ScanInfo scaninfo = new ScanInfo(getConfig(), null, 0, 1, HConstants.FOREVER,KeepDeletedCells.FALSE, 0, KeyValue.COMPARATOR);
#else
ScanInfo scaninfo = new ScanInfo(null, 0, 1, HConstants.FOREVER,KeepDeletedCells.FALSE, 0, KeyValue.COMPARATOR);
#endif
@@ -1032,4 +1035,10 @@ public class TrxTransactionState extends TransactionState {
}
}
}
+
+#ifdef CDH5.7 APACHE1.2
+ public Configuration getConfig() {
+ return config;
+ }
+#endif
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/23bb89af/install/installer/addNode_step1
----------------------------------------------------------------------
diff --git a/install/installer/addNode_step1 b/install/installer/addNode_step1
index 05302b0..66e6209 100755
--- a/install/installer/addNode_step1
+++ b/install/installer/addNode_step1
@@ -202,84 +202,6 @@ sudo chmod 777 $TRAF_CONFIG
}
-function removeNodeExclude {
-
-source $TRAF_CONFIG
-temp=""
-
-for node in $TRAF_EXCLUDE_LIST
-do
- if [[ ! $NODES =~ .*$node.* ]]; then
- temp="$temp $node"
- fi
-
-done
-excludeCount=$(echo $TRAF_EXCLUDE_LIST | wc -w)
-tempCount=$(echo $temp | wc -w)
-
-
-if [[ "$excludeCount" -eq "$tempCount" ]]; then
-#New node name
- changeNodeName
- NAME_CHANGE="true"
- sudo chmod 777 $TRAF_CONFIG
- sed -i '/NAME_CHANGE\=/d' $TRAF_CONFIG
- echo "export NAME_CHANGE=\"$NAME_CHANGE\"" >> $TRAF_CONFIG
- sudo chmod 777 $TRAF_CONFIG
-else
- TRAF_EXCLUDE_LIST=$temp
- sudo chmod 777 $TRAF_CONFIG
- sed -i '/TRAF_EXCLUDE_LIST\=/d' $TRAF_CONFIG
- echo "export TRAF_EXCLUDE_LIST=\"$TRAF_EXCLUDE_LIST\"" >> $TRAF_CONFIG
- sudo chmod 777 $TRAF_CONFIG
-fi
-
-}
-
-function changeNodeName {
-
-source $TRAF_CONFIG
-
-for node in $NODES
-do
-
- export oldNODENAME=$(echo $TRAF_EXCLUDE_LIST | head -n1 | awk '{print $1;}')
- temp=""
-
- for nodes in $TRAF_EXCLUDE_LIST
- do
- if [[ "$oldNODENAME" != $nodes ]]; then
- temp="$temp $nodes"
- fi
- done
- export TRAF_EXCLUDE_LIST=$temp
-
- oldToNew="$oldNODENAME $node"
- echo
- echo "********************************************************************"
- echo "***VERY IMPORTANT: User must change old user name to a new user name."
- echo "***VERY IMPORTANT: open another session and sudo su trafodion"
- echo "***VERY IMPORTANT: sqshell -a"
- echo "***VERY IMPORTANT: node name $oldToNew"
- sleep 5
- echo -n "***VERY IMPORTANT: Press any key when complete."
- read answer
- echo
- echo "********************************************************************"
-
- sudo sed -i -e "s/\<$oldNODENAME\>/$node/g" $TRAF_HOME/tmp/cluster.conf
- sudo sed -i -e "s/\<$oldNODENAME\>/$node/g" $TRAF_HOME/sql/scripts/sqconfig
- sudo rm -rf $TRAF_HOME/tmp/se*
- sudo rm -rf $TRAF_HOME/sql/scripts/se*
- sudo chmod 777 $TRAF_CONFIG
- sed -i '/TRAF_EXCLUDE_LIST\=/d' $TRAF_CONFIG
- echo "export TRAF_EXCLUDE_LIST=\"$TRAF_EXCLUDE_LIST\"" >> $TRAF_CONFIG
- sudo chmod 777 $TRAF_CONFIG
-
-done
-
-}
-
function createConfigDir {
$TRAF_NEW_PDSH sudo mkdir -p /etc/trafodion
@@ -328,6 +250,7 @@ $TRAF_NEW_PDSH rm -rf trafodion-util*
function printMessage {
source $TRAF_CONFIG
+echo
echo "***IMPORTANT: Go restart HBase on new nodes"
echo "***IMPORTANT: Wait until that is done... then..."
echo "***IMPORTANT: Ready to run addNode_step2"
@@ -342,7 +265,6 @@ checkForHA
addNewNodesConfig
copyHBaseTrx
createNewNodes
-removeNodeExclude
createConfigDir
copyConfig
checkHBaseTrx
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/23bb89af/install/installer/addNode_step2
----------------------------------------------------------------------
diff --git a/install/installer/addNode_step2 b/install/installer/addNode_step2
index ad52013..9a28cbb 100755
--- a/install/installer/addNode_step2
+++ b/install/installer/addNode_step2
@@ -153,8 +153,10 @@ function editTrafbashrc {
source $TRAF_CONFIG
sudo chmod 777 $HOME_DIR/$TRAF_USER/.bashrc
-sudo sed -i -e "s@export NODE_LIST=.*@export NODE_LIST=\"$NODE_LIST\"@" $HOME_DIR/$TRAF_USER/.bashrc
-sudo sed -i -e "s@export MY_NODES=.*@export MY_NODES=\"$MY_NODES\"@" $HOME_DIR/$TRAF_USER/.bashrc
+#sudo sed -i -e "s@export NODE_LIST=.*@export NODE_LIST=\"$NODE_LIST\"@" $HOME_DIR/$TRAF_USER/.bashrc
+#sudo sed -i -e "s@export MY_NODES=.*@export MY_NODES=\"$MY_NODES\"@" $HOME_DIR/$TRAF_USER/.bashrc
+sudo sed -i -e "/export NODE_LIST/d" $HOME_DIR/$TRAF_USER/.bashrc
+sudo sed -i -e "/export MY_NODES=/d" $HOME_DIR/$TRAF_USER/.bashrc
}
@@ -172,43 +174,6 @@ $TRAF_PDSH sudo chmod 644 $HOME_DIR/$TRAF_USER/.bashrc
}
-function copyClusterConf {
-
-source $TRAF_CONFIG
-echo "***INFO: Copying over new cluster.conf file"
-
-echo "***IMPORTANT*** Ignore copy errors to new node."
-echo
-sleep 5
-
-sudo cp $TRAF_HOME/tmp/cluster.conf $PWD
-sudo chown $(whoami).$(whoami) $PWD/cluster.conf
-$TRAF_PDCP $PWD/cluster.conf $HOME
-$TRAF_PDSH sudo cp $HOME/cluster.conf $TRAF_HOME/tmp/cluster.conf 2>&1 > /dev/null
-$TRAF_PDSH sudo chown $TRAF_USER.trafodion $TRAF_HOME/tmp/cluster.conf 2>&1 > /dev/null
-$TRAF_PDSH sudo rm $HOME/cluster.conf
-
-}
-
-function copySQconfig {
-
-source $TRAF_CONFIG
-echo "***INFO: Copying over new sqconfig file"
-
-echo "***IMPORTANT*** Ignore copy errors to new node."
-echo
-sleep 5
-
-sudo cp -r $TRAF_HOME/sql/scripts/sqconfig $PWD
-sudo chown $(whoami).$(whoami) $PWD/sqconfig
-$TRAF_PDCP $PWD/sqconfig $HOME
-$TRAF_PDSH sudo cp $HOME/sqconfig $TRAF_HOME/sql/scripts/sqconfig 2>&1 > /dev/null
-$TRAF_PDSH sudo chown $TRAF_USER.trafodion $TRAF_HOME/sql/scripts/sqconfig 2>&1 > /dev/null
-$TRAF_PDSH sudo rm $HOME/sqconfig
-
-
-}
-
function addTraftoHBase {
echo "***INFO: Adding $TRAF_USER userid to $HBASE_GROUP group"
@@ -285,7 +250,7 @@ function copyAll {
source $TRAF_CONFIG
echo
echo "***IMPORTANT: Copying files to $NEW_NODES"
-echo "***IMPORTANT: This will take some time, it's alot of file. Please wait...."
+echo "***IMPORTANT: This will take some time, it's a lot of file. Please wait...."
echo
sudo mkdir -p $HOME/tmpTraf/
$TRAF_NEW_PDSH sudo rm -rf $HOME_DIR/$TRAF_USER/.ssh
@@ -363,19 +328,67 @@ $TRAF_PDSH rm -r $HOME/tmpTraf
}
+function copysqConfig {
+
+source $TRAF_CONFIG
+
+$TRAF_PDSH mkdir -p $HOME/tmpTraf
+sudo cp -r $TRAF_HOME/sql/scripts/sqconfig $HOME/tmpTraf
+sudo chown -R $(whoami).$(whoami) $HOME/tmpTraf
+$TRAF_PDCP -r $HOME/tmpTraf $HOME
+$TRAF_PDSH sudo cp -rf $HOME/tmpTraf/sqconfig $TRAF_HOME/sql/scripts 2>&1 > /dev/null
+$TRAF_PDSH sudo chown -R $TRAF_USER.trafodion $TRAF_HOME/sql/scripts 2>&1 > /dev/null
+$TRAF_PDSH rm -r $HOME/tmpTraf
+
+}
+
+
function printMessage {
source $TRAF_CONFIG
echo
echo "***IMPORTANT: EXIT OUT OF ALL EXISTING SHELLS, need to pick up new environment variables"
-echo "***IMPORTANT: Node is ready to be added"
-echo "***IMPORTANT: sudo su $TRAF_USER"
-echo "***IMPORTANT: sqshell -a"
-echo "***IMPORTANT: up <new node>"
+echo "***IMPORTANT: All node(s) should be added!"
+#echo "***IMPORTANT: Node is ready to be added"
+#echo "***IMPORTANT: sudo su $TRAF_USER"
+#echo "***IMPORTANT: sqshell -a"
+#echo "***IMPORTANT: up <new node>"
echo
}
+function addUpNodes {
+
+for node in $NEW_NODES
+do
+
+ nodeToAdd="node-name $node, cores $CORES, processors $PROCESSORS, roles connection,aggregation,storage"
+
+ sudo su $TRAF_USER --login --command "cd $TRAF_HOME/sql/scripts; echo \"node add $nodeToAdd \" | sqshell -a"
+ sleep 30
+ sudo su $TRAF_USER --login --command "cd $TRAF_HOME/sql/scripts; echo \"node up $node\" | sqshell -a"
+ sleep 30
+
+done
+
+}
+
+function sqRegen {
+
+sudo su $TRAF_USER --login --command "cd $TRAF_HOME/sql/scripts; sqregen -config"
+
+}
+
+function rmsStart {
+
+sudo su $TRAF_USER --login --command "cd $SQ_ROOT/sql/scripts; rmsstart"
+}
+
+function dcsStart {
+
+sudo su $TRAF_USER --login --command "cd $TRAF_HOME/sql/scripts; dcsstart"
+}
+
function cleanUp {
$TRAF_PDSH rm -rf $HOME/hbase-site*
@@ -411,8 +424,12 @@ if [[ "$ENABLE_HA" == "true" ]]; then
editDCSBackUp
fi
addTraftoHBase
-copyClusterConf
-copySQconfig
copySqcert
-printMessage
+addUpNodes
+sqRegen
+copysqConfig
+rmsStart
+dcsStart
cleanUp
+printMessage
+
[26/50] [abbrv] incubator-trafodion git commit: Merge remote branch
'origin/master' into TRAFODION-2001
Posted by su...@apache.org.
Merge remote branch 'origin/master' into TRAFODION-2001
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/cf2aece0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/cf2aece0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/cf2aece0
Branch: refs/heads/master
Commit: cf2aece00322b0d0cb1a53493d6e37edfa5f36ea
Parents: 1323127 6a130fc
Author: Zalo Correa <za...@esgyn.com>
Authored: Mon Oct 31 13:24:22 2016 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Mon Oct 31 13:24:22 2016 -0700
----------------------------------------------------------------------
core/sqf/monitor/linux/cluster.cxx | 6 +++---
core/sqf/sqenvcom.sh | 6 +++---
core/sql/optimizer/RelSequence.cpp | 3 +++
3 files changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cf2aece0/core/sqf/monitor/linux/cluster.cxx
----------------------------------------------------------------------
[39/50] [abbrv] incubator-trafodion git commit: Merge branch
'TRAFODION-2001' of github.com:zcorrea/incubator-trafodion into
TRAFODION-2001
Posted by su...@apache.org.
Merge branch 'TRAFODION-2001' of github.com:zcorrea/incubator-trafodion into TRAFODION-2001
Conflicts:
core/sqf/monitor/linux/clusterconf.cxx
core/sqf/monitor/linux/monlogging.cxx
core/sqf/monitor/linux/pstartd.cxx
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/145cd9b1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/145cd9b1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/145cd9b1
Branch: refs/heads/master
Commit: 145cd9b1375bb5d568bba6567317f593f5119813
Parents: fd1c115 9523fd2
Author: Zalo Correa <za...@esgyn.com>
Authored: Fri Feb 24 20:38:26 2017 -0800
Committer: Zalo Correa <za...@esgyn.com>
Committed: Fri Feb 24 20:38:26 2017 -0800
----------------------------------------------------------------------
.rat-excludes | 13 +-
RAT_README | 39 +-
core/Makefile | 8 +-
core/bldenvchk.sh | 6 +-
core/conn/Makefile | 4 +-
core/conn/jdbcT4/Makefile | 6 +-
.../trafodion/jdbc/t4/InterfaceUtilities.java | 3 +-
core/conn/jdbc_type2/Makefile | 8 +-
core/conn/jdbc_type2/build.xml | 8 +-
.../native/ResStatisticsStatement.cpp | 123 +-
core/conn/jdbc_type2/samples/README | 4 +-
core/conn/odb/Makefile | 6 +-
core/conn/odbc/src/odbc/Common/QSData.cpp | 24 +
core/conn/odbc/src/odbc/Common/QSData.h | 45 +
core/conn/odbc/src/odbc/Makefile | 12 +-
core/conn/odbc/src/odbc/macros.gmk | 2 +-
core/conn/odbc/src/odbc/nsksrvr/Makefile | 8 +-
core/conn/odbc/src/odbc/nsksrvr/SrvrConnect.cpp | 5 +-
core/conn/odbc/src/odbc/nsksrvrcore/Makefile | 8 +-
.../odbc/nsksrvrcore/ResStatisticsStatement.cpp | 125 +-
core/conn/trafci/.gitignore | 6 +
core/conn/trafci/Makefile | 41 +
core/conn/trafci/build.xml | 10 +-
core/conn/trafci/install/Installer.java | 3389 --------------
core/conn/trafci/install/Installer.java-tmpl | 3368 ++++++++++++++
core/conn/trafci/installer_pom.xml | 119 +
core/conn/trafci/manualtests/README | 2 +-
core/conn/trafci/pom.xml | 140 +
.../org/trafodion/ci/AWTExceptionHandler.java | 36 +
.../main/java/org/trafodion/ci/CSVDisplay.java | 90 +
.../src/main/java/org/trafodion/ci/Column.java | 131 +
.../java/org/trafodion/ci/ConditionalQuery.java | 435 ++
.../trafodion/ci/ConditionalQueryException.java | 43 +
.../trafodion/ci/ConditionalSyntaxError.java | 123 +
.../java/org/trafodion/ci/ConsoleReader.java | 231 +
.../java/org/trafodion/ci/ConsoleWriter.java | 130 +
.../java/org/trafodion/ci/DatabaseQuery.java | 1819 ++++++++
.../src/main/java/org/trafodion/ci/Display.java | 68 +
.../trafodion/ci/DuplicateParamException.java | 40 +
.../main/java/org/trafodion/ci/ErrorObject.java | 103 +
.../src/main/java/org/trafodion/ci/FCQuery.java | 334 ++
.../main/java/org/trafodion/ci/FileReader.java | 176 +
.../main/java/org/trafodion/ci/FileWriter.java | 80 +
.../main/java/org/trafodion/ci/HTMLDisplay.java | 80 +
.../main/java/org/trafodion/ci/HTMLObject.java | 628 +++
.../main/java/org/trafodion/ci/HelpIndexer.java | 134 +
.../src/main/java/org/trafodion/ci/Helper.java | 225 +
.../main/java/org/trafodion/ci/HostQuery.java | 289 ++
.../main/java/org/trafodion/ci/IDisplay.java | 28 +
.../main/java/org/trafodion/ci/IndexStruct.java | 55 +
.../java/org/trafodion/ci/InterfaceQuery.java | 4380 ++++++++++++++++++
.../trafodion/ci/InterfaceQueryException.java | 35 +
.../org/trafodion/ci/InterfaceSyntaxError.java | 83 +
.../trafodion/ci/InvalidNumberOfArguments.java | 35 +
.../main/java/org/trafodion/ci/JDBCVproc.java | 38 +
.../java/org/trafodion/ci/LFProperties.java | 130 +
.../java/org/trafodion/ci/MaskingThread.java | 73 +
.../java/org/trafodion/ci/MultiByteUtils.java | 56 +
.../org/trafodion/ci/NullKeyWordException.java | 35 +
.../org/trafodion/ci/OutputColumnAttribute.java | 47 +
.../java/org/trafodion/ci/OutputContents.java | 144 +
.../main/java/org/trafodion/ci/ParallelRun.java | 1320 ++++++
.../org/trafodion/ci/ParamStringObject.java | 256 +
.../java/org/trafodion/ci/ParseArguments.java | 660 +++
.../src/main/java/org/trafodion/ci/Parser.java | 1195 +++++
.../ci/ParserMissingParamException.java | 42 +
.../trafciDefaultLookAndFeel.properties | 60 +
.../main/java/org/trafodion/ci/PrunSummary.java | 119 +
.../org/trafodion/ci/PrunUserInterruption.java | 34 +
.../java/org/trafodion/ci/PythonInterface.java | 180 +
.../src/main/java/org/trafodion/ci/Query.java | 188 +
.../main/java/org/trafodion/ci/QueryUtils.java | 37 +
.../java/org/trafodion/ci/QueryWrapper.java | 700 +++
.../main/java/org/trafodion/ci/RawDisplay.java | 189 +
.../src/main/java/org/trafodion/ci/Reader.java | 286 ++
.../java/org/trafodion/ci/RepObjInterface.java | 27 +
.../java/org/trafodion/ci/ReplacementObj.java | 39 +
.../org/trafodion/ci/ScriptSectionNotFound.java | 34 +
.../java/org/trafodion/ci/ScriptsInterface.java | 153 +
.../src/main/java/org/trafodion/ci/Session.java | 1919 ++++++++
.../java/org/trafodion/ci/SessionDefaults.java | 342 ++
.../java/org/trafodion/ci/SessionError.java | 181 +
.../java/org/trafodion/ci/SessionInterface.java | 1487 ++++++
.../org/trafodion/ci/SessionTimeoutTask.java | 93 +
.../src/main/java/org/trafodion/ci/SqlEnum.java | 83 +
.../java/org/trafodion/ci/StatusThread.java | 100 +
.../org/trafodion/ci/TerminalProcessBridge.java | 246 +
.../trafodion/ci/UnKnownInterfaceCommand.java | 34 +
.../java/org/trafodion/ci/UserInterface.java | 421 ++
.../java/org/trafodion/ci/UserInterruption.java | 36 +
.../src/main/java/org/trafodion/ci/Utils.java | 381 ++
.../java/org/trafodion/ci/ValidateQuery.java | 412 ++
.../org/trafodion/ci/ValidationException.java | 39 +
.../main/java/org/trafodion/ci/Vproc.java-tmpl | 36 +
.../main/java/org/trafodion/ci/WCIUtils.java | 122 +
.../src/main/java/org/trafodion/ci/Writer.java | 418 ++
.../main/java/org/trafodion/ci/XMLDisplay.java | 75 +
.../main/java/org/trafodion/ci/XMLObject.java | 607 +++
.../org/trafodion/ci/help/common_common.help | 457 ++
.../java/org/trafodion/ci/help/help_file.idx | 30 +
.../java/org/trafodion/ci/help/sql_common.help | 376 ++
.../org/trafodion/ci/pwdencrypt/ArgMap.java | 61 +
.../org/trafodion/ci/pwdencrypt/ArgsDef.java | 74 +
.../trafodion/ci/pwdencrypt/EncryptUtil.java | 249 +
.../java/org/trafodion/ci/pwdencrypt/JCE.java | 414 ++
.../trafodion/ci/pwdencrypt/PasswordOpts.java | 292 ++
.../org/trafodion/ci/pwdencrypt/RefLookup.java | 127 +
.../org/trafodion/ci/pwdencrypt/WorkTypes.java | 55 +
.../trafci/src/main/resources/install_jar.xml | 71 +
.../trafci/src/main/resources/install_tar.xml | 45 +
.../trafci/src/main/resources/trafci.properties | 5 +
.../org/trafodion/ci/AWTExceptionHandler.java | 36 -
.../trafci/src/org/trafodion/ci/CSVDisplay.java | 90 -
.../trafci/src/org/trafodion/ci/Column.java | 131 -
.../src/org/trafodion/ci/ConditionalQuery.java | 435 --
.../trafodion/ci/ConditionalQueryException.java | 43 -
.../trafodion/ci/ConditionalSyntaxError.java | 123 -
.../src/org/trafodion/ci/ConsoleReader.java | 218 -
.../src/org/trafodion/ci/ConsoleWriter.java | 130 -
.../src/org/trafodion/ci/DatabaseQuery.java | 1804 --------
.../trafci/src/org/trafodion/ci/Display.java | 68 -
.../trafodion/ci/DuplicateParamException.java | 40 -
.../src/org/trafodion/ci/ErrorObject.java | 103 -
.../trafci/src/org/trafodion/ci/FCQuery.java | 334 --
.../trafci/src/org/trafodion/ci/FileReader.java | 176 -
.../trafci/src/org/trafodion/ci/FileWriter.java | 80 -
.../src/org/trafodion/ci/HTMLDisplay.java | 80 -
.../trafci/src/org/trafodion/ci/HTMLObject.java | 628 ---
.../src/org/trafodion/ci/HelpIndexer.java | 134 -
.../trafci/src/org/trafodion/ci/Helper.java | 225 -
.../trafci/src/org/trafodion/ci/HostQuery.java | 289 --
.../trafci/src/org/trafodion/ci/IDisplay.java | 28 -
.../src/org/trafodion/ci/IndexStruct.java | 55 -
.../src/org/trafodion/ci/InterfaceQuery.java | 4378 -----------------
.../trafodion/ci/InterfaceQueryException.java | 35 -
.../org/trafodion/ci/InterfaceSyntaxError.java | 83 -
.../trafodion/ci/InvalidNumberOfArguments.java | 35 -
.../trafci/src/org/trafodion/ci/JDBCVproc.java | 38 -
.../src/org/trafodion/ci/LFProperties.java | 130 -
.../src/org/trafodion/ci/MaskingThread.java | 73 -
.../src/org/trafodion/ci/MultiByteUtils.java | 56 -
.../org/trafodion/ci/NullKeyWordException.java | 35 -
.../org/trafodion/ci/OutputColumnAttribute.java | 47 -
.../src/org/trafodion/ci/OutputContents.java | 144 -
.../src/org/trafodion/ci/ParallelRun.java | 1320 ------
.../src/org/trafodion/ci/ParamStringObject.java | 256 -
.../src/org/trafodion/ci/ParseArguments.java | 660 ---
.../trafci/src/org/trafodion/ci/Parser.java | 1195 -----
.../ci/ParserMissingParamException.java | 42 -
.../trafciDefaultLookAndFeel.properties | 60 -
.../src/org/trafodion/ci/PrunSummary.java | 119 -
.../org/trafodion/ci/PrunUserInterruption.java | 34 -
.../src/org/trafodion/ci/PythonInterface.java | 180 -
.../conn/trafci/src/org/trafodion/ci/Query.java | 188 -
.../trafci/src/org/trafodion/ci/QueryUtils.java | 37 -
.../src/org/trafodion/ci/QueryWrapper.java | 700 ---
.../trafci/src/org/trafodion/ci/RawDisplay.java | 189 -
.../trafci/src/org/trafodion/ci/Reader.java | 286 --
.../src/org/trafodion/ci/RepObjInterface.java | 27 -
.../src/org/trafodion/ci/ReplacementObj.java | 39 -
.../org/trafodion/ci/ScriptSectionNotFound.java | 34 -
.../src/org/trafodion/ci/ScriptsInterface.java | 153 -
.../trafci/src/org/trafodion/ci/Session.java | 1908 --------
.../src/org/trafodion/ci/SessionDefaults.java | 342 --
.../src/org/trafodion/ci/SessionError.java | 181 -
.../src/org/trafodion/ci/SessionInterface.java | 1487 ------
.../org/trafodion/ci/SessionTimeoutTask.java | 93 -
.../trafci/src/org/trafodion/ci/SqlEnum.java | 83 -
.../src/org/trafodion/ci/StatusThread.java | 100 -
.../org/trafodion/ci/TerminalProcessBridge.java | 246 -
.../trafodion/ci/UnKnownInterfaceCommand.java | 34 -
.../src/org/trafodion/ci/UserInterface.java | 421 --
.../src/org/trafodion/ci/UserInterruption.java | 36 -
.../conn/trafci/src/org/trafodion/ci/Utils.java | 381 --
.../src/org/trafodion/ci/ValidateQuery.java | 412 --
.../org/trafodion/ci/ValidationException.java | 39 -
.../conn/trafci/src/org/trafodion/ci/Vproc.java | 36 -
.../trafci/src/org/trafodion/ci/WCIUtils.java | 122 -
.../trafci/src/org/trafodion/ci/Writer.java | 418 --
.../trafci/src/org/trafodion/ci/XMLDisplay.java | 75 -
.../trafci/src/org/trafodion/ci/XMLObject.java | 607 ---
.../org/trafodion/ci/help/common_common.help | 457 --
.../src/org/trafodion/ci/help/help_file.idx | 30 -
.../src/org/trafodion/ci/help/sql_common.help | 376 --
.../src/org/trafodion/ci/pwdencrypt/ArgMap.java | 61 -
.../org/trafodion/ci/pwdencrypt/ArgsDef.java | 74 -
.../trafodion/ci/pwdencrypt/EncryptUtil.java | 249 -
.../src/org/trafodion/ci/pwdencrypt/JCE.java | 414 --
.../trafodion/ci/pwdencrypt/PasswordOpts.java | 292 --
.../org/trafodion/ci/pwdencrypt/RefLookup.java | 127 -
.../org/trafodion/ci/pwdencrypt/WorkTypes.java | 55 -
.../org/trafodion/ci/UserInterfaceTest.java | 116 +
core/conn/trafci/utils/ciencr.sh | 8 +-
core/conn/trafci/utils/trafci | 16 +-
core/conn/trafci/utils/trafci.cmd-tmpl | 2 +-
core/conn/trafci/utils/trafci_install.sh | 8 +-
.../odbc/odbcclient/unixcli/cli/cdesc.cpp | 17 +-
.../odbc/odbcclient/unixcli/cli/cdesc.h | 6 +-
.../odbc/odbcclient/unixcli/cli/cdiag.cpp | 10 +-
.../odbc/odbcclient/unixcli/cli/charsetconv.cpp | 4 +-
.../odbc/odbcclient/unixcli/cli/ctosqlconv.cpp | 49 +-
.../odbc/odbcclient/unixcli/cli/ctosqlconv.h | 2 +-
.../odbc/odbcclient/unixcli/cli/sqltocconv.cpp | 403 +-
.../odbc/odbcclient/unixcli/makefile.lnx | 4 +-
.../odbc/odbcclient/unixcli/package/mklnxpkg.sh | 2 +-
.../unixcli/package/runconnect_test.sh | 2 +-
core/dbsecurity/Makefile | 12 +-
core/dbsecurity/auth/Makefile | 16 +-
core/dbsecurity/auth/src/authEvents.cpp | 4 +-
core/dbsecurity/auth/src/ldapconfigfile.cpp | 18 +-
core/dbsecurity/auth/src/sqldapconfigcheck.cpp | 2 +-
core/dbsecurity/cert/Makefile | 10 +-
core/dbsecurity/cert/src/secsrvr.cpp | 2 +-
core/dbsecurity/macros.gmk | 2 +-
core/dbsecurity/scripts/sqcertgen | 2 +-
core/dbsecurity/scripts/update_auth | 16 +-
core/mpi/Makefile | 4 +-
core/rest/Makefile | 2 +-
core/rest/bin/rest | 8 +-
core/rest/conf/rest-env.sh | 4 +-
core/rest/genvers | 2 +-
.../asciidoc/_chapters/getting_started.adoc | 2 +-
core/seamonster/src/Makefile | 4 +-
core/seamonster/src/macros.gmk | 4 +-
core/sqf/LocalSettingsTemplate.sh | 10 +-
core/sqf/Makefile | 13 +-
core/sqf/build-scripts/check_man | 6 +-
core/sqf/build-scripts/genverhdr.ksh | 2 +-
core/sqf/commonLogger/CommonLogger.cpp | 6 +-
core/sqf/commonLogger/CommonLogger.h | 2 +-
core/sqf/conf/install_features | 2 +-
core/sqf/conf/log4cxx.monitor.mon.config | 2 +-
core/sqf/conf/log4cxx.monitor.mon.snmp.config | 2 +-
core/sqf/conf/log4cxx.monitor.psd.config | 2 +-
core/sqf/conf/log4cxx.monitor.wdg.config | 2 +-
core/sqf/conf/log4cxx.monitor.wdg.snmp.config | 2 +-
core/sqf/conf/log4cxx.trafodion.auth.config | 2 +-
core/sqf/conf/log4cxx.trafodion.lob.config | 2 +-
.../sqf/conf/log4cxx.trafodion.masterexe.config | 2 +-
core/sqf/conf/log4cxx.trafodion.sscp.config | 2 +-
core/sqf/conf/log4cxx.trafodion.ssmp.config | 2 +-
core/sqf/conf/log4cxx.trafodion.tm.config | 2 +-
core/sqf/conf/log4cxx.trafodion.udr.config | 2 +-
core/sqf/conf/trafodion.udr.config | 4 +-
.../export/include/common/evl_sqlog_eventnum.h | 2 +
core/sqf/export/include/dtm/tm.h | 10 +-
core/sqf/export/include/dtm/tmtransaction.h | 2 +-
.../sqf/export/limited-support-tools/LSO/README | 56 +-
.../export/limited-support-tools/LSO/offender | 13 +-
.../limited-support-tools/LSO/se_blocked.sql | 35 +
core/sqf/export/share/man/man1/createhooks.1 | 2 +-
core/sqf/export/share/man/man1/sqcore.1 | 4 +-
core/sqf/export/share/man/man1/sqcorefile.1 | 2 +-
core/sqf/export/share/man/man1/sqgen.1 | 38 +-
core/sqf/export/share/man/man1/sqid.1 | 2 +-
core/sqf/export/share/man/man1/sqinfo.1 | 8 +-
core/sqf/export/share/man/man1/sqvers.1 | 8 +-
core/sqf/export/share/man/man1/update_sql.1 | 2 +-
core/sqf/gdb/create-host-tar-lib | 14 +-
core/sqf/hbase_utilities/Makefile | 6 +-
.../backup_restore_functions.sh | 16 +-
core/sqf/inc/cextdecs/cextdecs.h | 14 +
core/sqf/macros.gmk | 8 +-
core/sqf/monitor/linux/macros.gmk | 2 +-
core/sqf/monitor/linux/makefile | 5 +-
core/sqf/monitor/linux/monitor.cxx | 8 +-
core/sqf/monitor/linux/monlogging.cxx | 2 +-
core/sqf/monitor/linux/montest_run.virtual | 6 +-
core/sqf/monitor/linux/pnode.cxx | 2 +-
core/sqf/monitor/linux/pnodeconfig.cxx | 57 +-
core/sqf/monitor/linux/pnodeconfig.h | 1 +
core/sqf/monitor/linux/process.cxx | 43 +-
core/sqf/monitor/linux/process.h | 2 +-
core/sqf/monitor/linux/reqqueue.cxx | 14 +
core/sqf/monitor/linux/shell.cxx | 58 +-
core/sqf/monitor/linux/zclient.cxx | 110 +-
core/sqf/monitor/linux/zclient.h | 83 +-
core/sqf/monitor/linux/zootest.cxx | 5 +-
core/sqf/monitor/test/notes.txt | 2 +-
core/sqf/monitor/test/runtest | 46 +-
core/sqf/monitor/test/sqconfig.monitor.cluster | 2 +-
core/sqf/sqenvcom.sh | 67 +-
core/sqf/sqevlog/sq_evl_libs/macros.gmk | 2 +-
core/sqf/sqid | 10 +-
core/sqf/sqinfo | 18 +-
core/sqf/sql/macros.gmk | 2 +-
core/sqf/sql/scripts/UsasRepos | 2 +-
core/sqf/sql/scripts/analyzeMessageGuide.py | 656 +++
.../sqf/sql/scripts/bats/runmonitorbats.virtual | 6 +-
core/sqf/sql/scripts/bats/runseabedbats.virtual | 8 +-
core/sqf/sql/scripts/bats/runsqlreg.virtual | 8 +-
core/sqf/sql/scripts/bats/runtmbats.virtual | 14 +-
core/sqf/sql/scripts/bats/sqconfig.tm | 4 +-
core/sqf/sql/scripts/build_apidocs.sh | 4 +-
core/sqf/sql/scripts/ckill | 4 +-
core/sqf/sql/scripts/ckillall | 4 +-
core/sqf/sql/scripts/cleanZKNodes | 2 +-
core/sqf/sql/scripts/cleanat | 2 +-
core/sqf/sql/scripts/cleanlogs | 16 +-
core/sqf/sql/scripts/cresumeall | 4 +-
core/sqf/sql/scripts/cstat | 2 +-
core/sqf/sql/scripts/csuspendall | 6 +-
core/sqf/sql/scripts/dbcheck | 12 +-
core/sqf/sql/scripts/genmon | 2 +-
core/sqf/sql/scripts/genms | 10 +-
core/sqf/sql/scripts/gensq.pl | 4 +-
core/sqf/sql/scripts/genstats.sh | 2 +-
core/sqf/sql/scripts/get_libhdfs_files | 6 +-
core/sqf/sql/scripts/ilh_cleanhb | 12 +-
core/sqf/sql/scripts/ilh_hbase_repair | 8 +-
core/sqf/sql/scripts/ilh_hbcheck | 4 +-
core/sqf/sql/scripts/ilh_traf_restart | 16 +-
core/sqf/sql/scripts/ilh_trafinit | 16 +-
core/sqf/sql/scripts/install_apache_hadoop | 52 +-
core/sqf/sql/scripts/install_local_drill | 16 +-
core/sqf/sql/scripts/install_local_hadoop | 26 +-
core/sqf/sql/scripts/install_traf_components | 81 +-
core/sqf/sql/scripts/krb5check | 4 +-
core/sqf/sql/scripts/krb5functions | 4 +-
core/sqf/sql/scripts/krb5service | 8 +-
core/sqf/sql/scripts/makemsg.ksh | 8 +-
core/sqf/sql/scripts/qmmstart | 2 +-
core/sqf/sql/scripts/rmscheck | 2 +-
core/sqf/sql/scripts/runbats | 24 +-
core/sqf/sql/scripts/sqcheck | 2 +-
core/sqf/sql/scripts/sqcheckmon | 2 +-
core/sqf/sql/scripts/sqcore | 14 +-
core/sqf/sql/scripts/sqcorefile | 6 +-
core/sqf/sql/scripts/sqgen | 62 +-
core/sqf/sql/scripts/sqnodeipcrm | 4 +-
core/sqf/sql/scripts/sqnodestatus | 4 +-
core/sqf/sql/scripts/sqsmdstats | 10 +-
core/sqf/sql/scripts/sqstart | 32 +-
core/sqf/sql/scripts/sqstop | 22 +-
core/sqf/sql/scripts/sqsystem.pm | 4 +-
core/sqf/sql/scripts/traf_authentication_config | 4 +-
core/sqf/sql/scripts/traf_authentication_setup | 36 +-
core/sqf/sql/scripts/trafnodestatus | 10 +-
core/sqf/sql/scripts/uninstall_traf_components | 22 +-
core/sqf/sql/scripts/update_hbase | 11 +-
core/sqf/sql/scripts/update_sql | 10 +-
core/sqf/sqvers | 20 +-
core/sqf/src/seabed/macros.gmk | 2 +-
core/sqf/src/seabed/src/env.cpp | 2 +-
core/sqf/src/seabed/src/util.cpp | 2 +-
core/sqf/src/seabed/test/go284j | 2 +-
core/sqf/src/seabed/test/go9 | 4 +-
core/sqf/src/seabed/test/goshell205 | 2 +-
core/sqf/src/seabed/test/gostart | 4 +-
core/sqf/src/seabed/test/t9thread.rh6.supp | 56 +-
core/sqf/src/seabed/test/tcheck.cpp | 2 +-
core/sqf/src/seabed/tools/sqmanvers | 2 +-
core/sqf/src/seabed/tools/sqmanvers.java | 2 +-
core/sqf/src/seatrans/hbase-trx/Makefile | 64 +-
core/sqf/src/seatrans/hbase-trx/genvers | 2 +-
core/sqf/src/seatrans/hbase-trx/pp.awk | 152 +-
.../transactional/TransactionManager.java | 14 +-
.../client/transactional/TransactionState.java | 24 +
.../transactional/CommitConflictException.java | 61 +
.../transactional/TrxRegionEndpoint.java.tmpl | 90 +-
.../transactional/TrxTransactionState.java.tmpl | 73 +-
core/sqf/src/seatrans/tm/hbasetmlib2/Makefile | 6 +-
.../seatrans/tm/hbasetmlib2/TMInterface.java | 2 +-
.../sqf/src/seatrans/tm/hbasetmlib2/hbasetm.cpp | 234 +-
core/sqf/src/seatrans/tm/hbasetmlib2/hbasetm.h | 2 +-
.../tm/hbasetmlib2/javaobjectinterfacetm.cpp | 156 +-
.../tm/hbasetmlib2/javaobjectinterfacetm.h | 16 +-
.../src/seatrans/tm/hbasetmlib2/pom.xml.apache | 4 +-
.../sqf/src/seatrans/tm/hbasetmlib2/pom.xml.hdp | 2 +-
.../java/org/trafodion/dtm/HBaseTxClient.java | 65 +-
.../dtm/TransactionManagerException.java | 70 +
.../sqf/src/seatrans/tm/hbasetmlib2/testrun.cpp | 6 +-
core/sqf/src/seatrans/tm/macros.gmk | 6 +-
core/sqf/src/tm/Makefile | 6 +-
core/sqf/src/tm/macros.gmk | 6 +-
core/sqf/src/tm/tmlib.cpp | 56 +-
core/sqf/src/tm/tmlib.h | 1 +
core/sqf/src/tm/tmlibmsg.h | 2 +
core/sqf/src/tm/tmrm.h | 2 +-
core/sqf/src/tm/tmrmhbase.cpp | 9 +-
core/sqf/src/tm/tmrmhbase.h | 2 +-
core/sqf/src/tm/tmrmtse.cpp | 2 +-
core/sqf/src/tm/tmrmtse.h | 2 +-
core/sqf/src/tm/tmtransaction.cpp | 9 +-
core/sqf/src/tm/tmtx.cpp | 2 +-
core/sqf/src/tm/tmtxbranches.cpp | 7 +-
core/sqf/src/tm/tmtxbranches.h | 2 +-
core/sqf/src/tm/tmxatxn.cpp | 2 +-
core/sqf/src/tm/tools/dtmci.cpp | 1 +
core/sqf/src/tm/tools/run_dtmci | 4 +-
core/sqf/sysinstall/etc/init.d/trafodion | 131 +
.../etc/security/limits.d/trafodion.conf | 25 +
core/sqf/sysinstall/etc/sudoers.d/trafodion | 35 +
core/sqf/sysinstall/home/trafodion/.bashrc | 69 +
core/sqf/tools/sqdiag_core_compare | 2 +-
core/sqf/tools/sqdiag_core_mask | 2 +-
core/sqf/tools/sqtools.sh | 116 +-
core/sql/SqlCompilerDebugger/cln.sh | 6 +-
core/sql/arkcmp/CmpErrLog.cpp | 6 +-
core/sql/arkcmp/CmpStatement.cpp | 46 +-
core/sql/arkcmp/CmpStatement.h | 7 +-
core/sql/arkcmp/CompException.cpp | 82 +-
core/sql/arkcmp/CompException.h | 25 +-
core/sql/bin/SqlciErrors.txt | 131 +-
core/sql/bin/clitest.cpp | 97 +-
core/sql/bin/ex_esp_main.cpp | 20 +-
core/sql/cli/Cli.cpp | 174 +-
core/sql/cli/Cli.h | 1 +
core/sql/cli/CliExtern.cpp | 2 +
core/sql/cli/Context.cpp | 9 -
core/sql/cli/Globals.cpp | 97 +-
core/sql/cli/Globals.h | 4 -
core/sql/cli/SessionDefaults.cpp | 2 +-
core/sql/cli/Statement.cpp | 123 -
core/sql/cli/Statement.h | 5 -
core/sql/cli/memorymonitor.cpp | 76 +-
core/sql/cli/memorymonitor.h | 18 +-
core/sql/cli/sqlcli.h | 23 +-
core/sql/clitest/blobtest.cpp | 108 +-
core/sql/clitest/blobtest.h | 3 +
core/sql/comexe/ComTdb.h | 3 +
core/sql/comexe/ComTdbExeUtil.cpp | 82 +-
core/sql/comexe/ComTdbExeUtil.h | 116 +-
core/sql/comexe/ComTdbHbaseAccess.cpp | 22 +-
core/sql/comexe/ComTdbHbaseAccess.h | 27 +-
core/sql/comexe/ComTdbHdfsScan.h | 2 +-
core/sql/comexe/ComTdbRoot.h | 3 +-
core/sql/comexe/ComTdbSort.h | 2 +-
core/sql/common/CharType.cpp | 2 +-
core/sql/common/ComJSON.cpp | 1175 +++++
core/sql/common/ComJSON.h | 159 +
core/sql/common/ComJSONFuncs.cpp | 793 ++++
core/sql/common/ComJSONStringInfo.cpp | 297 ++
core/sql/common/ComJSONStringInfo.h | 176 +
core/sql/common/ComMisc.cpp | 28 +-
core/sql/common/ComMisc.h | 2 +
core/sql/common/ComResWords.cpp | 1 -
core/sql/common/ComRtUtils.cpp | 2 +-
core/sql/common/ComSSL.cpp | 49 +
core/sql/common/ComSSL.h | 60 +
core/sql/common/ComSmallDefs.h | 29 +-
core/sql/common/ComUser.cpp | 27 +
core/sql/common/ComUser.h | 2 +
core/sql/common/ExprNode.cpp | 19 +-
core/sql/common/Ipc.cpp | 4 +-
core/sql/common/NAMemory.cpp | 2 +-
core/sql/common/NAString.cpp | 1 +
core/sql/common/OperTypeEnum.h | 10 +-
core/sql/common/sql_charset_strings.h | 2 +
core/sql/executor/ExComTdb.cpp | 7 +
core/sql/executor/ExExeUtil.h | 119 +-
core/sql/executor/ExExeUtilCli.cpp | 10 +-
core/sql/executor/ExExeUtilCli.h | 3 +-
core/sql/executor/ExExeUtilCommon.cpp | 28 +-
core/sql/executor/ExExeUtilGet.cpp | 964 ++--
core/sql/executor/ExExeUtilGetStats.cpp | 306 +-
core/sql/executor/ExExeUtilLoad.cpp | 784 +++-
core/sql/executor/ExHbaseAccess.cpp | 353 +-
core/sql/executor/ExHbaseAccess.h | 18 +-
core/sql/executor/ExHbaseIUD.cpp | 308 +-
core/sql/executor/ExHbaseSelect.cpp | 4 +-
core/sql/executor/ExHdfsScan.cpp | 171 +-
core/sql/executor/ExHdfsScan.h | 13 +-
core/sql/executor/ExSMTrace.cpp | 6 +-
core/sql/executor/ExStats.cpp | 3097 +++++--------
core/sql/executor/ExStats.h | 623 +--
core/sql/executor/HBaseClient_JNI.cpp | 50 +-
core/sql/executor/HBaseClient_JNI.h | 3 +-
core/sql/executor/HdfsLogger.h | 2 +-
core/sql/executor/JavaObjectInterface.cpp | 2 +-
core/sql/executor/ex_control.cpp | 8 +-
core/sql/executor/ex_exe_stmt_globals.h | 3 -
core/sql/executor/ex_frag_rt.cpp | 16 +-
core/sql/executor/ex_hash_grby.h | 3 -
core/sql/executor/ex_root.cpp | 38 -
core/sql/executor/ex_sort.cpp | 6 +
core/sql/executor/ex_transaction.cpp | 15 +-
core/sql/executor/hiveHook.cpp | 3 +-
core/sql/exp/ExpError.h | 4 +-
core/sql/exp/ExpErrorEnums.h | 25 +
core/sql/exp/ExpHbaseDefs.h | 2 +
core/sql/exp/ExpHbaseInterface.cpp | 16 +-
core/sql/exp/ExpHbaseInterface.h | 8 +-
core/sql/exp/ExpLOB.cpp | 94 +-
core/sql/exp/ExpLOB.h | 14 +-
core/sql/exp/ExpLOBaccess.cpp | 359 +-
core/sql/exp/ExpLOBaccess.h | 42 +-
core/sql/exp/ExpLOBenums.h | 2 +
core/sql/exp/ExpLOBexternal.h | 1 +
core/sql/exp/ExpLOBinterface.cpp | 6 +-
core/sql/exp/ExpLOBinterface.h | 3 +
core/sql/exp/ExpLOBprocess.cpp | 2 +-
core/sql/exp/ExpPackDefs.cpp | 15 +
core/sql/exp/exp_clause.cpp | 21 +
core/sql/exp/exp_clause.h | 5 +-
core/sql/exp/exp_datetime.cpp | 72 +-
core/sql/exp/exp_datetime.h | 21 +
core/sql/exp/exp_function.cpp | 297 +-
core/sql/exp/exp_function.h | 94 +
core/sql/exp/exp_math_func.cpp | 19 +-
core/sql/export/ComDiags.cpp | 6 +-
core/sql/export/ComDiags.h | 2 +-
core/sql/export/ExceptionCallBack.h | 6 +-
core/sql/export/NAAbort.cpp | 16 +-
core/sql/generator/GenExpGenerator.cpp | 161 +-
core/sql/generator/GenExpGenerator.h | 57 +-
core/sql/generator/GenItemFunc.cpp | 36 +-
core/sql/generator/GenKey.cpp | 140 +-
core/sql/generator/GenPreCode.cpp | 113 +-
core/sql/generator/GenRelExeUtil.cpp | 206 +-
core/sql/generator/GenRelMisc.cpp | 19 +-
core/sql/generator/GenRelScan.cpp | 273 +-
core/sql/generator/GenRelUpdate.cpp | 140 +-
core/sql/generator/GenShape.cpp | 4 +-
core/sql/generator/Generator.cpp | 1 +
core/sql/generator/LmExpr.cpp | 6 +-
core/sql/langman/LmLangManagerJava.cpp | 2 +-
core/sql/lib_mgmt/Makefile | 4 +-
core/sql/lib_mgmt/README.rst | 2 +-
core/sql/lib_mgmt/pom.xml | 2 +-
.../java/org/trafodion/libmgmt/FileMgmt.java | 2 +-
.../lib_mgmt/src/main/resources/init_libmgmt.sh | 2 +-
core/sql/nskgmake/Makerules.linux | 30 +-
core/sql/nskgmake/Makerules.mk | 10 +-
core/sql/nskgmake/cli/Makefile | 2 +-
core/sql/nskgmake/clitest/Makefile | 2 +-
core/sql/nskgmake/common/Makefile | 4 +
core/sql/nskgmake/tdm_sqlexp/Makefile | 14 +-
core/sql/optimizer/BindItemExpr.cpp | 195 +-
core/sql/optimizer/BindRelExpr.cpp | 395 +-
core/sql/optimizer/BindWA.h | 13 +-
core/sql/optimizer/ColStatDesc.cpp | 96 +
core/sql/optimizer/ColStatDesc.h | 25 +-
core/sql/optimizer/ImplRule.cpp | 30 +-
core/sql/optimizer/Inlining.cpp | 88 +-
core/sql/optimizer/ItemExpr.cpp | 45 +-
core/sql/optimizer/ItemFunc.h | 13 +-
core/sql/optimizer/NAColumn.h | 9 +-
core/sql/optimizer/NAFileSet.cpp | 7 +
core/sql/optimizer/NAFileSet.h | 2 +-
core/sql/optimizer/NATable.cpp | 154 +-
core/sql/optimizer/NATable.h | 22 +-
core/sql/optimizer/NormRelExpr.cpp | 529 ++-
core/sql/optimizer/ObjectNames.cpp | 10 +
core/sql/optimizer/ObjectNames.h | 3 +
core/sql/optimizer/OptLogRelExpr.cpp | 77 +-
core/sql/optimizer/OptPhysRelExpr.cpp | 13 +-
core/sql/optimizer/RETDesc.cpp | 44 +-
core/sql/optimizer/RelExeUtil.cpp | 174 +-
core/sql/optimizer/RelExeUtil.h | 84 +-
core/sql/optimizer/RelExpr.cpp | 430 +-
core/sql/optimizer/RelExpr.h | 16 +-
core/sql/optimizer/RelGrby.h | 5 +-
core/sql/optimizer/RelJoin.h | 7 +-
core/sql/optimizer/RelMisc.h | 188 +-
core/sql/optimizer/RelRoutine.cpp | 150 +-
core/sql/optimizer/RelRoutine.h | 77 +-
core/sql/optimizer/RelScan.h | 14 +-
core/sql/optimizer/RelSequence.cpp | 9 +-
core/sql/optimizer/RelSet.h | 5 +-
core/sql/optimizer/RelUpdate.h | 86 +-
core/sql/optimizer/SynthType.cpp | 140 +-
core/sql/optimizer/TransRule.cpp | 5 +-
core/sql/optimizer/UdfDllInteraction.cpp | 44 +-
core/sql/optimizer/VEGTable.cpp | 29 +-
core/sql/optimizer/ValueDesc.cpp | 8 +-
core/sql/optimizer/ValueDesc.h | 2 +-
core/sql/optimizer/costmethod.cpp | 4 +
core/sql/parser/BindStmtDDL.cpp | 4 +
core/sql/parser/ElemDDLConstraintPK.h | 37 +-
core/sql/parser/ElemDDLLikeOptions.cpp | 23 +
core/sql/parser/ElemDDLLikeOptions.h | 28 +
core/sql/parser/ElemDDLNode.cpp | 5 +
core/sql/parser/ElemDDLNode.h | 2 +
core/sql/parser/ElemDDLStoreOptions.cpp | 3 +-
core/sql/parser/ElemDDLStoreOptions.h | 14 +
core/sql/parser/ParDDLLikeOpts.cpp | 16 +
core/sql/parser/ParDDLLikeOptsCreateTable.h | 14 +-
core/sql/parser/ParKeyWords.cpp | 14 +-
core/sql/parser/SqlParserAux.cpp | 7 +-
core/sql/parser/SqlParserAux.h | 2 +
core/sql/parser/StmtDDLAlterTable.h | 18 +
core/sql/parser/StmtDDLCleanupObjects.h | 18 +
core/sql/parser/StmtDDLCreate.cpp | 7 +-
core/sql/parser/StmtDDLCreateTable.h | 42 +-
core/sql/parser/StmtDDLMisc.cpp | 4 +
core/sql/parser/sqlparser.y | 286 +-
core/sql/parser/ulexer.cpp | 7 +
core/sql/pom.xml | 7 +
core/sql/pom.xml.apache | 2 +-
core/sql/pom.xml.hdp | 2 +-
core/sql/qms/QmmQmm.cpp | 2 +-
core/sql/qmscommon/QRLogger.cpp | 6 +-
core/sql/qmscommon/QRLogger.h | 2 +-
core/sql/regress/compGeneral/DIFF042.KNOWN | 106 +-
core/sql/regress/compGeneral/EXPECTED005 | 54 +-
core/sql/regress/compGeneral/EXPECTED006.SB | 682 ++-
core/sql/regress/compGeneral/EXPECTED013.SB | 21 +-
core/sql/regress/compGeneral/EXPECTED042 | 785 ++--
core/sql/regress/compGeneral/EXPECTED045 | 91 +-
core/sql/regress/compGeneral/EXPECTED071 | 4 +-
core/sql/regress/compGeneral/FILTER042 | 6 +-
core/sql/regress/compGeneral/TEST006 | 115 +
core/sql/regress/compGeneral/TEST042 | 92 +-
core/sql/regress/compGeneral/TEST045 | 11 +
core/sql/regress/compGeneral/TEST071 | 4 +-
core/sql/regress/core/EXPECTED005.SB | 2 +-
core/sql/regress/core/EXPECTED061.SB | 10 +-
core/sql/regress/core/EXPECTED116 | 47 +-
core/sql/regress/core/EXPECTEDRTS | 2189 +++++----
core/sql/regress/core/FILTERRTS | 15 +-
core/sql/regress/core/TESTRTS | 11 +
core/sql/regress/executor/DIFF015.KNOWN | 24 +
core/sql/regress/executor/EXPECTED013.SB | 2 +-
core/sql/regress/executor/EXPECTED015.SB | 211 +-
core/sql/regress/executor/EXPECTED107 | 52 +
core/sql/regress/executor/EXPECTED130 | 316 +-
core/sql/regress/executor/EXPECTED140 | 75 +-
core/sql/regress/executor/FILTER140 | 1 +
core/sql/regress/executor/TEST015 | 77 +-
core/sql/regress/executor/TEST107 | 27 +
core/sql/regress/executor/TEST130 | 63 +-
core/sql/regress/executor/TEST130_argfile3 | 3 +
core/sql/regress/hive/EXPECTED005 | 149 +-
core/sql/regress/hive/EXPECTED007 | 373 ++
core/sql/regress/hive/EXPECTED009 | 62 +-
core/sql/regress/hive/EXPECTED015 | 254 +-
core/sql/regress/hive/EXPECTED018 | 522 ++-
core/sql/regress/hive/FILTER005 | 34 +
core/sql/regress/hive/FILTER015 | 3 +-
core/sql/regress/hive/FILTER018 | 3 +-
core/sql/regress/hive/TEST005 | 13 +
core/sql/regress/hive/TEST007 | 160 +
core/sql/regress/hive/TEST009 | 10 +-
core/sql/regress/newregr/mvqr/installMvqrSQ | 6 +-
core/sql/regress/newregr/mvqr/uninstallMvqrSQ | 2 +-
core/sql/regress/privs1/EXPECTED123 | 1187 +++++
core/sql/regress/privs1/EXPECTED141 | Bin 100853 -> 102260 bytes
core/sql/regress/privs1/TEST123 | 178 +
core/sql/regress/privs1/TEST141 | 10 +-
core/sql/regress/privs2/EXPECTED129 | 52 +-
core/sql/regress/privs2/EXPECTED138 | 6 +-
core/sql/regress/privs2/EXPECTED140 | 4 +-
core/sql/regress/privs2/EXPECTED144 | Bin 59408 -> 59453 bytes
core/sql/regress/privs2/FILTER144 | 31 +
core/sql/regress/qat/eqatdml12 | 36 +-
core/sql/regress/qat/eqatdml13 | 36 +-
core/sql/regress/seabase/DIFF025.KNOWN | 2 +-
core/sql/regress/seabase/EXPECTED012 | 22 +-
core/sql/regress/seabase/EXPECTED020 | 24 +-
core/sql/regress/seabase/EXPECTED022 | 872 +++-
core/sql/regress/seabase/EXPECTED027 | 2 +-
core/sql/regress/seabase/EXPECTED030 | 141 +-
core/sql/regress/seabase/EXPECTED032 | 17 +-
core/sql/regress/seabase/TEST022 | 284 +-
core/sql/regress/seabase/TEST030 | 28 +-
core/sql/regress/seabase/TEST032 | 4 +-
core/sql/regress/tools/dll-compile.ksh | 6 +-
core/sql/regress/tools/java-compile.ksh | 2 +-
core/sql/regress/tools/regress-filter-linux | 8 +-
core/sql/regress/tools/regrhadoop.ksh | 2 +-
core/sql/regress/tools/regrhbase.ksh | 2 +-
core/sql/regress/tools/regrhive.ksh | 2 +-
core/sql/regress/tools/runallsb | 8 +-
core/sql/regress/tools/runregr_compGeneral.ksh | 39 +-
core/sql/regress/tools/runregr_executor.ksh | 2 +-
core/sql/regress/tools/runregr_hive.ksh | 2 +-
core/sql/regress/tools/runregr_seabase.ksh | 2 +-
core/sql/regress/tools/runregr_udr.ksh | 4 +-
core/sql/regress/tools/setupenv | 4 +-
core/sql/regress/tools/setuplnxenv | 24 +-
core/sql/regress/udr/EXPECTED001 | 98 +-
core/sql/regress/udr/EXPECTED002 | 10 +-
core/sql/regress/udr/EXPECTED100.SB | 2 +-
core/sql/regress/udr/TEST001 | 31 +-
core/sql/regress/udr/TEST002 | 10 +-
core/sql/regress/udr/TEST107 | 4 +-
core/sql/regress/udr/TEST163 | 4 +-
core/sql/regress/udr/Utils.java | 4 +-
core/sql/regress/udr/tvudf.c | 2 +-
core/sql/runtimestats/SqlStats.cpp | 12 +
core/sql/runtimestats/SqlStats.h | 7 +-
core/sql/runtimestats/sscpipc.cpp | 12 +
core/sql/runtimestats/ssmpipc.cpp | 1 -
core/sql/smdio/CmUtil.cpp | 1 -
core/sql/sort/CommonStructs.h | 1 -
core/sql/sqlcat/TrafDDLdesc.h | 7 +-
core/sql/sqlcat/desc.h | 29 -
core/sql/sqlci/SqlCmd.cpp | 4 +
core/sql/sqlci/SqlciStats.cpp | 44 +-
core/sql/sqlci/sqlci_yacc.y | 57 +-
core/sql/sqlcomp/CmpDDLCatErrorCodes.h | 89 +-
core/sql/sqlcomp/CmpDescribe.cpp | 162 +-
core/sql/sqlcomp/CmpMain.cpp | 15 +
core/sql/sqlcomp/CmpSeabaseDDL.h | 40 +-
core/sql/sqlcomp/CmpSeabaseDDLauth.cpp | 103 +-
core/sql/sqlcomp/CmpSeabaseDDLauth.h | 1 +
core/sql/sqlcomp/CmpSeabaseDDLcleanup.cpp | 4 +-
core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp | 115 +-
core/sql/sqlcomp/CmpSeabaseDDLindex.cpp | 38 +-
core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp | 24 +-
core/sql/sqlcomp/CmpSeabaseDDLschema.cpp | 57 +-
core/sql/sqlcomp/CmpSeabaseDDLtable.cpp | 1911 ++++----
core/sql/sqlcomp/CmpSeabaseDDLupgrade.cpp | 7 +
core/sql/sqlcomp/CmpSeabaseDDLutil.cpp | 6 +-
core/sql/sqlcomp/CmpSeabaseDDLview.cpp | 273 +-
core/sql/sqlcomp/DefaultConstants.h | 24 +-
core/sql/sqlcomp/PrivMgr.cpp | 10 +-
core/sql/sqlcomp/PrivMgr.h | 5 +-
core/sql/sqlcomp/PrivMgrCommands.cpp | 65 +-
core/sql/sqlcomp/PrivMgrCommands.h | 6 +
core/sql/sqlcomp/PrivMgrPrivileges.cpp | 26 +-
core/sql/sqlcomp/PrivMgrPrivileges.h | 4 +-
core/sql/sqlcomp/PrivMgrRoles.cpp | 106 +-
core/sql/sqlcomp/nadefaults.cpp | 26 +-
core/sql/sqlmsg/GetErrorMessage.cpp | 2 +-
core/sql/sqlmxevents/logmxevent_traf.cpp | 150 +-
core/sql/sqlmxevents/logmxevent_traf.h | 7 +-
core/sql/sqludr/SqlUdrPredefLogReader.cpp | 4 +-
core/sql/sqludr/doxygen_tmudr.1.6.config | 2 +-
core/sql/sqludr/sqludr.cpp | 370 +-
core/sql/sqludr/sqludr.h | 20 +-
.../java/org/trafodion/sql/HBaseClient.java | 97 +-
.../main/java/org/trafodion/sql/HiveClient.java | 5 +-
.../org/trafodion/sql/TrafConfiguration.java | 2 +-
.../java/org/trafodion/sql/udr/ColumnInfo.java | 22 +-
.../sql/udr/ComparisonPredicateInfo.java | 15 +-
.../org/trafodion/sql/udr/ConstraintInfo.java | 13 +-
.../java/org/trafodion/sql/udr/OrderInfo.java | 4 +
.../trafodion/sql/udr/ParameterListInfo.java | 14 +-
.../org/trafodion/sql/udr/PartitionInfo.java | 6 +-
.../org/trafodion/sql/udr/PredicateInfo.java | 17 +-
.../sql/udr/TMUDRSerializableObject.java | 72 +-
.../java/org/trafodion/sql/udr/TableInfo.java | 14 +-
.../java/org/trafodion/sql/udr/TupleInfo.java | 256 +-
.../java/org/trafodion/sql/udr/TypeInfo.java | 117 +-
.../main/java/org/trafodion/sql/udr/UDR.java | 103 +-
.../trafodion/sql/udr/UDRInvocationInfo.java | 39 +-
.../java/org/trafodion/sql/udr/UDRPlanInfo.java | 38 +-
.../org/trafodion/sql/udr/predef/JDBCUDR.java | 6 +-
.../org/trafodion/sql/ustat/ChgAutoList.java | 2 +-
.../java/org/trafodion/sql/ustat/UstatUtil.java | 4 +-
core/sql/udrserv/UdrCfgParser.cpp | 2 +-
core/sql/udrserv/spinfoCallback.cpp | 2 +-
core/sql/udrserv/udrload.cpp | 2 +-
core/sql/udrserv/udrserv.cpp | 2 +-
core/sql/ustat/FillAutoTbl.sh | 4 +-
core/sql/ustat/RunLogUstats.sh | 2 +-
core/sql/ustat/StopAutoStats.sh | 2 +-
core/sql/ustat/USAS.sh | 16 +-
core/sql/ustat/hs_cli.cpp | 27 +-
core/sql/ustat/hs_cli.h | 3 +
core/sql/ustat/hs_const.h | 1 +
core/sql/ustat/hs_globals.cpp | 50 +-
core/sql/ustat/hs_la.cpp | 31 +-
core/sql/ustat/hs_la.h | 27 +-
core/sql/ustat/hs_log.cpp | 7 +-
core/sql/ustat/hs_parser.cpp | 13 +
core/sql/ustat/hs_util.cpp | 4 +-
core/sql/ustat/stats_profile | 8 +-
core/trafodion.spec | 29 +-
dcs/Makefile | 2 +-
dcs/bin/dcs | 12 +-
dcs/bin/dcs-config.sh | 6 +-
dcs/conf/dcs-env.sh | 14 +-
dcs/genvers | 2 +-
.../main/asciidoc/_chapters/configuration.adoc | 2 +-
.../asciidoc/_chapters/getting_started.adoc | 2 +-
.../org/trafodion/dcs/server/ServerManager.java | 2 +-
.../trafodion/dcs/servermt/ServerManager.java | 14 +-
.../org/trafodion/dcs/util/RetryCounter.java | 2 +-
.../org/trafodion/jdbc_test/TestNumeric.java | 114 +
dcs/src/test/odbc/README.txt | 47 +
dcs/src/test/odbc/build/Makefile | 43 +
dcs/src/test/odbc/build/odbc.vcxproj | 157 +
dcs/src/test/odbc/build/odbc.vcxproj.filters | 40 +
dcs/src/test/odbc/src/Main.cpp | 57 +
dcs/src/test/odbc/src/common/Global.cpp | 116 +
dcs/src/test/odbc/src/common/Global.h | 60 +
dcs/src/test/odbc/src/common/TestBase.cpp | 263 ++
dcs/src/test/odbc/src/common/TestBase.h | 55 +
.../src/test/varchar32k/LargeVarcharCol.cpp | 2639 +++++++++++
.../odbc/src/test/varchar32k/LargeVarcharCol.h | 52 +
.../src/asciidoc/_chapters/ddl_msgs.adoc | 628 +--
.../src/asciidoc/_chapters/executor_msgs.adoc | 15 +
.../src/asciidoc/_chapters/about.adoc | 2 +-
.../src/asciidoc/_chapters/activate.adoc | 4 +-
.../src/asciidoc/_chapters/ambari_install.adoc | 92 +
.../src/asciidoc/_chapters/enable_security.adoc | 20 +-
.../src/asciidoc/_chapters/introduction.adoc | 28 +-
.../src/asciidoc/_chapters/prepare.adoc | 136 +-
.../src/asciidoc/_chapters/quickstart.adoc | 8 +-
.../src/asciidoc/_chapters/recipe_install.adoc | 29 -
.../src/asciidoc/_chapters/recipe_upgrade.adoc | 30 -
.../src/asciidoc/_chapters/requirements.adoc | 159 +-
.../src/asciidoc/_chapters/script_install.adoc | 2 -
.../src/asciidoc/_chapters/script_remove.adoc | 2 +-
.../src/asciidoc/_chapters/script_upgrade.adoc | 6 +-
docs/provisioning_guide/src/asciidoc/index.adoc | 4 +-
.../sql_functions_and_expressions.adoc | 286 +-
.../_chapters/sql_language_elements.adoc | 134 +-
.../src/asciidoc/_chapters/sql_statements.adoc | 437 +-
docs/src/site/markdown/architecture-overview.md | 2 +-
docs/src/site/markdown/management.md | 6 +-
.../site/markdown/traf_authentication_config.md | 8 +-
install/.gitignore | 5 +
install/Makefile | 39 +-
install/README.md | 81 +
install/ambari-installer/Makefile | 87 +
install/ambari-installer/meta.template | 34 +
.../mpack-install/am_install.sh | 56 +
install/ambari-installer/mpack.json | 46 +
install/ambari-installer/repo.template | 24 +
.../TRAFODION/2.1/configuration/dcs-env.xml | 150 +
.../TRAFODION/2.1/configuration/dcs-log4j.xml | 107 +
.../TRAFODION/2.1/configuration/dcs-site.xml | 271 ++
.../TRAFODION/2.1/configuration/rest-site.xml | 157 +
.../2.1/configuration/traf-cluster-env.xml | 41 +
.../2.1/configuration/trafodion-env.xml | 252 +
.../common-services/TRAFODION/2.1/metainfo.xml | 165 +
.../TRAFODION/2.1/package/scripts/params.py | 95 +
.../2.1/package/scripts/status_params.py | 23 +
.../2.1/package/scripts/trafodiondcs.py | 60 +
.../2.1/package/scripts/trafodionmaster.py | 186 +
.../2.1/package/scripts/trafodionnode.py | 217 +
.../TRAFODION/2.1/role_command_order.json | 21 +
.../TRAFODION/2.1/service_advisor.py | 255 +
.../TRAFODION/2.1/themes/theme.json | 192 +
install/ambari-installer/traf_ambari.spec | 76 +
install/installer/addNode_step1 | 8 +-
install/installer/addNode_step2 | 28 +-
install/installer/bashrc_default | 7 +-
install/installer/dcs_installer | 47 +-
install/installer/rest_installer | 29 +-
install/installer/traf_add_kerberos | 2 +-
install/installer/traf_add_ldap | 16 +-
.../installer/traf_authentication_conf_default | 4 +-
install/installer/traf_cloudera_mods | 2 +-
install/installer/traf_config | 30 +-
install/installer/traf_config_check | 4 +-
install/installer/traf_config_setup | 12 +-
install/installer/traf_hortonworks_mods | 10 -
install/installer/traf_secure | 20 +-
install/installer/traf_sqgen | 10 +-
install/installer/traf_start | 18 +-
install/installer/trafodion_config_default | 2 +-
install/installer/trafodion_install | 6 +-
install/installer/trafodion_uninstaller | 8 +-
install/python-installer/README.md | 2 +-
install/python-installer/apache_mods.py | 72 -
install/python-installer/bashrc.template | 79 -
install/python-installer/common.py | 478 --
.../configs/db_config_default.ini | 128 +
.../python-installer/configs/default_ports.ini | 25 +
install/python-installer/configs/mod_cfgs.json | 59 +
install/python-installer/configs/prompt.json | 236 +
install/python-installer/configs/script.json | 87 +
install/python-installer/configs/version.json | 10 +
install/python-installer/copy_files.py | 64 -
install/python-installer/db_config_default | 120 -
install/python-installer/db_install.py | 138 +-
install/python-installer/db_uninstall.py | 114 +
install/python-installer/dcs_setup.py | 114 -
install/python-installer/discovery.py | 12 +-
install/python-installer/hadoop_mods.py | 203 -
install/python-installer/hdfs_cmds.py | 68 -
install/python-installer/mod_cfgs.json | 73 -
install/python-installer/prettytable.py | 1475 ++++++
install/python-installer/prompt.json | 227 -
install/python-installer/script.json | 87 -
install/python-installer/scripts/__init__.py | 0
install/python-installer/scripts/apache_mods.py | 72 +
install/python-installer/scripts/common.py | 534 +++
install/python-installer/scripts/copy_files.py | 76 +
install/python-installer/scripts/dcs_setup.py | 105 +
install/python-installer/scripts/hadoop_mods.py | 184 +
install/python-installer/scripts/hdfs_cmds.py | 68 +
.../scripts/httplib2/__init__.py | 1714 +++++++
.../scripts/httplib2/iri2uri.py | 132 +
.../python-installer/scripts/httplib2/socks.py | 438 ++
install/python-installer/scripts/traf_check.py | 87 +
install/python-installer/scripts/traf_dep.py | 106 +
.../python-installer/scripts/traf_discover.py | 269 ++
.../python-installer/scripts/traf_kerberos.py | 118 +
install/python-installer/scripts/traf_ldap.py | 72 +
.../python-installer/scripts/traf_package.py | 50 +
install/python-installer/scripts/traf_setup.py | 137 +
.../python-installer/scripts/traf_sqconfig.py | 77 +
install/python-installer/scripts/traf_start.py | 80 +
install/python-installer/scripts/traf_user.py | 158 +
install/python-installer/scripts/wrapper.py | 274 ++
.../traf_authentication_conf.template | 71 -
install/python-installer/traf_check.py | 87 -
install/python-installer/traf_dep.py | 110 -
install/python-installer/traf_discover.py | 253 -
install/python-installer/traf_kerberos.py | 116 -
install/python-installer/traf_ldap.py | 73 -
install/python-installer/traf_package.py | 47 -
install/python-installer/traf_setup.py | 125 -
install/python-installer/traf_sqconfig.py | 74 -
install/python-installer/traf_start.py | 70 -
install/python-installer/traf_user.py | 146 -
install/python-installer/version.json | 10 -
install/python-installer/wrapper.py | 301 --
licenses/Makefile | 7 +-
licenses/lic-pyinstall-src | 63 +
licenses/lic-server-src | 29 +-
tests/phx/README.rst | 4 +-
tests/phx/phoenix_test.py | 6 +-
tests/phx/pom.xml.template | 8 +-
win-odbc64/odbcclient/drvr35/cdesc.cpp | 25 +-
win-odbc64/odbcclient/drvr35/cdesc.h | 6 +-
win-odbc64/odbcclient/drvr35/cdiag.cpp | 12 +-
win-odbc64/odbcclient/drvr35/ctosqlconv.cpp | 43 +-
win-odbc64/odbcclient/drvr35/ctosqlconv.h | 2 +-
win-odbc64/odbcclient/drvr35/sqltocconv.cpp | 454 +-
wms/conf/wms-env.sh | 6 +-
917 files changed, 69954 insertions(+), 43839 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/145cd9b1/core/sqf/export/include/common/evl_sqlog_eventnum.h
----------------------------------------------------------------------
diff --cc core/sqf/export/include/common/evl_sqlog_eventnum.h
index f028ae5,6a91fea..8c17d24
--- a/core/sqf/export/include/common/evl_sqlog_eventnum.h
+++ b/core/sqf/export/include/common/evl_sqlog_eventnum.h
@@@ -842,10 -814,9 +842,12 @@@
#define MON_ZCLIENT_WATCHNODEDELETE_3 101371703
#define MON_ZCLIENT_ISZNODEEXPIRED_1 101371801
#define MON_ZCLIENT_ISZNODEEXPIRED_2 101371802
+ #define MON_ZCLIENT_CHECKMYZNODE_1 101371901
+ #define MON_ZCLIENT_CHECKMYZNODE_2 101371902
+/* Module: sqliteconfig.cxx = 90 */
+#define MON_DATABASE_ERROR 101900101
+
/**********************************************/
/*********** Seabed ***********/
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/145cd9b1/core/sqf/monitor/linux/makefile
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/145cd9b1/core/sqf/monitor/linux/monitor.cxx
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/145cd9b1/core/sqf/monitor/linux/monlogging.cxx
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/145cd9b1/core/sqf/monitor/linux/pnodeconfig.cxx
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/145cd9b1/core/sqf/monitor/linux/pnodeconfig.h
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/pnodeconfig.h
index 2bf7cc2,d239513..1916797
--- a/core/sqf/monitor/linux/pnodeconfig.h
+++ b/core/sqf/monitor/linux/pnodeconfig.h
@@@ -52,8 -38,13 +52,9 @@@ public
CPNodeConfigContainer( int pnodesConfigMax );
~CPNodeConfigContainer( void );
- CPNodeConfig *AddPNodeConfig( int pnid
- , char *name
- , int excludedFirstCore
- , int excludedLastCore
- , bool spare );
+ CPNodeConfig *AddPNodeConfig( pnodeConfigInfo_t &pnodeConfigInfo );
void Clear( void );
+ static int hostnamecmp(const char *p_str1, const char *p_str2);
void DeletePNodeConfig( CPNodeConfig *pnodeConfig );
inline CPNodeConfig *GetFirstPNodeConfig( void ) { return ( head_ ); }
inline int GetNextPNid( void ) { return ( nextPNid_ ); }
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/145cd9b1/core/sqf/monitor/linux/shell.cxx
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/145cd9b1/core/sqf/monitor/linux/zclient.cxx
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/145cd9b1/core/sqf/monitor/linux/zootest.cxx
----------------------------------------------------------------------
diff --cc core/sqf/monitor/linux/zootest.cxx
index 43cb4ff,68aaa91..7a4620b
--- a/core/sqf/monitor/linux/zootest.cxx
+++ b/core/sqf/monitor/linux/zootest.cxx
@@@ -52,10 -53,11 +53,10 @@@ int MyPid = -1
CZClient *ZClient = NULL;
CMonLog *MonLog = NULL;
-CMonLog *SnmpLog = NULL;
- void HandleZSessionExpiration( void )
+ void HandleMyNodeExpiration( void )
{
- const char method_name[] = "HandleZSessionExpiration";
+ const char method_name[] = "HandleMyNodeExpiration";
TRACE_ENTRY;
printf( "%s@%d ZSession expired!\n", method_name, __LINE__ );
ZClient->StopMonitoring();
[03/50] [abbrv] incubator-trafodion git commit: Merge branch
'TRAFODION-2001' of github.com:zcorrea/incubator-trafodion into
TRAFODION-2001
Posted by su...@apache.org.
Merge branch 'TRAFODION-2001' of github.com:zcorrea/incubator-trafodion into TRAFODION-2001
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/7c6002b3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/7c6002b3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/7c6002b3
Branch: refs/heads/master
Commit: 7c6002b3220e4e7af923806d7f0c9a45d92f5b8e
Parents: adbef87 71cbf8e
Author: Zalo Correa <za...@esgyn.com>
Authored: Wed Aug 10 18:08:56 2016 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Wed Aug 10 18:08:56 2016 -0700
----------------------------------------------------------------------
install/installer/addNode_step1 | 55 +++++++++++++++++++++++++++++--
install/installer/addNode_step2 | 32 ++++++++++++++----
install/installer/deleteNode | 20 +++++------
install/installer/traf_cloudera_mods | 2 +-
install/installer/traf_config_check | 2 +-
install/installer/traf_sqgen | 6 ++++
install/installer/trafodion_install | 19 ++++++++---
7 files changed, 110 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
[21/50] [abbrv] incubator-trafodion git commit: Re-enabled sqconfig
persist section generation.
Posted by su...@apache.org.
Re-enabled sqconfig persist section generation.
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/8fad692c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/8fad692c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/8fad692c
Branch: refs/heads/master
Commit: 8fad692c6b64b6673950d90f006fee8d64409cf8
Parents: 1315eaf
Author: Zalo Correa <za...@esgyn.com>
Authored: Mon Oct 17 11:42:26 2016 -0700
Committer: Zalo Correa <za...@esgyn.com>
Committed: Mon Oct 17 11:42:26 2016 -0700
----------------------------------------------------------------------
install/installer/traf_sqconfig | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fad692c/install/installer/traf_sqconfig
----------------------------------------------------------------------
diff --git a/install/installer/traf_sqconfig b/install/installer/traf_sqconfig
index 85f45b3..09fe04c 100755
--- a/install/installer/traf_sqconfig
+++ b/install/installer/traf_sqconfig
@@ -77,9 +77,11 @@ do
done
echo "end node" >> $sqconfig
-#Can be added back later
-##This sed is dependent on the nubmer of line in the Apahce copyright. If it get larger this needs to change.
-#sed '1,21d' $LOCAL_WORKDIR/sqconfig_persist.txt >> $sqconfig
+
+# The following sed is dependent on the nunber of lines in the copyright,
+# as they are excluded. If the copyright gets larger this needs to change.
+sed '1,20d' $LOCAL_WORKDIR/sqconfig_persist.txt >> $sqconfig
+
sudo cp $sqconfig $UNTAR_DIR
sudo cp $sqconfig $TRAF_USER_DIR/sqconfig
sudo chown $TRAF_USER.$TRAF_GROUP $TRAF_USER_DIR/sqconfig