I have a samza job which I am trying to run on yarn cluster using
./bin/run-job.sh --config-factory=org.apache.samza.config.factories.PropertiesConfigFactory --config-path=file:///home/anshu/samzaJob.properties
The job triggers and runs fine with this configuration.
Now after the job has started, I have some application specific configurations (in form of separate properties files) which I am trying to load using apache commons configuration library. For this, I have created a appconfig folder and trying to read all the files in that folder
CONFIGURATION_FILE_PATH = System.getProperty("user.dir") + "/config/appconfig";
This works fine on my local box, but when this is run on yarn cluster, this resolves to
/var/lib/hadoop-yarn/data/samza-yarn/usercache/anshu/appcache/application_1462311090906_0973/container_e19_1462311090906_0973_01_000003/config/appconfig
which is not correct.
How should I find the correct path to load the file from? Or is there any other way this can be done?