You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hawq.apache.org by hu...@apache.org on 2015/12/31 03:45:56 UTC

incubator-hawq git commit: HAWQ-294. Rename prefix of logs in pg_log from gpdb-xxx to hawq-xxx

Repository: incubator-hawq
Updated Branches:
  refs/heads/master ff8506697 -> 35acf7539


HAWQ-294. Rename prefix of logs in pg_log from gpdb-xxx to hawq-xxx


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

Branch: refs/heads/master
Commit: 35acf753960ee48bac8e2ecb3f2bdfe944d1ae15
Parents: ff85066
Author: Ruilong Huo <rh...@pivotal.io>
Authored: Tue Dec 29 23:45:43 2015 -0800
Committer: Ruilong Huo <rh...@pivotal.io>
Committed: Thu Dec 31 10:45:39 2015 +0800

----------------------------------------------------------------------
 src/backend/utils/adt/genfile.c | 20 ++++++++++----------
 src/backend/utils/misc/guc.c    |  2 +-
 tools/bin/gplogfilter           |  8 ++++----
 3 files changed, 15 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/35acf753/src/backend/utils/adt/genfile.c
----------------------------------------------------------------------
diff --git a/src/backend/utils/adt/genfile.c b/src/backend/utils/adt/genfile.c
index 7a9b0e3..9d53cf1 100644
--- a/src/backend/utils/adt/genfile.c
+++ b/src/backend/utils/adt/genfile.c
@@ -476,22 +476,22 @@ pg_logdir_ls(PG_FUNCTION_ARGS)
 	FuncCallContext *funcctx;
 	struct dirent *de;
 	directory_fctx *fctx;
-    bool prefix_is_gpdb = true;
+    bool prefix_is_hawq = true;
 
 	if (!superuser())
 		ereport(ERROR,
 				(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
 				 (errmsg("only superuser can list the log directory"))));
 
-	if (strcmp(Log_filename, "gpdb-%Y-%m-%d_%H%M%S.csv") != 0 &&
-        strcmp(Log_filename, "gpdb-%Y-%m-%d_%H%M%S.log") != 0 &&
+	if (strcmp(Log_filename, "hawq-%Y-%m-%d_%H%M%S.csv") != 0 &&
+        strcmp(Log_filename, "hawq-%Y-%m-%d_%H%M%S.log") != 0 &&
         strcmp(Log_filename, "postgresql-%Y-%m-%d_%H%M%S.log") != 0 )
 		ereport(ERROR,
 				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 (errmsg("the log_filename parameter must equal 'gpdb-%%Y-%%m-%%d_%%H%%M%%S.csv'"))));
+				 (errmsg("the log_filename parameter must equal 'hawq-%%Y-%%m-%%d_%%H%%M%%S.csv'"))));
 
-    if (strncmp(Log_filename, "gpdb", 4) != 0)
-        prefix_is_gpdb = false;
+    if (strncmp(Log_filename, "hawq", 4) != 0)
+        prefix_is_hawq = false;
 
 	if (SRF_IS_FIRSTCALL())
 	{
@@ -541,14 +541,14 @@ pg_logdir_ls(PG_FUNCTION_ARGS)
 		int			tz = 0;
 		struct pg_tm date;
 
-        if (prefix_is_gpdb)
+        if (prefix_is_hawq)
         {
             int end = 17;
             /*
-		     * Default format: gpdb-YYYY-MM-DD_HHMMSS.log or gpdb-YYYY-MM-DD_HHMMSS.csv
+		     * Default format: hawq-YYYY-MM-DD_HHMMSS.log or hawq-YYYY-MM-DD_HHMMSS.csv
 		     */
 		    if (strlen(de->d_name) != 26
-			    || strncmp(de->d_name, "gpdb-", 5) != 0
+			    || strncmp(de->d_name, "hawq-", 5) != 0
 			    || de->d_name[15] != '_'
 			    || (strcmp(de->d_name + 22, ".log") != 0 && strcmp(de->d_name + 22, ".csv") != 0))
             {
@@ -558,7 +558,7 @@ pg_logdir_ls(PG_FUNCTION_ARGS)
                  */
              
                 if (strlen(de->d_name) != 26
-			    || strncmp(de->d_name, "gpdb-", 5) != 0
+			    || strncmp(de->d_name, "hawq-", 5) != 0
 			    || de->d_name[15] != '_'
 			    || (strcmp(de->d_name + 22, ".log") != 0 && strcmp(de->d_name + 22, ".csv") != 0))
                     continue;

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/35acf753/src/backend/utils/misc/guc.c
----------------------------------------------------------------------
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 20194b4..424254c 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -7456,7 +7456,7 @@ static struct config_string ConfigureNamesString[] =
 			GUC_SUPERUSER_ONLY | GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE
 		},
 		&Log_filename,
-		"gpdb-%Y-%m-%d_%H%M%S.csv", NULL, NULL
+		"hawq-%Y-%m-%d_%H%M%S.csv", NULL, NULL
 	},
 
 	{

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/35acf753/tools/bin/gplogfilter
----------------------------------------------------------------------
diff --git a/tools/bin/gplogfilter b/tools/bin/gplogfilter
index 675b00e..fb55c86 100755
--- a/tools/bin/gplogfilter
+++ b/tools/bin/gplogfilter
@@ -77,7 +77,7 @@ TROUBLE_VALUES=[
                 ]
 
 description = ("""
-Reads GPDB log file(s), extracts log entries which meet
+Reads HAWQ log file(s), extracts log entries which meet
 all the criteria you specify, and writes them to output
 file(s) or standard output.
 """)
@@ -148,7 +148,7 @@ def parseargs():
     optgrp.add_option('-d', '--duration', type='duration', metavar='[h][:m[:s]]',
                       help='duration from beginning to end')
     optgrp.add_option('--prunefiles', action='store_true', default=False, 
-                        help="Discard files based on filename of the form gpdb-%Y-%m-%d_%H%M%S.csv")
+                        help="Discard files based on filename of the form hawq-%Y-%m-%d_%H%M%S.csv")
     parser.add_option_group(optgrp)
 
     optgrp = OptionGroup(parser, 'Pattern and string matching',
@@ -251,7 +251,7 @@ def openInputFile(ifn, options):
         ifn = os.path.abspath(ifn)
         # In case a master or segment instance's data directory name
         # was given, append '.log' to get the instance's log file name
-        # (gpdb convention).
+        # (hawq convention).
         if (os.path.isdir(ifn)):
             ifn += '.log'
         zname = os.path.split(ifn)[1]
@@ -436,7 +436,7 @@ try:
             fileIn, inputFilesToClose, ifn, zname = openInputFile(ifn, options)
             
             # if we can skip the whole file, let's do so
-            if zname.startswith('gpdb') and zname.endswith('.csv'):
+            if zname.startswith('hawq') and zname.endswith('.csv'):
                 goodFormat = True
                 try:
                    # try format YYYY-MM-DD_HHMMSS