Skip to content

Commit 511dede

Browse files
Maciej Brynskisrowen
Maciej Brynski
authored andcommitted
[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.
1 parent dd8514f commit 511dede

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

core/src/main/scala/org/apache/spark/rpc/netty/Dispatcher.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
package org.apache.spark.rpc.netty
1919

20-
import java.util.concurrent.{ConcurrentHashMap, LinkedBlockingQueue, ThreadPoolExecutor, TimeUnit}
20+
import java.util.concurrent.{ConcurrentHashMap, ConcurrentMap, LinkedBlockingQueue, ThreadPoolExecutor, TimeUnit}
2121
import javax.annotation.concurrent.GuardedBy
2222

2323
import scala.collection.JavaConverters._
@@ -42,8 +42,10 @@ private[netty] class Dispatcher(nettyEnv: NettyRpcEnv) extends Logging {
4242
val inbox = new Inbox(ref, endpoint)
4343
}
4444

45-
private val endpoints = new ConcurrentHashMap[String, EndpointData]
46-
private val endpointRefs = new ConcurrentHashMap[RpcEndpoint, RpcEndpointRef]
45+
private val endpoints: ConcurrentMap[String, EndpointData] =
46+
new ConcurrentHashMap[String, EndpointData]
47+
private val endpointRefs: ConcurrentMap[RpcEndpoint, RpcEndpointRef] =
48+
new ConcurrentHashMap[RpcEndpoint, RpcEndpointRef]
4749

4850
// Track the receivers whose inboxes may contain messages.
4951
private val receivers = new LinkedBlockingQueue[EndpointData]

0 commit comments

Comments
 (0)