Repository: spark
Updated Branches:
  refs/heads/branch-1.0 8d92d93c0 -> 00a3ccc7c


SPARK-1611: Fix incorrect initialization order in AppendOnlyMap

JIRA: https://issues.apache.org/jira/browse/SPARK-1611

Author: zsxwing <zsxw...@gmail.com>

Closes #534 from zsxwing/SPARK-1611 and squashes the following commits:

96af089 [zsxwing] SPARK-1611: Fix incorrect initialization order in 
AppendOnlyMap
(cherry picked from commit 78a49b2532d4751257654dfe55a564bcd10701b3)

Signed-off-by: Patrick Wendell <pwend...@gmail.com>


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

Branch: refs/heads/branch-1.0
Commit: 00a3ccc7cbf2d256ddaf9557d856f997b1e6f2c3
Parents: 8d92d93
Author: zsxwing <zsxw...@gmail.com>
Authored: Thu Apr 24 11:13:40 2014 -0700
Committer: Patrick Wendell <pwend...@gmail.com>
Committed: Thu Apr 24 11:13:56 2014 -0700

----------------------------------------------------------------------
 .../scala/org/apache/spark/util/collection/AppendOnlyMap.scala   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/00a3ccc7/core/src/main/scala/org/apache/spark/util/collection/AppendOnlyMap.scala
----------------------------------------------------------------------
diff --git 
a/core/src/main/scala/org/apache/spark/util/collection/AppendOnlyMap.scala 
b/core/src/main/scala/org/apache/spark/util/collection/AppendOnlyMap.scala
index ad38250..1a6f1c2 100644
--- a/core/src/main/scala/org/apache/spark/util/collection/AppendOnlyMap.scala
+++ b/core/src/main/scala/org/apache/spark/util/collection/AppendOnlyMap.scala
@@ -40,6 +40,8 @@ class AppendOnlyMap[K, V](initialCapacity: Int = 64)
   require(initialCapacity <= (1 << 29), "Can't make capacity bigger than 2^29 
elements")
   require(initialCapacity >= 1, "Invalid initial capacity")
 
+  private val LOAD_FACTOR = 0.7
+
   private var capacity = nextPowerOf2(initialCapacity)
   private var mask = capacity - 1
   private var curSize = 0
@@ -57,8 +59,6 @@ class AppendOnlyMap[K, V](initialCapacity: Int = 64)
   private var destroyed = false
   private val destructionMessage = "Map state is invalid from destructive 
sorting!"
 
-  private val LOAD_FACTOR = 0.7
-
   /** Get the value for a given key */
   def apply(key: K): V = {
     assert(!destroyed, destructionMessage)

Reply via email to