You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by sh...@apache.org on 2016/05/05 11:21:50 UTC
incubator-atlas git commit: ATLAS-659 atlas_start fails on Windows
(dkantor via shwethags)
Repository: incubator-atlas
Updated Branches:
refs/heads/master feff0cf71 -> dab9cb7ca
ATLAS-659 atlas_start fails on Windows (dkantor via shwethags)
Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/dab9cb7c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/dab9cb7c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/dab9cb7c
Branch: refs/heads/master
Commit: dab9cb7ca3068dfb13a1682233467d78109112fe
Parents: feff0cf
Author: Shwetha GS <ss...@hortonworks.com>
Authored: Thu May 5 16:51:42 2016 +0530
Committer: Shwetha GS <ss...@hortonworks.com>
Committed: Thu May 5 16:51:42 2016 +0530
----------------------------------------------------------------------
distro/src/bin/atlas_config.py | 31 +++++++++++++++++----
distro/src/bin/atlas_start.py | 12 ++++----
distro/src/bin/atlas_stop.py | 2 +-
distro/src/conf/hbase/hbase-site.xml.template | 2 +-
distro/src/test/python/scripts/TestMetadata.py | 5 +++-
release-log.txt | 1 +
6 files changed, 38 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/dab9cb7c/distro/src/bin/atlas_config.py
----------------------------------------------------------------------
diff --git a/distro/src/bin/atlas_config.py b/distro/src/bin/atlas_config.py
index 2b6bc82..dbe1191 100755
--- a/distro/src/bin/atlas_config.py
+++ b/distro/src/bin/atlas_config.py
@@ -326,13 +326,14 @@ def exist_pid(pid):
elif IS_WINDOWS:
#The os.kill approach does not work on Windows with python 2.7
#the output from tasklist command is searched for the process id
- command='tasklist /fi "pid eq '+ pid + '"'
+ pidStr = str(pid)
+ command='tasklist /fi "pid eq %s"' % pidStr
sub_process=subprocess.Popen(command, stdout = subprocess.PIPE, shell=False)
sub_process.communicate()
output = subprocess.check_output(command)
output=split(" *",output)
for line in output:
- if pid in line:
+ if pidStr in line:
return True
return False
#os other than nt or posix - not supported - need to delete the file to restart server if pid no longer exist
@@ -359,11 +360,23 @@ def is_hbase_local(confdir):
confdir = os.path.join(confdir, CONF_FILE)
return grep(confdir, HBASE_STORAGE_CONF_ENTRY) is not None and grep(confdir, HBASE_STORAGE_LOCAL_CONF_ENTRY) is not None
-def run_hbase(dir, action, hbase_conf_dir = None, logdir = None, wait=True):
- if hbase_conf_dir is not None:
- cmd = [os.path.join(dir, "hbase-daemon.sh"), '--config', hbase_conf_dir, action, 'master']
+def run_hbase_action(dir, action, hbase_conf_dir = None, logdir = None, wait=True):
+ if IS_WINDOWS:
+ if action == 'start':
+ hbaseScript = 'start-hbase.cmd'
+ else:
+ hbaseScript = 'stop-hbase.cmd'
+ if hbase_conf_dir is not None:
+ cmd = [os.path.join(dir, hbaseScript), '--config', hbase_conf_dir]
+ else:
+ cmd = [os.path.join(dir, hbaseScript)]
else:
- cmd = [os.path.join(dir, "hbase-daemon.sh"), action, 'master']
+ hbaseScript = 'hbase-daemon.sh'
+ if hbase_conf_dir is not None:
+ cmd = [os.path.join(dir, hbaseScript), '--config', hbase_conf_dir, action, 'master']
+ else:
+ cmd = [os.path.join(dir, hbaseScript), action, 'master']
+
return runProcess(cmd, logdir, False, wait)
@@ -376,6 +389,11 @@ def configure_hbase(dir):
hbase_conf_file = "hbase-site.xml"
tmpl_file = os.path.join(tmpl_dir, hbase_conf_file + ".template")
+ if IS_WINDOWS:
+ url_prefix="file:///"
+ else:
+ url_prefix="file://"
+
conf_file = os.path.join(conf_dir, hbase_conf_file)
if os.path.exists(tmpl_file):
@@ -385,6 +403,7 @@ def configure_hbase(dir):
f.close()
config = template.replace("${hbase_home}", dir)
+ config = config.replace("${url_prefix}", url_prefix)
f = open(conf_file,'w')
f.write(config)
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/dab9cb7c/distro/src/bin/atlas_start.py
----------------------------------------------------------------------
diff --git a/distro/src/bin/atlas_start.py b/distro/src/bin/atlas_start.py
index 4199e37..73b8920 100755
--- a/distro/src/bin/atlas_start.py
+++ b/distro/src/bin/atlas_start.py
@@ -74,12 +74,6 @@ def main():
#add hbase-site.xml to classpath
hbase_conf_dir = mc.hbaseConfDir(atlas_home)
- if mc.is_hbase_local(confdir):
- print "configured for local hbase."
- mc.configure_hbase(atlas_home)
- mc.run_hbase(mc.hbaseBinDir(atlas_home), "start", hbase_conf_dir, logdir)
- print "hbase started."
-
p = os.pathsep
atlas_classpath = confdir + p \
+ os.path.join(web_app_dir, "atlas", "WEB-INF", "classes" ) + p \
@@ -111,6 +105,12 @@ def main():
else:
mc.server_pid_not_running(pid)
+ if mc.is_hbase_local(confdir):
+ print "configured for local hbase."
+ mc.configure_hbase(atlas_home)
+ mc.run_hbase_action(mc.hbaseBinDir(atlas_home), "start", hbase_conf_dir, logdir)
+ print "hbase started."
+
web_app_path = os.path.join(web_app_dir, "atlas")
if (mc.isCygwin()):
web_app_path = mc.convertCygwinPath(web_app_path)
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/dab9cb7c/distro/src/bin/atlas_stop.py
----------------------------------------------------------------------
diff --git a/distro/src/bin/atlas_stop.py b/distro/src/bin/atlas_stop.py
index 5653244..265084e 100755
--- a/distro/src/bin/atlas_stop.py
+++ b/distro/src/bin/atlas_stop.py
@@ -56,7 +56,7 @@ def main():
# stop hbase
if mc.is_hbase_local(confdir):
- mc.run_hbase(mc.hbaseBinDir(atlas_home), "stop", None, None, True)
+ mc.run_hbase_action(mc.hbaseBinDir(atlas_home), "stop", None, None, True)
if __name__ == '__main__':
try:
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/dab9cb7c/distro/src/conf/hbase/hbase-site.xml.template
----------------------------------------------------------------------
diff --git a/distro/src/conf/hbase/hbase-site.xml.template b/distro/src/conf/hbase/hbase-site.xml.template
index 4ace2fd..f5c4aad 100644
--- a/distro/src/conf/hbase/hbase-site.xml.template
+++ b/distro/src/conf/hbase/hbase-site.xml.template
@@ -19,7 +19,7 @@
<configuration>
<property>
<name>hbase.rootdir</name>
- <value>file://${hbase_home}/root</value>
+ <value>${url_prefix}${hbase_home}/root</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/dab9cb7c/distro/src/test/python/scripts/TestMetadata.py
----------------------------------------------------------------------
diff --git a/distro/src/test/python/scripts/TestMetadata.py b/distro/src/test/python/scripts/TestMetadata.py
index bb74f20..9e55869 100644
--- a/distro/src/test/python/scripts/TestMetadata.py
+++ b/distro/src/test/python/scripts/TestMetadata.py
@@ -53,7 +53,10 @@ class TestMetadata(unittest.TestCase):
atlas.main()
self.assertTrue(configure_hbase_mock.called)
- runProcess_mock.assert_called_with(['atlas_home/hbase/bin/hbase-daemon.sh', '--config', 'atlas_home/hbase/conf', 'start', 'master'], 'atlas_home/logs', False, True)
+ if IS_WINDOWS:
+ runProcess_mock.assert_called_with(['atlas_home\\hbase\\bin\\start-hbase.cmd', '--config', 'atlas_home\\hbase\\conf'], 'atlas_home\\logs', False, True)
+ else:
+ runProcess_mock.assert_called_with(['atlas_home/hbase/bin/hbase-daemon.sh', '--config', 'atlas_home/hbase/conf', 'start', 'master'], 'atlas_home/logs', False, True)
self.assertTrue(java_mock.called)
if IS_WINDOWS:
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/dab9cb7c/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index 790f0a7..ec871de 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -18,6 +18,7 @@ ATLAS-409 Atlas will not import avro tables with schema read from a file (dosset
ATLAS-379 Create sqoop and falcon metadata addons (venkatnrangan,bvellanki,sowmyaramesh via shwethags)
ALL CHANGES:
+ATLAS-659 atlas_start fails on Windows (dkantor via shwethags)
ATLAS-732 Dashboard v2 build fails on Windows (vmadugun via yhemanth)
ATLAS-602 Hooks stuck in case of failure (svimal2106 via shwethags)
ATLAS-631 Introduce Versioning to Atlas Notification Payload (tbeerbower via shwethags)