You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hawq.apache.org by wl...@apache.org on 2016/11/03 03:23:51 UTC

incubator-hawq git commit: HAWQ-1133. Replace print with logger output in hawqregister.

Repository: incubator-hawq
Updated Branches:
  refs/heads/master 0d2599462 -> b2c14cfc6


HAWQ-1133. Replace print with logger output in hawqregister.


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

Branch: refs/heads/master
Commit: b2c14cfc6d7681c29d9bce39c4d47813ba2f594d
Parents: 0d25994
Author: xunzhang <xu...@gmail.com>
Authored: Tue Nov 1 19:39:29 2016 +0800
Committer: Wen Lin <wl...@pivotal.io>
Committed: Thu Nov 3 11:23:19 2016 +0800

----------------------------------------------------------------------
 tools/bin/hawqregister | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/b2c14cfc/tools/bin/hawqregister
----------------------------------------------------------------------
diff --git a/tools/bin/hawqregister b/tools/bin/hawqregister
index 3477e81..7456fdc 100755
--- a/tools/bin/hawqregister
+++ b/tools/bin/hawqregister
@@ -511,7 +511,7 @@ class HawqRegister(object):
             self._set_yml_data(Format, files, sizes, tupcounts, eofuncompresseds, varblockcounts, params['TableName'], params['%s_Schema' % Format], params['Distribution_Policy'], params[Format_FileLocations], bucketNum, partitionby, partitions_constraint, partitions_name, partitions_compression_level, partitions_compression_type, partitions_checksum, partitions_filepaths, partitions_filesizes, partitions_tupcounts, partitions_eofuncompresseds, partitions_varblockcounts, encoding)
 
         except KeyError as e:
-            print 'Invalid yaml file, %s is missing.' % e
+            logger.error('Invalid yaml file, %s is missing.' % e)
             self.failure_handler.rollback()
             sys.exit(1)
 
@@ -546,11 +546,13 @@ class HawqRegister(object):
             sys.exit(1)
 
     def _check_file_not_folder(self):
+        logger.info('Files check...')
         for fn in self.files:
             hdfscmd = 'hadoop fs -test -f %s' % fn
             if local_ssh(hdfscmd, logger):
                 logger.info('%s is not a file in hdfs, please check the yaml configuration file.' % fn)
                 sys.exit(1)
+        logger.info('Files check done...')
 
     def _is_folder(self, filepath):
         hdfscmd = 'hadoop fs -test -d %s' % filepath
@@ -692,9 +694,9 @@ class HawqRegister(object):
 
         self._check_files_and_table_in_same_hdfs_cluster(self.filepath, self.tabledir)
 
-        print 'New file(s) to be registered: ', self.files_append
+        logger.info('New file(s) to be registered: %s' % self.files_append)
         if self.files_update:
-            print 'Catalog info need to be updated for these files: ', self.files_update
+            logger.info('Catalog info need to be updated for these files: %s' % self.files_update)
 
         if self.filesize is not None:
             if len(self.files) != 1: