You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by yl...@apache.org on 2017/07/31 02:42:15 UTC
spark git commit: [SPARK-21575][SPARKR] Eliminate needless
synchronization in java-R serialization
Repository: spark
Updated Branches:
refs/heads/master 44e501ace -> 106eaa9b9
[SPARK-21575][SPARKR] Eliminate needless synchronization in java-R serialization
## What changes were proposed in this pull request?
Remove surplus synchronized blocks.
## How was this patch tested?
Unit tests run OK.
Author: iurii.ant <se...@gmail.com>
Closes #18775 from SereneAnt/eliminate_unnecessary_synchronization_in_java-R_serialization.
Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/106eaa9b
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/106eaa9b
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/106eaa9b
Branch: refs/heads/master
Commit: 106eaa9b95192f0cdbb382c11efdcb85032e679b
Parents: 44e501a
Author: iurii.ant <se...@gmail.com>
Authored: Mon Jul 31 10:42:09 2017 +0800
Committer: Yanbo Liang <yb...@gmail.com>
Committed: Mon Jul 31 10:42:09 2017 +0800
----------------------------------------------------------------------
.../org/apache/spark/api/r/JVMObjectTracker.scala | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/spark/blob/106eaa9b/core/src/main/scala/org/apache/spark/api/r/JVMObjectTracker.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/org/apache/spark/api/r/JVMObjectTracker.scala b/core/src/main/scala/org/apache/spark/api/r/JVMObjectTracker.scala
index 3432700..fe7438a 100644
--- a/core/src/main/scala/org/apache/spark/api/r/JVMObjectTracker.scala
+++ b/core/src/main/scala/org/apache/spark/api/r/JVMObjectTracker.scala
@@ -37,13 +37,7 @@ private[r] class JVMObjectTracker {
/**
* Returns the JVM object associated with the input key or None if not found.
*/
- final def get(id: JVMObjectId): Option[Object] = this.synchronized {
- if (objMap.containsKey(id)) {
- Some(objMap.get(id))
- } else {
- None
- }
- }
+ final def get(id: JVMObjectId): Option[Object] = Option(objMap.get(id))
/**
* Returns the JVM object associated with the input key or throws an exception if not found.
@@ -67,13 +61,7 @@ private[r] class JVMObjectTracker {
/**
* Removes and returns a JVM object with the specific ID from the tracker, or None if not found.
*/
- final def remove(id: JVMObjectId): Option[Object] = this.synchronized {
- if (objMap.containsKey(id)) {
- Some(objMap.remove(id))
- } else {
- None
- }
- }
+ final def remove(id: JVMObjectId): Option[Object] = Option(objMap.remove(id))
/**
* Number of JVM objects being tracked.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org