You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hugegraph.apache.org by ji...@apache.org on 2022/11/09 10:25:33 UTC
[incubator-hugegraph] 30/33: fix ap compile error for edition 0.11 (#72)
This is an automated email from the ASF dual-hosted git repository.
jin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-hugegraph.git
commit b4fa2a16acc34c32bb041c2e6f6ccd17690c2071
Author: zhoney <zh...@baidu.com>
AuthorDate: Wed Dec 16 16:04:33 2020 +0800
fix ap compile error for edition 0.11 (#72)
Change-Id: Ibf0f415ee6bd9cf0ff8b598e2166cc70667c49b7
---
.../hugegraph/job/algorithm/cent/DegreeCentralityAlgorithm.java | 2 +-
.../com/baidu/hugegraph/job/algorithm/comm/KCoreAlgorithm.java | 8 ++------
.../job/algorithm/similarity/FusiformSimilarityAlgorithm.java | 4 +---
3 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/job/algorithm/cent/DegreeCentralityAlgorithm.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/job/algorithm/cent/DegreeCentralityAlgorithm.java
index 54b72c2bf..6592c119d 100644
--- a/hugegraph-core/src/main/java/com/baidu/hugegraph/job/algorithm/cent/DegreeCentralityAlgorithm.java
+++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/job/algorithm/cent/DegreeCentralityAlgorithm.java
@@ -30,7 +30,7 @@ import org.apache.tinkerpop.gremlin.structure.Vertex;
import com.baidu.hugegraph.backend.id.Id;
import com.baidu.hugegraph.job.UserJob;
import com.baidu.hugegraph.structure.HugeEdge;
-import com.baidu.hugegraph.traversal.algorithm.EdgeStep;
+import com.baidu.hugegraph.traversal.algorithm.steps.EdgeStep;
import com.baidu.hugegraph.type.define.Directions;
public class DegreeCentralityAlgorithm extends AbstractCentAlgorithm {
diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/job/algorithm/comm/KCoreAlgorithm.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/job/algorithm/comm/KCoreAlgorithm.java
index f03db565e..8ea287796 100644
--- a/hugegraph-core/src/main/java/com/baidu/hugegraph/job/algorithm/comm/KCoreAlgorithm.java
+++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/job/algorithm/comm/KCoreAlgorithm.java
@@ -34,7 +34,6 @@ import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
import com.baidu.hugegraph.HugeGraph;
import com.baidu.hugegraph.backend.id.Id;
import com.baidu.hugegraph.job.UserJob;
-import com.baidu.hugegraph.schema.EdgeLabel;
import com.baidu.hugegraph.traversal.algorithm.FusiformSimilarityTraverser;
import com.baidu.hugegraph.type.define.Directions;
import com.baidu.hugegraph.util.CollectionUtil;
@@ -111,7 +110,6 @@ public class KCoreAlgorithm extends AbstractCommAlgorithm {
Directions dir, String label, int k, double alpha,
long degree, boolean merged) {
HugeGraph graph = this.graph();
- EdgeLabel edgeLabel = label == null ? null : graph.edgeLabel(label);
KcoreTraverser traverser = new KcoreTraverser(graph);
JsonMap kcoresJson = new JsonMap();
@@ -123,8 +121,7 @@ public class KCoreAlgorithm extends AbstractCommAlgorithm {
this.traverse(sourceLabel, sourceCLabel, v -> {
Set<Id> kcore = traverser.kcore(IteratorUtils.of(v),
- dir, edgeLabel, k, alpha,
- degree);
+ dir, label, k, alpha, degree);
if (kcore.isEmpty()) {
return;
}
@@ -183,8 +180,7 @@ public class KCoreAlgorithm extends AbstractCommAlgorithm {
}
public Set<Id> kcore(Iterator<Vertex> vertices, Directions direction,
- EdgeLabel label, int k, double alpha,
- long degree) {
+ String label, int k, double alpha, long degree) {
int minNeighbors = (int) Math.floor(1.0 / alpha * k);
SimilarsMap map = fusiformSimilarity(vertices, direction, label,
minNeighbors, alpha, k - 1,
diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/job/algorithm/similarity/FusiformSimilarityAlgorithm.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/job/algorithm/similarity/FusiformSimilarityAlgorithm.java
index 0a1679fcf..68d3ef548 100644
--- a/hugegraph-core/src/main/java/com/baidu/hugegraph/job/algorithm/similarity/FusiformSimilarityAlgorithm.java
+++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/job/algorithm/similarity/FusiformSimilarityAlgorithm.java
@@ -28,7 +28,6 @@ import com.baidu.hugegraph.HugeGraph;
import com.baidu.hugegraph.job.UserJob;
import com.baidu.hugegraph.job.algorithm.AbstractAlgorithm;
import com.baidu.hugegraph.job.algorithm.Consumers.StopExecution;
-import com.baidu.hugegraph.schema.EdgeLabel;
import com.baidu.hugegraph.traversal.algorithm.FusiformSimilarityTraverser;
import com.baidu.hugegraph.traversal.algorithm.FusiformSimilarityTraverser.SimilarsMap;
import com.baidu.hugegraph.traversal.algorithm.HugeTraverser;
@@ -165,7 +164,6 @@ public class FusiformSimilarityAlgorithm extends AbstractAlgorithm {
String groupProperty, int minGroups,
long degree, long limit) {
HugeGraph graph = this.graph();
- EdgeLabel edgeLabel = label == null ? null : graph.edgeLabel(label);
FusiformSimilarityTraverser traverser =
new FusiformSimilarityTraverser(graph);
@@ -177,7 +175,7 @@ public class FusiformSimilarityAlgorithm extends AbstractAlgorithm {
this.traverse(sourceLabel, sourceCLabel, v -> {
SimilarsMap similars = traverser.fusiformSimilarity(
IteratorUtils.of(v), direction,
- edgeLabel, minNeighbors, alpha,
+ label, minNeighbors, alpha,
minSimilars, (int) topSimilars,
groupProperty, minGroups, degree,
MAX_CAPACITY, NO_LIMIT, true);