Skip to content
Snippets Groups Projects
Commit 511dede1 authored by Maciej Brynski's avatar Maciej Brynski Committed by Sean Owen
Browse files

[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.
parent dd8514fa
No related branches found
No related tags found
No related merge requests found
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
package org.apache.spark.rpc.netty 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 javax.annotation.concurrent.GuardedBy
import scala.collection.JavaConverters._ import scala.collection.JavaConverters._
...@@ -42,8 +42,10 @@ private[netty] class Dispatcher(nettyEnv: NettyRpcEnv) extends Logging { ...@@ -42,8 +42,10 @@ private[netty] class Dispatcher(nettyEnv: NettyRpcEnv) extends Logging {
val inbox = new Inbox(ref, endpoint) val inbox = new Inbox(ref, endpoint)
} }
private val endpoints = new ConcurrentHashMap[String, EndpointData] private val endpoints: ConcurrentMap[String, EndpointData] =
private val endpointRefs = new ConcurrentHashMap[RpcEndpoint, RpcEndpointRef] new ConcurrentHashMap[String, EndpointData]
private val endpointRefs: ConcurrentMap[RpcEndpoint, RpcEndpointRef] =
new ConcurrentHashMap[RpcEndpoint, RpcEndpointRef]
// Track the receivers whose inboxes may contain messages. // Track the receivers whose inboxes may contain messages.
private val receivers = new LinkedBlockingQueue[EndpointData] private val receivers = new LinkedBlockingQueue[EndpointData]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment