Skip to content

Commit a8894b4

Browse files
committed
MapR [SPARK-1249] Configure.sh should be able to find HBase version automatically (apache#1169)
1 parent 1fc1b9f commit a8894b4

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

bin/configure.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,14 @@ function changeWardenConfig() {
239239
fi
240240
}
241241

242+
function changeCompatibilityVersions() {
243+
component_name=$1
244+
component_version=$2
245+
compatibility_version_file_path="${SPARK_HOME}/mapr-util/compatibility.version"
246+
new_component_line="${component_name}_versions=${component_version}"
247+
sed -i "/$component_name/c\\$new_component_line" "$compatibility_version_file_path"
248+
}
249+
242250
#
243251
# Change permission
244252
#
@@ -382,6 +390,7 @@ function configureOnHive() {
382390
if [ -f $SPARK_HOME/conf/hive-site.xml ] ; then
383391
java -cp $SPARK_HOME'/jars/*' org.apache.spark.editor.HiveSiteEditor replace hive.security.authorization.manager=org.apache.hadoop.hive.ql.security.authorization.plugin.fallback.FallbackHiveAuthorizerFactory hive.execution.engine=mr
384392
fi
393+
changeCompatibilityVersions hive $HIVE_VERSION
385394
}
386395

387396
#
@@ -392,6 +401,15 @@ function configureOnHbase() {
392401
if [ -f $HBASE_HOME/conf/hbase-site.xml ]; then
393402
cp $HBASE_HOME/conf/hbase-site.xml $SPARK_HOME/conf/hbase-site.xml
394403
fi
404+
changeCompatibilityVersions hbase $HBASE_VERSION
405+
}
406+
407+
#
408+
# Configure on Hadoop
409+
#
410+
411+
function configureOnHadoop() {
412+
changeCompatibilityVersions hbase $HBASE_VERSION
395413
}
396414

397415
#
@@ -652,6 +670,7 @@ fi
652670
if [ "$HBASE_INSTALLED" = true ]; then
653671
configureOnHbase
654672
fi
673+
configureOnHadoop
655674
if [ ! "$isSecure" -eq 2 ] ; then
656675
configureSecurity
657676
fi

0 commit comments

Comments
 (0)