Remove duplicated YARN getLocalDirs() code.
Update getLocalDir() documentation.
Use env vars to detect if running in YARN container.