Skip to content

Commit

Permalink
[SPARK-15541] Casting ConcurrentHashMap to ConcurrentMap (branch-1.6)
Browse files Browse the repository at this point in the history
## What changes were proposed in this pull request?

Casting ConcurrentHashMap to ConcurrentMap allows to run code compiled with Java 8 on Java 7

## How was this patch tested?

Compilation. Existing automatic tests

Author: Maciej Brynski <[email protected]>

Closes apache#14390 from maver1ck/spark-15541.
  • Loading branch information
Maciej Brynski authored and srowen committed Aug 2, 2016
1 parent 8a22275 commit 797e758
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package org.apache.spark.sql.catalyst.analysis

import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.{ConcurrentHashMap, ConcurrentMap}

import scala.collection.JavaConverters._
import scala.collection.mutable
Expand Down Expand Up @@ -80,7 +80,8 @@ trait Catalog {
}

class SimpleCatalog(val conf: CatalystConf) extends Catalog {
private[this] val tables = new ConcurrentHashMap[String, LogicalPlan]
private[this] val tables: ConcurrentMap[String, LogicalPlan] =
new ConcurrentHashMap[String, LogicalPlan]

override def registerTable(tableIdent: TableIdentifier, plan: LogicalPlan): Unit = {
tables.put(getTableName(tableIdent), plan)
Expand Down

0 comments on commit 797e758

Please sign in to comment.