diff options
author | Maciej Brynski <maciej.brynski@adpilot.pl> | 2016-08-02 08:07:08 -0700 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2016-08-02 08:07:08 -0700 |
commit | 511dede1118f20a7756f614acb6fc88af52c9de9 (patch) | |
tree | b7be7f746a5fadcefd11da5a83f782b6beabe4d2 /core | |
parent | dd8514fa2059a695143073f852b1abee50e522bd (diff) | |
download | spark-511dede1118f20a7756f614acb6fc88af52c9de9.tar.gz spark-511dede1118f20a7756f614acb6fc88af52c9de9.tar.bz2 spark-511dede1118f20a7756f614acb6fc88af52c9de9.zip |
[SPARK-15541] Casting ConcurrentHashMap to ConcurrentMap (master branch)
## 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 <maciej.brynski@adpilot.pl>
Closes #14459 from maver1ck/spark-15541-master.
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/scala/org/apache/spark/rpc/netty/Dispatcher.scala | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/src/main/scala/org/apache/spark/rpc/netty/Dispatcher.scala b/core/src/main/scala/org/apache/spark/rpc/netty/Dispatcher.scala index d305de2e13..a02cf30a5d 100644 --- a/core/src/main/scala/org/apache/spark/rpc/netty/Dispatcher.scala +++ b/core/src/main/scala/org/apache/spark/rpc/netty/Dispatcher.scala @@ -17,7 +17,7 @@ package org.apache.spark.rpc.netty -import java.util.concurrent.{ConcurrentHashMap, LinkedBlockingQueue, ThreadPoolExecutor, TimeUnit} +import java.util.concurrent.{ConcurrentHashMap, ConcurrentMap, LinkedBlockingQueue, ThreadPoolExecutor, TimeUnit} import javax.annotation.concurrent.GuardedBy import scala.collection.JavaConverters._ @@ -42,8 +42,10 @@ 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] |