Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into dmlVALUES
Browse files Browse the repository at this point in the history
  • Loading branch information
sumwale committed Aug 24, 2019
2 parents bbeeb10 + 69af564 commit 7be931f
Show file tree
Hide file tree
Showing 937 changed files with 7,780 additions and 1,653 deletions.
126 changes: 99 additions & 27 deletions README.md

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ allprojects {
apply plugin: "build-time-tracker"

group = 'io.snappydata'
version = '1.1.0-HF-1'
version = '1.1.1'

// apply compiler options
tasks.withType(JavaCompile) {
Expand Down Expand Up @@ -108,7 +108,7 @@ allprojects {
scalaBinaryVersion = '2.11'
scalaVersion = scalaBinaryVersion + '.8'
sparkVersion = '2.1.1'
snappySparkVersion = '2.1.1.6'
snappySparkVersion = '2.1.1.7'
sparkDistName = "spark-${sparkVersion}-bin-hadoop2.7"
sparkCurrentVersion = '2.3.2'
sparkCurrentDistName = "spark-${sparkCurrentVersion}-bin-hadoop2.7"
Expand Down Expand Up @@ -151,10 +151,10 @@ allprojects {
antlr2Version = '2.7.7'

pegdownVersion = '1.6.0'
snappyStoreVersion = '1.6.3'
snappyStoreVersion = '1.6.4'
snappydataVersion = version
pulseVersion = '1.5.1'
zeppelinInterpreterVersion = '0.7.3.5'
zeppelinInterpreterVersion = '0.7.3.6'

buildFlags = ''
createdBy = System.getProperty('user.name')
Expand All @@ -165,7 +165,7 @@ allprojects {
buildDate = new Date().format('yyyy-MM-dd HH:mm:ss Z')
buildNumber = new Date().format('MMddyy')
jdkVersion = System.getProperty('java.version')
sparkJobServerVersion = '0.6.2.9'
sparkJobServerVersion = '0.6.2.10'
eclipseCollectionsVersion = '9.2.0'
fastutilVersion = '8.2.2'

Expand Down
2 changes: 1 addition & 1 deletion cluster/bin/load-snappy-env.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

#
# Copyright (c) 2018 SnappyData, Inc. All rights reserved.
# Copyright (c) 2017-2019 TIBCO Software Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
# may not use this file except in compliance with the License. You
Expand Down
2 changes: 1 addition & 1 deletion cluster/bin/snappy-job.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

#
# Copyright (c) 2018 SnappyData, Inc. All rights reserved.
# Copyright (c) 2017-2019 TIBCO Software Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
# may not use this file except in compliance with the License. You
Expand Down
2 changes: 1 addition & 1 deletion cluster/bin/snappy-sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

#
# Copyright (c) 2018 SnappyData, Inc. All rights reserved.
# Copyright (c) 2017-2019 TIBCO Software Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
# may not use this file except in compliance with the License. You
Expand Down
2 changes: 1 addition & 1 deletion cluster/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018 SnappyData, Inc. All rights reserved.
* Copyright (c) 2017-2019 TIBCO Software Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you
* may not use this file except in compliance with the License. You
Expand Down
2 changes: 1 addition & 1 deletion cluster/conf/leads.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2018 SnappyData, Inc. All rights reserved.
# Copyright (c) 2017-2019 TIBCO Software Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
# may not use this file except in compliance with the License. You
Expand Down
2 changes: 1 addition & 1 deletion cluster/conf/locators.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2018 SnappyData, Inc. All rights reserved.
# Copyright (c) 2017-2019 TIBCO Software Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
# may not use this file except in compliance with the License. You
Expand Down
2 changes: 1 addition & 1 deletion cluster/conf/log4j.properties.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2018 SnappyData, Inc. All rights reserved.
# Copyright (c) 2017-2019 TIBCO Software Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
# may not use this file except in compliance with the License. You
Expand Down
2 changes: 1 addition & 1 deletion cluster/conf/servers.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2018 SnappyData, Inc. All rights reserved.
# Copyright (c) 2017-2019 TIBCO Software Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
# may not use this file except in compliance with the License. You
Expand Down
2 changes: 1 addition & 1 deletion cluster/sbin/check-dir-option.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

#
# Copyright (c) 2018 SnappyData, Inc. All rights reserved.
# Copyright (c) 2017-2019 TIBCO Software Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
# may not use this file except in compliance with the License. You
Expand Down
231 changes: 231 additions & 0 deletions cluster/sbin/cluster-util.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
#!/bin/bash
#
# Copyright (c) 2017-2019 TIBCO Software Inc. All rights reserved.
#
# Licensed 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. See accompanying
# LICENSE file.
#


function absPath() {
perl -MCwd -le 'print Cwd::abs_path(shift)' "$1"
}
sbin="$(dirname "$(absPath "$0")")"

# Load the Spark configuration
. "$sbin/snappy-config.sh"
. "$sbin/spark-config.sh"

if [[ ! -d ${SNAPPY_HOME} ]]; then
echo "${SNAPPY_HOME} does not exist. Exiting ..."
exit 1
fi

bold=$(tput bold)
normal=$(tput sgr0)
space=
usage() {
echo "${bold}Usage: ${normal}cluster-util.sh (--on-locators|--on-servers|--on-leads|--on-all) [-y] (--copy-conf | --run \"<cmd-to-run-on-selected-nodes>\")"
echo
echo "${bold}Description${normal}"
echo
echo -e ' \t '"This is an utility to execute a given command on selected members of the cluster."
echo -e ' \t '"The script relies on the entries you specify in locators, servers and leads files in conf directory to identify the members of the cluster."
echo
echo -e ' \t '"--on-locators"
echo -e ' \t ''\t'"If specified, the given command would be executed on locators."
echo
echo
echo -e ' \t '"--on-servers"
echo -e ' \t ''\t'"If specified, the given command would be executed on servers."
echo
echo
echo -e ' \t '"--on-leads"
echo -e ' \t ''\t'"If specified, the given command would be executed on leads."
echo
echo
echo -e ' \t '"--on-all"
echo -e ' \t ''\t'"If specified, the given command would be executed on all member of the cluster."
echo
echo -e ' \t '"-y"
echo -e ' \t ''\t'"If specified, the script doesn't ask for confirmation for execution of the command on each member node."
echo
echo -e ' \t '"--copy-conf"
echo -e ' \t ''\t'"This is a shortcut command which when specified copies log4j.properties, snappy-env.sh and "
echo -e ' \t ''\t'"spark-env.sh configuration files from local machine to all the members."
echo -e ' \t ''\t'"These files are copied only if a) these are absent in the destination member or b) their content is different. In "
echo -e ' \t ''\t'"latter case, a backup of the file is taken in conf/backup directory on destination member, before copy."
echo -e ' \t '"--run '<cmd-to-run-on-selected-nodes>'"
echo -e ' \t ''\t'"Will execute the given command(s) on specified members. Command to be executed specified after --run must be in double-quotes."
echo
exit 1
}

ISFORCE=0
SPARK_CONF_DIR=
COPY_CONF=0

MEMBER_LIST=
MEMBER_TYPE=

COMMAND=

while [ "$1" != "" ]; do

case $1 in
--run)
RUN="true"
COMMAND="$2"
shift
;;
--copy-conf)
COPY_CONF=1
SPARK_CONF_DIR=$SNAPPY_HOME/conf/
shift
;;
-y)
ISFORCE=1
shift
;;
--on-locators)
if [[ ! -e $SNAPPY_HOME/conf/locators ]]; then
echo "${SNAPPY_HOME}/conf/locators does not exist. Exiting ..."
exit 2
fi
LOCATOR_LIST=$(sed ':loop /^[^#].*[^\\]\\$/N; s/\\\n//; t loop' $SNAPPY_HOME/conf/locators | awk '!/^ *#/ && !/^[[:space:]]*$/ { print$1; }' | awk '!seen[$0]++')
MEMBER_LIST=$LOCATOR_LIST
MEMBER_TYPE="locator"
shift
;;
--on-servers)
if [[ ! -e $SNAPPY_HOME/conf/servers ]]; then
echo "${SNAPPY_HOME}/conf/servers does not exist. Exiting ..."
exit 3
fi
SERVER_LIST=$(sed ':loop /^[^#].*[^\\]\\$/N; s/\\\n//; t loop' $SNAPPY_HOME/conf/servers | awk '!/^ *#/ && !/^[[:space:]]*$/ { print$1; }' | awk '!seen[$0]++')
MEMBER_LIST=$SERVER_LIST
MEMBER_TYPE="server"
shift
;;
--on-leads)
if [[ ! -e $SNAPPY_HOME/conf/leads ]]; then
echo "${SNAPPY_HOME}/conf/leads does not exist. Exiting ..."
exit 4
fi
LEAD_LIST=$(sed ':loop /^[^#].*[^\\]\\$/N; s/\\\n//; t loop' $SNAPPY_HOME/conf/leads | awk '!/^ *#/ && !/^[[:space:]]*$/ { print$1; }' | awk '!seen[$0]++')
MEMBER_LIST=$LEAD_LIST
MEMBER_TYPE="lead"
shift
;;
--on-all)
MEMBER_LIST="all"
MEMBER_TYPE="all"
rm -f /tmp/snappy-nodes.txt
LOCATOR_LIST=$(sed ':loop /^[^#].*[^\\]\\$/N; s/\\\n//; t loop' $SNAPPY_HOME/conf/locators | awk '!/^ *#/ && !/^[[:space:]]*$/ { print$1; }' | awk '!seen[$0]++')
echo $LOCATOR_LIST >> /tmp/snappy-nodes.txt
SERVER_LIST=$(sed ':loop /^[^#].*[^\\]\\$/N; s/\\\n//; t loop' $SNAPPY_HOME/conf/servers | awk '!/^ *#/ && !/^[[:space:]]*$/ { print$1; }' | awk '!seen[$0]++')
echo $SERVER_LIST >> /tmp/snappy-nodes.txt
LEAD_LIST=$(sed ':loop /^[^#].*[^\\]\\$/N; s/\\\n//; t loop' $SNAPPY_HOME/conf/leads | awk '!/^ *#/ && !/^[[:space:]]*$/ { print$1; }' | awk '!seen[$0]++')
echo $LEAD_LIST >> /tmp/snappy-nodes.txt
#cat /tmp/snappy-nodes.txt
ALL_MEMBER_LIST=$(awk '!seen[$0]++' /tmp/snappy-nodes.txt)
rm /tmp/snappy-nodes.txt
shift
;;
-*)
echo "ERROR: Unknown option: $1" >&2
echo
usage
;;
*) # End of options
break
;;
esac
done

