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/10/26 02:11:10 UTC

incubator-hawq git commit: HAWQ-1120. Optimize exec time for check_sizes_valid function in hawqregister.

Repository: incubator-hawq
Updated Branches:
  refs/heads/master 01866e798 -> be0bcf20e


HAWQ-1120. Optimize exec time for check_sizes_valid function 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/be0bcf20
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/be0bcf20
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/be0bcf20

Branch: refs/heads/master
Commit: be0bcf20e1245a5a383b266dc93ba2c3a4d168a5
Parents: 01866e7
Author: xunzhang <xu...@gmail.com>
Authored: Tue Oct 25 22:18:45 2016 +0800
Committer: Wen Lin <wl...@pivotal.io>
Committed: Wed Oct 26 10:09:54 2016 +0800

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


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/be0bcf20/tools/bin/hawqregister
----------------------------------------------------------------------
diff --git a/tools/bin/hawqregister b/tools/bin/hawqregister
index 2affdc3..82ce274 100755
--- a/tools/bin/hawqregister
+++ b/tools/bin/hawqregister
@@ -497,14 +497,15 @@ class HawqRegister(object):
                 logger.error('File size(%s) in yaml configuration file should not be less than 0.' % sz)
                 self.failure_handler.rollback()
                 sys.exit(1)
-        for k, fn in enumerate(self.files):
-            hdfscmd = 'hadoop fs -du %s' % fn
-            _, out, _ = local_ssh_output(hdfscmd)
+        hdfscmd = 'hadoop fs -du %s' % ' '.join(self.files)
+        _, outs, _ = local_ssh_output(hdfscmd)
+        outs = outs.split('\n')
+        for k, out in enumerate(outs):
             if self.sizes[k] > int(out.strip().split()[0]):
                 if self.mode == 'usage1':
-                    logger.error('Specified file size(%s) should not exceed actual length(%s) of file %s.' % (self.sizes[k], out.strip().split()[0], fn))
+                    logger.error('Specified file size(%s) should not exceed actual length(%s) of file %s.' % (self.sizes[k], out.strip().split()[0], self.files[k]))
                 else:
-                    logger.error('File size(%s) in yaml configuration file should not exceed actual length(%s) of file %s.' % (self.sizes[k], out.strip().split()[0], fn))    
+                    logger.error('File size(%s) in yaml configuration file should not exceed actual length(%s) of file %s.' % (self.sizes[k], out.strip().split()[0], self.files[k]))
                 self.failure_handler.rollback()
                 sys.exit(1)