Scenario:
I am running the Spark Scala job in AWS EMR. Now my job dumps some metadata unique to that application. Now for dumping I am writing at location "s3://bucket/key/<APPLICATION_ID>" Where ApplicationId is val APPLICATION_ID: String = getSparkSession.sparkContext.getConf.getAppId
Now basically is there a way to write at s3 location something like "s3://bucket/key/<emr_cluster_id>_<emr_step_id>". How can i get the cluster id and step id from inside the spark Scala application.
Writing in this way will help me debug and help me in reaching the cluster based and debug the logs.
Is there any way other than reading the "/mnt/var/lib/info/job-flow.json" ?
PS: I am new to spark, scala and emr . Apologies in advance if this is an obvious query.