@@ -90,23 +90,32 @@ private[graphx] abstract class VertexPartitionBaseOps
90
90
91
91
/**
92
92
* Hides vertices that are the same between this and other. For vertices that are different, keeps
93
- * the values from `other`. The indices of `this` and `other` must be the same.
93
+ * the values from `other`.
94
94
*/
95
95
def diff (other : Self [VD ]): Self [VD ] = {
96
- if (self.index != other.index) {
97
- logWarning(" Diffing two VertexPartitions with different indexes is slow." )
98
- diff(createUsingIndex(other.iterator))
99
- } else {
100
- val newMask = self.mask & other.mask
96
+ // if (self.index != other.index) {
97
+ // logWarning("Diffing two VertexPartitions with different indexes is slow.")
98
+ // diff(createUsingIndex(other.iterator))
99
+ // } else {
100
+ // val newMask = self.mask & other.mask
101
+ /* logInfo("NEWMASK START " + other.iterator.mkString + " AND " +
102
+ self.iterator.mkString)
101
103
var i = newMask.nextSetBit(0)
102
104
while (i >= 0) {
103
105
if (self.values(i) == other.values(i)) {
106
+ logInfo("BEFORE i: " + i + " newMask: " + newMask.iterator.mkString +
107
+ " sv " + self.values(i) + " ov " + other.values(i) + " om: " +
108
+ other.mask.iterator.mkString + " selfm: " +
109
+ self.mask.iterator.mkString)
104
110
newMask.unset(i)
105
111
}
106
112
i = newMask.nextSetBit(i + 1)
107
- }
108
- this .withValues(other.values).withMask(newMask)
109
- }
113
+ }*/
114
+ this
115
+ .withIndex(other.index)
116
+ .withValues(other.values)
117
+ .withMask((self.mask & other.mask) ^ other.mask)
118
+ // }
110
119
}
111
120
112
121
/** Left outer join another VertexPartition. */
@@ -172,7 +181,7 @@ private[graphx] abstract class VertexPartitionBaseOps
172
181
val newMask = new BitSet (self.capacity)
173
182
val newValues = new Array [VD2 ](self.capacity)
174
183
iter.foreach { pair =>
175
- val pos = self.index.getPos(pair._1)
184
+ var pos = self.index.getPos(pair._1)
176
185
if (pos >= 0 ) {
177
186
newMask.set(pos)
178
187
newValues(pos) = pair._2
0 commit comments