Remove unused EdgePartition.filter
This commit is contained in:
parent
6bb077cd3d
commit
cd01539d6f
|
@ -56,16 +56,6 @@ class EdgePartition[@specialized(Char, Int, Boolean, Byte, Long, Float, Double)
|
|||
new EdgePartition(srcIds, dstIds, newData, index)
|
||||
}
|
||||
|
||||
def filter(pred: Edge[ED] => Boolean): EdgePartition[ED] = {
|
||||
val builder = new EdgePartitionBuilder[ED]
|
||||
iterator.foreach { e =>
|
||||
if (pred(e)) {
|
||||
builder.add(e.srcId, e.dstId, e.attr)
|
||||
}
|
||||
}
|
||||
builder.toEdgePartition
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply the function f to all edges in this partition.
|
||||
*
|
||||
|
|
|
@ -31,17 +31,6 @@ class EdgePartitionSuite extends FunSuite {
|
|||
edges.map(e => e.copy(attr = e.srcId + e.dstId)))
|
||||
}
|
||||
|
||||
test("filter") {
|
||||
val edges = List(Edge(0, 1, 0), Edge(1, 2, 0), Edge(2, 0, 0))
|
||||
val builder = new EdgePartitionBuilder[Int]
|
||||
for (e <- edges) {
|
||||
builder.add(e.srcId, e.dstId, e.attr)
|
||||
}
|
||||
val edgePartition = builder.toEdgePartition
|
||||
assert(edgePartition.filter(e => e.srcId <= 1).iterator.map(_.copy()).toList ===
|
||||
edges.filter(e => e.srcId <= 1))
|
||||
}
|
||||
|
||||
test("groupEdges") {
|
||||
val edges = List(
|
||||
Edge(0, 1, 1), Edge(1, 2, 2), Edge(2, 0, 4), Edge(0, 1, 8), Edge(1, 2, 16), Edge(2, 0, 32))
|
||||
|
|
Loading…
Reference in a new issue