Copied existing code back

Copied existing code back from Spark Core repo to private repo to fix
missing Github linkage.