Change default action
Project: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/commit/83ffcd5c Tree: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/tree/83ffcd5c Diff: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/diff/83ffcd5c Branch: refs/heads/master Commit: 83ffcd5c947ddcc1e566b1134143ffe50daece77 Parents: b5a44d9 Author: daewon <[email protected]> Authored: Mon May 2 15:40:44 2016 +0900 Committer: DO YUNG YOON <[email protected]> Committed: Thu Nov 10 08:01:41 2016 +0900 ---------------------------------------------------------------------- .../apache/s2graph/core/storage/Storage.scala | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/83ffcd5c/s2core/src/main/scala/org/apache/s2graph/core/storage/Storage.scala ---------------------------------------------------------------------- diff --git a/s2core/src/main/scala/org/apache/s2graph/core/storage/Storage.scala b/s2core/src/main/scala/org/apache/s2graph/core/storage/Storage.scala index f5cc4f4..2d7d198 100644 --- a/s2core/src/main/scala/org/apache/s2graph/core/storage/Storage.scala +++ b/s2core/src/main/scala/org/apache/s2graph/core/storage/Storage.scala @@ -1322,16 +1322,18 @@ abstract class Storage[R](val config: Config)(implicit ec: ExecutionContext) { } } - def buildVertexPutsAsync(edge: Edge): Seq[SKeyValue] = - edge.label.extraOptions.get("skipVertex") match { - case Some(v) if v == false => - if (edge.op == GraphUtil.operations("delete")) - buildDeleteBelongsToId(edge.srcForVertex) ++ buildDeleteBelongsToId(edge.tgtForVertex) - else - vertexSerializer(edge.srcForVertex).toKeyValues ++ vertexSerializer(edge.tgtForVertex).toKeyValues - case _ => Seq.empty - } + def buildVertexPutsAsync(edge: Edge): Seq[SKeyValue] = { + val storeVertex = edge.label.extraOptions.get("storeVertex").map(_.as[Boolean]).getOrElse(false) + if (storeVertex) { + if (edge.op == GraphUtil.operations("delete")) + buildDeleteBelongsToId(edge.srcForVertex) ++ buildDeleteBelongsToId(edge.tgtForVertex) + else + vertexSerializer(edge.srcForVertex).toKeyValues ++ vertexSerializer(edge.tgtForVertex).toKeyValues + } else { + Seq.empty + } + } def buildPutsAll(vertex: Vertex): Seq[SKeyValue] = { vertex.op match {
