View test.py
#!/usr/bin/python | |
# | |
# Licensed to the Apache Software Foundation (ASF) under one or more | |
# contributor license agreements. See the NOTICE file distributed with | |
# this work for additional information regarding copyright ownership. | |
# The ASF licenses this file to You under the Apache License, Version 2.0 | |
# (the "License"); you may not use this file except in compliance with | |
# the License. You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 |
View gist:d3b255c0d3f66cb934d5
function readSparkConf() { | |
SPARK_CONF_PATH="${1}" | |
echo "Reading ${SPARK_CONF_PATH}" | |
while read line; do | |
echo "${line}" | grep -e "^spark[.]" > /dev/null | |
if [ $? -ne 0 ]; then | |
# skip the line not started with 'spark.' | |
continue; | |
fi | |
SPARK_CONF_KEY=`echo "${line}" | sed -e 's/\(^spark[^ ]*\)[ \t]*\(.*\)/\1/g'` |