if [[ $COPY_CONF == 1 && $RUN == "true" ]]; then
echo
echo "Invalid operation: Specify either '--copy-conf' or '--run \"<command>\"'"
echo
usage
exit
fi

START_ALL_TIMESTAMP="$(date +"%Y_%m_%d_%H_%M_%S")"

function copyConf() {
for entry in "${SPARK_CONF_DIR}"/*; do
if [ -f "$entry" ];then
fileName=$(basename $entry)
if [[ $fileName == "log4j.properties" || $fileName == "snappy-env.sh" || $fileName == "spark-env.sh" ]]; then
if ! ssh $node "test -e $entry"; then #"File does not exist."
scp ${SPARK_CONF_DIR}/$fileName $node:${SPARK_CONF_DIR}
else
backupDir="backup_"${START_ALL_TIMESTAMP}
if [[ ! -z $(ssh $node "cat $entry" | diff - "$entry") ]] ; then
ssh "$node" "mkdir -p \"${SPARK_CONF_DIR}/$backupDir\" "
ssh $node "mv ${SPARK_CONF_DIR}/$fileName ${SPARK_CONF_DIR}/$backupDir/$fileName"
echo "INFO:Copying $filename from this host to $node. Moved the original $filename on $node to $backupDir/$fileName."
scp ${SPARK_CONF_DIR}/$fileName $node:${SPARK_CONF_DIR}
fi
fi
fi # end of if, check the conf file name
fi # end of if to get each file
done #end of for loop
}

function executeCommand() {
echo
echo "--------- Executing $@ on $MEMBER_TYPE $node ----------"
echo
if [[ $ISFORCE -eq 0 ]]; then
read -p "Are you sure to run $@ on $MEMBER_TYPE $node (y/n)? " userinput
echo
if [[ $userinput == "y" || $userinput == "yes" || $userinput == "Y" || $userinput == "YES" ]]; then
if [[ $COPY_CONF == 1 ]]; then
copyConf "$@"
elif [[ $RUN == "true" ]]; then
ssh $node "$COMMAND | column"
else
echo "Invalid operation"
echo
usage
exit
fi
fi
else
if [[ $COPY_CONF == 1 ]]; then
copyConf "$@"
elif [[ $RUN == "true" ]]; then
ssh $node "$COMMAND | column"
else
echo "Invalid operation"
echo
usage
exit
fi
fi #end if ISFORCE
}


if [[ $MEMBER_LIST != "all" ]]; then
for node in $MEMBER_LIST; do
executeCommand "$@"
done
else
for node in $ALL_MEMBER_LIST; do
executeCommand "$@"
done
fi


2 changes: 1 addition & 1 deletion cluster/sbin/collect-debug-artifacts.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

#
# Copyright (c) 2018 SnappyData, Inc. All rights reserved.
# Copyright (c) 2017-2019 TIBCO Software Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
# may not use this file except in compliance with the License. You
Expand Down
2 changes: 1 addition & 1 deletion cluster/sbin/snappy-config.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2018 SnappyData, Inc. All rights reserved.
# Copyright (c) 2017-2019 TIBCO Software Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
# may not use this file except in compliance with the License. You
Expand Down
2 changes: 1 addition & 1 deletion cluster/sbin/snappy-lead.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

#
# Copyright (c) 2018 SnappyData, Inc. All rights reserved.
# Copyright (c) 2017-2019 TIBCO Software Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
# may not use this file except in compliance with the License. You
Expand Down
2 changes: 1 addition & 1 deletion cluster/sbin/snappy-leads.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

#
# Copyright (c) 2018 SnappyData, Inc. All rights reserved.
# Copyright (c) 2017-2019 TIBCO Software Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
# may not use this file except in compliance with the License. You
Expand Down
2 changes: 1 addition & 1 deletion cluster/sbin/snappy-locator.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

#
# Copyright (c) 2018 SnappyData, Inc. All rights reserved.
# Copyright (c) 2017-2019 TIBCO Software Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
# may not use this file except in compliance with the License. You
Expand Down
2 changes: 1 addition & 1 deletion cluster/sbin/snappy-locators.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

#
# Copyright (c) 2018 SnappyData, Inc. All rights reserved.
# Copyright (c) 2017-2019 TIBCO Software Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
# may not use this file except in compliance with the License. You
Expand Down
Loading

0 comments on commit 7be931f

Please sign in to comment.