Skip to content
Snippets Groups Projects
Commit 63311d9c authored by Joseph E. Gonzalez's avatar Joseph E. Gonzalez
Browse files

renamed update to setMerge

parent 7f584403
No related branches found
No related tags found
No related merge requests found
...@@ -79,7 +79,7 @@ class OpenHashMap[K >: Null : ClassManifest, @specialized(Long, Int, Double) V: ...@@ -79,7 +79,7 @@ class OpenHashMap[K >: Null : ClassManifest, @specialized(Long, Int, Double) V:
} }
/** Set the value for a key */ /** Set the value for a key */
def update(k: K, v: V, mergeF: (V,V) => V) { def setMerge(k: K, v: V, mergeF: (V,V) => V) {
if (k == null) { if (k == null) {
if(haveNullValue) { if(haveNullValue) {
nullValue = mergeF(nullValue, v) nullValue = mergeF(nullValue, v)
......
...@@ -65,7 +65,7 @@ class PrimitiveKeyOpenHashMap[@specialized(Long, Int) K: ClassManifest, ...@@ -65,7 +65,7 @@ class PrimitiveKeyOpenHashMap[@specialized(Long, Int) K: ClassManifest,
/** Set the value for a key */ /** Set the value for a key */
def update(k: K, v: V, mergeF: (V,V) => V) { def setMerge(k: K, v: V, mergeF: (V,V) => V) {
val pos = keySet.fastAdd(k) val pos = keySet.fastAdd(k)
val ind = pos & OpenHashSet.POSITION_MASK val ind = pos & OpenHashSet.POSITION_MASK
if ((pos & OpenHashSet.EXISTENCE_MASK) != 0) { // if first add if ((pos & OpenHashSet.EXISTENCE_MASK) != 0) { // if first add
......
...@@ -641,7 +641,7 @@ object VertexSetRDD { ...@@ -641,7 +641,7 @@ object VertexSetRDD {
val groups = preAgg.mapPartitions( iter => { val groups = preAgg.mapPartitions( iter => {
val hashMap = new PrimitiveKeyOpenHashMap[Vid, V] val hashMap = new PrimitiveKeyOpenHashMap[Vid, V]
for ((k,v) <- iter) { for ((k,v) <- iter) {
hashMap.update(k, v, reduceFunc) hashMap.setMerge(k, v, reduceFunc)
} }
val index = hashMap.keySet val index = hashMap.keySet
val values: IndexedSeq[V] = hashMap._values val values: IndexedSeq[V] = hashMap._values
......
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