Skip to content

Commit

Permalink
[SPARK-15541] Casting ConcurrentHashMap to ConcurrentMap
Browse files Browse the repository at this point in the history
  • Loading branch information
Maciej Brynski committed Jul 28, 2016
1 parent 702178d commit 921e3c8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package org.apache.spark.rpc.netty

import java.util.concurrent.{ThreadPoolExecutor, ConcurrentHashMap, LinkedBlockingQueue, TimeUnit}
import java.util.concurrent.{ThreadPoolExecutor, ConcurrentHashMap, ConcurrentMap, LinkedBlockingQueue, TimeUnit}
import javax.annotation.concurrent.GuardedBy

import scala.collection.JavaConverters._
Expand All @@ -41,8 +41,8 @@ private[netty] class Dispatcher(nettyEnv: NettyRpcEnv) extends Logging {
val inbox = new Inbox(ref, endpoint)
}

private val endpoints = new ConcurrentHashMap[String, EndpointData]
private val endpointRefs = new ConcurrentHashMap[RpcEndpoint, RpcEndpointRef]
private val endpoints: ConcurrentMap[String, EndpointData] = new ConcurrentHashMap[String, EndpointData]
private val endpointRefs: ConcurrentMap[RpcEndpoint, RpcEndpointRef] = new ConcurrentHashMap[RpcEndpoint, RpcEndpointRef]

// Track the receivers whose inboxes may contain messages.
private val receivers = new LinkedBlockingQueue[EndpointData]
Expand Down
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,7 @@ 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 921e3c8

Please sign in to comment.