github.com/treeverse/lakefs@v1.24.1-0.20240520134607-95648127bfb0/test/lakectl_metastore/etc/spark-thrift-entrypoint.sh (about)

     1  #!/bin/bash
     2  
     3  MAX_ATTEMPTS=15
     4  
     5  attempt_counter=0
     6  while ! /opt/bitnami/spark/bin/spark-submit --class org.apache.spark.sql.hive.thriftserver.HiveThriftServer2; do
     7    if [ ${attempt_counter} -eq ${MAX_ATTEMPTS} ]; then
     8      echo "Operation got to max attempts"
     9      exit 1
    10    fi
    11  
    12    attempt_counter=$(($attempt_counter + 1))
    13    echo "Retry run Hive Thrift Server: ${attempt_counter}/${MAX_ATTEMPTS}"
    14    sleep 1
    15  done