trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lium...@apache.org
Subject [1/5] trafodion git commit: add command to dtmci
Date Tue, 07 Aug 2018 23:40:45 GMT
Repository: trafodion
Updated Branches:
  refs/heads/master 843e089c8 -> 45727da59


add command to dtmci


Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/a864ee1c
Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/a864ee1c
Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/a864ee1c

Branch: refs/heads/master
Commit: a864ee1c947182443ba370158529162628b46d76
Parents: b0fe804
Author: LiuMing <ovis_poly@sina.com>
Authored: Wed Aug 1 23:40:40 2018 +0800
Committer: LiuMing <ovis_poly@sina.com>
Committed: Wed Aug 1 23:40:40 2018 +0800

----------------------------------------------------------------------
 core/sqf/sql/scripts/stfscheck  | 37 ++++++++++++++++++++++++++++++++++++
 core/sqf/src/tm/tools/dtmci.cpp | 14 ++++++++++++++
 2 files changed, 51 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/a864ee1c/core/sqf/sql/scripts/stfscheck
----------------------------------------------------------------------
diff --git a/core/sqf/sql/scripts/stfscheck b/core/sqf/sql/scripts/stfscheck
new file mode 100755
index 0000000..e5ff0c0
--- /dev/null
+++ b/core/sqf/sql/scripts/stfscheck
@@ -0,0 +1,37 @@
+#!/bin/bash
+#
+# @@@ 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 @@@
+
+#this is to check the health of STFS
+
+#parse the ms.env
+
+stfspath=`dtmci showenv STFS_HDD_LOCATION`
+IFS=: declare -a DIRS=($stfspath) 
+for ELEM in "${DIRS[@]}"
+do
+  touch $ELEM/test1
+  if [ $? -ne 0 ]; then
+    return 1
+  fi
+  rm $ELEM/test1
+done

http://git-wip-us.apache.org/repos/asf/trafodion/blob/a864ee1c/core/sqf/src/tm/tools/dtmci.cpp
----------------------------------------------------------------------
diff --git a/core/sqf/src/tm/tools/dtmci.cpp b/core/sqf/src/tm/tools/dtmci.cpp
index 5d19734..26fee0e 100644
--- a/core/sqf/src/tm/tools/dtmci.cpp
+++ b/core/sqf/src/tm/tools/dtmci.cpp
@@ -1801,6 +1801,20 @@ int main(int argc, char *argv[])
                     << "' for status command." << endl;
             }
         }
+        else if (!strcmp(lp_nextcmd, "showenv"))
+        {
+           get_cmd(lp_inputstr, lp_nextcmd);
+           if (lp_nextcmd[0] == '\0')
+             cout <<"TODO: show all env var\n" << endl;
+           else
+           {
+              const char* v = ms_getenv_str((const char*)lp_nextcmd);
+              if(v == NULL)
+                cout <<"*** Enviorement Var not exist" << endl;
+              else
+                cout << v << endl;
+           }
+        }
         else if (!strcmp(lp_nextcmd, "transid"))
         {
            get_cmd(lp_inputstr, lp_nextcmd);


Mime
View raw message