[SPARK-1371] fix computePreferredLocations signature to not depend on underlying implementation



Change to Map and Set - not mutable HashMap and HashSet