Skip to content

Commit

Permalink
Change to reuse index
Browse files Browse the repository at this point in the history
  • Loading branch information
tgravescs committed Sep 8, 2020
1 parent 1fd826b commit db665a1
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,12 @@ private[spark] object ResourceUtils extends Logging {

def listResourceIds(sparkConf: SparkConf, componentName: String): Seq[ResourceID] = {
sparkConf.getAllWithPrefix(s"$componentName.$RESOURCE_PREFIX.").map { case (key, _) =>
if (key.indexOf('.') < 0) {
val index = key.indexOf('.')
if (index < 0) {
throw new SparkException(s"You must specify an amount config for resource: $key " +
s"config: $componentName.$RESOURCE_PREFIX.$key")
}
key.substring(0, key.indexOf('.'))
key.substring(0, index)
}.distinct.map(name => new ResourceID(componentName, name))
}

Expand Down

0 comments on commit db665a1

Please sign in to comment.