diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/API.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/API.java index e1c98b1565..ab84acad21 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/API.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/API.java @@ -36,7 +36,6 @@ import com.baidu.hugegraph.core.GraphManager; import com.baidu.hugegraph.define.Checkable; import com.baidu.hugegraph.metrics.MetricsUtil; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.util.E; import com.baidu.hugegraph.util.JsonUtil; import com.baidu.hugegraph.util.Log; diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/AccessAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/AccessAPI.java index 7e9b61e2e9..b616d6dd9c 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/AccessAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/AccessAPI.java @@ -46,7 +46,6 @@ import com.baidu.hugegraph.core.GraphManager; import com.baidu.hugegraph.define.Checkable; import com.baidu.hugegraph.exception.NotFoundException; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.util.E; import com.baidu.hugegraph.util.Log; import com.codahale.metrics.annotation.Timed; diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/BelongAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/BelongAPI.java index 1567be3ce5..0435c60889 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/BelongAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/BelongAPI.java @@ -45,7 +45,6 @@ import com.baidu.hugegraph.core.GraphManager; import com.baidu.hugegraph.define.Checkable; import com.baidu.hugegraph.exception.NotFoundException; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.util.E; import com.baidu.hugegraph.util.Log; import com.codahale.metrics.annotation.Timed; diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/GroupAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/GroupAPI.java index 7537724028..943a5d8bb9 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/GroupAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/GroupAPI.java @@ -45,7 +45,6 @@ import com.baidu.hugegraph.core.GraphManager; import com.baidu.hugegraph.define.Checkable; import com.baidu.hugegraph.exception.NotFoundException; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.util.E; import com.baidu.hugegraph.util.Log; import com.codahale.metrics.annotation.Timed; diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/LoginAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/LoginAPI.java index 75b68e506c..08e1903939 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/LoginAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/LoginAPI.java @@ -47,7 +47,6 @@ import com.baidu.hugegraph.auth.UserWithRole; import com.baidu.hugegraph.core.GraphManager; import com.baidu.hugegraph.define.Checkable; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.util.E; import com.baidu.hugegraph.util.Log; import com.codahale.metrics.annotation.Timed; diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/ProjectAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/ProjectAPI.java index 871824f40e..6ecbe8de5e 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/ProjectAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/ProjectAPI.java @@ -50,7 +50,6 @@ import com.baidu.hugegraph.core.GraphManager; import com.baidu.hugegraph.define.Checkable; import com.baidu.hugegraph.exception.NotFoundException; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.util.E; import com.baidu.hugegraph.util.Log; import com.codahale.metrics.annotation.Timed; diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/TargetAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/TargetAPI.java index 5ac5fb5f5b..c19facc8e6 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/TargetAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/TargetAPI.java @@ -45,7 +45,6 @@ import com.baidu.hugegraph.core.GraphManager; import com.baidu.hugegraph.define.Checkable; import com.baidu.hugegraph.exception.NotFoundException; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.util.E; import com.baidu.hugegraph.util.JsonUtil; import com.baidu.hugegraph.util.Log; diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/UserAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/UserAPI.java index 2c3334e87c..ce4fe3b316 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/UserAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/UserAPI.java @@ -47,7 +47,6 @@ import com.baidu.hugegraph.core.GraphManager; import com.baidu.hugegraph.define.Checkable; import com.baidu.hugegraph.exception.NotFoundException; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.util.E; import com.baidu.hugegraph.util.Log; import com.baidu.hugegraph.util.StringEncoding; diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/filter/CompressInterceptor.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/filter/CompressInterceptor.java index df342af8d3..b7c3f24cfe 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/filter/CompressInterceptor.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/filter/CompressInterceptor.java @@ -36,7 +36,6 @@ import org.slf4j.Logger; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.util.Log; @Provider diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/job/ComputerAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/job/ComputerAPI.java index 5527cc7aa1..f3825f893e 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/job/ComputerAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/job/ComputerAPI.java @@ -40,7 +40,6 @@ import com.baidu.hugegraph.core.GraphManager; import com.baidu.hugegraph.job.ComputerJob; import com.baidu.hugegraph.job.JobBuilder; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.task.HugeTask; import com.baidu.hugegraph.util.E; import com.baidu.hugegraph.util.JsonUtil; diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/job/GremlinAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/job/GremlinAPI.java index 1f6e177d05..46039271a3 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/job/GremlinAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/job/GremlinAPI.java @@ -49,7 +49,6 @@ import com.baidu.hugegraph.job.GremlinJob; import com.baidu.hugegraph.job.JobBuilder; import com.baidu.hugegraph.metrics.MetricsUtil; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.util.E; import com.baidu.hugegraph.util.JsonUtil; import com.baidu.hugegraph.util.Log; diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/job/TaskAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/job/TaskAPI.java index c96fb6008d..bdd7bdc8d5 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/job/TaskAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/job/TaskAPI.java @@ -49,7 +49,6 @@ import com.baidu.hugegraph.backend.id.IdGenerator; import com.baidu.hugegraph.backend.page.PageInfo; import com.baidu.hugegraph.core.GraphManager; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.task.HugeTask; import com.baidu.hugegraph.task.TaskScheduler; import com.baidu.hugegraph.task.TaskStatus; diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/profile/GraphsAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/profile/GraphsAPI.java index 1b784f7594..d59a9afaa4 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/profile/GraphsAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/profile/GraphsAPI.java @@ -50,7 +50,6 @@ import com.baidu.hugegraph.auth.HugePermission; import com.baidu.hugegraph.config.HugeConfig; import com.baidu.hugegraph.core.GraphManager; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.type.define.GraphMode; import com.baidu.hugegraph.type.define.GraphReadMode; import com.baidu.hugegraph.util.E; diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/AdamicAdarAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/AdamicAdarAPI.java index f8bcd5d60a..2f3dc115e7 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/AdamicAdarAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/AdamicAdarAPI.java @@ -67,7 +67,7 @@ public String get(@Context GraphManager manager, @QueryParam("max_degree") @DefaultValue(DEFAULT_MAX_DEGREE) long maxDegree, @QueryParam("limit") - @DefaultValue(DEFAULT_ELEMENTS_LIMIT) long limit) { + @DefaultValue(DEFAULT_ELEMENTS_LIMIT) int limit) { LOG.debug("Graph [{}] get adamic adar between '{}' and '{}' with " + "direction {}, edge label {}, max degree '{}' and limit '{}'", graph, current, other, direction, edgeLabel, maxDegree, diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/AllShortestPathsAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/AllShortestPathsAPI.java index 5f33a6f5d0..2b8660f90d 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/AllShortestPathsAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/AllShortestPathsAPI.java @@ -42,7 +42,6 @@ import com.baidu.hugegraph.api.graph.VertexAPI; import com.baidu.hugegraph.backend.id.Id; import com.baidu.hugegraph.core.GraphManager; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.traversal.algorithm.HugeTraverser; import com.baidu.hugegraph.traversal.algorithm.ShortestPathTraverser; import com.baidu.hugegraph.type.define.Directions; diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/CountAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/CountAPI.java index ef93aa8e39..3a0ebb2e64 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/CountAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/CountAPI.java @@ -41,7 +41,6 @@ import com.baidu.hugegraph.api.API; import com.baidu.hugegraph.backend.id.Id; import com.baidu.hugegraph.core.GraphManager; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.structure.HugeVertex; import com.baidu.hugegraph.traversal.algorithm.CountTraverser; import com.baidu.hugegraph.traversal.algorithm.steps.EdgeStep; diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/CrosspointsAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/CrosspointsAPI.java index 689df287b9..53daf2f1d3 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/CrosspointsAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/CrosspointsAPI.java @@ -41,7 +41,6 @@ import com.baidu.hugegraph.api.graph.VertexAPI; import com.baidu.hugegraph.backend.id.Id; import com.baidu.hugegraph.core.GraphManager; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.traversal.algorithm.HugeTraverser; import com.baidu.hugegraph.traversal.algorithm.PathsTraverser; import com.baidu.hugegraph.type.define.Directions; @@ -70,7 +69,7 @@ public String get(@Context GraphManager manager, @QueryParam("capacity") @DefaultValue(DEFAULT_CAPACITY) long capacity, @QueryParam("limit") - @DefaultValue(DEFAULT_PATHS_LIMIT) long limit) { + @DefaultValue(DEFAULT_PATHS_LIMIT) int limit) { LOG.debug("Graph [{}] get crosspoints with paths from '{}', to '{}' " + "with direction '{}', edge label '{}', max depth '{}', " + "max degree '{}', capacity '{}' and limit '{}'", diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/CustomizedCrosspointsAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/CustomizedCrosspointsAPI.java index 5af4a3cb22..c1699e9bd5 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/CustomizedCrosspointsAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/CustomizedCrosspointsAPI.java @@ -47,7 +47,6 @@ import com.baidu.hugegraph.backend.id.Id; import com.baidu.hugegraph.backend.query.QueryResults; import com.baidu.hugegraph.core.GraphManager; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.traversal.algorithm.CustomizedCrosspointsTraverser; import com.baidu.hugegraph.traversal.algorithm.HugeTraverser; import com.baidu.hugegraph.type.define.Directions; @@ -141,7 +140,7 @@ private static class CrosspointsRequest { @JsonProperty("capacity") public long capacity = Long.parseLong(DEFAULT_CAPACITY); @JsonProperty("limit") - public long limit = Long.parseLong(DEFAULT_PATHS_LIMIT); + public int limit = Integer.parseInt(DEFAULT_PATHS_LIMIT); @JsonProperty("with_path") public boolean withPath = false; @JsonProperty("with_vertex") diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/CustomizedPathsAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/CustomizedPathsAPI.java index 3c1d9559a5..4e525f2873 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/CustomizedPathsAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/CustomizedPathsAPI.java @@ -49,7 +49,6 @@ import com.baidu.hugegraph.backend.id.Id; import com.baidu.hugegraph.backend.query.QueryResults; import com.baidu.hugegraph.core.GraphManager; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.traversal.algorithm.CustomizePathsTraverser; import com.baidu.hugegraph.traversal.algorithm.HugeTraverser; import com.baidu.hugegraph.traversal.algorithm.steps.WeightedEdgeStep; @@ -141,7 +140,7 @@ private static class PathRequest { @JsonProperty("capacity") public long capacity = Long.parseLong(DEFAULT_CAPACITY); @JsonProperty("limit") - public long limit = Long.parseLong(DEFAULT_PATHS_LIMIT); + public int limit = Integer.parseInt(DEFAULT_PATHS_LIMIT); @JsonProperty("with_vertex") public boolean withVertex = false; diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/EdgesAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/EdgesAPI.java index a155b0e52c..200d0b1aeb 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/EdgesAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/EdgesAPI.java @@ -44,7 +44,6 @@ import com.baidu.hugegraph.backend.query.ConditionQuery; import com.baidu.hugegraph.backend.store.Shard; import com.baidu.hugegraph.core.GraphManager; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.structure.HugeEdge; import com.baidu.hugegraph.type.HugeType; import com.baidu.hugegraph.util.E; diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/FusiformSimilarityAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/FusiformSimilarityAPI.java index 6a34e9e6fd..8e659c101f 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/FusiformSimilarityAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/FusiformSimilarityAPI.java @@ -43,7 +43,6 @@ import com.baidu.hugegraph.api.API; import com.baidu.hugegraph.backend.query.QueryResults; import com.baidu.hugegraph.core.GraphManager; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.traversal.algorithm.FusiformSimilarityTraverser; import com.baidu.hugegraph.traversal.algorithm.FusiformSimilarityTraverser.SimilarsMap; import com.baidu.hugegraph.type.define.Directions; @@ -146,7 +145,7 @@ private static class FusiformSimilarityRequest { @JsonProperty("capacity") public long capacity = Long.parseLong(DEFAULT_CAPACITY); @JsonProperty("limit") - public long limit = Long.parseLong(DEFAULT_PATHS_LIMIT); + public int limit = Integer.parseInt(DEFAULT_PATHS_LIMIT); @JsonProperty("with_intermediary") public boolean withIntermediary = false; @JsonProperty("with_vertex") diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/JaccardSimilarityAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/JaccardSimilarityAPI.java index d8ec29562c..3a31cf4ebe 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/JaccardSimilarityAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/JaccardSimilarityAPI.java @@ -44,7 +44,6 @@ import com.baidu.hugegraph.api.graph.VertexAPI; import com.baidu.hugegraph.backend.id.Id; import com.baidu.hugegraph.core.GraphManager; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.structure.HugeVertex; import com.baidu.hugegraph.traversal.algorithm.steps.EdgeStep; import com.baidu.hugegraph.traversal.algorithm.JaccardSimilarTraverser; diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/KneighborAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/KneighborAPI.java index 71e85b5288..31fd626f83 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/KneighborAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/KneighborAPI.java @@ -49,7 +49,6 @@ import com.baidu.hugegraph.backend.query.Query; import com.baidu.hugegraph.backend.query.QueryResults; import com.baidu.hugegraph.core.GraphManager; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.structure.HugeVertex; import com.baidu.hugegraph.traversal.algorithm.HugeTraverser; import com.baidu.hugegraph.traversal.algorithm.KneighborTraverser; @@ -81,7 +80,7 @@ public String get(@Context GraphManager manager, @QueryParam("max_degree") @DefaultValue(DEFAULT_MAX_DEGREE) long maxDegree, @QueryParam("limit") - @DefaultValue(DEFAULT_ELEMENTS_LIMIT) long limit) { + @DefaultValue(DEFAULT_ELEMENTS_LIMIT) int limit) { LOG.debug("Graph [{}] get k-neighbor from '{}' with " + "direction '{}', edge label '{}', max depth '{}', " + "max degree '{}' and limit '{}'", @@ -172,7 +171,7 @@ private static class Request { @JsonProperty("max_depth") public int maxDepth; @JsonProperty("limit") - public long limit = Long.parseLong(DEFAULT_ELEMENTS_LIMIT); + public int limit = Integer.parseInt(DEFAULT_ELEMENTS_LIMIT); @JsonProperty("count_only") public boolean countOnly = false; @JsonProperty("with_vertex") diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/KoutAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/KoutAPI.java index ef315dd36a..11a069cf80 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/KoutAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/KoutAPI.java @@ -50,7 +50,6 @@ import com.baidu.hugegraph.backend.query.Query; import com.baidu.hugegraph.backend.query.QueryResults; import com.baidu.hugegraph.core.GraphManager; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.structure.HugeVertex; import com.baidu.hugegraph.traversal.algorithm.HugeTraverser; import com.baidu.hugegraph.traversal.algorithm.KoutTraverser; @@ -86,7 +85,7 @@ public String get(@Context GraphManager manager, @QueryParam("capacity") @DefaultValue(DEFAULT_CAPACITY) long capacity, @QueryParam("limit") - @DefaultValue(DEFAULT_ELEMENTS_LIMIT) long limit) { + @DefaultValue(DEFAULT_ELEMENTS_LIMIT) int limit) { LOG.debug("Graph [{}] get k-out from '{}' with " + "direction '{}', edge label '{}', max depth '{}', nearest " + "'{}', max degree '{}', capacity '{}' and limit '{}'", @@ -188,7 +187,7 @@ private static class Request { @JsonProperty("capacity") public long capacity = Long.parseLong(DEFAULT_CAPACITY); @JsonProperty("limit") - public long limit = Long.parseLong(DEFAULT_ELEMENTS_LIMIT); + public int limit = Integer.parseInt(DEFAULT_ELEMENTS_LIMIT); @JsonProperty("with_vertex") public boolean withVertex = false; @JsonProperty("with_path") diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/MultiNodeShortestPathAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/MultiNodeShortestPathAPI.java index f09da73854..dcf9d715f3 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/MultiNodeShortestPathAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/MultiNodeShortestPathAPI.java @@ -42,7 +42,6 @@ import com.baidu.hugegraph.backend.id.Id; import com.baidu.hugegraph.backend.query.QueryResults; import com.baidu.hugegraph.core.GraphManager; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.traversal.algorithm.steps.EdgeStep; import com.baidu.hugegraph.traversal.algorithm.HugeTraverser; import com.baidu.hugegraph.traversal.algorithm.MultiNodeShortestPathTraverser; diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/NeighborRankAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/NeighborRankAPI.java index d164db502e..7361c27a1c 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/NeighborRankAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/NeighborRankAPI.java @@ -42,7 +42,6 @@ import com.baidu.hugegraph.api.API; import com.baidu.hugegraph.backend.id.Id; import com.baidu.hugegraph.core.GraphManager; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.structure.HugeVertex; import com.baidu.hugegraph.traversal.algorithm.NeighborRankTraverser; import com.baidu.hugegraph.type.define.Directions; diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/PathsAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/PathsAPI.java index fa87db58a2..c227c283e0 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/PathsAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/PathsAPI.java @@ -50,7 +50,6 @@ import com.baidu.hugegraph.backend.id.Id; import com.baidu.hugegraph.backend.query.QueryResults; import com.baidu.hugegraph.core.GraphManager; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.traversal.algorithm.CollectionPathsTraverser; import com.baidu.hugegraph.traversal.algorithm.HugeTraverser; import com.baidu.hugegraph.traversal.algorithm.PathsTraverser; @@ -83,7 +82,7 @@ public String get(@Context GraphManager manager, @QueryParam("capacity") @DefaultValue(DEFAULT_CAPACITY) long capacity, @QueryParam("limit") - @DefaultValue(DEFAULT_PATHS_LIMIT) long limit) { + @DefaultValue(DEFAULT_PATHS_LIMIT) int limit) { LOG.debug("Graph [{}] get paths from '{}', to '{}' with " + "direction {}, edge label {}, max depth '{}', " + "max degree '{}', capacity '{}' and limit '{}'", @@ -169,7 +168,7 @@ private static class Request { @JsonProperty("capacity") public long capacity = Long.parseLong(DEFAULT_CAPACITY); @JsonProperty("limit") - public long limit = Long.parseLong(DEFAULT_PATHS_LIMIT); + public int limit = Integer.parseInt(DEFAULT_PATHS_LIMIT); @JsonProperty("with_vertex") public boolean withVertex = false; diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/PersonalRankAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/PersonalRankAPI.java index da74ef04bd..96c17e9e84 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/PersonalRankAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/PersonalRankAPI.java @@ -40,7 +40,6 @@ import com.baidu.hugegraph.api.API; import com.baidu.hugegraph.backend.id.Id; import com.baidu.hugegraph.core.GraphManager; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.structure.HugeVertex; import com.baidu.hugegraph.traversal.algorithm.HugeTraverser; import com.baidu.hugegraph.traversal.algorithm.PersonalRankTraverser; @@ -121,7 +120,7 @@ private static class RankRequest { @JsonProperty("max_degree") private long maxDegree = Long.parseLong(DEFAULT_MAX_DEGREE); @JsonProperty("limit") - private long limit = Long.parseLong(DEFAULT_LIMIT); + private int limit = Integer.parseInt(DEFAULT_LIMIT); @JsonProperty("max_depth") private int maxDepth = DEFAULT_DEPTH; @JsonProperty("with_label") diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/RaysAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/RaysAPI.java index 321b4eb2c2..c2b78f43d2 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/RaysAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/RaysAPI.java @@ -41,7 +41,6 @@ import com.baidu.hugegraph.api.graph.VertexAPI; import com.baidu.hugegraph.backend.id.Id; import com.baidu.hugegraph.core.GraphManager; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.traversal.algorithm.HugeTraverser; import com.baidu.hugegraph.traversal.algorithm.SubGraphTraverser; import com.baidu.hugegraph.type.define.Directions; @@ -69,7 +68,7 @@ public String get(@Context GraphManager manager, @QueryParam("capacity") @DefaultValue(DEFAULT_CAPACITY) long capacity, @QueryParam("limit") - @DefaultValue(DEFAULT_PATHS_LIMIT) long limit) { + @DefaultValue(DEFAULT_PATHS_LIMIT) int limit) { LOG.debug("Graph [{}] get rays paths from '{}' with " + "direction '{}', edge label '{}', max depth '{}', " + "max degree '{}', capacity '{}' and limit '{}'", diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/ResourceAllocationAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/ResourceAllocationAPI.java index 5c4b1e8b2f..ed729ad1c5 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/ResourceAllocationAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/ResourceAllocationAPI.java @@ -67,7 +67,7 @@ public String create(@Context GraphManager manager, @QueryParam("max_degree") @DefaultValue(DEFAULT_MAX_DEGREE) long maxDegree, @QueryParam("limit") - @DefaultValue(DEFAULT_ELEMENTS_LIMIT) long limit) { + @DefaultValue(DEFAULT_ELEMENTS_LIMIT) int limit) { LOG.debug("Graph [{}] get resource allocation between '{}' and '{}' " + "with direction {}, edge label {}, max degree '{}' and " + "limit '{}'", graph, current, other, direction, edgeLabel, diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/RingsAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/RingsAPI.java index 0bb1cb0a5c..0574208161 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/RingsAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/RingsAPI.java @@ -41,7 +41,6 @@ import com.baidu.hugegraph.api.graph.VertexAPI; import com.baidu.hugegraph.backend.id.Id; import com.baidu.hugegraph.core.GraphManager; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.traversal.algorithm.HugeTraverser; import com.baidu.hugegraph.traversal.algorithm.SubGraphTraverser; import com.baidu.hugegraph.type.define.Directions; @@ -71,7 +70,7 @@ public String get(@Context GraphManager manager, @QueryParam("capacity") @DefaultValue(DEFAULT_CAPACITY) long capacity, @QueryParam("limit") - @DefaultValue(DEFAULT_PATHS_LIMIT) long limit) { + @DefaultValue(DEFAULT_PATHS_LIMIT) int limit) { LOG.debug("Graph [{}] get rings paths reachable from '{}' with " + "direction '{}', edge label '{}', max depth '{}', " + "source in ring '{}', max degree '{}', capacity '{}' " + diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/SameNeighborsAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/SameNeighborsAPI.java index 6d87ec1d07..1653e040ee 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/SameNeighborsAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/SameNeighborsAPI.java @@ -42,7 +42,6 @@ import com.baidu.hugegraph.api.graph.VertexAPI; import com.baidu.hugegraph.backend.id.Id; import com.baidu.hugegraph.core.GraphManager; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.traversal.algorithm.SameNeighborTraverser; import com.baidu.hugegraph.type.define.Directions; import com.baidu.hugegraph.util.Log; @@ -67,7 +66,7 @@ public String get(@Context GraphManager manager, @QueryParam("max_degree") @DefaultValue(DEFAULT_MAX_DEGREE) long maxDegree, @QueryParam("limit") - @DefaultValue(DEFAULT_ELEMENTS_LIMIT) long limit) { + @DefaultValue(DEFAULT_ELEMENTS_LIMIT) int limit) { LOG.debug("Graph [{}] get same neighbors between '{}' and '{}' with " + "direction {}, edge label {}, max degree '{}' and limit '{}'", graph, vertex, other, direction, edgeLabel, maxDegree, limit); diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/ShortestPathAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/ShortestPathAPI.java index fbe6555f22..f64e369b21 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/ShortestPathAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/ShortestPathAPI.java @@ -42,7 +42,6 @@ import com.baidu.hugegraph.api.graph.VertexAPI; import com.baidu.hugegraph.backend.id.Id; import com.baidu.hugegraph.core.GraphManager; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.traversal.algorithm.HugeTraverser; import com.baidu.hugegraph.traversal.algorithm.ShortestPathTraverser; import com.baidu.hugegraph.type.define.Directions; diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/SingleSourceShortestPathAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/SingleSourceShortestPathAPI.java index fd3ebd345d..6e0b612ead 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/SingleSourceShortestPathAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/SingleSourceShortestPathAPI.java @@ -45,7 +45,6 @@ import com.baidu.hugegraph.backend.id.Id; import com.baidu.hugegraph.backend.query.QueryResults; import com.baidu.hugegraph.core.GraphManager; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.traversal.algorithm.SingleSourceShortestPathTraverser; import com.baidu.hugegraph.traversal.algorithm.SingleSourceShortestPathTraverser.WeightedPaths; import com.baidu.hugegraph.type.define.Directions; @@ -75,7 +74,7 @@ public String get(@Context GraphManager manager, @QueryParam("capacity") @DefaultValue(DEFAULT_CAPACITY) long capacity, @QueryParam("limit") - @DefaultValue(DEFAULT_PATHS_LIMIT) long limit, + @DefaultValue(DEFAULT_PATHS_LIMIT) int limit, @QueryParam("with_vertex") boolean withVertex) { LOG.debug("Graph [{}] get single source shortest path from '{}' " + "with direction {}, edge label {}, weight property {}, " + diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/TemplatePathsAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/TemplatePathsAPI.java index b593aa0a7e..fdc8eca282 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/TemplatePathsAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/TemplatePathsAPI.java @@ -44,7 +44,6 @@ import com.baidu.hugegraph.backend.id.Id; import com.baidu.hugegraph.backend.query.QueryResults; import com.baidu.hugegraph.core.GraphManager; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.traversal.algorithm.HugeTraverser; import com.baidu.hugegraph.traversal.algorithm.TemplatePathsTraverser; import com.baidu.hugegraph.traversal.algorithm.steps.RepeatEdgeStep; @@ -136,7 +135,7 @@ private static class Request { @JsonProperty("capacity") public long capacity = Long.parseLong(DEFAULT_CAPACITY); @JsonProperty("limit") - public long limit = Long.parseLong(DEFAULT_PATHS_LIMIT); + public int limit = Integer.parseInt(DEFAULT_PATHS_LIMIT); @JsonProperty("with_vertex") public boolean withVertex = false; diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/VerticesAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/VerticesAPI.java index d9c0b70782..56b10d8f46 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/VerticesAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/VerticesAPI.java @@ -45,7 +45,6 @@ import com.baidu.hugegraph.backend.query.ConditionQuery; import com.baidu.hugegraph.backend.store.Shard; import com.baidu.hugegraph.core.GraphManager; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.type.HugeType; import com.baidu.hugegraph.util.E; import com.baidu.hugegraph.util.Log; diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/WeightedShortestPathAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/WeightedShortestPathAPI.java index 4cdd1f2571..65dfdf52ac 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/WeightedShortestPathAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/WeightedShortestPathAPI.java @@ -44,7 +44,6 @@ import com.baidu.hugegraph.backend.id.Id; import com.baidu.hugegraph.backend.query.QueryResults; import com.baidu.hugegraph.core.GraphManager; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.traversal.algorithm.SingleSourceShortestPathTraverser; import com.baidu.hugegraph.traversal.algorithm.SingleSourceShortestPathTraverser.NodeWithWeight; import com.baidu.hugegraph.type.define.Directions; diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/variables/VariablesAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/variables/VariablesAPI.java index bacce9c4b9..ab931ff128 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/variables/VariablesAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/variables/VariablesAPI.java @@ -39,7 +39,6 @@ import com.baidu.hugegraph.HugeGraph; import com.baidu.hugegraph.api.API; import com.baidu.hugegraph.core.GraphManager; -import com.baidu.hugegraph.server.RestServer; import com.baidu.hugegraph.util.E; import com.baidu.hugegraph.util.Log; import com.codahale.metrics.annotation.Timed; diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/auth/HugeAuthenticator.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/auth/HugeAuthenticator.java index 88c5c78705..66c6a935e5 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/auth/HugeAuthenticator.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/auth/HugeAuthenticator.java @@ -81,7 +81,7 @@ default void setup(final Map config) { @Override default User authenticate(final Map credentials) - throws AuthenticationException { + throws AuthenticationException { HugeGraphAuthProxy.resetContext(); diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/auth/HugeFactoryAuthProxy.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/auth/HugeFactoryAuthProxy.java index 498b24f1e4..2fd14536d1 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/auth/HugeFactoryAuthProxy.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/auth/HugeFactoryAuthProxy.java @@ -309,13 +309,17 @@ private static boolean registerClass(Class clazz, code = String.format("Reflection.registerFieldsToFilter(%s.class, \"%s\");", clazz.getCanonicalName(), String.join("\", \"", fields)); if (!fields.isEmpty()) { + // CHECKSTYLE:OFF System.out.println(code); + // CHECKSTYLE:ON } code = String.format("Reflection.registerMethodsToFilter(%s.class, \"%s\");", clazz.getCanonicalName(), String.join("\", \"", methods)); if (!methods.isEmpty()) { + // CHECKSTYLE:OFF System.out.println(code); + // CHECKSTYLE:ON } return true; diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/auth/HugeGraphAuthProxy.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/auth/HugeGraphAuthProxy.java index 78a3fabf05..8fac1fdf1d 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/auth/HugeGraphAuthProxy.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/auth/HugeGraphAuthProxy.java @@ -1679,6 +1679,7 @@ public TraversalStrategies removeStrategies( @Override public TraversalStrategies clone() { + // CHECKSTYLE:OFF return this.strategies.clone(); } diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/auth/StandardAuthenticator.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/auth/StandardAuthenticator.java index b8e559680f..6006aad927 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/auth/StandardAuthenticator.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/auth/StandardAuthenticator.java @@ -87,7 +87,9 @@ private String inputPassword() { char[] chars = console.readPassword(inputPrompt); password = new String(chars); } else { - System.out.print(inputPrompt); + // CHECKSTYLE:OFF + System.out.println(inputPrompt); + // CHECKSTYLE:ON @SuppressWarnings("resource") // just wrapper of System.in Scanner scanner = new Scanner(System.in); password = scanner.nextLine(); @@ -95,7 +97,9 @@ private String inputPassword() { if (!password.isEmpty()) { return password; } + // CHECKSTYLE:OFF System.out.println(notEmptyPrompt); + // CHECKSTYLE:ON } } diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/license/LicenseVerifier.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/license/LicenseVerifier.java index c1fab55eee..6b3ab4ab1e 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/license/LicenseVerifier.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/license/LicenseVerifier.java @@ -28,7 +28,6 @@ import org.slf4j.Logger; import com.baidu.hugegraph.HugeException; -import com.baidu.hugegraph.HugeGraph; import com.baidu.hugegraph.config.HugeConfig; import com.baidu.hugegraph.core.GraphManager; import com.baidu.hugegraph.util.Log; diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/analyzer/AnalyzerFactory.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/analyzer/AnalyzerFactory.java index fbd043be28..ab84dba632 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/analyzer/AnalyzerFactory.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/analyzer/AnalyzerFactory.java @@ -27,10 +27,10 @@ public class AnalyzerFactory { - private static final Map> analyzers; + private static final Map> ANALYZERS; static { - analyzers = new ConcurrentHashMap<>(); + ANALYZERS = new ConcurrentHashMap<>(); } public static Analyzer analyzer(String name, String mode) { @@ -58,7 +58,7 @@ public static Analyzer analyzer(String name, String mode) { } private static Analyzer customizedAnalyzer(String name, String mode) { - Class clazz = analyzers.get(name); + Class clazz = ANALYZERS.get(name); if (clazz == null) { throw new HugeException("Not exists analyzer: %s", name); } @@ -91,12 +91,12 @@ public static void register(String name, String classPath) { } // Check exists - if (analyzers.containsKey(name)) { + if (ANALYZERS.containsKey(name)) { throw new HugeException("Exists analyzer: %s(%s)", - name, analyzers.get(name).getName()); + name, ANALYZERS.get(name).getName()); } // Register class - analyzers.put(name, (Class) clazz); + ANALYZERS.put(name, (Class) clazz); } } diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/BackendStoreInfo.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/BackendStoreInfo.java index 86021301bb..3c7f9dc4dc 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/BackendStoreInfo.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/BackendStoreInfo.java @@ -22,7 +22,6 @@ import com.baidu.hugegraph.config.HugeConfig; import org.slf4j.Logger; -import com.baidu.hugegraph.HugeGraph; import com.baidu.hugegraph.util.Log; public class BackendStoreInfo { diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/election/RoleElectionStateMachineImpl.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/election/RoleElectionStateMachineImpl.java index 016f51cb8d..69f8d5a3d9 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/election/RoleElectionStateMachineImpl.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/election/RoleElectionStateMachineImpl.java @@ -57,7 +57,7 @@ public void apply(StateMachineCallback stateMachineCallback) { failCount = 0; } catch (Throwable e) { stateMachineCallback.error(context, e); - failCount ++; + failCount++; if (failCount >= this.config.exceedsFailCount()) { this.state = new AbdicationState(context.epoch()); Callback runnable = this.state.callback(stateMachineCallback); @@ -69,7 +69,7 @@ public void apply(StateMachineCallback stateMachineCallback) { private interface RoleState { - SecureRandom secureRandom = new SecureRandom(); + SecureRandom SECURE_RANDOM = new SecureRandom(); RoleState transform(StateMachineContext context); @@ -83,7 +83,7 @@ static void heartBeatPark(StateMachineContext context) { static void randomPark(StateMachineContext context) { long randomTimeout = context.config().randomTimeoutMillisecond(); long baseTime = context.config().baseTimeoutMillisecond(); - long timeout = (long) (baseTime + (randomTimeout / 10.0 * secureRandom.nextInt(11))); + long timeout = (long) (baseTime + (randomTimeout / 10.0 * SECURE_RANDOM.nextInt(11))); LockSupport.parkNanos(timeout * 1_000_000); } } @@ -216,7 +216,7 @@ public void merge(WorkerState state) { if (state.roleTypeData.epoch() > this.roleTypeData.epoch()) { this.clock = 0; this.roleTypeData = state.roleTypeData; - } else if (state.roleTypeData.epoch() < this.roleTypeData.epoch()){ + } else if (state.roleTypeData.epoch() < this.roleTypeData.epoch()) { throw new IllegalStateException("Epoch must increase"); } else if (state.roleTypeData.epoch() == this.roleTypeData.epoch() && state.roleTypeData.clock() < this.roleTypeData.clock()) { diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/traversal/algorithm/PredictionTraverser.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/traversal/algorithm/PredictionTraverser.java index da6e924a8f..86191453de 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/traversal/algorithm/PredictionTraverser.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/traversal/algorithm/PredictionTraverser.java @@ -35,7 +35,7 @@ public PredictionTraverser(HugeGraph graph) { } public double adamicAdar(Id source, Id target, Directions dir, - String label, long degree, long limit) { + String label, long degree, int limit) { Set neighbors = checkAndGetCommonNeighbors(source, target, dir, label, degree, limit); EdgeStep step = label == null ? new EdgeStep(graph(), dir) : @@ -52,7 +52,7 @@ public double adamicAdar(Id source, Id target, Directions dir, } public double resourceAllocation(Id source, Id target, Directions dir, - String label, long degree, long limit) { + String label, long degree, int limit) { Set neighbors = checkAndGetCommonNeighbors(source, target, dir, label, degree, limit); EdgeStep step = label == null ? new EdgeStep(graph(), dir) : @@ -70,7 +70,7 @@ public double resourceAllocation(Id source, Id target, Directions dir, private Set checkAndGetCommonNeighbors(Id source, Id target, Directions dir, String label, - long degree, long limit) { + long degree, int limit) { E.checkNotNull(source, "source id"); E.checkNotNull(target, "the target id"); this.checkVertexExist(source, "source"); diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/traversal/algorithm/SameNeighborTraverser.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/traversal/algorithm/SameNeighborTraverser.java index 6cb14b6db8..cafcd9059f 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/traversal/algorithm/SameNeighborTraverser.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/traversal/algorithm/SameNeighborTraverser.java @@ -36,7 +36,7 @@ public SameNeighborTraverser(HugeGraph graph) { } public Set sameNeighbors(Id vertex, Id other, Directions direction, - String label, long degree, long limit) { + String label, long degree, int limit) { E.checkNotNull(vertex, "vertex id"); E.checkNotNull(other, "the other vertex id"); this.checkVertexExist(vertex, "vertex"); @@ -54,7 +54,7 @@ public Set sameNeighbors(Id vertex, Id other, Directions direction, Set sameNeighbors = (Set) CollectionUtil.intersect( sourceNeighbors, targetNeighbors); if (limit != NO_LIMIT) { - int end = Math.min(sameNeighbors.size(), (int) limit); + int end = Math.min(sameNeighbors.size(), limit); sameNeighbors = CollectionUtil.subSet(sameNeighbors, 0, end); } return sameNeighbors; diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/util/RateLimiter.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/util/RateLimiter.java index c2983da684..9888be99fa 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/util/RateLimiter.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/util/RateLimiter.java @@ -19,8 +19,6 @@ package com.baidu.hugegraph.util; -import org.slf4j.Logger; - // TODO: Move to common module (concurrent package) public interface RateLimiter { diff --git a/hugegraph-dist/src/assembly/static/conf/rest-server.properties b/hugegraph-dist/src/assembly/static/conf/rest-server.properties index f7eda0010c..9e54fcf450 100644 --- a/hugegraph-dist/src/assembly/static/conf/rest-server.properties +++ b/hugegraph-dist/src/assembly/static/conf/rest-server.properties @@ -10,7 +10,8 @@ batch.max_write_ratio=80 batch.max_write_threads=0 # authentication configs -# choose 'com.baidu.hugegraph.auth.StandardAuthenticator' or 'com.baidu.hugegraph.auth.ConfigAuthenticator' +# choose 'com.baidu.hugegraph.auth.StandardAuthenticator' or +# 'com.baidu.hugegraph.auth.ConfigAuthenticator' #auth.authenticator= # for StandardAuthenticator mode diff --git a/hugegraph-hbase/src/main/java/com/baidu/hugegraph/backend/store/hbase/HbaseSessions.java b/hugegraph-hbase/src/main/java/com/baidu/hugegraph/backend/store/hbase/HbaseSessions.java index 03d0d5596e..89f82d63c5 100644 --- a/hugegraph-hbase/src/main/java/com/baidu/hugegraph/backend/store/hbase/HbaseSessions.java +++ b/hugegraph-hbase/src/main/java/com/baidu/hugegraph/backend/store/hbase/HbaseSessions.java @@ -457,7 +457,7 @@ long increase(String table, byte[] family, byte[] rowkey, * Session implement for HBase */ public class Session extends AbstractBackendSession - implements HbaseSession { + implements HbaseSession { private final Map> batch; @@ -483,7 +483,7 @@ private int batchSize() { } private void checkBatchResults(Object[] results, List rows) - throws Throwable { + throws Throwable { assert rows.size() == results.length; for (int i = 0; i < results.length; i++) { Object result = results[i]; @@ -552,7 +552,7 @@ public Integer commit() { } catch (Throwable e) { // TODO: Mark and delete committed records throw new BackendException("Failed to commit, " + - "there may be inconsistent states for HBase", e); + "there may be inconsistent states for HBase", e); } } @@ -806,7 +806,8 @@ private void dump(String table, Scan scan) throws IOException { Cell cell = cellScanner.current(); byte[] key = CellUtil.cloneQualifier(cell); byte[] val = CellUtil.cloneValue(cell); - LOG.info(" {}={}", StringEncoding.format(key), + LOG.info(" {}={}", + StringEncoding.format(key), StringEncoding.format(val)); } } diff --git a/hugegraph-palo/src/main/java/com/baidu/hugegraph/backend/store/palo/PaloTable.java b/hugegraph-palo/src/main/java/com/baidu/hugegraph/backend/store/palo/PaloTable.java index 6a75589930..16721a6f00 100644 --- a/hugegraph-palo/src/main/java/com/baidu/hugegraph/backend/store/palo/PaloTable.java +++ b/hugegraph-palo/src/main/java/com/baidu/hugegraph/backend/store/palo/PaloTable.java @@ -32,7 +32,6 @@ import com.baidu.hugegraph.backend.store.TableDefine; import com.baidu.hugegraph.backend.store.mysql.MysqlBackendEntry; import com.baidu.hugegraph.backend.store.mysql.MysqlSessions; -import com.baidu.hugegraph.backend.store.mysql.MysqlStore; import com.baidu.hugegraph.backend.store.mysql.MysqlTable; import com.baidu.hugegraph.type.define.HugeKeys; import com.baidu.hugegraph.util.Log; diff --git a/hugegraph-postgresql/src/main/java/com/baidu/hugegraph/backend/store/postgresql/PostgresqlSessions.java b/hugegraph-postgresql/src/main/java/com/baidu/hugegraph/backend/store/postgresql/PostgresqlSessions.java index 448c07fa4b..4603b9dae0 100644 --- a/hugegraph-postgresql/src/main/java/com/baidu/hugegraph/backend/store/postgresql/PostgresqlSessions.java +++ b/hugegraph-postgresql/src/main/java/com/baidu/hugegraph/backend/store/postgresql/PostgresqlSessions.java @@ -31,7 +31,6 @@ import com.baidu.hugegraph.backend.BackendException; import com.baidu.hugegraph.backend.store.mysql.MysqlSessions; -import com.baidu.hugegraph.backend.store.mysql.MysqlStore; import com.baidu.hugegraph.backend.store.mysql.MysqlUtil; import com.baidu.hugegraph.config.HugeConfig; import com.baidu.hugegraph.util.Log; diff --git a/hugegraph-test/src/main/java/com/baidu/hugegraph/core/RoleElectionStateMachineTest.java b/hugegraph-test/src/main/java/com/baidu/hugegraph/core/RoleElectionStateMachineTest.java index 6e8af972dc..c32e1ee23d 100644 --- a/hugegraph-test/src/main/java/com/baidu/hugegraph/core/RoleElectionStateMachineTest.java +++ b/hugegraph-test/src/main/java/com/baidu/hugegraph/core/RoleElectionStateMachineTest.java @@ -40,6 +40,7 @@ import com.baidu.hugegraph.election.StateMachineCallback; import com.baidu.hugegraph.election.StateMachineContext; import com.baidu.hugegraph.testutil.Assert; +import com.baidu.hugegraph.testutil.Utils; import org.junit.Test; public class RoleElectionStateMachineTest { @@ -149,7 +150,7 @@ public void master(StateMachineContext context) { if (logRecords.size() > MAX_COUNT) { context.stateMachine().shutdown(); } - System.out.println("master node: " + node); + Utils.println("master node: " + node); masterNodes.add(node); } @@ -195,7 +196,9 @@ public void abdication(StateMachineContext context) { @Override public void error(StateMachineContext context, Throwable e) { - System.out.println("state machine error: node " + context.node() + " message " + e.getMessage()); + Utils.println("state machine error: node " + + context.node() + + " message " + e.getMessage()); } }; @@ -225,14 +228,14 @@ public boolean updateIfNodePresent(RoleTypeData stateData) { this.epoch = copy.epoch(); Assert.assertNull(value); metaDataLogs.add(copy); - System.out.println("The node " + copy + " become new master:"); + Utils.println("The node " + copy + " become new master:"); return copy; } Assert.assertEquals(value.epoch(), copy.epoch()); if (Objects.equals(value.node(), copy.node()) && value.clock() <= copy.clock()) { - System.out.println("The master node " + copy + " keep heartbeat"); + Utils.println("The master node " + copy + " keep heartbeat"); metaDataLogs.add(copy); if (value.clock() == copy.clock()) { Assert.fail("Clock must increase when same epoch and node id"); @@ -247,14 +250,16 @@ public boolean updateIfNodePresent(RoleTypeData stateData) { @Override public Optional query() { - return Optional.ofNullable(this.copy(this.data.get(this.epoch))); + return Optional.ofNullable( + this.copy(this.data.get(this.epoch))); } }; RoleElectionStateMachine[] machines = new RoleElectionStateMachine[4]; Thread node1 = new Thread(() -> { Config config = new TestConfig("1"); - RoleElectionStateMachine stateMachine = new RoleElectionStateMachineImpl(config, adapter); + RoleElectionStateMachine stateMachine = + new RoleElectionStateMachineImpl(config, adapter); machines[1] = stateMachine; stateMachine.apply(callback); stop.countDown(); @@ -262,7 +267,8 @@ public Optional query() { Thread node2 = new Thread(() -> { Config config = new TestConfig("2"); - RoleElectionStateMachine stateMachine = new RoleElectionStateMachineImpl(config, adapter); + RoleElectionStateMachine stateMachine = + new RoleElectionStateMachineImpl(config, adapter); machines[2] = stateMachine; stateMachine.apply(callback); stop.countDown(); @@ -270,7 +276,8 @@ public Optional query() { Thread node3 = new Thread(() -> { Config config = new TestConfig("3"); - RoleElectionStateMachine stateMachine = new RoleElectionStateMachineImpl(config, adapter); + RoleElectionStateMachine stateMachine = + new RoleElectionStateMachineImpl(config, adapter); machines[3] = stateMachine; stateMachine.apply(callback); stop.countDown(); @@ -294,7 +301,7 @@ public Optional query() { } machines[Integer.parseInt(node)].shutdown(); dropNodes.add(node); - System.out.println("----shutdown machine " + node); + Utils.println("----shutdown machine " + node); } stop.countDown(); }); diff --git a/hugegraph-test/src/main/java/com/baidu/hugegraph/testutil/Utils.java b/hugegraph-test/src/main/java/com/baidu/hugegraph/testutil/Utils.java index d1f245b323..770b0f26ed 100644 --- a/hugegraph-test/src/main/java/com/baidu/hugegraph/testutil/Utils.java +++ b/hugegraph-test/src/main/java/com/baidu/hugegraph/testutil/Utils.java @@ -105,4 +105,10 @@ public static PropertiesConfiguration getConf() { } return config; } + + public static void println(String message) { + // CHECKSTYLE:OFF + System.out.println(message); + // CHECKSTYLE:ON + } } diff --git a/hugegraph-test/src/main/java/com/baidu/hugegraph/unit/core/AnalyzerTest.java b/hugegraph-test/src/main/java/com/baidu/hugegraph/unit/core/AnalyzerTest.java index fdd7499930..3674ee83f1 100644 --- a/hugegraph-test/src/main/java/com/baidu/hugegraph/unit/core/AnalyzerTest.java +++ b/hugegraph-test/src/main/java/com/baidu/hugegraph/unit/core/AnalyzerTest.java @@ -33,8 +33,8 @@ public class AnalyzerTest { - private static final String text1 = "England wins World Cup"; - private static final String text2 = "英格兰世界杯夺冠,中华人民共和国国歌," + + private static final String TEXT_1 = "England wins World Cup"; + private static final String TEXT_2 = "英格兰世界杯夺冠,中华人民共和国国歌," + "百度科技园位于北京市海淀区西北旺东路10号院"; @Before @@ -52,20 +52,20 @@ public void testWordAnalyzer() { // MaximumMatching mode Analyzer analyzer = AnalyzerFactory.analyzer("word", "MaximumMatching"); Assert.assertEquals(setOf("england", "wins", "world", "cup"), - analyzer.segment(text1)); + analyzer.segment(TEXT_1)); Assert.assertEquals(setOf("英格兰", "世界杯", "夺冠", "中华人民共和国", "国歌", "百度", "科技园", "位于", "北京市", "海淀区", "西北旺", "东路", "10号", "院"), - analyzer.segment(text2)); + analyzer.segment(TEXT_2)); // ReverseMaximumMatching mode analyzer = AnalyzerFactory.analyzer("word", "ReverseMaximumMatching"); Assert.assertEquals(setOf("england", "wins", "world", "cup"), - analyzer.segment(text1)); + analyzer.segment(TEXT_1)); Assert.assertEquals(setOf("英格兰", "世界杯", "夺冠", "中华人民共和国", "国歌", "百度", "科技园", "位于", "北京市", "海淀区", "西北旺", "东路", "10号", "院"), - analyzer.segment(text2)); + analyzer.segment(TEXT_2)); } @Test @@ -73,20 +73,20 @@ public void testAnsjAnalyzer() { // BaseAnalysis mode Analyzer analyzer = AnalyzerFactory.analyzer("ansj", "BaseAnalysis"); Assert.assertEquals(setOf("england", " ", "wins", "world", "cup"), - analyzer.segment(text1)); + analyzer.segment(TEXT_1)); Assert.assertEquals(setOf("英格兰", "世界杯", "夺冠", ",", "中华人民共和国", "国歌", "百度", "科技", "园", "位于", "北京市", "海淀区", "西北", "旺", "东路", "10", "号", "院"), - analyzer.segment(text2)); + analyzer.segment(TEXT_2)); // IndexAnalysis mode analyzer = AnalyzerFactory.analyzer("ansj", "IndexAnalysis"); Assert.assertEquals(setOf("england", " ", "wins", "world", "cup"), - analyzer.segment(text1)); + analyzer.segment(TEXT_1)); Assert.assertEquals(setOf("英格兰", "世界杯", "夺冠", ",", "中华人民共和国", "国歌", "百度", "科技", "园", "位于", "北京市", "海淀区", "西北", "旺", "东路", "10号", "院"), - analyzer.segment(text2)); + analyzer.segment(TEXT_2)); } @Test @@ -94,36 +94,36 @@ public void testHanlpAnalyzer() { // standard mode Analyzer analyzer = AnalyzerFactory.analyzer("hanlp", "standard"); Assert.assertEquals(setOf("England", " ", "wins", "World", "Cup"), - analyzer.segment(text1)); + analyzer.segment(TEXT_1)); Assert.assertEquals(setOf("英格兰", "世界杯", "夺冠", ",", "中华人民共和国", "国歌", "百度", "科技园", "位于", "北京市", "海淀区", "西北旺", "东路", "10", "号", "院"), - analyzer.segment(text2)); + analyzer.segment(TEXT_2)); // Note latest hanlp portable version not contains model data // https://github.com/hankcs/HanLP/tree/portable#%E6%96%B9%E5%BC%8F%E4%B8%80maven // So test IndexTokenizer instead analyzer = AnalyzerFactory.analyzer("hanlp", "index"); Assert.assertEquals(setOf("England", " ", "wins", "World", "Cup"), - analyzer.segment(text1)); + analyzer.segment(TEXT_1)); Assert.assertEquals(setOf("英格兰", "英格", "格兰", "世界杯", "世界", "夺冠", ",", "中华人民共和国", "中华", "华人", "人民", "共和国", "共和","国歌", "百度", "科技园", "科技", "位于", "北京市", "北京", "海淀区", "海淀", "淀区", "西北旺", "西北", "东路", "10", "号", "院"), - analyzer.segment(text2)); + analyzer.segment(TEXT_2)); } @Test public void testSmartCNAnalyzer() { Analyzer analyzer = AnalyzerFactory.analyzer("smartcn", ""); Assert.assertEquals(setOf("england", "win", "world", "cup"), - analyzer.segment(text1)); + analyzer.segment(TEXT_1)); Assert.assertEquals(setOf("英格兰", "世界杯", "夺冠", "中华人民共和国", "国歌", "百", "度", "科技", "园", "位于", "北京市", "海淀区", "西北", "旺", "东", "路", "10", "号", "院"), - analyzer.segment(text2)); + analyzer.segment(TEXT_2)); } @Test @@ -131,22 +131,22 @@ public void testJiebaAnalyzer() { // SEARCH mode Analyzer analyzer = AnalyzerFactory.analyzer("jieba", "SEARCH"); Assert.assertEquals(setOf("england", " ", "wins", "world", "cup"), - analyzer.segment(text1)); + analyzer.segment(TEXT_1)); Assert.assertEquals(setOf("英格兰", "世界杯", "夺冠", ",", "中华人民共和国", "国歌", "百度", "科技园", "位于", "北京市", "海淀区", "西北", "旺", "东路", "10", "号院"), - analyzer.segment(text2)); + analyzer.segment(TEXT_2)); // INDEX mode analyzer = AnalyzerFactory.analyzer("jieba", "INDEX"); Assert.assertEquals(setOf("england", " ", "wins", "world", "cup"), - analyzer.segment(text1)); + analyzer.segment(TEXT_1)); Assert.assertEquals(setOf("英格兰", "世界", "世界杯", "夺冠", ",", "中华", "华人", "人民", "共和", "共和国", "中华人民共和国", "国歌", "百度", "科技", "科技园", "位于", "北京", "京市", "北京市", "海淀", "淀区", "海淀区", "西北", "旺", "东路", "10", "号院"), - analyzer.segment(text2)); + analyzer.segment(TEXT_2)); } @Test @@ -154,22 +154,22 @@ public void testJcsegAnalyzer() { // Simple mode Analyzer analyzer = AnalyzerFactory.analyzer("jcseg", "Simple"); Assert.assertEquals(setOf("england", "wins", "world", "cup"), - analyzer.segment(text1)); + analyzer.segment(TEXT_1)); Assert.assertEquals(setOf("英格兰", "世界杯", "夺冠", ",", "中华", "人民共和国", "国歌", "百度", "科技", "园", "位于", "北京市", "海淀区", "西北", "旺", "东路", "1", "0", "号", "院"), - analyzer.segment(text2)); + analyzer.segment(TEXT_2)); // Complex mode analyzer = AnalyzerFactory.analyzer("jcseg", "Complex"); Assert.assertEquals(setOf("england", "wins", "world", "cup"), - analyzer.segment(text1)); + analyzer.segment(TEXT_1)); Assert.assertEquals(setOf("英格兰", "世界杯", "夺冠", ",", "中华", "人民共和国", "国歌", "百度", "科技", "园", "位于", "北京市", "海淀区", "西北", "旺", "东路", "1", "0", "号", "院"), - analyzer.segment(text2)); + analyzer.segment(TEXT_2)); } @Test @@ -177,22 +177,22 @@ public void testMMSeg4JAnalyzer() { // Simple mode Analyzer analyzer = AnalyzerFactory.analyzer("mmseg4j", "Simple"); Assert.assertEquals(setOf("england", "wins", "world", "cup"), - analyzer.segment(text1)); + analyzer.segment(TEXT_1)); Assert.assertEquals(setOf("英格兰", "世界杯", "夺冠", "中华人民共和国", "国歌", "百度", "科技园", "位于", "北京市", "海淀区", "西北", "旺", "东路", "10", "号", "院"), - analyzer.segment(text2)); + analyzer.segment(TEXT_2)); // Complex mode analyzer = AnalyzerFactory.analyzer("mmseg4j", "Complex"); Assert.assertEquals(setOf("england", "wins", "world", "cup"), - analyzer.segment(text1)); + analyzer.segment(TEXT_1)); Assert.assertEquals(setOf("英格兰", "世界杯", "夺冠", "中华人民共和国", "国歌", "百度", "科技园", "位于", "北京市", "海淀区", "西北", "旺", "东路", "10", "号", "院"), - analyzer.segment(text2)); + analyzer.segment(TEXT_2)); } @Test @@ -200,16 +200,16 @@ public void testIKAnalyzer() { // Smart mode Analyzer analyzer = AnalyzerFactory.analyzer("ikanalyzer", "smart"); Assert.assertEquals(setOf("england", "wins", "world", "cup"), - analyzer.segment(text1)); + analyzer.segment(TEXT_1)); Assert.assertEquals(setOf("英格兰", "世界杯", "夺冠", "中华人民共和国", "国歌", "百度", "科技园", "位于", "北京市", "海淀区", "西北", "旺", "东路", "10号", "院"), - analyzer.segment(text2)); + analyzer.segment(TEXT_2)); // Max_word mode analyzer = AnalyzerFactory.analyzer("ikanalyzer", "max_word"); Assert.assertEquals(setOf("england", "wins", "world", "cup"), - analyzer.segment(text1)); + analyzer.segment(TEXT_1)); Assert.assertEquals(setOf("英格兰", "世界杯", "世界", "杯", "夺冠", "中华人民共和国", "中华人民", "中华", "华人", "人民共和国", "人民", "共和国", "共和", "国", @@ -217,7 +217,7 @@ public void testIKAnalyzer() { "园", "位于", "北京市", "北京", "市", "海淀区", "海淀", "淀区", "西北", "旺", "东路", "10", "号", "院"), - analyzer.segment(text2)); + analyzer.segment(TEXT_2)); } private static Set setOf(String... elems) {