[SPARK-3543] Write TaskContext in Java and expose it through a static accessor.

actually don't make them public - this breaks binary compatibility right now.

you should make them private, and create a public accessor stageId()