diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/job/AlgorithmAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/job/AlgorithmAPI.java index c965e02a56..b0e0d06925 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/job/AlgorithmAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/job/AlgorithmAPI.java @@ -21,15 +21,6 @@ import java.util.Map; -import javax.inject.Singleton; -import javax.ws.rs.Consumes; -import javax.ws.rs.NotFoundException; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Context; - import org.slf4j.Logger; import com.baidu.hugegraph.HugeGraph; @@ -46,6 +37,15 @@ import com.codahale.metrics.annotation.Timed; import com.google.common.collect.ImmutableMap; +import jakarta.inject.Singleton; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.NotFoundException; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.Context; + @Path("graphs/{graph}/jobs/algorithm") @Singleton public class AlgorithmAPI extends API { diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/job/algorithm/AbstractAlgorithm.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/job/algorithm/AbstractAlgorithm.java index 943debb4b8..dbe3f7e2b8 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/job/algorithm/AbstractAlgorithm.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/job/algorithm/AbstractAlgorithm.java @@ -57,8 +57,7 @@ import com.baidu.hugegraph.util.E; import com.baidu.hugegraph.util.JsonUtil; import com.baidu.hugegraph.util.ParameterUtil; - -import jersey.repackaged.com.google.common.base.Objects; +import com.google.common.base.Objects; @SuppressWarnings("deprecation") // StringEscapeUtils public abstract class AbstractAlgorithm implements Algorithm { @@ -382,9 +381,7 @@ protected Iterator vertices(Object label, long limit) { ConditionQuery query = new ConditionQuery(HugeType.VERTEX); query.capacity(Query.NO_CAPACITY); query.limit(limit); - if (label != null) { - query.eq(HugeKeys.LABEL, this.getVertexLabelId(label)); - } + query.eq(HugeKeys.LABEL, this.getVertexLabelId(label)); return this.graph().vertices(query); } @@ -544,8 +541,8 @@ public JsonMap() { this(4 * (int) Bytes.KB); } - public JsonMap(int initCapaticy) { - this.json = new StringBuilder(initCapaticy); + public JsonMap(int initCapacity) { + this.json = new StringBuilder(initCapacity); } public void startObject() { diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/job/algorithm/SubgraphStatAlgorithm.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/job/algorithm/SubgraphStatAlgorithm.java index d91748e41e..4779905e00 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/job/algorithm/SubgraphStatAlgorithm.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/job/algorithm/SubgraphStatAlgorithm.java @@ -22,7 +22,7 @@ import java.util.Iterator; import java.util.Map; -import org.apache.commons.configuration.PropertiesConfiguration; +import org.apache.commons.configuration2.PropertiesConfiguration; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.slf4j.Logger; @@ -90,7 +90,6 @@ private HugeGraph createTempGraph(UserJob job) { PropertiesConfiguration config = new PropertiesConfiguration(); config.setProperty(CoreOptions.BACKEND.name(), "memory"); config.setProperty(CoreOptions.STORE.name(), name); - config.setDelimiterParsingDisabled(true); /* * NOTE: this temp graph don't need to init backend because no task info * required, also not set started because no task to be scheduled. @@ -129,12 +128,11 @@ protected static boolean copySchema(Map parameters) { private static class Traverser extends AlgoTraverser { - private static Map PARAMS = ImmutableMap.of( - "depth", 10L, - "degree", -1L, - "sample", -1L, - "top", -1L /* sorted */, - "workers", 0); + private static final Map PARAMS = ImmutableMap.of("depth", 10L, + "degree", -1L, + "sample", -1L, + "top", -1L /* sorted */, + "workers", 0); public Traverser(UserJob job) { super(job);