Commit 9f28540b by Shwetha GS

ATLAS-426 atlas_start fails on cygwin (dkantor via shwethags)

parent dbe10615
...@@ -93,8 +93,11 @@ def expandWebApp(dir): ...@@ -93,8 +93,11 @@ def expandWebApp(dir):
if e.errno != errno.EEXIST: if e.errno != errno.EEXIST:
raise e raise e
pass pass
atlasWarPath = os.path.join(atlasDir(), "server", "webapp", "atlas.war")
if (isCygwin()):
atlasWarPath = convertCygwinPath(atlasWarPath)
os.chdir(webAppMetadataDir) os.chdir(webAppMetadataDir)
jar(os.path.join(atlasDir(), "server", "webapp", "atlas.war")) jar(atlasWarPath)
def dirMustExist(dirname): def dirMustExist(dirname):
if not os.path.exists(dirname): if not os.path.exists(dirname):
...@@ -337,3 +340,19 @@ def grep(file, value): ...@@ -337,3 +340,19 @@ def grep(file, value):
if re.match(value, line): if re.match(value, line):
return line return line
return None return None
def isCygwin():
return platform.system().startswith("CYGWIN")
# Convert the specified cygwin-style pathname to Windows format,
# using the cygpath utility. By default, path is assumed
# to be a file system pathname. If isClasspath is True,
# then path is treated as a Java classpath string.
def convertCygwinPath(path, isClasspath=False):
if (isClasspath):
cygpathArgs = ["cygpath", "-w", "-p", path]
else:
cygpathArgs = ["cygpath", "-w", path]
windowsPath = subprocess.Popen(cygpathArgs, stdout=subprocess.PIPE).communicate()[0]
windowsPath = windowsPath.strip()
return windowsPath
...@@ -34,14 +34,23 @@ def main(): ...@@ -34,14 +34,23 @@ def main():
confdir = mc.dirMustExist(mc.confDir(atlas_home)) confdir = mc.dirMustExist(mc.confDir(atlas_home))
mc.executeEnvSh(confdir) mc.executeEnvSh(confdir)
logdir = mc.dirMustExist(mc.logDir(atlas_home)) logdir = mc.dirMustExist(mc.logDir(atlas_home))
if mc.isCygwin():
# Pathnames that are passed to JVM must be converted to Windows format.
jvm_atlas_home = mc.convertCygwinPath(atlas_home)
jvm_confdir = mc.convertCygwinPath(confdir)
jvm_logdir = mc.convertCygwinPath(logdir)
else:
jvm_atlas_home = atlas_home
jvm_confdir = confdir
jvm_logdir = logdir
#create sys property for conf dirs #create sys property for conf dirs
jvm_opts_list = (ATLAS_LOG_OPTS % logdir).split() jvm_opts_list = (ATLAS_LOG_OPTS % jvm_logdir).split()
cmd_opts = (ATLAS_COMMAND_OPTS % atlas_home) cmd_opts = (ATLAS_COMMAND_OPTS % jvm_atlas_home)
jvm_opts_list.extend(cmd_opts.split()) jvm_opts_list.extend(cmd_opts.split())
config_opts = (ATLAS_CONFIG_OPTS % confdir) config_opts = (ATLAS_CONFIG_OPTS % jvm_confdir)
jvm_opts_list.extend(config_opts.split()) jvm_opts_list.extend(config_opts.split())
default_jvm_opts = DEFAULT_JVM_OPTS default_jvm_opts = DEFAULT_JVM_OPTS
...@@ -69,8 +78,10 @@ def main(): ...@@ -69,8 +78,10 @@ def main():
if storage_backend != None: if storage_backend != None:
raise Exception("Could not find hbase-site.xml in %s. Please set env var HBASE_CONF_DIR to the hbase client conf dir", hbase_conf_dir) raise Exception("Could not find hbase-site.xml in %s. Please set env var HBASE_CONF_DIR to the hbase client conf dir", hbase_conf_dir)
if mc.isCygwin():
atlas_classpath = mc.convertCygwinPath(atlas_classpath, True)
atlas_pid_file = mc.pidFile(atlas_home) atlas_pid_file = mc.pidFile(atlas_home)
if os.path.isfile(atlas_pid_file): if os.path.isfile(atlas_pid_file):
#Check if process listed in atlas.pid file is still running #Check if process listed in atlas.pid file is still running
...@@ -99,11 +110,13 @@ def main(): ...@@ -99,11 +110,13 @@ def main():
mc.server_already_running(pid) mc.server_already_running(pid)
web_app_path = os.path.join(web_app_dir, "atlas")
args = ["-app", os.path.join(web_app_dir, "atlas")] if (mc.isCygwin()):
web_app_path = mc.convertCygwinPath(web_app_path)
args = ["-app", web_app_path]
args.extend(sys.argv[1:]) args.extend(sys.argv[1:])
process = mc.java("org.apache.atlas.Atlas", args, atlas_classpath, jvm_opts_list, logdir) process = mc.java("org.apache.atlas.Atlas", args, atlas_classpath, jvm_opts_list, jvm_logdir)
mc.writePid(atlas_pid_file, process) mc.writePid(atlas_pid_file, process)
print "Apache Atlas Server started!!!\n" print "Apache Atlas Server started!!!\n"
......
...@@ -7,6 +7,7 @@ ATLAS-409 Atlas will not import avro tables with schema read from a file (dosset ...@@ -7,6 +7,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) ATLAS-379 Create sqoop and falcon metadata addons (venkatnrangan,bvellanki,sowmyaramesh via shwethags)
ALL CHANGES: ALL CHANGES:
ATLAS-426 atlas_start fails on cygwin (dkantor via shwethags)
ATLAS-448 Hive IllegalArgumentException with Atlas hook enabled on SHOW TRANSACTIONS AND SHOW COMPACTIONS (shwethags) ATLAS-448 Hive IllegalArgumentException with Atlas hook enabled on SHOW TRANSACTIONS AND SHOW COMPACTIONS (shwethags)
ATLAS-181 Integrate storm topology metadata into Atlas (svenkat,yhemanth via shwethags) ATLAS-181 Integrate storm topology metadata into Atlas (svenkat,yhemanth via shwethags)
ATLAS-311 UI: Local storage for traits - caching [not cleared on refresh] To be cleared on time lapse for 1hr (Anilg via shwethags) ATLAS-311 UI: Local storage for traits - caching [not cleared on refresh] To be cleared on time lapse for 1hr (Anilg via shwethags)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment