spark git commit: [SPARK-5640] Synchronize ScalaReflection where necessary

2015-02-06 Thread marmbrus
Repository: spark
Updated Branches:
  refs/heads/branch-1.3 921121d57 -> 779e28b6d


[SPARK-5640] Synchronize ScalaReflection where necessary

Author: Tobias Schlatter 

Closes #4431 from gzm0/sync-scala-refl and squashes the following commits:

c5da21e [Tobias Schlatter] [SPARK-5640] Synchronize ScalaReflection where 
necessary

(cherry picked from commit 500dc2b4b3136029457e708859fe27da93b1f9e8)
Signed-off-by: Michael Armbrust 


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/779e28b6
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/779e28b6
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/779e28b6

Branch: refs/heads/branch-1.3
Commit: 779e28b6db9f62376a4f2020a6776084ba293b95
Parents: 921121d
Author: Tobias Schlatter 
Authored: Fri Feb 6 12:15:02 2015 -0800
Committer: Michael Armbrust 
Committed: Fri Feb 6 12:15:12 2015 -0800

--
 .../scala/org/apache/spark/sql/catalyst/ScalaReflection.scala   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/spark/blob/779e28b6/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala
--
diff --git 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala
 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala
index 0445f3a..5d9c331 100644
--- 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala
+++ 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala
@@ -103,10 +103,11 @@ trait ScalaReflection {
   }
 
   /** Returns a catalyst DataType and its nullability for the given Scala Type 
using reflection. */
-  def schemaFor[T: TypeTag]: Schema = schemaFor(typeOf[T])
+  def schemaFor[T: TypeTag]: Schema =
+ScalaReflectionLock.synchronized { schemaFor(typeOf[T]) }
 
   /** Returns a catalyst DataType and its nullability for the given Scala Type 
using reflection. */
-  def schemaFor(tpe: `Type`): Schema = {
+  def schemaFor(tpe: `Type`): Schema = ScalaReflectionLock.synchronized {
 val className: String = tpe.erasure.typeSymbol.asClass.fullName
 tpe match {
   case t if Utils.classIsLoadable(className) &&


-
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org



spark git commit: [SPARK-5640] Synchronize ScalaReflection where necessary

2015-02-06 Thread marmbrus
Repository: spark
Updated Branches:
  refs/heads/master d43381615 -> 500dc2b4b


[SPARK-5640] Synchronize ScalaReflection where necessary

Author: Tobias Schlatter 

Closes #4431 from gzm0/sync-scala-refl and squashes the following commits:

c5da21e [Tobias Schlatter] [SPARK-5640] Synchronize ScalaReflection where 
necessary


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/500dc2b4
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/500dc2b4
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/500dc2b4

Branch: refs/heads/master
Commit: 500dc2b4b3136029457e708859fe27da93b1f9e8
Parents: d433816
Author: Tobias Schlatter 
Authored: Fri Feb 6 12:15:02 2015 -0800
Committer: Michael Armbrust 
Committed: Fri Feb 6 12:15:02 2015 -0800

--
 .../scala/org/apache/spark/sql/catalyst/ScalaReflection.scala   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/spark/blob/500dc2b4/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala
--
diff --git 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala
 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala
index 0445f3a..5d9c331 100644
--- 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala
+++ 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala
@@ -103,10 +103,11 @@ trait ScalaReflection {
   }
 
   /** Returns a catalyst DataType and its nullability for the given Scala Type 
using reflection. */
-  def schemaFor[T: TypeTag]: Schema = schemaFor(typeOf[T])
+  def schemaFor[T: TypeTag]: Schema =
+ScalaReflectionLock.synchronized { schemaFor(typeOf[T]) }
 
   /** Returns a catalyst DataType and its nullability for the given Scala Type 
using reflection. */
-  def schemaFor(tpe: `Type`): Schema = {
+  def schemaFor(tpe: `Type`): Schema = ScalaReflectionLock.synchronized {
 val className: String = tpe.erasure.typeSymbol.asClass.fullName
 tpe match {
   case t if Utils.classIsLoadable(className) &&


-
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org