You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hawq.apache.org by rl...@apache.org on 2016/08/26 01:46:27 UTC

incubator-hawq git commit: HAWQ-1009 Remove requirement of environment value MASTER_DATA_DIRECTORY

Repository: incubator-hawq
Updated Branches:
  refs/heads/master 1923e03e6 -> 2c1710cee


HAWQ-1009  Remove requirement of environment value MASTER_DATA_DIRECTORY


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/2c1710ce
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/2c1710ce
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/2c1710ce

Branch: refs/heads/master
Commit: 2c1710cee35ba97a9d7278f428dd06d566baf269
Parents: 1923e03
Author: rlei <rl...@pivotal.io>
Authored: Thu Aug 25 17:13:36 2016 +0800
Committer: rlei <rl...@pivotal.io>
Committed: Fri Aug 26 09:44:49 2016 +0800

----------------------------------------------------------------------
 tools/bin/gplogfilter                     | 7 ++++---
 tools/bin/gppylib/operations/filespace.py | 4 ++--
 tools/doc/gplogfilter_help                | 8 ++++----
 3 files changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2c1710ce/tools/bin/gplogfilter
----------------------------------------------------------------------
diff --git a/tools/bin/gplogfilter b/tools/bin/gplogfilter
index fb55c86..682f2b0 100755
--- a/tools/bin/gplogfilter
+++ b/tools/bin/gplogfilter
@@ -39,6 +39,7 @@ try:
     from gppylib.datetimeutils import str_to_datetime, str_to_duration, DatetimeValueError
     from gppylib.logfilter import *
     from gppylib.gpcoverage import GpCoverage
+    from gppylib.commands import gp
 except ImportError, e:    
     sys.exit('ERROR: Cannot import modules.  Please check that you have sourced greenplum_path.sh.  Detail: ' + str(e))
 
@@ -84,7 +85,7 @@ file(s) or standard output.
 
 _help = ["""
 If no input file is specified, the value of the MASTER_DATA_DIRECTORY
-environment variable is used, if defined.  If an input file is a
+is used.  If an input file is a
 directory, the suffix ".log" is appended to obtain the input file name.
 To read from standard input, specify input file "-".
 ""","""
@@ -380,9 +381,9 @@ if (options.zip is None and
     options.zip = '9'
 
 try:
-    # If no inputfile arg, try MASTER_DATA_DIRECTORY environment variable
+    # If no inputfile arg, use MASTER_DATA_DIRECTORY variable as default
     if len(args) == 0:
-        s = os.getenv('MASTER_DATA_DIRECTORY')
+        s = gp.get_masterdatadir()
         if s:
             #we only support log rotation in pg_log dir.
             if os.path.exists(s + "/pg_log"):

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2c1710ce/tools/bin/gppylib/operations/filespace.py
----------------------------------------------------------------------
diff --git a/tools/bin/gppylib/operations/filespace.py b/tools/bin/gppylib/operations/filespace.py
index c4c0d3b..bc21c31 100644
--- a/tools/bin/gppylib/operations/filespace.py
+++ b/tools/bin/gppylib/operations/filespace.py
@@ -27,7 +27,7 @@ import urlparse
 from gppylib.db import dbconn, catalog
 from gppylib.db.dbconn import UnexpectedRowsError, executeUpdateOrInsert
 from gppylib import gplog
-from gppylib.commands.gp import GpStop, GpStart, get_local_db_mode
+from gppylib.commands.gp import GpStop, GpStart, get_local_db_mode, get_masterdatadir
 from gppylib.commands.unix import Ping, RemoveDirectory, RemoveFiles, MakeDirectory
 from gppylib.operations import Operation
 from gppylib.operations.utils import RemoteOperation, ParallelOperation
@@ -41,7 +41,7 @@ logger = gplog.get_default_logger()
 GP_TRANSACTION_FILES_FILESPACE = 'gp_transaction_files_filespace'
 GP_TEMPORARY_FILES_FILESPACE = 'gp_temporary_files_filespace'
 PG_SYSTEM_FILESPACE = 'pg_system'
-MASTER_DATA_DIR = os.environ.get('MASTER_DATA_DIRECTORY')
+MASTER_DATA_DIR = get_masterdatadir()
 NUM_WORKERS = 16  #Number of simultaneous parallel process that are started by ParallelOperation
 
 class FileType:

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/2c1710ce/tools/doc/gplogfilter_help
----------------------------------------------------------------------
diff --git a/tools/doc/gplogfilter_help b/tools/doc/gplogfilter_help
index 886ec7d..eb2f40b 100644
--- a/tools/doc/gplogfilter_help
+++ b/tools/doc/gplogfilter_help
@@ -21,7 +21,7 @@ DESCRIPTION
 The gplogfilter utility can be used to search through a 
 HAWQ log file for entries matching the specified 
 criteria. If an input file is not supplied, then gplogfilter will 
-use the $MASTER_DATA_DIRECTORY environment variable to 
+use the default MASTER_DATA_DIRECTORY variable to 
 locate the HAWQ master log file. To read from standard input, 
 use a dash (-) as the input file name. Input files may be compressed 
 using gzip. In an input file, a log entry is identified by its 
@@ -157,8 +157,8 @@ INPUT OPTIONS
 
 The name of the input log file(s) to search through. If 
 an input file is not supplied, gplogfilter will use the 
-$MASTER_DATA_DIRECTORY environment variable to locate the 
-Greenplum master log file. To read from standard input, 
+default MASTER_DATA_DIRECTORY variable to locate the 
+HAWQ master log file. To read from standard input, 
 use a dash (-) as the input file name.
 
 -u | --unzip
@@ -209,4 +209,4 @@ con6 /gpdata/*/gp*.log' > seglog.out
 SEE ALSO
 *****************************************************
 
-gpssh, gpscp
\ No newline at end of file
+gpssh, gpscp