Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 8425F200B6B for ; Fri, 26 Aug 2016 03:46:33 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 82785160ABD; Fri, 26 Aug 2016 01:46:33 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A3558160AA5 for ; Fri, 26 Aug 2016 03:46:32 +0200 (CEST) Received: (qmail 83026 invoked by uid 500); 26 Aug 2016 01:46:31 -0000 Mailing-List: contact commits-help@hawq.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hawq.incubator.apache.org Delivered-To: mailing list commits@hawq.incubator.apache.org Received: (qmail 83017 invoked by uid 99); 26 Aug 2016 01:46:31 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Aug 2016 01:46:31 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 754611A12A9 for ; Fri, 26 Aug 2016 01:46:31 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.645 X-Spam-Level: X-Spam-Status: No, score=-4.645 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.426, WEIRD_QUOTING=0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id Nyt-bnD8vjWW for ; Fri, 26 Aug 2016 01:46:29 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 393755F30D for ; Fri, 26 Aug 2016 01:46:28 +0000 (UTC) Received: (qmail 82994 invoked by uid 99); 26 Aug 2016 01:46:27 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Aug 2016 01:46:27 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 5A452E055E; Fri, 26 Aug 2016 01:46:27 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: rlei@apache.org To: commits@hawq.incubator.apache.org Message-Id: <819d65c8637e40a5bd24a4e831b42ce1@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: incubator-hawq git commit: HAWQ-1009 Remove requirement of environment value MASTER_DATA_DIRECTORY Date: Fri, 26 Aug 2016 01:46:27 +0000 (UTC) archived-at: Fri, 26 Aug 2016 01:46:33 -0000 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 Authored: Thu Aug 25 17:13:36 2016 +0800 Committer: rlei 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