Github user pwendell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/1845#discussion_r16280454
  
    --- Diff: bin/utils.sh ---
    @@ -0,0 +1,108 @@
    +#!/usr/bin/env bash
    +#
    +# 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
    +#
    +# Unless required by applicable law or agreed to in writing, software
    +# distributed under the License is distributed on an "AS IS" BASIS,
    +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +# See the License for the specific language governing permissions and
    +# limitations under the License.
    +#
    +
    +# * ---------------------------------------------------- *
    +# |  Utility functions for launching Spark applications  |
    +# * ---------------------------------------------------- *
    +
    +# Parse the value of a config from a java properties file according to the 
specifications in
    +# 
http://docs.oracle.com/javase/7/docs/api/java/util/Properties.html#load(java.io.Reader).
    +# This accepts the name of the config as an argument, and expects the path 
of the property
    +# file to be found in PROPERTIES_FILE. The value is returned through 
JAVA_PROPERTY_VALUE.
    +parse_java_property() {
    +  JAVA_PROPERTY_VALUE=""  # return value
    +  config_buffer=""        # buffer for collecting parts of a config value
    +  multi_line=0            # whether this config is spanning multiple lines
    +  while read -r line; do
    +    # Strip leading and trailing whitespace
    +    line=$(echo "$line" | sed "s/^[[:space:]]\(.*\)[[:space:]]*$/\1/")
    +    contains_config=$(echo "$line" | grep -e "^$1")
    +    if [[ -n "$contains_config" || "$multi_line" == 1 ]]; then
    +      has_more_lines=$(echo "$line" | grep -e "\\\\$")
    +      if [[ -n "$has_more_lines" ]]; then
    --- End diff --
    
    We discussed this already today, but I'd prefer not to deal with multiline 
statements at all here to keep this simpler.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to