sahara-plugin-spark/sahara_plugin_spark/plugins/spark/resources/topology.sh
Telles Nobrega fbc20448ab Plugins splitted from sahara core
Change-Id: I43e0beec6508f93a436a150749bfa23571986b9d
2019-01-03 14:54:33 -03:00

22 lines
394 B
Bash

#!/bin/bash
HADOOP_CONF=/etc/hadoop
while [ $# -gt 0 ] ; do
nodeArg=$1
exec< ${HADOOP_CONF}/topology.data
result=""
while read line ; do
ar=( $line )
if [ "${ar[0]}" = "$nodeArg" ] ; then
result="${ar[1]}"
fi
done
shift
if [ -z "$result" ] ; then
echo -n "/default/rack "
else
echo -n "$result "
fi
done