[SPARK-3161][MLLIB] Adding a node Id caching mechanism for training deci...

...sion trees. @jkbradley @mengxr @chouqin Please review this.
Have you checked out timing to see if using a Map like this causes issues with garbage collection?  I'm wondering if using something like org.apache.spark.util.collection.OpenHashMap would be more efficient; you could construct the map using an OpenHashMap and then cast it to an immutable map.  I've only tested locally so far, and it does not seem to be an issue.  But we can keep it in mind for distributed tests if we ever see that the internal timing for findBestSplits is significantly different from chooseSplits.