You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by se...@apache.org on 2017/06/26 20:14:58 UTC
[1/6] incubator-trafodion git commit: [TRAFODION-2654] Change the
location of trafodion-site.xml from $TRAF_HOME/etc to config [TRAFODION-2653]
Sort operator loops at times
Repository: incubator-trafodion
Updated Branches:
refs/heads/master c7dfd5a2e -> 9ce0d8e4e
[TRAFODION-2654] Change the location of trafodion-site.xml from $TRAF_HOME/etc to config
[TRAFODION-2653] Sort operator loops at times
All HBase client connections from Trafodion uses Trafodion configuration
concept. Any client side property can now be set in trafodion-site.xml.
The scratch files are now open in blocking mode. Hence any scratch file
operation shouldn't return EAGAIN.
The internal table TDDL of table is now created without any table
coprocessors attached to it.
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/e4582909
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/e4582909
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/e4582909
Branch: refs/heads/master
Commit: e458290995e419361872822466bcf2acd568a9cc
Parents: 1083be3
Author: selvaganesang <se...@esgyn.com>
Authored: Fri May 26 22:27:54 2017 +0000
Committer: selvaganesang <se...@esgyn.com>
Committed: Fri Jun 23 00:49:42 2017 +0000
----------------------------------------------------------------------
core/sqf/conf/log4j.sql.config | 6 +-
core/sqf/conf/trafodion-site.xml | 38 ++++++++++
core/sqf/sql/scripts/install_local_hadoop | 8 --
core/sqf/sql/scripts/sqgen | 80 ++++++--------------
core/sqf/sql/scripts/trafodion-site.xml | 38 ----------
.../transactional/TrxRegionEndpoint.java.tmpl | 45 +++++++----
.../transactional/TrxTransactionState.java.tmpl | 1 -
.../java/org/trafodion/dtm/HBaseTxClient.java | 4 +-
.../main/java/org/trafodion/dtm/TrafInfo.java | 2 +-
core/sql/common/Ipc.h | 2 +-
core/sql/executor/ExExeUtil.h | 0
core/sql/executor/HBaseClient_JNI.cpp | 41 +++++++++-
core/sql/executor/HBaseClient_JNI.h | 4 +
core/sql/executor/ex_frag_rt.cpp | 7 +-
core/sql/exp/ExpHbaseInterface.cpp | 19 +++++
core/sql/exp/ExpHbaseInterface.h | 3 +-
core/sql/sort/scratchfile_sq.cpp | 1 -
core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp | 4 +-
.../java/org/trafodion/sql/HBaseClient.java | 25 +++++-
.../java/org/trafodion/sql/OrcFileReader.java | 25 +++++-
.../org/trafodion/sql/SequenceFileReader.java | 23 ++++--
.../org/trafodion/sql/SequenceFileWriter.java | 3 +-
.../org/trafodion/sql/TrafConfiguration.java | 61 ++++++++-------
.../java/org/trafodion/sql/TrafRegionStats.java | 12 ++-
24 files changed, 271 insertions(+), 181 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e4582909/core/sqf/conf/log4j.sql.config
----------------------------------------------------------------------
diff --git a/core/sqf/conf/log4j.sql.config b/core/sqf/conf/log4j.sql.config
index 6f010b2..2e780c2 100644
--- a/core/sqf/conf/log4j.sql.config
+++ b/core/sqf/conf/log4j.sql.config
@@ -45,7 +45,5 @@ log4j.appender.hbaseclient.MaxBackupIndex=20
# Custom Logging levels
-log4j.logger.org.apache.zookeeper=ERROR
-log4j.logger.org.apache.hadoop.hbase=ERROR
-log4j.logger.org.trafodion.sql=ERROR
-
+log4j.logger.org.apache=ERROR
+log4j.logger.org.trafodion.sql=INFO
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e4582909/core/sqf/conf/trafodion-site.xml
----------------------------------------------------------------------
diff --git a/core/sqf/conf/trafodion-site.xml b/core/sqf/conf/trafodion-site.xml
new file mode 100644
index 0000000..fc04716
--- /dev/null
+++ b/core/sqf/conf/trafodion-site.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+ <!--
+/**
+ * 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.
+ */
+-->
+
+<!-- Put Trafodion site-specific property overrides in this file. -->
+
+<configuration>
+ <property>
+ <name>hbase.coprocessor.region.classes</name>
+ <value>
+ org.apache.hadoop.hbase.coprocessor.transactional.TrxRegionObserver,
+ org.apache.hadoop.hbase.coprocessor.transactional.TrxRegionEndpoint,
+ org.apache.hadoop.hbase.coprocessor.AggregateImplementation
+ </value>
+ </property>
+ <property>
+ <name>hbase.client.scanner.timeout.period</name>
+ <value>3600000</value>
+ </property>
+</configuration>
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e4582909/core/sqf/sql/scripts/install_local_hadoop
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/install_local_hadoop b/core/sqf/sql/scripts/install_local_hadoop
index 0a42a60..fc3eed1 100755
--- a/core/sqf/sql/scripts/install_local_hadoop
+++ b/core/sqf/sql/scripts/install_local_hadoop
@@ -1627,16 +1627,8 @@ echo "$MY_LOCAL_SW_DIST/${HBASE_TAR}"
<name>hbase.snapshot.enabled</name>
<value>true</value>
</property>
- <property>
- <name>hbase.hregion.impl</name>
- <value>org.apache.hadoop.hbase.regionserver.transactional.TransactionalRegion</value>
- </property>
${HREGION_IMPL}
${MASTER_VISBILITY_COPROC}
- <property>
- <name>hbase.client.keyvalue.maxsize</name>
- <value>0</value>
- </property>
</configuration>
EOF
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e4582909/core/sqf/sql/scripts/sqgen
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/sqgen b/core/sqf/sql/scripts/sqgen
index f953717..ba48e74 100755
--- a/core/sqf/sql/scripts/sqgen
+++ b/core/sqf/sql/scripts/sqgen
@@ -28,10 +28,9 @@ function Usage {
echo
echo $script_name generates various Trafodion files in the $TRAF_HOME/sql/scripts directory.
echo
- echo "Usage: $script_name [ -? | -h ] [<sqconfig_filename>]"
- echo " -? Help"
+ echo "Usage: $script_name {-ft | -perf | [sqconfig_filename] | -h}"
echo " -h Help"
- 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,7 +74,6 @@ function GetSQcnfg {
FT_FLAG=1
PERF_FLAG=0
SQCONFIG_FILE=sqconfig
-SQCONFIG_DB_FILE=sqconfig.db
if [ -z $TRAF_HOME ]; then
echo
@@ -121,38 +119,15 @@ cd $TRAF_HOME/sql/scripts
# Check to make sure this is a real cluster
if [[ -n "$node_count" ]] && [[ "$node_count" -gt "1" ]]; then
- # The configuration database can only be created the first time.
- # Since nodes can be added and deleted through the 'shell node add/delete'
- # commands, the 'sqconfig' node section may not reflect the current node
- # configured. The 'sqregen' script can be used to update the SQCONFIG_FILE
- # node section to reflect the current node configuration stored in
- # the SQCONFIG_DB_FILE.
- echo "Checking for the configuration file ($SQCONFIG_DB_FILE)."
- if [ -f $SQCONFIG_DB_FILE ]; then
- echo
- echo "The configuration file ($SQCONFIG_DB_FILE) exists."
- echo "Use the 'sqshell node add/delete' commands to change the node membership in the configuration database."
- echo "Use the 'sqshell persist add/delete' commands to change the persist object configuration in the configuration database."
- echo "Use the 'sqregen -node' script to update the $SQCONFIG_FILE 'node' section with the"
- echo "current node membership in the configuration database."
- echo "Use the 'sqregen -persist' script to update the $SQCONFIG_FILE 'persist' section with the"
- echo "current persist configuration stored in the configuration database."
- exit 1
- fi
GetSQcnfg
+
else
- echo
- echo "Workstation environment - Not a clustered environment"
- if [ -f $SQCONFIG_DB_FILE ]; then
- echo
- echo "The configuration file ($SQCONFIG_DB_FILE) was previously created."
- echo "Removing and re-creating $SQCONFIG_DB_FILE!"
- rm -f $SQCONFIG_DB_FILE
- fi
+ echo "Workstation environment - Not a clustered environment"
fi
-# Assume option is SQCONFIG_FILE
+# -ft command line option indicates fault tolerance,
+# otherwise we assume option is SQCONFIG_FILE
while [ $# != 0 ]
do
flag="$1"
@@ -172,6 +147,7 @@ mkdir -p $MPI_TMPDIR
# mkdir a dir for CBF data used by SQL IUS feature
mkdir -p $HOME/cbfs
+#If pdsh exists
if [[ -n "$node_count" ]] && [[ "$node_count" -gt "1" ]]; then
echo
echo "Creating directories on cluster nodes"
@@ -191,6 +167,7 @@ if [[ -n "$node_count" ]] && [[ "$node_count" -gt "1" ]]; then
fi
SQSCRIPT_FILE=./gomon
+SQCLUSTERCONF_FILE=$MPI_TMPDIR/cluster.conf
SQESPENV_FILE=$TRAF_HOME/sql/scripts/tdm_arkesp.env
echo
@@ -204,34 +181,20 @@ else
./genms > $SQETC_DIR/ms.env
lv_retcode=$?
if [[ $lv_retcode != 0 ]]; then
- echo "Error $lv_retcode while executing genms. Exiting..."
- exit $lv_retcode
+ echo "Error $lv_retcode while executing genms. Exiting..."
+ exit $lv_retcode
fi
fi
./gensqstatem2lenv > $SQETC_DIR/sqstatem2l.env
-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
-sqlite3 -init createConfigDb $SQCONFIG_DB_FILE <<eof
+rm -f sqconfig.db
+sqlite3 -init createConfigDb sqconfig.db <<eof
.quit
eof
-./gensq.pl $SQSCRIPT_FILE `hostname` $FT_FLAG $PERF_FLAG $SQCONFIG_FILE $TRAF_HOME/sql/scripts/sqconfig.persist
+./gensq.pl $SQCONFIG_FILE $SQSCRIPT_FILE $SQCLUSTERCONF_FILE `hostname` $FT_FLAG $PERF_FLAG
sq_stat=$?
if [[ $sq_stat != 0 ]]; then
exit $sq_stat;
@@ -267,13 +230,16 @@ if [[ -n "$node_count" ]] && [[ "$node_count" -gt "1" ]]; then
echo
echo "Copying the generated files to all the nodes in the cluster"
echo
+ echo "Copying $SQCLUSTERCONF_FILE to $MPI_TMPDIR of all the nodes"
+ echo "$PDCP -w ${ExNodeList[@]} -x `uname -n` $SQCLUSTERCONF_FILE $MPI_TMPDIR"
+ $PDCP -w ${ExNodeList[@]} -x `uname -n` $SQCLUSTERCONF_FILE $MPI_TMPDIR
+
+
+ echo
echo "Copying $SQETC_DIR/ms.env to $SQETC_DIR of all the nodes"
echo "$PDCP -w ${ExNodeList[@]} -x `uname -n` $SQETC_DIR/ms.env $SQETC_DIR "
$PDCP -w ${ExNodeList[@]} -x `uname -n` $SQETC_DIR/ms.env $SQETC_DIR
- echo "Copying $SQETC_DIR/traf_coprocessor.properties to $SQETC_DIR of all the nodes"
- echo "$PDCP -w ${ExNodeList[@]} -x `uname -n` $SQETC_DIR/traf_coprocessor.properties $SQETC_DIR "
- $PDCP -w ${ExNodeList[@]} -x `uname -n` $SQETC_DIR/traf_coprocessor.properties $SQETC_DIR
echo
echo "Copying $SQETC_DIR/seamonster.env to $SQETC_DIR of all the nodes"
@@ -292,11 +258,11 @@ if [[ -n "$node_count" ]] && [[ "$node_count" -gt "1" ]]; then
echo
echo "Copying rest of the generated files to $PWD"
- echo "$PDCP -w ${ExNodeList[@]} -x `uname -n` sqconfig sqshell gomon.cold rmsstart rmsstop rmscheck.sql ssmpstart ssmpstop sscpstart sscpstop $PWD"
- $PDCP -w ${ExNodeList[@]} -x `uname -n` sqconfig sqshell gomon.cold rmsstart rmsstop rmscheck.sql ssmpstart ssmpstop sscpstart sscpstop $PWD
+ echo "$PDCP -w ${ExNodeList[@]} -x `uname -n` sqconfig sqshell gomon.cold gomon.warm rmsstart rmsstop rmscheck.sql ssmpstart ssmpstop sscpstart sscpstop $PWD"
+ $PDCP -w ${ExNodeList[@]} -x `uname -n` sqconfig sqshell gomon.cold gomon.warm rmsstart rmsstop rmscheck.sql ssmpstart ssmpstop sscpstart sscpstop $PWD
- echo "$PDCP -w ${ExNodeList[@]} -x `uname -n` $SQCONFIG_FILE $SQCONFIG_DB_FILE $PWD "
- $PDCP -w ${ExNodeList[@]} -x `uname -n` $SQCONFIG_FILE $SQCONFIG_DB_FILE $PWD
+ echo "$PDCP -w ${ExNodeList[@]} -x `uname -n` $SQCONFIG_FILE sqconfig.db $PWD "
+ $PDCP -w ${ExNodeList[@]} -x `uname -n` $SQCONFIG_FILE sqconfig.db $PWD
echo
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e4582909/core/sqf/sql/scripts/trafodion-site.xml
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/trafodion-site.xml b/core/sqf/sql/scripts/trafodion-site.xml
deleted file mode 100644
index fc04716..0000000
--- a/core/sqf/sql/scripts/trafodion-site.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
- <!--
-/**
- * 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.
- */
--->
-
-<!-- Put Trafodion site-specific property overrides in this file. -->
-
-<configuration>
- <property>
- <name>hbase.coprocessor.region.classes</name>
- <value>
- org.apache.hadoop.hbase.coprocessor.transactional.TrxRegionObserver,
- org.apache.hadoop.hbase.coprocessor.transactional.TrxRegionEndpoint,
- org.apache.hadoop.hbase.coprocessor.AggregateImplementation
- </value>
- </property>
- <property>
- <name>hbase.client.scanner.timeout.period</name>
- <value>3600000</value>
- </property>
-</configuration>
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e4582909/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java.tmpl
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java.tmpl b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java.tmpl
index 5a67afc..9baa5e7 100644
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java.tmpl
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java.tmpl
@@ -2802,7 +2802,7 @@ CoprocessorService, Coprocessor {
switch(regionState) {
case REGION_STATE_RECOVERING: // RECOVERING, already create a list of in-doubt txn, but still in the state of resolving them,
// retrieve all in-doubt txn from rmid and return them into a long a
- if (LOG.isInfoEnabled()) LOG.info("TRAF RCOV:recoveryRequest in region starting" + regionInfo.getEncodedName() + " has in-doubt transaction " + indoubtTransactionsById.size());
+ if (LOG.isInfoEnabled()) LOG.info("TRAF RCOV:recoveryRequest in region starting " + regionInfo.getEncodedName() + " has in-doubt transaction " + indoubtTransactionsById.size());
for (Entry<Long, List<WALEdit>> entry : indoubtTransactionsById.entrySet()) {
long tid = entry.getKey();
int nodeid = (int) TransactionState.getNodeId(tid);
@@ -4015,6 +4015,25 @@ CoprocessorService, Coprocessor {
if (LOG.isTraceEnabled()) LOG.trace("Trafodion Recovery: region " + m_regionDetails + " is STARTED.");
}
+ public static void WALSync(WAL wal, long transactionId, long txid) throws IOException
+ {
+ try {
+ if (txid == 0)
+ wal.sync();
+ else
+ wal.sync(txid);
+ } catch (IOException wale) {
+ wale.fillInStackTrace();
+ LOG.error("commitRequest txId: " + transactionId + " HLog seq " + txid + " Caught IOException in HLOG sync ", wale );
+ try {
+ Thread.sleep(1000); ///1000 milliseconds is one second.
+ } catch(InterruptedException ex) {
+ Thread.currentThread().interrupt();
+ }
+ throw wale;
+ }
+ }
+
/**
* Commits the transaction
* @param TrxTransactionState state
@@ -4435,7 +4454,7 @@ CoprocessorService, Coprocessor {
false,
null);
#endif
- this.tHLog.sync(txid);
+ WALSync(tHLog, transactionId, txid);
#ifdef CDH5.7 APACHE1.2
if (writeEntry != null) {
@@ -5507,7 +5526,7 @@ CoprocessorService, Coprocessor {
+ " HLog seq "
+ txid
);
- this.tHLog.sync(txid);
+ WALSync(tHLog, transactionId, txid);
#ifdef CDH5.7 APACHE1.2
if (writeEntry != null) {
this.t_Region.getMVCC().completeAndWait(writeEntry);
@@ -6020,6 +6039,7 @@ TrxTransactionState isTransactionOnCommittedList(final long transactionId)
else {
state.prepareEditSize = state.getEdit().getCells().size();
}
+
/*
ArrayList<Cell> wkvs = state.getEdit().getCells();
@@ -6036,7 +6056,6 @@ TrxTransactionState isTransactionOnCommittedList(final long transactionId)
#ifdef CDH5.7 APACHE1.2
txid = this.tHLog.append(this.m_Region.getTableDesc(), this.regionInfo, wk, state.getEdit(), false);
-
writeEntry = wk.getWriteEntry();
mvccNum = writeEntry.getWriteNumber();
@@ -6070,11 +6089,10 @@ TrxTransactionState isTransactionOnCommittedList(final long transactionId)
+ " flushHLOG: " + flushHLOG
);
#endif
- if (flushHLOG) this.tHLog.sync(txid);
+ if (flushHLOG) WALSync(tHLog, transactionId, txid);
}
else {
- //if (LOG.isDebugEnabled()) LOG.debug("YYY0 commitRequest just SYNC -- EXIT txId: " + transactionId + " MAX HLog seq " + state.getFlushTxId());
- if (flushHLOG) this.tHLog.sync(state.getFlushTxId());
+ if (flushHLOG) WALSync(tHLog, transactionId, state.getFlushTxId());
}
#ifdef CDH5.7 APACHE1.2
@@ -6092,7 +6110,8 @@ TrxTransactionState isTransactionOnCommittedList(final long transactionId)
//if (LOG.isTraceEnabled()) LOG.trace("TrxRegionEndpoint coprocessor:commitRequest COMMIT_OK -- EXIT txId: "
// + transactionId + " regionTx: " + state.getIsRegionTx() + " HLog seq " + txid);
} catch (IOException exp) {
- LOG.error("commitRequest txId: " + transactionId + " HLog seq " + txid + " Caught IOException in HLOG appendNoSync ", exp );
+ exp.fillInStackTrace();
+ LOG.error("commitRequest txId: " + transactionId + " HLog seq " + txid + " Caught IOException in HLOG operations", exp );
throw exp;
}
@@ -6362,7 +6381,7 @@ TrxTransactionState isTransactionOnCommittedList(final long transactionId)
false,
null);
#endif
- this.tHLog.sync(txid);
+ WALSync(tHLog, transactionId, txid);
#ifdef CDH5.7 APACHE1.2
if (writeEntry != null) {
@@ -6780,12 +6799,12 @@ TrxTransactionState isTransactionOnCommittedList(final long transactionId)
if (minStartSeqNumber == null) {
minStartSeqNumber = Long.MAX_VALUE;
}
-
+
synchronized (commitedTransactionsBySequenceNumber) {
choreCount++;
- try{
- this.tHLog.sync();
- }catch (IOException ioe){
+ try {
+ WALSync(tHLog, -1, 0);
+ } catch (IOException ioe) {
LOG.error("chore removeUnNeededCommitedTransactions Cleanup " + m_regionDetails + " exception: ", ioe);
}
if ((commitedTransactionsBySequenceNumber.size() != 0) && ((choreCount % 20) == 1)) {
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e4582909/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 899d491..131d1ee 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
@@ -1158,7 +1158,6 @@ public class TrxTransactionState extends TransactionState {
}
}
}
-
#ifdef CDH5.7 APACHE1.2
public Configuration getConfig() {
return config;
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e4582909/core/sqf/src/seatrans/tm/hbasetmlib2/src/main/java/org/trafodion/dtm/HBaseTxClient.java
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/tm/hbasetmlib2/src/main/java/org/trafodion/dtm/HBaseTxClient.java b/core/sqf/src/seatrans/tm/hbasetmlib2/src/main/java/org/trafodion/dtm/HBaseTxClient.java
index 21ca319..556faed 100644
--- a/core/sqf/src/seatrans/tm/hbasetmlib2/src/main/java/org/trafodion/dtm/HBaseTxClient.java
+++ b/core/sqf/src/seatrans/tm/hbasetmlib2/src/main/java/org/trafodion/dtm/HBaseTxClient.java
@@ -127,7 +127,7 @@ public class HBaseTxClient {
if (LOG.isDebugEnabled()) LOG.debug("Enter init, hBasePath:" + hBasePath);
if (LOG.isTraceEnabled()) LOG.trace("mapTransactionStates " + mapTransactionStates + " entries " + mapTransactionStates.size());
if (config == null) {
- config = TrafConfiguration.create();
+ config = TrafConfiguration.create(TrafConfiguration.HBASE_CONF);
connection = ConnectionFactory.createConnection(config);
}
config.set("hbase.zookeeper.quorum", zkServers);
@@ -206,7 +206,7 @@ public class HBaseTxClient {
setupLog4j();
if (LOG.isDebugEnabled()) LOG.debug("Enter init(" + dtmid + ")");
if (config == null) {
- config = TrafConfiguration.create();
+ config = TrafConfiguration.create(TrafConfiguration.HBASE_CONF);
connection = ConnectionFactory.createConnection(config);
}
config.set("hbase.hregion.impl", "org.apache.hadoop.hbase.regionserver.transactional.TransactionalRegion");
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e4582909/core/sqf/src/seatrans/tm/hbasetmlib2/src/main/java/org/trafodion/dtm/TrafInfo.java
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/tm/hbasetmlib2/src/main/java/org/trafodion/dtm/TrafInfo.java b/core/sqf/src/seatrans/tm/hbasetmlib2/src/main/java/org/trafodion/dtm/TrafInfo.java
index 495ad46..26371a4 100644
--- a/core/sqf/src/seatrans/tm/hbasetmlib2/src/main/java/org/trafodion/dtm/TrafInfo.java
+++ b/core/sqf/src/seatrans/tm/hbasetmlib2/src/main/java/org/trafodion/dtm/TrafInfo.java
@@ -50,7 +50,7 @@ public class TrafInfo {
}
public void init() throws IOException {
- this.config = TrafConfiguration.create();
+ this.config = TrafConfiguration.create(TrafConfiguration.HBASE_CONF);
this.connection = ConnectionFactory.createConnection(config);
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e4582909/core/sql/common/Ipc.h
----------------------------------------------------------------------
diff --git a/core/sql/common/Ipc.h b/core/sql/common/Ipc.h
index b048680..47df2db 100644
--- a/core/sql/common/Ipc.h
+++ b/core/sql/common/Ipc.h
@@ -3209,7 +3209,7 @@ private:
// we need to be able to send 2 messages simultaneously. There are two
// constants: an initial one to save resources, and a second one for
// large queries to keep the number of ESPs low. See logic on IpcEnvironment
-// constructor that allows these to be overridden with DEFINEs.
+// constructor that allows these to be overridden with environment variables.
const Int32 InitialNowaitRequestsPerEsp = 15;
const Int32 HighLoadNowaitRequestsPerEsp = 15;
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e4582909/core/sql/executor/ExExeUtil.h
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExeUtil.h b/core/sql/executor/ExExeUtil.h
old mode 100755
new mode 100644
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e4582909/core/sql/executor/HBaseClient_JNI.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/HBaseClient_JNI.cpp b/core/sql/executor/HBaseClient_JNI.cpp
index 9fde698..769b9d4 100644
--- a/core/sql/executor/HBaseClient_JNI.cpp
+++ b/core/sql/executor/HBaseClient_JNI.cpp
@@ -106,6 +106,11 @@ static const char* const hbcErrorEnumStr[] =
,"Java exception in deleteSnapshot()."
,"JNI NewStringUTF() in verifySnapshot()."
,"Java exception in verifySnapshot()."
+ ,"Preparing parameters for namespaceOperation()"
+ ,"Java exception or Error in namespaceOperation()"
+ ,"Namespace doesn't exist"
+ ,"Preparing parameters for truncate()."
+ ,"Java exception in truncate()."
};
//////////////////////////////////////////////////////////////////////////////
@@ -294,6 +299,8 @@ HBC_RetCode HBaseClient_JNI::init()
JavaMethods_[JM_HBC_DELETE_SNAPSHOT].jm_signature = "(Ljava/lang/String;)Z";
JavaMethods_[JM_HBC_VERIFY_SNAPSHOT].jm_name = "verifySnapshot";
JavaMethods_[JM_HBC_VERIFY_SNAPSHOT].jm_signature = "(Ljava/lang/String;Ljava/lang/String;)Z";
+ JavaMethods_[JM_TRUNCATE ].jm_name = "truncate";
+ JavaMethods_[JM_TRUNCATE ].jm_signature = "(Ljava/lang/String;ZJ)Z";
rc = (HBC_RetCode)JavaObjectInterface::init(className, javaClass_, JavaMethods_, (Int32)JM_LAST, javaMethodsInitialized_);
javaMethodsInitialized_ = TRUE;
pthread_mutex_unlock(&javaMethodsInitMutex_);
@@ -942,6 +949,38 @@ HBC_RetCode HBaseClient_JNI::registerTruncateOnAbort(const char* fileName, Int64
//////////////////////////////////////////////////////////////////////////////
//
//////////////////////////////////////////////////////////////////////////////
+HBC_RetCode HBaseClient_JNI::truncate(const char* fileName, NABoolean preserveSplits, Int64 transID)
+{
+ QRLogger::log(CAT_SQL_HBASE, LL_DEBUG, "HBaseClient_JNI::truncate(%s) called.", fileName);
+ if (initJNIEnv() != JOI_OK)
+ return HBC_ERROR_INIT_PARAM;
+
+ jstring js_fileName = jenv_->NewStringUTF(fileName);
+ if (js_fileName == NULL)
+ {
+ GetCliGlobals()->setJniErrorStr(getErrorText(HBC_ERROR_DROP_PARAM));
+ jenv_->PopLocalFrame(NULL);
+ return HBC_ERROR_TRUNCATE_PARAM;
+ }
+ jboolean j_preserveSplits = preserveSplits;
+ jlong j_tid = transID;
+ // boolean drop(java.lang.String);
+ tsRecentJMFromJNI = JavaMethods_[JM_TRUNCATE].jm_full_name;
+ jboolean jresult = jenv_->CallBooleanMethod(javaObj_, JavaMethods_[JM_TRUNCATE].methodID, js_fileName, j_preserveSplits, j_tid);
+
+ if (jenv_->ExceptionCheck())
+ {
+ getExceptionDetails(jenv_);
+ logError(CAT_SQL_HBASE, __FILE__, __LINE__);
+ logError(CAT_SQL_HBASE, "HBaseClient_JNI::drop()", getLastError());
+ jenv_->PopLocalFrame(NULL);
+ return HBC_ERROR_TRUNCATE_EXCEPTION;
+ }
+
+ jenv_->PopLocalFrame(NULL);
+ return HBC_OK;
+}
+
HBC_RetCode HBaseClient_JNI::drop(const char* fileName, JNIEnv* jenv, Int64 transID)
{
QRLogger::log(CAT_SQL_HBASE, LL_DEBUG, "HBaseClient_JNI::drop(%s) called.", fileName);
@@ -2530,7 +2569,7 @@ HBC_RetCode HBaseClient_JNI::insertRows(NAHeap *heap, const char *tableName,
htc->setHbaseStats(hbs);
}
if (initJNIEnv() != JOI_OK) {
- if (htc != NULL)
+ if (htc != NULL)
NADELETE(htc, HTableClient_JNI, heap);
return HBC_ERROR_INIT_PARAM;
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e4582909/core/sql/executor/HBaseClient_JNI.h
----------------------------------------------------------------------
diff --git a/core/sql/executor/HBaseClient_JNI.h b/core/sql/executor/HBaseClient_JNI.h
index 735cd09..2591ba6 100644
--- a/core/sql/executor/HBaseClient_JNI.h
+++ b/core/sql/executor/HBaseClient_JNI.h
@@ -405,6 +405,8 @@ typedef enum {
,HBC_ERROR_DELETE_SNAPSHOT_EXCEPTION
,HBC_ERROR_VERIFY_SNAPSHOT_PARAM
,HBC_ERROR_VERIFY_SNAPSHOT_EXCEPTION
+ ,HBC_ERROR_TRUNCATE_PARAM
+ ,HBC_ERROR_TRUNCATE_EXCEPTION
,HBC_LAST
} HBC_RetCode;
@@ -437,6 +439,7 @@ public:
int numSplits, int keyLength, const char** splitValues, Int64 transID, NABoolean isMVCC);
HBC_RetCode alter(const char* fileName, NAText* hbaseOptions, Int64 transID);
HBC_RetCode registerTruncateOnAbort(const char* fileName, Int64 transID);
+ HBC_RetCode truncate(const char* fileName, NABoolean preserveSplits, Int64 transID);
HBC_RetCode drop(const char* fileName, bool async, Int64 transID);
HBC_RetCode drop(const char* fileName, JNIEnv* jenv, Int64 transID); // thread specific
HBC_RetCode dropAll(const char* pattern, bool async, Int64 transID);
@@ -571,6 +574,7 @@ private:
,JM_HBC_CREATE_SNAPSHOT
,JM_HBC_DELETE_SNAPSHOT
,JM_HBC_VERIFY_SNAPSHOT
+ ,JM_TRUNCATE
,JM_LAST
};
static jclass javaClass_;
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e4582909/core/sql/executor/ex_frag_rt.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ex_frag_rt.cpp b/core/sql/executor/ex_frag_rt.cpp
index 45c1a29..9ea5cf9 100644
--- a/core/sql/executor/ex_frag_rt.cpp
+++ b/core/sql/executor/ex_frag_rt.cpp
@@ -241,9 +241,10 @@ void ExRtFragTable::setInactiveState()
numRootRequests_--;
}
+#define MAX_NUM_FRAGMENTS_PER_ESP 6
// multi fragment esp - begin
static NABoolean sv_esp_multi_fragment = TRUE;
-static UInt8 sv_esp_num_fragments = 3;
+static UInt8 sv_esp_num_fragments = MAX_NUM_FRAGMENTS_PER_ESP;
static UInt16 sv_esp_multi_fragment_vm = 4000;
static NABoolean sv_esp_fragment_quotas = TRUE;
static char *sv_envvar_esp_multi_fragment = 0;
@@ -283,10 +284,10 @@ getAssignedEspEnvVar()
sv_esp_multi_fragment = TRUE;
}
if (sv_esp_fragment_quotas == TRUE)
- sv_esp_num_fragments = 6;
+ sv_esp_num_fragments = MAX_NUM_FRAGMENTS_PER_ESP;
if (sv_envvar_esp_num_fragments) {
lv_i = atoi(sv_envvar_esp_num_fragments);
- if (lv_i > 0 && lv_i <=6) {
+ if (lv_i > 0 && lv_i <= MAX_NUM_FRAGMENTS_PER_ESP) {
sv_esp_num_fragments = (UInt8)lv_i;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e4582909/core/sql/exp/ExpHbaseInterface.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpHbaseInterface.cpp b/core/sql/exp/ExpHbaseInterface.cpp
index 85b0160..248e089 100644
--- a/core/sql/exp/ExpHbaseInterface.cpp
+++ b/core/sql/exp/ExpHbaseInterface.cpp
@@ -496,6 +496,25 @@ Lng32 ExpHbaseInterface_JNI::registerTruncateOnAbort(HbaseStr &tblName, NABoolea
return -HBASE_DROP_ERROR;
}
+Lng32 ExpHbaseInterface_JNI::truncate(HbaseStr &tblName, NABoolean preserveSplits, NABoolean useHbaseXn)
+{
+ Int64 transID;
+ if (useHbaseXn)
+ transID = 0;
+ else
+ transID = getTransactionIDFromContext();
+
+ if (client_ == NULL)
+ {
+ if (init(hbs_) != HBASE_ACCESS_SUCCESS)
+ return -HBASE_ACCESS_ERROR;
+ }
+ retCode_ = client_->truncate(tblName.val, preserveSplits, transID);
+ if (retCode_ == HBC_OK)
+ return HBASE_ACCESS_SUCCESS;
+ else
+ return -HBASE_DROP_ERROR;
+}
//----------------------------------------------------------------------------
Lng32 ExpHbaseInterface_JNI::drop(HbaseStr &tblName, NABoolean async, NABoolean useHbaseXn)
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e4582909/core/sql/exp/ExpHbaseInterface.h
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpHbaseInterface.h b/core/sql/exp/ExpHbaseInterface.h
index db0bb14..5f44e9c 100644
--- a/core/sql/exp/ExpHbaseInterface.h
+++ b/core/sql/exp/ExpHbaseInterface.h
@@ -111,6 +111,7 @@ class ExpHbaseInterface : public NABasicObject
// during create, we delay and retry for a fixed number of times since that table
// may still be dropped by the worked thread.
virtual Lng32 drop(HbaseStr &tblName, NABoolean async, NABoolean useHbaseXn) = 0;
+ virtual Lng32 truncate(HbaseStr &tblName, NABoolean preserveSplits, NABoolean useHbaseXn) = 0;
// drops all objects from hbase that match the pattern
virtual Lng32 dropAll(const char * pattern, NABoolean async, NABoolean useHbaseXn) = 0;
@@ -436,7 +437,7 @@ class ExpHbaseInterface_JNI : public ExpHbaseInterface
NABoolean useHbaseXn);
virtual Lng32 registerTruncateOnAbort(HbaseStr &tblName, NABoolean useHbaseXn);
-
+ virtual Lng32 truncate(HbaseStr &tblName, NABoolean preserveSplits, NABoolean useHbaseXn);
virtual Lng32 drop(HbaseStr &tblName, NABoolean async, NABoolean useHbaseXn);
virtual Lng32 dropAll(const char * pattern, NABoolean async, NABoolean useHbaseXn);
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e4582909/core/sql/sort/scratchfile_sq.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sort/scratchfile_sq.cpp b/core/sql/sort/scratchfile_sq.cpp
index 6decaad..87f1083 100644
--- a/core/sql/sort/scratchfile_sq.cpp
+++ b/core/sql/sort/scratchfile_sq.cpp
@@ -175,7 +175,6 @@ SQScratchFile::SQScratchFile(ScratchSpace *scratchSpace,
//other flags
flags |= O_APPEND;
- flags |= O_NONBLOCK;
flags |= O_NOATIME;
//O_DIRECT is ON by default. User has to explicitly define
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e4582909/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
index 398bcb2..38399ca 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
@@ -7251,9 +7251,7 @@ void CmpSeabaseDDL::initSeabaseMD(NABoolean ddlXns, NABoolean minimal)
tddlTable.len = tddlNAS.length();
if (ehi->exists(tddlTable) == -1) // exists
{
- dropHbaseTable(ehi, &tddlTable, FALSE, FALSE);
- createHbaseTable(ehi, &tddlTable, "tddlcf",
- NULL, 0, 0, NULL, FALSE, FALSE);
+ ehi->truncate(tddlTable, TRUE, TRUE);
}
// create hbase physical objects
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e4582909/core/sql/src/main/java/org/trafodion/sql/HBaseClient.java
----------------------------------------------------------------------
diff --git a/core/sql/src/main/java/org/trafodion/sql/HBaseClient.java b/core/sql/src/main/java/org/trafodion/sql/HBaseClient.java
index 474b09e..d015baf 100644
--- a/core/sql/src/main/java/org/trafodion/sql/HBaseClient.java
+++ b/core/sql/src/main/java/org/trafodion/sql/HBaseClient.java
@@ -162,7 +162,7 @@ public class HBaseClient {
confFile = System.getenv("TRAF_HOME") + "/conf/log4j.sql.config";
}
PropertyConfigurator.configure(confFile);
- config = TrafConfiguration.create();
+ config = TrafConfiguration.create(TrafConfiguration.HBASE_CONF);
}
@@ -191,7 +191,7 @@ public class HBaseClient {
}
}
}
-
+
public boolean create(String tblName, Object[] colFamNameList,
boolean isMVCC)
throws IOException, MasterNotRunningException {
@@ -644,6 +644,25 @@ public class HBaseClient {
return true;
}
+ public boolean truncate(String tblName, boolean preserveSplits, long transID)
+ throws MasterNotRunningException, IOException {
+ if (logger.isDebugEnabled()) logger.debug("HBaseClient.truncate(" + tblName + ") called.");
+ Admin admin = getConnection().getAdmin();
+ try {
+ if (transID != 0) {
+ throw new IOException("Unsupported : Hbase truncate within a transaction");
+ }
+ else {
+ TableName tableName = TableName.valueOf(tblName);
+ admin.truncateTable(tableName, preserveSplits);
+ }
+ } finally {
+ admin.close();
+ }
+ return true;
+ }
+
+
public boolean drop(String tblName, long transID)
throws MasterNotRunningException, IOException {
if (logger.isDebugEnabled()) logger.debug("HBaseClient.drop(" + tblName + ") called.");
@@ -740,7 +759,7 @@ public class HBaseClient {
switch (clusterStatsState) {
case 1: // open
{
- rsc = new TrafRegionStats();
+ rsc = new TrafRegionStats(getConnection());
rsc.Open();
regionInfo = new byte[MAX_REGION_INFO_ROWS][];
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e4582909/core/sql/src/main/java/org/trafodion/sql/OrcFileReader.java
----------------------------------------------------------------------
diff --git a/core/sql/src/main/java/org/trafodion/sql/OrcFileReader.java b/core/sql/src/main/java/org/trafodion/sql/OrcFileReader.java
index f3c09c5..c0ee050 100644
--- a/core/sql/src/main/java/org/trafodion/sql/OrcFileReader.java
+++ b/core/sql/src/main/java/org/trafodion/sql/OrcFileReader.java
@@ -28,15 +28,37 @@ import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import org.apache.hadoop.conf.Configuration;
+import org.trafodion.sql.TrafConfiguration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hive.serde2.objectinspector.*;
import org.apache.hadoop.hive.ql.io.orc.*;
+import org.apache.log4j.PropertyConfigurator;
+import org.apache.log4j.Logger;
+
public class OrcFileReader
{
- Configuration m_conf;
+ static Logger logger = Logger.getLogger(OrcFileReader.class.getName());;
+ static Configuration m_conf;
+
+ static {
+
+ /*
+ The following code takes care of initializing log4j for the org.trafodion.sql package
+ (in case of an ESP, e.g.) when the class:org.trafodion.sql.HBaseClient (which initializes log4j
+ for the org.trafodion.sql package) hasn't been loaded.
+ */
+ String confFile = System.getProperty("trafodion.log4j.configFile");
+ if (confFile == null) {
+ System.setProperty("trafodion.sql.log", System.getenv("TRAF_HOME") + "/logs/trafodion.sql.java.log");
+ confFile = System.getenv("TRAF_HOME") + "/conf/log4j.sql.config";
+ }
+ PropertyConfigurator.configure(confFile);
+ m_conf = TrafConfiguration.create(TrafConfiguration.HDFS_CONF);
+ }
+
Path m_file_path;
Reader m_reader;
@@ -59,7 +81,6 @@ public class OrcRowReturnSQL
OrcFileReader() {
- m_conf = new Configuration();
rowData = new OrcRowReturnSQL(); //TEMP: was in fetch
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e4582909/core/sql/src/main/java/org/trafodion/sql/SequenceFileReader.java
----------------------------------------------------------------------
diff --git a/core/sql/src/main/java/org/trafodion/sql/SequenceFileReader.java b/core/sql/src/main/java/org/trafodion/sql/SequenceFileReader.java
index 2547af0..364ad19 100644
--- a/core/sql/src/main/java/org/trafodion/sql/SequenceFileReader.java
+++ b/core/sql/src/main/java/org/trafodion/sql/SequenceFileReader.java
@@ -29,7 +29,9 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
+import org.apache.log4j.PropertyConfigurator;
import org.apache.hadoop.conf.Configuration;
+import org.trafodion.sql.TrafConfiguration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IOUtils;
import org.apache.hadoop.io.SequenceFile;
@@ -45,20 +47,27 @@ import org.apache.hadoop.util.ReflectionUtils;
public class SequenceFileReader {
- Configuration conf = null; // File system configuration
+ static Configuration conf = null; // File system configuration
SequenceFile.Reader reader = null; // The HDFS SequenceFile reader object.
Writable key = null;
Writable row = null;
// LazySimpleSerDe serde = null;
boolean isEOF = false;
String lastError = null;
+ static {
+ String confFile = System.getProperty("trafodion.log4j.configFile");
+ if (confFile == null) {
+ System.setProperty("trafodion.sql.log", System.getenv("TRAF_HOME") + "/logs/trafodion.sql.java.log");
+ confFile = System.getenv("TRAF_HOME") + "/conf/log4j.sql.config";
+ }
+ PropertyConfigurator.configure(confFile);
+ conf = TrafConfiguration.create(TrafConfiguration.HDFS_CONF);
+ }
- /**
- * Class Constructor
- */
- SequenceFileReader() {
- conf = new Configuration();
- conf.set("fs.hdfs.impl","org.apache.hadoop.hdfs.DistributedFileSystem");
+ /**
+ * Class Constructor
+ */
+ SequenceFileReader() {
}
String getLastError() {
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e4582909/core/sql/src/main/java/org/trafodion/sql/SequenceFileWriter.java
----------------------------------------------------------------------
diff --git a/core/sql/src/main/java/org/trafodion/sql/SequenceFileWriter.java b/core/sql/src/main/java/org/trafodion/sql/SequenceFileWriter.java
index e1ee33c..2007005 100644
--- a/core/sql/src/main/java/org/trafodion/sql/SequenceFileWriter.java
+++ b/core/sql/src/main/java/org/trafodion/sql/SequenceFileWriter.java
@@ -28,6 +28,7 @@ import java.io.IOException;
import java.io.OutputStream;
import org.apache.hadoop.conf.Configuration;
+import org.trafodion.sql.TrafConfiguration;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.FileStatus;
@@ -83,7 +84,7 @@ public class SequenceFileWriter {
* Class Constructor
*/
static {
- conf = new Configuration(true);
+ conf = TrafConfiguration.create(TrafConfiguration.HDFS_CONF);
}
SequenceFileWriter() throws IOException
{
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e4582909/core/sql/src/main/java/org/trafodion/sql/TrafConfiguration.java
----------------------------------------------------------------------
diff --git a/core/sql/src/main/java/org/trafodion/sql/TrafConfiguration.java b/core/sql/src/main/java/org/trafodion/sql/TrafConfiguration.java
index 52599c3..5e67a65 100644
--- a/core/sql/src/main/java/org/trafodion/sql/TrafConfiguration.java
+++ b/core/sql/src/main/java/org/trafodion/sql/TrafConfiguration.java
@@ -27,44 +27,51 @@ import java.util.Map;
/**
* Adds Trafodion configuration files to a Configuration
*/
-public class TrafConfiguration extends HBaseConfiguration {
+public class TrafConfiguration {
static Logger logger = Logger.getLogger(TrafConfiguration.class.getName());
+ public static final int HBASE_CONF = 1;
+ public static final int HDFS_CONF = 2;
- public static Configuration addTrafResources(Configuration conf) {
+ public static Configuration addTrafResources(int config, Configuration conf) {
Configuration lv_conf = new Configuration();
- String trafSiteXml = new String(System.getenv("TRAF_HOME") + "/etc/trafodion-site.xml");
- Path fileRes = new Path(trafSiteXml);
- lv_conf.addResource(fileRes);
- Iterator<Map.Entry<String,String>> iter = lv_conf.iterator();
- String key;
- while (iter.hasNext()) {
- Map.Entry<String,String> entry = iter.next();
- key = entry.getKey();
- if (key.startsWith("trafodion."))
- key = key.substring(10); // 10 - length of trafodion.
- conf.set(key, entry.getValue());
+ switch (config) {
+ case HBASE_CONF:
+ String trafSiteXml = new String(System.getenv("TRAF_HOME") + "/conf/trafodion-site.xml");
+ Path fileRes = new Path(trafSiteXml);
+ lv_conf.addResource(fileRes);
+ Iterator<Map.Entry<String,String>> iter = lv_conf.iterator();
+ String key;
+ while (iter.hasNext()) {
+ Map.Entry<String,String> entry = iter.next();
+ key = entry.getKey();
+ if (key.startsWith("trafodion."))
+ key = key.substring(10); // 10 - length of trafodion.
+ conf.set(key, entry.getValue());
+ }
+ break;
+ default:
+ break;
}
return conf;
}
/**
* Creates a Configuration with Trafodion resources
- * @return a Configuration with Trafodion and HBase resources
+ * @return a Configuration with Trafodion and HBase/HDFS resources
*/
- public static Configuration create() {
- Configuration conf = HBaseConfiguration.create();
- return addTrafResources(conf);
- }
- /**
- * @param that Configuration to clone.
- * @return a Configuration created with the trafodion-site.xml files plus
- * the given configuration.
- */
- public static Configuration create(final Configuration that) {
- Configuration conf = create();
- merge(conf, that);
- return conf;
+ public static Configuration create(int config) {
+ Configuration conf = null;
+ switch (config) {
+ case HBASE_CONF:
+ conf = HBaseConfiguration.create();
+ break;
+ case HDFS_CONF:
+ default:
+ conf = new Configuration();
+ break;
+ }
+ return addTrafResources(config, conf);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/e4582909/core/sql/src/main/java/org/trafodion/sql/TrafRegionStats.java
----------------------------------------------------------------------
diff --git a/core/sql/src/main/java/org/trafodion/sql/TrafRegionStats.java b/core/sql/src/main/java/org/trafodion/sql/TrafRegionStats.java
index 42a9fba..aabdab2 100644
--- a/core/sql/src/main/java/org/trafodion/sql/TrafRegionStats.java
+++ b/core/sql/src/main/java/org/trafodion/sql/TrafRegionStats.java
@@ -32,7 +32,7 @@ import org.apache.hadoop.hbase.ServerName;
import org.apache.hadoop.hbase.client.Admin;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.HBaseAdmin;
-import org.trafodion.sql.TrafConfiguration;
+import org.apache.hadoop.hbase.client.Connection;
import java.io.IOException;
import java.util.Arrays;
@@ -62,7 +62,7 @@ class SizeInfo {
public class TrafRegionStats {
- private HBaseAdmin hbAdmin;
+ private Admin hbAdmin;
private ClusterStatus clusterStatus;
private Collection<ServerName> servers;
private ServerName server;
@@ -72,6 +72,7 @@ public class TrafRegionStats {
private boolean firstTime;
final long megaByte = 1024L * 1024L;
+
private final Map<byte[], SizeInfo> sizeInfoMap =
new TreeMap<byte[], SizeInfo>(Bytes.BYTES_COMPARATOR);
@@ -157,14 +158,11 @@ public class TrafRegionStats {
}
- public TrafRegionStats () throws IOException {
- Configuration config = TrafConfiguration.create();
-
- hbAdmin = new HBaseAdmin(config);
+ public TrafRegionStats (Connection connection) throws IOException {
+ hbAdmin = connection.getAdmin();
}
public boolean Open () throws IOException {
-
clusterStatus = hbAdmin.getClusterStatus();
servers = clusterStatus.getServers();
iterServer = servers.iterator();
[3/6] incubator-trafodion git commit: Fix in the commit e458290
Posted by se...@apache.org.
Fix in the commit e458290
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/8994faab
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/8994faab
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/8994faab
Branch: refs/heads/master
Commit: 8994faabb23963efa6e00ad482bdcdb5aa0975f7
Parents: d8e86dd
Author: selvaganesang <se...@esgyn.com>
Authored: Fri Jun 23 01:03:07 2017 +0000
Committer: selvaganesang <se...@esgyn.com>
Committed: Fri Jun 23 01:03:07 2017 +0000
----------------------------------------------------------------------
core/sql/executor/HBaseClient_JNI.cpp | 3 ---
1 file changed, 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8994faab/core/sql/executor/HBaseClient_JNI.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/HBaseClient_JNI.cpp b/core/sql/executor/HBaseClient_JNI.cpp
index 9e7c8c1..424bf34 100644
--- a/core/sql/executor/HBaseClient_JNI.cpp
+++ b/core/sql/executor/HBaseClient_JNI.cpp
@@ -106,9 +106,6 @@ static const char* const hbcErrorEnumStr[] =
,"Java exception in deleteSnapshot()."
,"JNI NewStringUTF() in verifySnapshot()."
,"Java exception in verifySnapshot()."
- ,"Preparing parameters for namespaceOperation()"
- ,"Java exception or Error in namespaceOperation()"
- ,"Namespace doesn't exist"
,"Preparing parameters for truncate()."
,"Java exception in truncate()."
};
[2/6] incubator-trafodion git commit: Merge branch 'master' of
git://git.apache.org/incubator-trafodion into trafodion-2654
Posted by se...@apache.org.
Merge branch 'master' of git://git.apache.org/incubator-trafodion into trafodion-2654
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/d8e86ddd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/d8e86ddd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/d8e86ddd
Branch: refs/heads/master
Commit: d8e86dddb79b159f4f3f0697f8edc7a27f23e843
Parents: e458290 8eacf5b
Author: selvaganesang <se...@esgyn.com>
Authored: Fri Jun 23 01:02:30 2017 +0000
Committer: selvaganesang <se...@esgyn.com>
Committed: Fri Jun 23 01:02:30 2017 +0000
----------------------------------------------------------------------
.../jdbc_type2/native/SQLMXCommonFunctions.cpp | 130 +-
.../org/apache/trafodion/jdbc/t2/SQLMXDesc.java | 19 +
core/conn/odb/src/odb.c | 38 +-
.../odbc/odbcclient/unixcli/cli/cdesc.cpp | 3 +-
.../odbc/odbcclient/unixcli/cli/cstmt.cpp | 1 +
.../odbc/odbcclient/unixcli/cli/ctosqlconv.cpp | 165 +-
.../odbc/odbcclient/unixcli/cli/sqltocconv.cpp | 123 +-
.../export/include/common/evl_sqlog_eventnum.h | 47 +-
core/sqf/monitor/linux/clusterconf.cxx | 14 +-
core/sqf/monitor/linux/clusterconf.h | 49 +-
core/sqf/monitor/linux/makefile | 49 +-
core/sqf/monitor/linux/montrace.cxx | 92 +-
core/sqf/monitor/linux/montrace.h | 30 +-
core/sqf/monitor/linux/persistconfig.cxx | 69 +
core/sqf/monitor/linux/persistconfig.h | 11 +
core/sqf/monitor/linux/pnode.cxx | 5 +-
core/sqf/monitor/linux/pnode.h | 2 +-
core/sqf/monitor/linux/pstartd.cxx | 51 +-
core/sqf/monitor/linux/pstartd.h | 2 +-
core/sqf/monitor/linux/reqqueue.cxx | 15 -
core/sqf/monitor/linux/shell.cxx | 126 +-
core/sqf/monitor/linux/sqliteconfig.cxx | 3383 -----------------
core/sqf/monitor/linux/sqliteconfig.h | 133 -
core/sqf/monitor/linux/tcdb.cxx | 478 +++
core/sqf/monitor/linux/tcdb.h | 117 +
core/sqf/monitor/linux/tcdbsqlite.cxx | 3398 ++++++++++++++++++
core/sqf/monitor/linux/tcdbsqlite.h | 130 +
core/sqf/monitor/linux/tcdbstore.cxx | 55 +
core/sqf/monitor/linux/tcdbstore.h | 113 +
core/sqf/monitor/linux/tcdbzstore.cxx | 2192 +++++++++++
core/sqf/monitor/linux/tcdbzstore.h | 130 +
core/sqf/monitor/linux/tclog.cxx | 121 +
core/sqf/monitor/linux/tclog.h | 46 +
core/sqf/monitor/linux/tctrace.cxx | 360 ++
core/sqf/monitor/linux/tctrace.h | 103 +
core/sqf/monitor/linux/testconf.cxx | 8 +-
core/sqf/monitor/linux/trafconf.cxx | 31 +-
core/sqf/monitor/linux/trafconfig.cxx | 218 +-
core/sqf/monitor/linux/trafconfig.h | 23 +-
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/type2str.cxx | 63 +
core/sqf/monitor/linux/type2str.h | 34 +
core/sqf/monitor/linux/watchdog.cxx | 2 +-
core/sqf/monitor/linux/zclient.cxx | 114 +-
core/sqf/sqenvcom.sh | 6 +
core/sqf/sql/scripts/createConfigDb | 4 +-
core/sqf/sql/scripts/gensq.pl | 52 +
core/sqf/sql/scripts/sqconfig | 20 +
core/sqf/sql/scripts/sqconfig.persist | 8 +
core/sqf/sql/scripts/sqconfig.sample | 20 +
core/sqf/sql/scripts/sqpersist.pm | 30 +-
core/sql/arkcmp/CmpContext.cpp | 2 +
core/sql/arkcmp/CmpContext.h | 7 +
core/sql/cli/Context.h | 3 +
core/sql/comexe/ComTdbExeUtil.h | 1 +
core/sql/executor/ExExeUtilGet.cpp | 38 +-
core/sql/executor/HBaseClient_JNI.cpp | 10 +
core/sql/export/NAStringDef.cpp | 14 +
core/sql/export/NAStringDef.h | 8 +-
core/sql/generator/GenPreCode.cpp | 10 +-
core/sql/generator/GenRelExeUtil.cpp | 3 +-
core/sql/optimizer/HDFSHook.cpp | 61 +-
core/sql/optimizer/HDFSHook.h | 78 +-
core/sql/optimizer/NAClusterInfo.cpp | 265 +-
core/sql/optimizer/NAClusterInfo.h | 12 +-
core/sql/optimizer/NATable.cpp | 108 +-
core/sql/optimizer/NodeMap.cpp | 12 +-
core/sql/optimizer/ObjectNames.cpp | 17 +
core/sql/optimizer/ObjectNames.h | 6 +-
core/sql/optimizer/OptPhysRelExpr.cpp | 2 +-
core/sql/optimizer/OptimizerSimulator.cpp | 2322 ++++++++----
core/sql/optimizer/OptimizerSimulator.h | 257 +-
core/sql/optimizer/RelExeUtil.cpp | 29 +-
core/sql/optimizer/RelExeUtil.h | 258 +-
core/sql/optimizer/ScanOptimizer.cpp | 22 +-
core/sql/optimizer/ScmCostMethod.cpp | 2 +-
core/sql/optimizer/SynthType.cpp | 11 +-
core/sql/parser/BindStmtDDL.cpp | 10 +
core/sql/parser/sqlparser.y | 237 +-
core/sql/regress/hive/EXPECTED007 | 68 +
core/sql/regress/hive/TEST007 | 16 +
core/sql/sqlcomp/CmpDescribe.cpp | 40 +-
core/sql/sqlcomp/CmpSeabaseDDL.h | 6 +-
core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp | 6 +-
core/sql/sqlcomp/CmpSeabaseDDLindex.cpp | 8 -
core/sql/sqlcomp/CmpSeabaseDDLschema.cpp | 61 +-
core/sql/sqlcomp/CmpSeabaseDDLtable.cpp | 34 +-
core/sql/sqlcomp/DefaultConstants.h | 3 +
core/sql/sqlcomp/nadefaults.cpp | 23 +-
core/sql/sqlcomp/parser.cpp | 3 +-
.../main/java/org/trafodion/sql/HiveClient.java | 9 +-
.../src/asciidoc/_chapters/introduction.adoc | 1 +
.../_chapters/sql_language_elements.adoc | 144 +-
win-odbc64/odbcclient/drvr35/cdesc.cpp | 3 +-
win-odbc64/odbcclient/drvr35/cstmt.cpp | 1 +
win-odbc64/odbcclient/drvr35/ctosqlconv.cpp | 161 +-
win-odbc64/odbcclient/drvr35/sqltocconv.cpp | 131 +-
win-odbc64/sql/cli/sqlcli.h | 8 +
101 files changed, 11538 insertions(+), 6043 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/d8e86ddd/core/sql/executor/HBaseClient_JNI.cpp
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/d8e86ddd/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
----------------------------------------------------------------------
[5/6] incubator-trafodion git commit: Removed the inadverent change
made in sqgen from the commit e45829
Posted by se...@apache.org.
Removed the inadverent change made in sqgen from the commit e45829
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/21c5e5e5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/21c5e5e5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/21c5e5e5
Branch: refs/heads/master
Commit: 21c5e5e52738c6abe89ea4f4fce9432e2d0e9075
Parents: 72638ed
Author: selvaganesang <se...@esgyn.com>
Authored: Fri Jun 23 14:59:12 2017 +0000
Committer: selvaganesang <se...@esgyn.com>
Committed: Fri Jun 23 14:59:12 2017 +0000
----------------------------------------------------------------------
core/sqf/sql/scripts/sqgen | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/21c5e5e5/core/sqf/sql/scripts/sqgen
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/sqgen b/core/sqf/sql/scripts/sqgen
index 8ef1c59..1ee8f17 100755
--- a/core/sqf/sql/scripts/sqgen
+++ b/core/sqf/sql/scripts/sqgen
@@ -211,8 +211,7 @@ fi
./gensqstatem2lenv > $SQETC_DIR/sqstatem2l.env
# Create configuration database tables
-rm -f sqconfig.db
-sqlite3 -init createConfigDb sqconfig.db <<eof
+sqlite3 -init createConfigDb $SQCONFIG_DB_FILE <<eof
.quit
eof
[6/6] incubator-trafodion git commit: Merge PR 1143 Fix for
[TRAFODION-2654] and [TRAFODION-2653]
Posted by se...@apache.org.
Merge PR 1143 Fix for [TRAFODION-2654] and [TRAFODION-2653]
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/9ce0d8e4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/9ce0d8e4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/9ce0d8e4
Branch: refs/heads/master
Commit: 9ce0d8e4e938ef2cd02fdd67ffffc59fc3dbc011
Parents: c7dfd5a 21c5e5e
Author: selvaganesang <se...@apache.org>
Authored: Mon Jun 26 20:13:20 2017 +0000
Committer: selvaganesang <se...@apache.org>
Committed: Mon Jun 26 20:13:20 2017 +0000
----------------------------------------------------------------------
core/sqf/conf/log4j.sql.config | 6 +-
core/sqf/conf/trafodion-site.xml | 38 +++++++++
core/sqf/sql/scripts/install_local_hadoop | 8 --
core/sqf/sql/scripts/sqgen | 84 ++++++++------------
core/sqf/sql/scripts/trafodion-site.xml | 38 ---------
.../transactional/TrxRegionEndpoint.java.tmpl | 45 ++++++++---
.../transactional/TrxTransactionState.java.tmpl | 1 -
.../java/org/trafodion/dtm/HBaseTxClient.java | 4 +-
.../main/java/org/trafodion/dtm/TrafInfo.java | 2 +-
core/sql/common/Ipc.h | 2 +-
core/sql/executor/ExExeUtil.h | 0
core/sql/executor/HBaseClient_JNI.cpp | 38 ++++++++-
core/sql/executor/HBaseClient_JNI.h | 4 +
core/sql/executor/ex_frag_rt.cpp | 7 +-
core/sql/exp/ExpHbaseInterface.cpp | 19 +++++
core/sql/exp/ExpHbaseInterface.h | 3 +-
core/sql/sort/scratchfile_sq.cpp | 1 -
core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp | 4 +-
.../java/org/trafodion/sql/HBaseClient.java | 25 +++++-
.../java/org/trafodion/sql/OrcFileReader.java | 25 +++++-
.../org/trafodion/sql/SequenceFileReader.java | 23 ++++--
.../org/trafodion/sql/SequenceFileWriter.java | 3 +-
.../org/trafodion/sql/TrafConfiguration.java | 61 +++++++-------
.../java/org/trafodion/sql/TrafRegionStats.java | 12 ++-
24 files changed, 278 insertions(+), 175 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9ce0d8e4/core/sql/executor/ExExeUtil.h
----------------------------------------------------------------------
diff --cc core/sql/executor/ExExeUtil.h
index 1567d35,6a86996..1567d35
mode 100755,100644..100644
--- a/core/sql/executor/ExExeUtil.h
+++ b/core/sql/executor/ExExeUtil.h
[4/6] incubator-trafodion git commit: Reverted the changes made by
sqgen in commit e4582909
Posted by se...@apache.org.
Reverted the changes made by sqgen in commit e4582909
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/72638ed9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/72638ed9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/72638ed9
Branch: refs/heads/master
Commit: 72638ed938460eacad8278f0c4bdf980a00fd180
Parents: 8994faa
Author: selvaganesang <se...@esgyn.com>
Authored: Fri Jun 23 14:10:06 2017 +0000
Committer: selvaganesang <se...@esgyn.com>
Committed: Fri Jun 23 14:10:06 2017 +0000
----------------------------------------------------------------------
core/sqf/sql/scripts/sqgen | 45 ++++++++++++++++++++++++++++-------------
1 file changed, 31 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/72638ed9/core/sqf/sql/scripts/sqgen
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/sqgen b/core/sqf/sql/scripts/sqgen
index ba48e74..8ef1c59 100755
--- a/core/sqf/sql/scripts/sqgen
+++ b/core/sqf/sql/scripts/sqgen
@@ -74,6 +74,7 @@ function GetSQcnfg {
FT_FLAG=1
PERF_FLAG=0
SQCONFIG_FILE=sqconfig
+SQCONFIG_DB_FILE=sqconfig.db
if [ -z $TRAF_HOME ]; then
echo
@@ -119,15 +120,38 @@ cd $TRAF_HOME/sql/scripts
# Check to make sure this is a real cluster
if [[ -n "$node_count" ]] && [[ "$node_count" -gt "1" ]]; then
-
+ # The configuration database can only be created the first time.
+ # Since nodes can be added and deleted through the 'shell node add/delete'
+ # commands, the 'sqconfig' node section may not reflect the current node
+ # configured. The 'sqregen' script can be used to update the SQCONFIG_FILE
+ # node section to reflect the current node configuration stored in
+ # the SQCONFIG_DB_FILE.
+ echo "Checking for the configuration file ($SQCONFIG_DB_FILE)."
+ if [ -f $SQCONFIG_DB_FILE ]; then
+ echo
+ echo "The configuration file ($SQCONFIG_DB_FILE) exists."
+ echo "Use the 'sqshell node add/delete' commands to change the node membership in the configuration database."
+ echo "Use the 'sqshell persist add/delete' commands to change the persist object configuration in the configuration database."
+ echo "Use the 'sqregen -node' script to update the $SQCONFIG_FILE 'node' section with the"
+ echo "current node membership in the configuration database."
+ echo "Use the 'sqregen -persist' script to update the $SQCONFIG_FILE 'persist' section with the"
+ echo "current persist configuration stored in the configuration database."
+ exit 1
+ fi
GetSQcnfg
else
- echo "Workstation environment - Not a clustered environment"
+ echo
+ echo "Workstation environment - Not a clustered environment"
+ if [ -f $SQCONFIG_DB_FILE ]; then
+ echo
+ echo "The configuration file ($SQCONFIG_DB_FILE) was previously created."
+ echo "Removing and re-creating $SQCONFIG_DB_FILE!"
+ rm -f $SQCONFIG_DB_FILE
+ fi
fi
-# -ft command line option indicates fault tolerance,
-# otherwise we assume option is SQCONFIG_FILE
+# assume option is SQCONFIG_FILE
while [ $# != 0 ]
do
flag="$1"
@@ -147,7 +171,6 @@ mkdir -p $MPI_TMPDIR
# mkdir a dir for CBF data used by SQL IUS feature
mkdir -p $HOME/cbfs
-#If pdsh exists
if [[ -n "$node_count" ]] && [[ "$node_count" -gt "1" ]]; then
echo
echo "Creating directories on cluster nodes"
@@ -167,7 +190,6 @@ if [[ -n "$node_count" ]] && [[ "$node_count" -gt "1" ]]; then
fi
SQSCRIPT_FILE=./gomon
-SQCLUSTERCONF_FILE=$MPI_TMPDIR/cluster.conf
SQESPENV_FILE=$TRAF_HOME/sql/scripts/tdm_arkesp.env
echo
@@ -194,7 +216,7 @@ sqlite3 -init createConfigDb sqconfig.db <<eof
.quit
eof
-./gensq.pl $SQCONFIG_FILE $SQSCRIPT_FILE $SQCLUSTERCONF_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;
@@ -230,17 +252,12 @@ if [[ -n "$node_count" ]] && [[ "$node_count" -gt "1" ]]; then
echo
echo "Copying the generated files to all the nodes in the cluster"
echo
- echo "Copying $SQCLUSTERCONF_FILE to $MPI_TMPDIR of all the nodes"
- echo "$PDCP -w ${ExNodeList[@]} -x `uname -n` $SQCLUSTERCONF_FILE $MPI_TMPDIR"
- $PDCP -w ${ExNodeList[@]} -x `uname -n` $SQCLUSTERCONF_FILE $MPI_TMPDIR
-
echo
echo "Copying $SQETC_DIR/ms.env to $SQETC_DIR of all the nodes"
echo "$PDCP -w ${ExNodeList[@]} -x `uname -n` $SQETC_DIR/ms.env $SQETC_DIR "
$PDCP -w ${ExNodeList[@]} -x `uname -n` $SQETC_DIR/ms.env $SQETC_DIR
-
echo
echo "Copying $SQETC_DIR/seamonster.env to $SQETC_DIR of all the nodes"
echo "$PDCP -w ${ExNodeList[@]} -x `uname -n` $SQETC_DIR/seamonster.env $SQETC_DIR "
@@ -261,8 +278,8 @@ if [[ -n "$node_count" ]] && [[ "$node_count" -gt "1" ]]; then
echo "$PDCP -w ${ExNodeList[@]} -x `uname -n` sqconfig sqshell gomon.cold gomon.warm rmsstart rmsstop rmscheck.sql ssmpstart ssmpstop sscpstart sscpstop $PWD"
$PDCP -w ${ExNodeList[@]} -x `uname -n` sqconfig sqshell gomon.cold gomon.warm rmsstart rmsstop rmscheck.sql ssmpstart ssmpstop sscpstart sscpstop $PWD
- echo "$PDCP -w ${ExNodeList[@]} -x `uname -n` $SQCONFIG_FILE sqconfig.db $PWD "
- $PDCP -w ${ExNodeList[@]} -x `uname -n` $SQCONFIG_FILE sqconfig.db $PWD
+ echo "$PDCP -w ${ExNodeList[@]} -x `uname -n` $SQCONFIG_FILE $SQCONFIG_DB_FILE $PWD "
+ $PDCP -w ${ExNodeList[@]} -x `uname -n` $SQCONFIG_FILE $SQCONFIG_DB_FILE $PWD
echo