diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/HugeGraphHubble.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/HugeGraphHubble.java index b0d3e8453..cfcb698fe 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/HugeGraphHubble.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/HugeGraphHubble.java @@ -49,7 +49,7 @@ public static void initEnv() { @Override protected SpringApplicationBuilder configure( - SpringApplicationBuilder builder) { + SpringApplicationBuilder builder) { return builder.sources(this.getClass()); } } diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/common/Constant.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/common/Constant.java index 9b0c047d4..11afe6a46 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/common/Constant.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/common/Constant.java @@ -39,7 +39,7 @@ public final class Constant { public static final String CONFIG_FILE = "hugegraph-hubble.properties"; public static final String CONTROLLER_PACKAGE = - "org.apache.hugegraph.controller"; + "org.apache.hugegraph.controller"; public static final String COOKIE_USER = "user"; public static final String API_V1_1 = "/api/v1.1/"; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/common/Mergeable.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/common/Mergeable.java index 1d9e3e477..3fd638bc3 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/common/Mergeable.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/common/Mergeable.java @@ -19,4 +19,5 @@ package org.apache.hugegraph.common; public interface Mergeable { + } diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/config/HubbleConfig.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/config/HubbleConfig.java index b5ff22e72..f5e2ae136 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/config/HubbleConfig.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/config/HubbleConfig.java @@ -20,6 +20,7 @@ import java.io.File; +import org.apache.hugegraph.common.Constant; import org.apache.hugegraph.exception.ExternalException; import org.apache.hugegraph.options.HubbleOptions; import org.slf4j.Logger; @@ -29,8 +30,6 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.apache.hugegraph.common.Constant; - @Configuration public class HubbleConfig { @@ -44,7 +43,7 @@ public HugeConfig hugeConfig() { String[] args = this.arguments.getSourceArgs(); if (args.length > 1) { throw new ExternalException( - "HugeGraphHubble accept up to one param as config file"); + "HugeGraphHubble accept up to one param as config file"); } else if (args.length == 0) { args = new String[]{Constant.CONFIG_FILE}; } diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/config/JacksonConfig.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/config/JacksonConfig.java index 2d796a85b..4fc2ab300 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/config/JacksonConfig.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/config/JacksonConfig.java @@ -21,13 +21,13 @@ import java.io.IOException; import java.util.Map; +import org.apache.hugegraph.common.Response; +import org.apache.hugegraph.structure.graph.Edge; +import org.apache.hugegraph.structure.graph.Vertex; import org.springframework.boot.jackson.JsonComponent; import org.springframework.context.annotation.Bean; import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; -import org.apache.hugegraph.common.Response; -import org.apache.hugegraph.structure.graph.Edge; -import org.apache.hugegraph.structure.graph.Vertex; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.ObjectMapper; @@ -98,7 +98,7 @@ public void serialize(Edge edge, JsonGenerator generator, private static void writeIdField(String fieldName, Object id, JsonGenerator generator) - throws IOException { + throws IOException { // Serialize id to string generator.writeStringField(fieldName, id.toString()); } @@ -106,7 +106,7 @@ private static void writeIdField(String fieldName, Object id, private static void writePropertiesField(Map properties, JsonGenerator generator, SerializerProvider provider) - throws IOException { + throws IOException { // Start write properties generator.writeFieldName("properties"); generator.writeStartObject(); diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/AboutController.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/AboutController.java index 3e3dca16a..044268b8d 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/AboutController.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/AboutController.java @@ -21,14 +21,13 @@ import java.util.LinkedHashMap; import java.util.Map; +import org.apache.hugegraph.common.Constant; +import org.apache.hugegraph.handler.MessageSourceHandler; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import org.apache.hugegraph.common.Constant; -import org.apache.hugegraph.handler.MessageSourceHandler; - @RestController @RequestMapping("about") // TODO: delete the class or keep it? diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/BaseController.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/BaseController.java index 355c690ea..bdcd4cd2a 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/BaseController.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/BaseController.java @@ -20,12 +20,11 @@ import java.util.List; -import org.springframework.util.StringUtils; - import org.apache.hugegraph.common.Identifiable; import org.apache.hugegraph.common.Mergeable; import org.apache.hugegraph.util.EntityUtil; import org.apache.hugegraph.util.Ex; +import org.springframework.util.StringUtils; public abstract class BaseController { diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/GraphConnectionController.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/GraphConnectionController.java index 1b6890386..4dfa07a52 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/GraphConnectionController.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/GraphConnectionController.java @@ -24,17 +24,6 @@ import java.util.regex.Pattern; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - import org.apache.hugegraph.common.Constant; import org.apache.hugegraph.common.Response; import org.apache.hugegraph.config.HugeConfig; @@ -48,6 +37,17 @@ import org.apache.hugegraph.util.Ex; import org.apache.hugegraph.util.HubbleUtil; import org.apache.hugegraph.util.HugeClientUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + import com.baomidou.mybatisplus.core.metadata.IPage; import lombok.extern.log4j.Log4j2; @@ -201,14 +201,14 @@ private void checkAddressSecurity(GraphConnection newEntity) { log.debug("The host: {}, ip: {}", address.getHostName(), ip); List ipWhiteList = this.config.get( - HubbleOptions.CONNECTION_IP_WHITE_LIST); + HubbleOptions.CONNECTION_IP_WHITE_LIST); if (!ipWhiteList.contains("*")) { Ex.check(ipWhiteList.contains(host) || ipWhiteList.contains(ip), "graph-connection.host.unauthorized"); } List portWhiteList = this.config.get( - HubbleOptions.CONNECTION_PORT_WHITE_LIST); + HubbleOptions.CONNECTION_PORT_WHITE_LIST); if (!portWhiteList.contains(-1)) { Ex.check(portWhiteList.contains(port), "graph-connection.port.unauthorized"); @@ -226,8 +226,8 @@ private void checkEntityUnique(GraphConnection newEntity, Ex.check(!oldEntity.getName().equals(newEntity.getName()), "graph-connection.exist.name", oldEntity.getName()); Ex.check(!(oldEntity.getGraph().equals(newEntity.getGraph()) && - oldEntity.getHost().equals(newEntity.getHost()) && - oldEntity.getPort().equals(newEntity.getPort())), + oldEntity.getHost().equals(newEntity.getHost()) && + oldEntity.getPort().equals(newEntity.getPort())), "graph-connection.exist.graph-host-port", oldEntity.getGraph(), oldEntity.getHost(), oldEntity.getPort()); diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/SettingController.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/SettingController.java index 7a4be2b36..1a00a1afa 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/SettingController.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/SettingController.java @@ -24,17 +24,16 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.hugegraph.common.Constant; +import org.apache.hugegraph.entity.UserInfo; +import org.apache.hugegraph.service.UserInfoService; +import org.apache.hugegraph.util.E; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import org.apache.hugegraph.common.Constant; -import org.apache.hugegraph.entity.UserInfo; -import org.apache.hugegraph.service.UserInfoService; -import org.apache.hugegraph.util.E; - @RestController @RequestMapping(Constant.API_VERSION + "setting") public class SettingController { diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/algorithm/OltpAlgoController.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/algorithm/OltpAlgoController.java index e6e229224..28a265968 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/algorithm/OltpAlgoController.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/algorithm/OltpAlgoController.java @@ -18,6 +18,10 @@ package org.apache.hugegraph.controller.algorithm; +import org.apache.hugegraph.common.Constant; +import org.apache.hugegraph.entity.algorithm.ShortestPath; +import org.apache.hugegraph.entity.query.GremlinResult; +import org.apache.hugegraph.service.algorithm.OltpAlgoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; @@ -25,11 +29,6 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import org.apache.hugegraph.common.Constant; -import org.apache.hugegraph.entity.algorithm.ShortestPath; -import org.apache.hugegraph.entity.query.GremlinResult; -import org.apache.hugegraph.service.algorithm.OltpAlgoService; - import lombok.extern.log4j.Log4j2; @Log4j2 diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/graph/GraphController.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/graph/GraphController.java index e3751e9ff..d103059fd 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/graph/GraphController.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/graph/GraphController.java @@ -22,15 +22,6 @@ import java.util.Set; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.util.UriUtils; - import org.apache.hugegraph.common.Constant; import org.apache.hugegraph.controller.BaseController; import org.apache.hugegraph.entity.graph.EdgeEntity; @@ -45,6 +36,14 @@ import org.apache.hugegraph.structure.graph.Edge; import org.apache.hugegraph.structure.graph.Vertex; import org.apache.hugegraph.util.Ex; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.util.UriUtils; @RestController @RequestMapping(Constant.API_VERSION + "graph-connections/{connId}/graph") diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/load/FileMappingController.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/load/FileMappingController.java index 87ad5d014..5614334e1 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/load/FileMappingController.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/load/FileMappingController.java @@ -22,18 +22,6 @@ import java.util.Set; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - import org.apache.hugegraph.common.Constant; import org.apache.hugegraph.controller.BaseController; import org.apache.hugegraph.entity.enums.JobStatus; @@ -54,6 +42,18 @@ import org.apache.hugegraph.util.CollectionUtil; import org.apache.hugegraph.util.Ex; import org.apache.hugegraph.util.HubbleUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + import com.baomidou.mybatisplus.core.metadata.IPage; import lombok.extern.log4j.Log4j2; @@ -195,7 +195,7 @@ public FileMapping deleteVertexMapping(@PathVariable("id") int id, boolean removed = mapping.getVertexMappings().remove(vertexMapping); if (!removed) { throw new ExternalException( - "load.file-mapping.vertex-mapping.not-exist.id", vmid); + "load.file-mapping.vertex-mapping.not-exist.id", vmid); } this.service.update(mapping); return mapping; @@ -252,7 +252,7 @@ public FileMapping deleteEdgeMapping(@PathVariable("id") int id, boolean removed = mapping.getEdgeMappings().remove(edgeMapping); if (!removed) { throw new ExternalException( - "load.file-mapping.edge-mapping.not-exist.id", emid); + "load.file-mapping.edge-mapping.not-exist.id", emid); } this.service.update(mapping); return mapping; @@ -305,15 +305,15 @@ private void checkVertexMappingValid(int connId, VertexMapping vertexMapping, vl.getPrimaryKeys().size(), "load.file-mapping.vertex.id-fields-should-same-size-pks"); Ex.check(!CollectionUtils.containsAny( - vertexMapping.fieldMappingToMap().values(), - vl.getPrimaryKeys()), + vertexMapping.fieldMappingToMap().values(), + vl.getPrimaryKeys()), "load.file-mapping.vertex.mapping-fields-cannot-contains-pk"); } else { Ex.check(vertexMapping.getIdFields().size() == 1, "load.file-mapping.vertex.id-fields-should-only-one"); } Ex.check(CollectionUtil.allUnique( - vertexMapping.fieldMappingToMap().values()), + vertexMapping.fieldMappingToMap().values()), "load.file-mapping.mapping-fields-should-no-duplicate"); this.checkMappingValid(vertexMapping, fileMapping); } @@ -341,7 +341,7 @@ private void checkEdgeMappingValid(int connId, EdgeMapping edgeMapping, "load.file-mapping.edge.target-fields-should-in-column-names", edgeMapping.getTargetFields(), columnNames); Ex.check(CollectionUtil.allUnique( - edgeMapping.fieldMappingToMap().values()), + edgeMapping.fieldMappingToMap().values()), "load.file-mapping.mapping-fields-should-no-duplicate"); this.checkMappingValid(edgeMapping, fileMapping); } diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/load/FileUploadController.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/load/FileUploadController.java index 79b4974f9..ea29b74d1 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/load/FileUploadController.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/load/FileUploadController.java @@ -33,17 +33,6 @@ import org.apache.commons.io.FileUtils; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; - import org.apache.hugegraph.common.Constant; import org.apache.hugegraph.config.HugeConfig; import org.apache.hugegraph.entity.enums.FileMappingStatus; @@ -59,6 +48,16 @@ import org.apache.hugegraph.util.Ex; import org.apache.hugegraph.util.FileUtil; import org.apache.hugegraph.util.HubbleUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; import lombok.extern.log4j.Log4j2; @@ -259,13 +258,13 @@ private void checkFileValid(int connId, int jobId, JobManager jobEntity, String format = FilenameUtils.getExtension(fileName); List formatWhiteList = this.config.get( - HubbleOptions.UPLOAD_FILE_FORMAT_LIST); + HubbleOptions.UPLOAD_FILE_FORMAT_LIST); Ex.check(formatWhiteList.contains(format), "load.upload.file.format.unsupported"); long fileSize = file.getSize(); long singleFileSizeLimit = this.config.get( - HubbleOptions.UPLOAD_SINGLE_FILE_SIZE_LIMIT); + HubbleOptions.UPLOAD_SINGLE_FILE_SIZE_LIMIT); Ex.check(fileSize <= singleFileSizeLimit, "load.upload.file.exceed-single-size", FileUtils.byteCountToDisplaySize(singleFileSizeLimit)); @@ -277,7 +276,7 @@ private void checkFileValid(int connId, int jobId, JobManager jobEntity, "load.upload.file.existed", fileName); long totalFileSizeLimit = this.config.get( - HubbleOptions.UPLOAD_TOTAL_FILE_SIZE_LIMIT); + HubbleOptions.UPLOAD_TOTAL_FILE_SIZE_LIMIT); List fileMappings = this.service.listAll(); long currentTotalSize = fileMappings.stream() .map(FileMapping::getTotalSize) diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/load/JobManagerController.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/load/JobManagerController.java index 6e4fe9fa6..5bb90526d 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/load/JobManagerController.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/load/JobManagerController.java @@ -22,17 +22,6 @@ import java.util.List; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - import org.apache.hugegraph.common.Constant; import org.apache.hugegraph.common.Response; import org.apache.hugegraph.entity.enums.JobStatus; @@ -48,6 +37,17 @@ import org.apache.hugegraph.service.load.LoadTaskService; import org.apache.hugegraph.util.Ex; import org.apache.hugegraph.util.HubbleUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + import com.baomidou.mybatisplus.core.metadata.IPage; import lombok.extern.log4j.Log4j2; @@ -77,14 +77,14 @@ public JobManager create(@PathVariable("connId") int connId, Ex.check(entity.getJobName().length() <= 48, "job.manager.job-name.reached-limit"); Ex.check(entity.getJobName() != null, () -> - Constant.COMMON_NAME_PATTERN.matcher( - entity.getJobName()).matches(), + Constant.COMMON_NAME_PATTERN.matcher( + entity.getJobName()).matches(), "job.manager.job-name.unmatch-regex"); Ex.check(entity.getJobRemarks().length() <= 200, "job.manager.job-remarks.reached-limit"); Ex.check(!StringUtils.isEmpty(entity.getJobRemarks()), () -> - Constant.COMMON_REMARK_PATTERN.matcher( - entity.getJobRemarks()).matches(), + Constant.COMMON_REMARK_PATTERN.matcher( + entity.getJobRemarks()).matches(), "job.manager.job-remarks.unmatch-regex"); Ex.check(this.service.count() < LIMIT, "job.manager.reached-limit", LIMIT); @@ -131,15 +131,15 @@ public IPage list(@PathVariable("connId") int connId, @RequestParam(name = "page_no", required = false, defaultValue = "1") - int pageNo, + int pageNo, @RequestParam(name = "page_size", required = false, defaultValue = "10") - int pageSize, + int pageSize, @RequestParam(name = "content", required = false, defaultValue = "") - String content) { + String content) { return this.service.list(connId, pageNo, pageSize, content); } @@ -150,12 +150,12 @@ public JobManager update(@PathVariable("connId") int connId, Ex.check(newEntity.getJobName().length() <= 48, "job.manager.job-name.reached-limit"); Ex.check(newEntity.getJobName() != null, () -> - Constant.COMMON_NAME_PATTERN.matcher( - newEntity.getJobName()).matches(), + Constant.COMMON_NAME_PATTERN.matcher( + newEntity.getJobName()).matches(), "job.manager.job-name.unmatch-regex"); Ex.check(!StringUtils.isEmpty(newEntity.getJobRemarks()), () -> - Constant.COMMON_REMARK_PATTERN.matcher( - newEntity.getJobRemarks()).matches(), + Constant.COMMON_REMARK_PATTERN.matcher( + newEntity.getJobRemarks()).matches(), "job.manager.job-remarks.unmatch-regex"); // Check exist Job Manager with this id JobManager entity = this.service.get(id); diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/load/LoadTaskController.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/load/LoadTaskController.java index 52a1137c6..b4862bf5b 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/load/LoadTaskController.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/load/LoadTaskController.java @@ -21,16 +21,6 @@ import java.util.ArrayList; import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - import org.apache.hugegraph.common.Constant; import org.apache.hugegraph.common.Response; import org.apache.hugegraph.controller.BaseController; @@ -46,6 +36,16 @@ import org.apache.hugegraph.service.load.LoadTaskService; import org.apache.hugegraph.util.Ex; import org.apache.hugegraph.util.HubbleUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + import com.baomidou.mybatisplus.core.metadata.IPage; import lombok.extern.log4j.Log4j2; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/query/ExecuteHistoryController.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/query/ExecuteHistoryController.java index 029d5d1f7..733028678 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/query/ExecuteHistoryController.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/query/ExecuteHistoryController.java @@ -18,6 +18,10 @@ package org.apache.hugegraph.controller.query; +import org.apache.hugegraph.common.Constant; +import org.apache.hugegraph.entity.query.ExecuteHistory; +import org.apache.hugegraph.exception.ExternalException; +import org.apache.hugegraph.service.query.ExecuteHistoryService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; @@ -26,10 +30,6 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import org.apache.hugegraph.common.Constant; -import org.apache.hugegraph.entity.query.ExecuteHistory; -import org.apache.hugegraph.exception.ExternalException; -import org.apache.hugegraph.service.query.ExecuteHistoryService; import com.baomidou.mybatisplus.core.metadata.IPage; @RestController diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/query/GremlinCollectionController.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/query/GremlinCollectionController.java index ad37a6de8..dd515271a 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/query/GremlinCollectionController.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/query/GremlinCollectionController.java @@ -19,6 +19,12 @@ package org.apache.hugegraph.controller.query; import org.apache.commons.lang3.StringUtils; +import org.apache.hugegraph.common.Constant; +import org.apache.hugegraph.entity.query.GremlinCollection; +import org.apache.hugegraph.exception.ExternalException; +import org.apache.hugegraph.service.query.GremlinCollectionService; +import org.apache.hugegraph.util.Ex; +import org.apache.hugegraph.util.HubbleUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; @@ -30,12 +36,6 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import org.apache.hugegraph.common.Constant; -import org.apache.hugegraph.entity.query.GremlinCollection; -import org.apache.hugegraph.exception.ExternalException; -import org.apache.hugegraph.service.query.GremlinCollectionService; -import org.apache.hugegraph.util.Ex; -import org.apache.hugegraph.util.HubbleUtil; import com.baomidou.mybatisplus.core.metadata.IPage; @RestController diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/query/GremlinQueryController.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/query/GremlinQueryController.java index e97847fed..58f7fcc5d 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/query/GremlinQueryController.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/query/GremlinQueryController.java @@ -24,14 +24,6 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.StopWatch; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - import org.apache.hugegraph.common.Constant; import org.apache.hugegraph.entity.enums.AsyncTaskStatus; import org.apache.hugegraph.entity.enums.ExecuteStatus; @@ -45,6 +37,14 @@ import org.apache.hugegraph.service.query.GremlinQueryService; import org.apache.hugegraph.util.Ex; import org.apache.hugegraph.util.HubbleUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + import com.google.common.collect.ImmutableSet; import lombok.extern.log4j.Log4j2; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/schema/EdgeLabelController.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/schema/EdgeLabelController.java index 7de2491ec..b21a94ed8 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/schema/EdgeLabelController.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/schema/EdgeLabelController.java @@ -22,19 +22,6 @@ import java.util.List; import java.util.Set; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.CollectionUtils; -import org.springframework.util.StringUtils; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - import org.apache.hugegraph.common.Constant; import org.apache.hugegraph.entity.schema.ConflictCheckEntity; import org.apache.hugegraph.entity.schema.ConflictDetail; @@ -49,6 +36,19 @@ import org.apache.hugegraph.util.CollectionUtil; import org.apache.hugegraph.util.Ex; import org.apache.hugegraph.util.HubbleUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + import com.baomidou.mybatisplus.core.metadata.IPage; import com.google.common.collect.ImmutableList; @@ -116,9 +116,9 @@ public void create(@PathVariable("connId") int connId, @PostMapping("check_conflict") public ConflictDetail checkConflict( - @PathVariable("connId") int connId, - @RequestParam("reused_conn_id") int reusedConnId, - @RequestBody ConflictCheckEntity entity) { + @PathVariable("connId") int connId, + @RequestParam("reused_conn_id") int reusedConnId, + @RequestBody ConflictCheckEntity entity) { Ex.check(!CollectionUtils.isEmpty(entity.getElEntities()), "common.param.cannot-be-empty", "edgelabels"); Ex.check(CollectionUtils.isEmpty(entity.getPkEntities()), @@ -152,8 +152,8 @@ public ConflictDetail checkConflict( @PostMapping("recheck_conflict") public ConflictDetail recheckConflict( - @PathVariable("connId") int connId, - @RequestBody ConflictCheckEntity entity) { + @PathVariable("connId") int connId, + @RequestBody ConflictCheckEntity entity) { Ex.check(!CollectionUtils.isEmpty(entity.getElEntities()), "common.param.cannot-be-empty", "edgelabels"); return this.elService.checkConflict(entity, connId, true); diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/schema/PropertyIndexController.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/schema/PropertyIndexController.java index ae034b558..731b11f82 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/schema/PropertyIndexController.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/schema/PropertyIndexController.java @@ -18,6 +18,10 @@ package org.apache.hugegraph.controller.schema; +import org.apache.hugegraph.common.Constant; +import org.apache.hugegraph.entity.schema.PropertyIndex; +import org.apache.hugegraph.service.schema.PropertyIndexService; +import org.apache.hugegraph.structure.constant.HugeType; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.GetMapping; @@ -26,10 +30,6 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import org.apache.hugegraph.common.Constant; -import org.apache.hugegraph.entity.schema.PropertyIndex; -import org.apache.hugegraph.service.schema.PropertyIndexService; -import org.apache.hugegraph.structure.constant.HugeType; import com.baomidou.mybatisplus.core.metadata.IPage; @RestController @@ -55,7 +55,7 @@ public IPage list(@PathVariable("connId") int connId, defaultValue = "10") int pageSize) { HugeType type = isVertexLabel ? HugeType.VERTEX_LABEL : - HugeType.EDGE_LABEL; + HugeType.EDGE_LABEL; if (StringUtils.isEmpty(content)) { return this.service.list(connId, type, pageNo, pageSize); } else { diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/schema/PropertyKeyController.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/schema/PropertyKeyController.java index 0e4b16c27..cdb56acc3 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/schema/PropertyKeyController.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/schema/PropertyKeyController.java @@ -22,6 +22,15 @@ import java.util.List; import java.util.Map; +import org.apache.hugegraph.common.Constant; +import org.apache.hugegraph.entity.schema.ConflictCheckEntity; +import org.apache.hugegraph.entity.schema.ConflictDetail; +import org.apache.hugegraph.entity.schema.PropertyKeyEntity; +import org.apache.hugegraph.entity.schema.UsingCheckEntity; +import org.apache.hugegraph.exception.ExternalException; +import org.apache.hugegraph.service.schema.PropertyKeyService; +import org.apache.hugegraph.util.Ex; +import org.apache.hugegraph.util.HubbleUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.DeleteMapping; @@ -33,15 +42,6 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import org.apache.hugegraph.common.Constant; -import org.apache.hugegraph.entity.schema.ConflictCheckEntity; -import org.apache.hugegraph.entity.schema.ConflictDetail; -import org.apache.hugegraph.entity.schema.PropertyKeyEntity; -import org.apache.hugegraph.entity.schema.UsingCheckEntity; -import org.apache.hugegraph.exception.ExternalException; -import org.apache.hugegraph.service.schema.PropertyKeyService; -import org.apache.hugegraph.util.HubbleUtil; -import org.apache.hugegraph.util.Ex; import com.baomidou.mybatisplus.core.metadata.IPage; import lombok.extern.log4j.Log4j2; @@ -91,8 +91,8 @@ public void create(@PathVariable("connId") int connId, @PostMapping("check_conflict") public ConflictDetail checkConflict( - @PathVariable("connId") int connId, - @RequestBody ConflictCheckEntity entity) { + @PathVariable("connId") int connId, + @RequestBody ConflictCheckEntity entity) { List entities = entity.getPkEntities(); Ex.check(!CollectionUtils.isEmpty(entities), "common.param.cannot-be-empty", "entities"); @@ -108,8 +108,8 @@ public ConflictDetail checkConflict( @PostMapping("recheck_conflict") public ConflictDetail recheckConflict( - @PathVariable("connId") int connId, - @RequestBody ConflictCheckEntity entity) { + @PathVariable("connId") int connId, + @RequestBody ConflictCheckEntity entity) { Ex.check(!CollectionUtils.isEmpty(entity.getPkEntities()), "common.param.cannot-be-empty", "propertykeys"); Ex.check(CollectionUtils.isEmpty(entity.getPiEntities()), diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/schema/SchemaController.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/schema/SchemaController.java index 4791d4ebb..9924afca5 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/schema/SchemaController.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/schema/SchemaController.java @@ -28,13 +28,6 @@ import java.util.function.Function; import java.util.stream.Collectors; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.StringUtils; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - import org.apache.hugegraph.common.Constant; import org.apache.hugegraph.controller.BaseController; import org.apache.hugegraph.entity.schema.EdgeLabelEntity; @@ -53,6 +46,13 @@ import org.apache.hugegraph.structure.constant.IdStrategy; import org.apache.hugegraph.util.Ex; import org.apache.hugegraph.util.PageUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.StringUtils; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + import com.baomidou.mybatisplus.core.metadata.IPage; import com.fasterxml.jackson.annotation.JsonProperty; @@ -96,8 +96,8 @@ public SchemaView displayInSchemaView(@PathVariable("connId") int connId) { for (EdgeLabelEntity entity : edgeLabels) { Map edge = new LinkedHashMap<>(); String edgeId = String.format( - "%s-%s->%s", entity.getSourceLabel(), - entity.getName(), entity.getTargetLabel()); + "%s-%s->%s", entity.getSourceLabel(), + entity.getName(), entity.getTargetLabel()); edge.put("id", edgeId); edge.put("label", entity.getName()); edge.put("source", entity.getSourceLabel()); @@ -147,10 +147,10 @@ private static class SchemaView { } public IPage listInPage( - Function> fetcher, - int connId, String content, - String nameOrder, - int pageNo, int pageSize) { + Function> fetcher, + int connId, String content, + String nameOrder, + int pageNo, int pageSize) { Boolean nameOrderAsc = null; if (!StringUtils.isEmpty(nameOrder)) { Ex.check(ORDER_ASC.equals(nameOrder) || ORDER_DESC.equals(nameOrder), diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/schema/VertexLabelController.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/schema/VertexLabelController.java index e80857d3f..b34608d56 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/schema/VertexLabelController.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/schema/VertexLabelController.java @@ -24,19 +24,6 @@ import java.util.Map; import java.util.Set; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.CollectionUtils; -import org.springframework.util.StringUtils; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - import org.apache.hugegraph.common.Constant; import org.apache.hugegraph.entity.schema.ConflictCheckEntity; import org.apache.hugegraph.entity.schema.ConflictDetail; @@ -52,6 +39,19 @@ import org.apache.hugegraph.util.CollectionUtil; import org.apache.hugegraph.util.Ex; import org.apache.hugegraph.util.HubbleUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + import com.baomidou.mybatisplus.core.metadata.IPage; import com.google.common.collect.ImmutableList; @@ -124,9 +124,9 @@ public void create(@PathVariable("connId") int connId, @PostMapping("check_conflict") public ConflictDetail checkConflicts( - @PathVariable("connId") int connId, - @RequestParam("reused_conn_id") int reusedConnId, - @RequestBody ConflictCheckEntity entity) { + @PathVariable("connId") int connId, + @RequestParam("reused_conn_id") int reusedConnId, + @RequestBody ConflictCheckEntity entity) { Ex.check(!CollectionUtils.isEmpty(entity.getVlEntities()), "common.param.cannot-be-empty", "vertexlabels"); Ex.check(CollectionUtils.isEmpty(entity.getPkEntities()), @@ -151,8 +151,8 @@ public ConflictDetail checkConflicts( @PostMapping("recheck_conflict") public ConflictDetail recheckConflicts( - @PathVariable("connId") int connId, - @RequestBody ConflictCheckEntity entity) { + @PathVariable("connId") int connId, + @RequestBody ConflictCheckEntity entity) { Ex.check(!CollectionUtils.isEmpty(entity.getVlEntities()), "common.param.cannot-be-empty", "vertexlabels"); Ex.check(CollectionUtils.isEmpty(entity.getElEntities()), @@ -181,8 +181,8 @@ public void update(@PathVariable("connId") int connId, @PostMapping("check_using") public Map checkUsing( - @PathVariable("connId") int connId, - @RequestBody UsingCheckEntity entity) { + @PathVariable("connId") int connId, + @RequestBody UsingCheckEntity entity) { Ex.check(!CollectionUtils.isEmpty(entity.getNames()), "common.param.cannot-be-empty", "names"); Map inUsing = new LinkedHashMap<>(); diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/task/AsyncTaskController.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/task/AsyncTaskController.java index 56eba4616..989cca5b7 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/task/AsyncTaskController.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/controller/task/AsyncTaskController.java @@ -20,6 +20,11 @@ import java.util.List; +import org.apache.hugegraph.common.Constant; +import org.apache.hugegraph.controller.BaseController; +import org.apache.hugegraph.exception.ExternalException; +import org.apache.hugegraph.service.algorithm.AsyncTaskService; +import org.apache.hugegraph.structure.Task; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; @@ -29,11 +34,6 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import org.apache.hugegraph.common.Constant; -import org.apache.hugegraph.controller.BaseController; -import org.apache.hugegraph.exception.ExternalException; -import org.apache.hugegraph.service.algorithm.AsyncTaskService; -import org.apache.hugegraph.structure.Task; import com.baomidou.mybatisplus.core.metadata.IPage; import lombok.extern.log4j.Log4j2; @@ -81,23 +81,23 @@ public IPage list(@PathVariable("connId") int connId, @RequestParam(name = "page_no", required = false, defaultValue = "1") - int pageNo, + int pageNo, @RequestParam(name = "page_size", required = false, defaultValue = "10") - int pageSize, + int pageSize, @RequestParam(name = "content", required = false, defaultValue = "") - String content, + String content, @RequestParam(name = "type", required = false, defaultValue = "") - String type, + String type, @RequestParam(name = "status", required = false, defaultValue = "") - String status) { + String status) { return this.service.list(connId, pageNo, pageSize, content, type, status); } diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/GraphConnection.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/GraphConnection.java index d97d7ba6e..3957f836f 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/GraphConnection.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/GraphConnection.java @@ -23,6 +23,7 @@ import org.apache.hugegraph.annotation.MergeProperty; import org.apache.hugegraph.common.Identifiable; import org.apache.hugegraph.common.Mergeable; + import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/algorithm/ShortestPath.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/algorithm/ShortestPath.java index cc3e52912..e70b366f0 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/algorithm/ShortestPath.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/algorithm/ShortestPath.java @@ -19,6 +19,7 @@ package org.apache.hugegraph.entity.algorithm; import org.apache.hugegraph.structure.constant.Direction; + import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/graph/EdgeEntity.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/graph/EdgeEntity.java index 46908b999..cb3824ef6 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/graph/EdgeEntity.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/graph/EdgeEntity.java @@ -21,6 +21,7 @@ import java.util.Map; import org.apache.hugegraph.common.Identifiable; + import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/graph/VertexEntity.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/graph/VertexEntity.java index 215c226be..9cf6fd3fb 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/graph/VertexEntity.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/graph/VertexEntity.java @@ -21,6 +21,7 @@ import java.util.Map; import org.apache.hugegraph.common.Identifiable; + import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/EdgeMapping.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/EdgeMapping.java index f354cf2be..64a9d0365 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/EdgeMapping.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/EdgeMapping.java @@ -21,6 +21,7 @@ import java.util.List; import org.apache.hugegraph.annotation.MergeProperty; + import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/ElementMapping.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/ElementMapping.java index bb90f4090..7c9ac7f6c 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/ElementMapping.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/ElementMapping.java @@ -24,6 +24,7 @@ import org.apache.hugegraph.annotation.MergeProperty; import org.apache.hugegraph.common.Mergeable; + import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/FieldMappingItem.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/FieldMappingItem.java index 892f0aeba..b01be289a 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/FieldMappingItem.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/FieldMappingItem.java @@ -19,6 +19,7 @@ package org.apache.hugegraph.entity.load; import org.apache.hugegraph.annotation.MergeProperty; + import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/FileMapping.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/FileMapping.java index cdf271960..53f8a525f 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/FileMapping.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/FileMapping.java @@ -30,6 +30,7 @@ import org.apache.hugegraph.handler.VertexMappingTypeHandler; import org.apache.hugegraph.util.HubbleUtil; import org.apache.hugegraph.util.SerializeUtil; + import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/FileSetting.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/FileSetting.java index 7ef4d5835..c682f8f61 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/FileSetting.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/FileSetting.java @@ -24,6 +24,7 @@ import org.apache.hugegraph.annotation.MergeProperty; import org.apache.hugegraph.common.Constant; import org.apache.hugegraph.common.Mergeable; + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; @@ -117,7 +118,7 @@ protected DelimiterDeserializer() { @Override public String deserialize(JsonParser jsonParser, DeserializationContext context) - throws IOException { + throws IOException { String delimiter = jsonParser.getText(); if ("\\t".equals(delimiter)) { return "\t"; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/FileUploadResult.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/FileUploadResult.java index 6e2fee5c5..967c2da6f 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/FileUploadResult.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/FileUploadResult.java @@ -19,6 +19,7 @@ package org.apache.hugegraph.entity.load; import org.apache.hugegraph.util.SerializeUtil; + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -57,6 +58,6 @@ public enum Status { FAILURE, - SUSPEND; + SUSPEND } } diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/JobManager.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/JobManager.java index 7ad15afac..283000905 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/JobManager.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/JobManager.java @@ -23,6 +23,7 @@ import org.apache.hugegraph.annotation.MergeProperty; import org.apache.hugegraph.entity.enums.JobStatus; import org.apache.hugegraph.util.SerializeUtil; + import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/JobManagerItem.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/JobManagerItem.java index d489928cf..28de6ebe4 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/JobManagerItem.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/JobManagerItem.java @@ -20,6 +20,7 @@ import org.apache.hugegraph.annotation.MergeProperty; import org.apache.hugegraph.util.SerializeUtil; + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonSerialize; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/JobManagerReasonResult.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/JobManagerReasonResult.java index 7a8489d6e..55a2717ca 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/JobManagerReasonResult.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/JobManagerReasonResult.java @@ -19,6 +19,7 @@ package org.apache.hugegraph.entity.load; import org.apache.hugegraph.annotation.MergeProperty; + import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/ListFormat.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/ListFormat.java index 83a3b8a30..edcf2404c 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/ListFormat.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/ListFormat.java @@ -23,6 +23,7 @@ import java.util.Set; import org.apache.hugegraph.loader.constant.Constants; + import com.fasterxml.jackson.annotation.JsonProperty; public final class ListFormat { diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/LoadParameter.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/LoadParameter.java index ff693ab7f..1da3af183 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/LoadParameter.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/LoadParameter.java @@ -20,6 +20,7 @@ import org.apache.hugegraph.annotation.MergeProperty; import org.apache.hugegraph.common.Mergeable; + import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/LoadTask.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/LoadTask.java index 86f5622d7..16422afab 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/LoadTask.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/LoadTask.java @@ -24,14 +24,15 @@ import java.util.concurrent.locks.ReentrantLock; import org.apache.hugegraph.annotation.MergeProperty; -import org.apache.hugegraph.entity.enums.LoadStatus; import org.apache.hugegraph.entity.GraphConnection; +import org.apache.hugegraph.entity.enums.LoadStatus; import org.apache.hugegraph.loader.HugeGraphLoader; import org.apache.hugegraph.loader.executor.LoadContext; import org.apache.hugegraph.loader.executor.LoadOptions; import org.apache.hugegraph.util.Ex; import org.apache.hugegraph.util.HubbleUtil; import org.apache.hugegraph.util.SerializeUtil; + import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/NullValues.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/NullValues.java index 979003e45..874b8f13a 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/NullValues.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/NullValues.java @@ -21,6 +21,7 @@ import java.util.Set; import org.apache.hugegraph.annotation.MergeProperty; + import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/ValueMappingItem.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/ValueMappingItem.java index 5a72f1444..9bfe1d917 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/ValueMappingItem.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/ValueMappingItem.java @@ -21,6 +21,7 @@ import java.util.List; import org.apache.hugegraph.annotation.MergeProperty; + import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/VertexMapping.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/VertexMapping.java index 4a5b023dc..7c6f394fd 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/VertexMapping.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/load/VertexMapping.java @@ -21,6 +21,7 @@ import java.util.List; import org.apache.hugegraph.annotation.MergeProperty; + import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/query/AdjacentQuery.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/query/AdjacentQuery.java index 9aece6b71..e9cf11e2a 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/query/AdjacentQuery.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/query/AdjacentQuery.java @@ -24,6 +24,7 @@ import org.apache.hugegraph.structure.constant.Direction; import org.apache.hugegraph.structure.graph.Edge; import org.apache.hugegraph.structure.graph.Vertex; + import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/query/ExecuteHistory.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/query/ExecuteHistory.java index 032287c7c..f1ddc3333 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/query/ExecuteHistory.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/query/ExecuteHistory.java @@ -27,6 +27,7 @@ import org.apache.hugegraph.entity.enums.ExecuteStatus; import org.apache.hugegraph.entity.enums.ExecuteType; import org.apache.hugegraph.util.SerializeUtil; + import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/query/GraphView.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/query/GraphView.java index 00c91a0fc..4d2d8d9c6 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/query/GraphView.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/query/GraphView.java @@ -22,6 +22,7 @@ import org.apache.hugegraph.structure.graph.Edge; import org.apache.hugegraph.structure.graph.Vertex; + import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/query/GremlinCollection.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/query/GremlinCollection.java index a188f9d7f..73747c79f 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/query/GremlinCollection.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/query/GremlinCollection.java @@ -23,6 +23,7 @@ import org.apache.hugegraph.annotation.MergeProperty; import org.apache.hugegraph.common.Identifiable; import org.apache.hugegraph.common.Mergeable; + import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/schema/ConflictDetail.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/schema/ConflictDetail.java index 9c2428667..8886a1500 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/schema/ConflictDetail.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/schema/ConflictDetail.java @@ -64,7 +64,7 @@ public ConflictDetail(SchemaType type) { @SuppressWarnings("unchecked") public List> getConflicts( - SchemaType type) { + SchemaType type) { switch (type) { case PROPERTY_KEY: return (List>) (Object) this.pkConflicts; @@ -76,7 +76,7 @@ public List> getConflicts( return (List>) (Object) this.elConflicts; default: throw new AssertionError(String.format( - "Unknown schema type '%s'", type)); + "Unknown schema type '%s'", type)); } } @@ -109,8 +109,8 @@ public boolean anyVertexLabelConflict(Collection names) { } private boolean anyConflict( - List> conflicts, - Collection names) { + List> conflicts, + Collection names) { if (CollectionUtils.isEmpty(names)) { return false; } diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/schema/EdgeLabelEntity.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/schema/EdgeLabelEntity.java index d48190bb3..4bd97090e 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/schema/EdgeLabelEntity.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/schema/EdgeLabelEntity.java @@ -23,6 +23,7 @@ import java.util.Set; import org.apache.hugegraph.util.HubbleUtil; + import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableSet; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/schema/PropertyIndex.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/schema/PropertyIndex.java index 058cfd4e3..29d798863 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/schema/PropertyIndex.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/schema/PropertyIndex.java @@ -22,6 +22,7 @@ import org.apache.hugegraph.structure.constant.IndexType; import org.apache.hugegraph.util.HubbleUtil; + import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/schema/PropertyKeyEntity.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/schema/PropertyKeyEntity.java index 81b712d55..e9b6f9a1e 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/schema/PropertyKeyEntity.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/schema/PropertyKeyEntity.java @@ -22,6 +22,7 @@ import org.apache.hugegraph.structure.constant.Cardinality; import org.apache.hugegraph.structure.constant.DataType; + import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/schema/SchemaStyle.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/schema/SchemaStyle.java index 027e02999..624a01ff6 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/schema/SchemaStyle.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/schema/SchemaStyle.java @@ -19,4 +19,5 @@ package org.apache.hugegraph.entity.schema; public class SchemaStyle { + } diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/schema/SchemaType.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/schema/SchemaType.java index 669ef14bc..8e3b1c85b 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/schema/SchemaType.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/schema/SchemaType.java @@ -69,7 +69,7 @@ public static SchemaType convert(HugeType type) { return PROPERTY_INDEX; default: throw new InternalException( - "Can't convert HugeType '%s' to SchemaType", type); + "Can't convert HugeType '%s' to SchemaType", type); } } } diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/schema/VertexLabelEntity.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/schema/VertexLabelEntity.java index 6e769c712..3edb81f97 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/schema/VertexLabelEntity.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/schema/VertexLabelEntity.java @@ -24,6 +24,7 @@ import org.apache.hugegraph.structure.constant.IdStrategy; import org.apache.hugegraph.util.HubbleUtil; + import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/task/AsyncTask.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/task/AsyncTask.java index f74e2de9a..015d2c043 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/task/AsyncTask.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/task/AsyncTask.java @@ -22,6 +22,7 @@ import org.apache.hugegraph.annotation.MergeProperty; import org.apache.hugegraph.util.SerializeUtil; + import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/task/AsyncTaskResult.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/task/AsyncTaskResult.java index e204c357d..6d0dc002c 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/task/AsyncTaskResult.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/entity/task/AsyncTaskResult.java @@ -19,6 +19,7 @@ package org.apache.hugegraph.entity.task; import org.apache.hugegraph.annotation.MergeProperty; + import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/CustomApplicationRunner.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/CustomApplicationRunner.java index 2c6bedc5d..fa91feef9 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/CustomApplicationRunner.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/CustomApplicationRunner.java @@ -18,6 +18,7 @@ package org.apache.hugegraph.handler; +import org.apache.hugegraph.config.HugeConfig; import org.apache.hugegraph.license.ServerInfo; import org.apache.hugegraph.options.HubbleOptions; import org.springframework.beans.factory.annotation.Autowired; @@ -25,8 +26,6 @@ import org.springframework.boot.ApplicationRunner; import org.springframework.stereotype.Component; -import org.apache.hugegraph.config.HugeConfig; - import lombok.extern.log4j.Log4j2; @Log4j2 diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/CustomInterceptor.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/CustomInterceptor.java index 08bd6352b..f7587e2a6 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/CustomInterceptor.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/CustomInterceptor.java @@ -40,7 +40,7 @@ public class CustomInterceptor extends HandlerInterceptorAdapter { private LicenseService licenseService; private static final Pattern CHECK_API_PATTERN = - Pattern.compile(".*/graph-connections/\\d+/.+"); + Pattern.compile(".*/graph-connections/\\d+/.+"); @Override public boolean preHandle(HttpServletRequest request, @@ -52,7 +52,7 @@ public boolean preHandle(HttpServletRequest request, } String connIdValue = StringUtils.substringBetween( - url, "/graph-connections/", "/"); + url, "/graph-connections/", "/"); if (StringUtils.isEmpty(connIdValue)) { throw new InternalException("Not found conn id in url"); } diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/EdgeMappingTypeHandler.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/EdgeMappingTypeHandler.java index 00b9fb0d6..fbeb04e92 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/EdgeMappingTypeHandler.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/EdgeMappingTypeHandler.java @@ -24,14 +24,13 @@ import java.sql.SQLException; import java.util.Set; +import org.apache.hugegraph.entity.load.EdgeMapping; +import org.apache.hugegraph.loader.util.JsonUtil; import org.apache.ibatis.type.BaseTypeHandler; import org.apache.ibatis.type.JdbcType; import org.apache.ibatis.type.MappedJdbcTypes; import org.apache.ibatis.type.MappedTypes; -import org.apache.hugegraph.entity.load.EdgeMapping; -import org.apache.hugegraph.loader.util.JsonUtil; - @MappedTypes(value = {EdgeMapping.class}) @MappedJdbcTypes(value = {JdbcType.VARCHAR}) public class EdgeMappingTypeHandler extends BaseTypeHandler> { @@ -46,7 +45,7 @@ public void setNonNullParameter(PreparedStatement preparedStatement, @Override public Set getNullableResult(ResultSet resultSet, String columnName) - throws SQLException { + throws SQLException { String json = resultSet.getString(columnName); return JsonUtil.convertSet(json, EdgeMapping.class); } @@ -54,15 +53,15 @@ public Set getNullableResult(ResultSet resultSet, @Override public Set getNullableResult(ResultSet resultSet, int columnIndex) - throws SQLException { + throws SQLException { String json = resultSet.getString(columnIndex); return JsonUtil.convertSet(json, EdgeMapping.class); } @Override public Set getNullableResult( - CallableStatement callableStatement, - int columnIndex) throws SQLException { + CallableStatement callableStatement, + int columnIndex) throws SQLException { String json = callableStatement.getString(columnIndex); return JsonUtil.convertSet(json, EdgeMapping.class); } diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/ExceptionAdvisor.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/ExceptionAdvisor.java index d78dad356..3d0091a47 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/ExceptionAdvisor.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/ExceptionAdvisor.java @@ -18,6 +18,8 @@ package org.apache.hugegraph.handler; +import org.apache.hugegraph.common.Constant; +import org.apache.hugegraph.common.Response; import org.apache.hugegraph.exception.ExternalException; import org.apache.hugegraph.exception.IllegalGremlinException; import org.apache.hugegraph.exception.InternalException; @@ -28,9 +30,6 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestControllerAdvice; -import org.apache.hugegraph.common.Constant; -import org.apache.hugegraph.common.Response; - import lombok.extern.log4j.Log4j2; @Log4j2 diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/LoadTaskExecutor.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/LoadTaskExecutor.java index 167ca8dbc..d660c273d 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/LoadTaskExecutor.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/LoadTaskExecutor.java @@ -18,11 +18,10 @@ package org.apache.hugegraph.handler; +import org.apache.hugegraph.entity.load.LoadTask; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; -import org.apache.hugegraph.entity.load.LoadTask; - import lombok.extern.log4j.Log4j2; @Log4j2 diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/MessageSourceHandler.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/MessageSourceHandler.java index 138f44fbb..62c1119d8 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/MessageSourceHandler.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/MessageSourceHandler.java @@ -24,6 +24,8 @@ import javax.servlet.http.HttpServletRequest; import org.apache.commons.lang3.LocaleUtils; +import org.apache.hugegraph.common.Constant; +import org.apache.hugegraph.entity.UserInfo; import org.apache.hugegraph.service.UserInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.MessageSource; @@ -34,9 +36,6 @@ import org.springframework.web.servlet.support.RequestContextUtils; import org.springframework.web.util.WebUtils; -import org.apache.hugegraph.common.Constant; -import org.apache.hugegraph.entity.UserInfo; - import lombok.extern.log4j.Log4j2; @Log4j2 diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/ResponseAdvisor.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/ResponseAdvisor.java index 4ea6e2ce6..b0c16bf4b 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/ResponseAdvisor.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/ResponseAdvisor.java @@ -18,6 +18,7 @@ package org.apache.hugegraph.handler; +import org.apache.hugegraph.common.Response; import org.springframework.core.MethodParameter; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -27,15 +28,13 @@ import org.springframework.web.bind.annotation.RestControllerAdvice; import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice; -import org.apache.hugegraph.common.Response; - @RestControllerAdvice(basePackages = "org.apache.hugegraph.controller") public class ResponseAdvisor implements ResponseBodyAdvice { @Override public boolean supports(MethodParameter returnType, Class> - converterType) { + converterType) { return true; } @@ -43,7 +42,7 @@ public boolean supports(MethodParameter returnType, public Response beforeBodyWrite(Object body, MethodParameter returnType, MediaType selectedContentType, Class> - selectedConverterType, + selectedConverterType, ServerHttpRequest request, ServerHttpResponse response) { if (body instanceof Response) { diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/VertexMappingTypeHandler.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/VertexMappingTypeHandler.java index 60360894d..a0018e884 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/VertexMappingTypeHandler.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/handler/VertexMappingTypeHandler.java @@ -24,18 +24,17 @@ import java.sql.SQLException; import java.util.Set; +import org.apache.hugegraph.entity.load.VertexMapping; +import org.apache.hugegraph.loader.util.JsonUtil; import org.apache.ibatis.type.BaseTypeHandler; import org.apache.ibatis.type.JdbcType; import org.apache.ibatis.type.MappedJdbcTypes; import org.apache.ibatis.type.MappedTypes; -import org.apache.hugegraph.entity.load.VertexMapping; -import org.apache.hugegraph.loader.util.JsonUtil; - @MappedTypes(value = {VertexMapping.class}) @MappedJdbcTypes(value = {JdbcType.VARCHAR}) public class VertexMappingTypeHandler - extends BaseTypeHandler> { + extends BaseTypeHandler> { @Override public void setNonNullParameter(PreparedStatement preparedStatement, @@ -48,7 +47,7 @@ public void setNonNullParameter(PreparedStatement preparedStatement, @Override public Set getNullableResult(ResultSet resultSet, String columnName) - throws SQLException { + throws SQLException { String json = resultSet.getString(columnName); return JsonUtil.convertSet(json, VertexMapping.class); } @@ -56,15 +55,15 @@ public Set getNullableResult(ResultSet resultSet, @Override public Set getNullableResult(ResultSet resultSet, int columnIndex) - throws SQLException { + throws SQLException { String json = resultSet.getString(columnIndex); return JsonUtil.convertSet(json, VertexMapping.class); } @Override public Set getNullableResult( - CallableStatement callableStatement, - int columnIndex) throws SQLException { + CallableStatement callableStatement, + int columnIndex) throws SQLException { String json = callableStatement.getString(columnIndex); return JsonUtil.convertSet(json, VertexMapping.class); } diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/GraphConnectionMapper.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/GraphConnectionMapper.java index aef4f0872..d65cc3f6d 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/GraphConnectionMapper.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/GraphConnectionMapper.java @@ -18,12 +18,12 @@ package org.apache.hugegraph.mapper; +import org.apache.hugegraph.entity.GraphConnection; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.springframework.stereotype.Component; -import org.apache.hugegraph.entity.GraphConnection; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/UserInfoMapper.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/UserInfoMapper.java index c384aec8e..9c1f9134a 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/UserInfoMapper.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/UserInfoMapper.java @@ -18,13 +18,14 @@ package org.apache.hugegraph.mapper; +import org.apache.hugegraph.entity.UserInfo; import org.apache.ibatis.annotations.Mapper; import org.springframework.stereotype.Component; -import org.apache.hugegraph.entity.UserInfo; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @Mapper @Component public interface UserInfoMapper extends BaseMapper { + } diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/algorithm/AsyncTaskMapper.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/algorithm/AsyncTaskMapper.java index 9bfe5213a..9f641e746 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/algorithm/AsyncTaskMapper.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/algorithm/AsyncTaskMapper.java @@ -18,13 +18,14 @@ package org.apache.hugegraph.mapper.algorithm; +import org.apache.hugegraph.entity.task.AsyncTask; import org.apache.ibatis.annotations.Mapper; import org.springframework.stereotype.Component; -import org.apache.hugegraph.entity.task.AsyncTask; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @Mapper @Component public interface AsyncTaskMapper extends BaseMapper { + } diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/load/FileMappingMapper.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/load/FileMappingMapper.java index bfb4cfd87..356122cd9 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/load/FileMappingMapper.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/load/FileMappingMapper.java @@ -18,13 +18,14 @@ package org.apache.hugegraph.mapper.load; +import org.apache.hugegraph.entity.load.FileMapping; import org.apache.ibatis.annotations.Mapper; import org.springframework.stereotype.Component; -import org.apache.hugegraph.entity.load.FileMapping; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @Mapper @Component public interface FileMappingMapper extends BaseMapper { + } diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/load/JobManagerMapper.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/load/JobManagerMapper.java index f1eb255b5..310b16b68 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/load/JobManagerMapper.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/load/JobManagerMapper.java @@ -18,13 +18,13 @@ package org.apache.hugegraph.mapper.load; +import org.apache.hugegraph.entity.load.JobManager; +import org.apache.hugegraph.entity.load.JobManagerItem; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.springframework.stereotype.Component; -import org.apache.hugegraph.entity.load.JobManager; -import org.apache.hugegraph.entity.load.JobManagerItem; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @Mapper diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/load/LoadTaskMapper.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/load/LoadTaskMapper.java index 1dca424bf..e007d0e16 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/load/LoadTaskMapper.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/load/LoadTaskMapper.java @@ -18,13 +18,14 @@ package org.apache.hugegraph.mapper.load; +import org.apache.hugegraph.entity.load.LoadTask; import org.apache.ibatis.annotations.Mapper; import org.springframework.stereotype.Component; -import org.apache.hugegraph.entity.load.LoadTask; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @Mapper @Component public interface LoadTaskMapper extends BaseMapper { + } diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/query/ExecuteHistoryMapper.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/query/ExecuteHistoryMapper.java index 1be6ce1b7..71f6520d9 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/query/ExecuteHistoryMapper.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/query/ExecuteHistoryMapper.java @@ -18,12 +18,12 @@ package org.apache.hugegraph.mapper.query; +import org.apache.hugegraph.entity.query.ExecuteHistory; import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Component; -import org.apache.hugegraph.entity.query.ExecuteHistory; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @Mapper diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/query/GremlinCollectionMapper.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/query/GremlinCollectionMapper.java index b9498a65d..06f38e2d9 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/query/GremlinCollectionMapper.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/mapper/query/GremlinCollectionMapper.java @@ -18,12 +18,12 @@ package org.apache.hugegraph.mapper.query; +import org.apache.hugegraph.entity.query.GremlinCollection; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.springframework.stereotype.Component; -import org.apache.hugegraph.entity.query.GremlinCollection; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/options/HubbleOptions.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/options/HubbleOptions.java index e8ffe3afa..b88ec2d3c 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/options/HubbleOptions.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/options/HubbleOptions.java @@ -23,13 +23,12 @@ import static org.apache.hugegraph.config.OptionChecker.positiveInt; import static org.apache.hugegraph.config.OptionChecker.rangeInt; -import org.springframework.util.CollectionUtils; - import org.apache.hugegraph.config.ConfigListOption; import org.apache.hugegraph.config.ConfigOption; import org.apache.hugegraph.config.OptionHolder; import org.apache.hugegraph.util.Bytes; import org.apache.hugegraph.util.HubbleUtil; +import org.springframework.util.CollectionUtils; public class HubbleOptions extends OptionHolder { diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/GraphConnectionService.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/GraphConnectionService.java index 3a70764c9..0889b666c 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/GraphConnectionService.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/GraphConnectionService.java @@ -20,16 +20,16 @@ import java.util.List; +import org.apache.hugegraph.entity.GraphConnection; import org.apache.hugegraph.exception.InternalException; +import org.apache.hugegraph.mapper.GraphConnectionMapper; +import org.apache.hugegraph.util.SQLUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Isolation; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.StringUtils; -import org.apache.hugegraph.entity.GraphConnection; -import org.apache.hugegraph.mapper.GraphConnectionMapper; -import org.apache.hugegraph.util.SQLUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/HugeClientPoolService.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/HugeClientPoolService.java index 4b6a5aebe..7b210efc3 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/HugeClientPoolService.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/HugeClientPoolService.java @@ -22,22 +22,21 @@ import javax.annotation.PreDestroy; -import org.apache.hugegraph.exception.ExternalException; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - import org.apache.hugegraph.config.HugeConfig; import org.apache.hugegraph.driver.HugeClient; import org.apache.hugegraph.entity.GraphConnection; +import org.apache.hugegraph.exception.ExternalException; import org.apache.hugegraph.options.HubbleOptions; import org.apache.hugegraph.util.HugeClientUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; import lombok.extern.log4j.Log4j2; @Log4j2 @Service public final class HugeClientPoolService - extends ConcurrentHashMap { + extends ConcurrentHashMap { @Autowired private HugeConfig config; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/SettingSSLService.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/SettingSSLService.java index 74dc1f85f..3ab2b549c 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/SettingSSLService.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/SettingSSLService.java @@ -34,9 +34,9 @@ public void configSSL(HugeConfig config, GraphConnection connection) { if ("https".equals(protocol)) { connection.setProtocol(protocol); String trustStoreFile = config.get( - HubbleOptions.CLIENT_TRUSTSTORE_FILE); + HubbleOptions.CLIENT_TRUSTSTORE_FILE); String trustStorePass = config.get( - HubbleOptions.CLIENT_TRUSTSTORE_PASSWORD); + HubbleOptions.CLIENT_TRUSTSTORE_PASSWORD); connection.setTrustStoreFile(trustStoreFile); connection.setTrustStorePassword(trustStorePass); } diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/UserInfoService.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/UserInfoService.java index 92f70d15e..b456c10a0 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/UserInfoService.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/UserInfoService.java @@ -18,12 +18,12 @@ package org.apache.hugegraph.service; +import org.apache.hugegraph.entity.UserInfo; import org.apache.hugegraph.exception.InternalException; +import org.apache.hugegraph.mapper.UserInfoMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import org.apache.hugegraph.entity.UserInfo; -import org.apache.hugegraph.mapper.UserInfoMapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/algorithm/AsyncTaskService.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/algorithm/AsyncTaskService.java index f00e2cf64..a509b3e2a 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/algorithm/AsyncTaskService.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/algorithm/AsyncTaskService.java @@ -22,13 +22,13 @@ import java.util.Comparator; import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - import org.apache.hugegraph.driver.HugeClient; import org.apache.hugegraph.service.HugeClientPoolService; import org.apache.hugegraph.structure.Task; import org.apache.hugegraph.util.PageUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + import com.baomidou.mybatisplus.core.metadata.IPage; import lombok.extern.log4j.Log4j2; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/algorithm/OltpAlgoService.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/algorithm/OltpAlgoService.java index 997d026d3..1335c1069 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/algorithm/OltpAlgoService.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/algorithm/OltpAlgoService.java @@ -24,9 +24,6 @@ import java.util.List; import java.util.Map; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - import org.apache.hugegraph.driver.HugeClient; import org.apache.hugegraph.driver.TraverserManager; import org.apache.hugegraph.entity.algorithm.ShortestPath; @@ -44,6 +41,9 @@ import org.apache.hugegraph.structure.graph.Path; import org.apache.hugegraph.structure.graph.Vertex; import org.apache.hugegraph.util.HubbleUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + import com.google.common.collect.ImmutableMap; import lombok.extern.log4j.Log4j2; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/graph/GraphService.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/graph/GraphService.java index 28b997d2b..8523e9e9e 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/graph/GraphService.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/graph/GraphService.java @@ -21,13 +21,6 @@ import java.util.Map; import org.apache.commons.lang3.StringUtils; -import org.apache.hugegraph.exception.ExternalException; -import org.apache.hugegraph.service.schema.EdgeLabelService; -import org.apache.hugegraph.service.schema.PropertyKeyService; -import org.apache.hugegraph.service.schema.VertexLabelService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - import org.apache.hugegraph.driver.GraphManager; import org.apache.hugegraph.driver.HugeClient; import org.apache.hugegraph.entity.graph.EdgeEntity; @@ -37,16 +30,23 @@ import org.apache.hugegraph.entity.schema.PropertyKeyEntity; import org.apache.hugegraph.entity.schema.SchemaLabelEntity; import org.apache.hugegraph.entity.schema.VertexLabelEntity; +import org.apache.hugegraph.exception.ExternalException; import org.apache.hugegraph.loader.source.file.FileSource; import org.apache.hugegraph.loader.source.file.ListFormat; import org.apache.hugegraph.loader.util.DataTypeUtil; import org.apache.hugegraph.service.HugeClientPoolService; +import org.apache.hugegraph.service.schema.EdgeLabelService; +import org.apache.hugegraph.service.schema.PropertyKeyService; +import org.apache.hugegraph.service.schema.VertexLabelService; import org.apache.hugegraph.structure.GraphElement; import org.apache.hugegraph.structure.constant.IdStrategy; import org.apache.hugegraph.structure.graph.Edge; import org.apache.hugegraph.structure.graph.Vertex; import org.apache.hugegraph.structure.schema.PropertyKey; import org.apache.hugegraph.util.Ex; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + import com.google.common.collect.ImmutableSet; import lombok.extern.log4j.Log4j2; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/license/LicenseService.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/license/LicenseService.java index ecee5d11c..72bb57153 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/license/LicenseService.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/license/LicenseService.java @@ -24,17 +24,16 @@ import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Async; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Service; - import org.apache.hugegraph.driver.HugeClient; import org.apache.hugegraph.entity.GraphConnection; import org.apache.hugegraph.handler.MessageSourceHandler; import org.apache.hugegraph.service.GraphConnectionService; import org.apache.hugegraph.service.HugeClientPoolService; import org.apache.hugegraph.util.Ex; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Service; import lombok.AllArgsConstructor; import lombok.Data; @@ -80,11 +79,11 @@ public String getMessage() { String comma = LicenseService.this.getMessage("common.joiner.comma"); String semicolon = LicenseService.this.getMessage( - "common.joiner.semicolon"); + "common.joiner.semicolon"); StringBuilder sb = new StringBuilder(); sb.append(LicenseService.this.getMessage( - "license.verify.graph-connection.failed.preifx")); + "license.verify.graph-connection.failed.preifx")); sb.append(comma); if (!StringUtils.isEmpty(this.graphsMessage)) { sb.append(this.graphsMessage); @@ -101,7 +100,7 @@ public String getMessage() { sb.deleteCharAt(sb.length() - 1); sb.append(comma); sb.append(LicenseService.this.getMessage( - "license.verify.graph-connection.failed.suffix")); + "license.verify.graph-connection.failed.suffix")); return sb.toString(); } } diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/load/FileMappingService.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/load/FileMappingService.java index 02a052f1f..e574ad797 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/load/FileMappingService.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/load/FileMappingService.java @@ -40,25 +40,25 @@ import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; -import org.apache.hugegraph.exception.InternalException; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Async; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Isolation; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.multipart.MultipartFile; - import org.apache.hugegraph.config.HugeConfig; import org.apache.hugegraph.entity.enums.FileMappingStatus; import org.apache.hugegraph.entity.load.FileMapping; import org.apache.hugegraph.entity.load.FileSetting; import org.apache.hugegraph.entity.load.FileUploadResult; +import org.apache.hugegraph.exception.InternalException; import org.apache.hugegraph.mapper.load.FileMappingMapper; import org.apache.hugegraph.options.HubbleOptions; import org.apache.hugegraph.util.Ex; import org.apache.hugegraph.util.HubbleUtil; import org.apache.hugegraph.util.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Isolation; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -214,7 +214,7 @@ public boolean tryMergePartFiles(String dirPath, int total) { log.error("Failed to copy file stream from {} to {}", partFile, newFile, e); throw new InternalException( - "load.upload.merge-file.failed", e); + "load.upload.merge-file.failed", e); } } } catch (IOException e) { @@ -299,7 +299,7 @@ public String moveToNextLevelDir(FileMapping mapping) { } catch (IOException e) { this.remove(mapping.getId()); throw new InternalException( - "Failed to move file to next level directory"); + "Failed to move file to next level directory"); } return Paths.get(destPath, currFile.getName()).toString(); } @@ -337,7 +337,7 @@ public void deleteUnfinishedFile() { query.in("file_status", FileMappingStatus.UPLOADING.getValue()); List mappings = this.mapper.selectList(query); long threshold = this.config.get( - HubbleOptions.UPLOAD_FILE_MAX_TIME_CONSUMING) * 1000; + HubbleOptions.UPLOAD_FILE_MAX_TIME_CONSUMING) * 1000; Date now = HubbleUtil.nowDate(); for (FileMapping mapping : mappings) { Date updateTime = mapping.getUpdateTime(); diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/load/JobManagerService.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/load/JobManagerService.java index 75472a319..6e337421a 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/load/JobManagerService.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/load/JobManagerService.java @@ -21,18 +21,18 @@ import java.util.Date; import java.util.List; -import org.apache.hugegraph.exception.InternalException; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Isolation; -import org.springframework.transaction.annotation.Transactional; - import org.apache.hugegraph.entity.enums.JobStatus; import org.apache.hugegraph.entity.enums.LoadStatus; import org.apache.hugegraph.entity.load.JobManager; import org.apache.hugegraph.entity.load.LoadTask; +import org.apache.hugegraph.exception.InternalException; import org.apache.hugegraph.mapper.load.JobManagerMapper; import org.apache.hugegraph.util.HubbleUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Isolation; +import org.springframework.transaction.annotation.Transactional; + import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/load/LoadTaskService.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/load/LoadTaskService.java index 3d3745336..a5d9dc515 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/load/LoadTaskService.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/load/LoadTaskService.java @@ -29,17 +29,6 @@ import java.util.concurrent.ConcurrentHashMap; import org.apache.commons.io.FileUtils; -import org.apache.hugegraph.exception.ExternalException; -import org.apache.hugegraph.exception.InternalException; -import org.apache.hugegraph.service.schema.EdgeLabelService; -import org.apache.hugegraph.service.schema.VertexLabelService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Async; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Isolation; -import org.springframework.transaction.annotation.Transactional; - import org.apache.hugegraph.common.Constant; import org.apache.hugegraph.config.HugeConfig; import org.apache.hugegraph.entity.GraphConnection; @@ -53,6 +42,8 @@ import org.apache.hugegraph.entity.load.VertexMapping; import org.apache.hugegraph.entity.schema.EdgeLabelEntity; import org.apache.hugegraph.entity.schema.VertexLabelEntity; +import org.apache.hugegraph.exception.ExternalException; +import org.apache.hugegraph.exception.InternalException; import org.apache.hugegraph.handler.LoadTaskExecutor; import org.apache.hugegraph.loader.executor.LoadContext; import org.apache.hugegraph.loader.executor.LoadOptions; @@ -63,7 +54,15 @@ import org.apache.hugegraph.loader.util.MappingUtil; import org.apache.hugegraph.mapper.load.LoadTaskMapper; import org.apache.hugegraph.service.SettingSSLService; +import org.apache.hugegraph.service.schema.EdgeLabelService; +import org.apache.hugegraph.service.schema.VertexLabelService; import org.apache.hugegraph.util.Ex; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Isolation; +import org.springframework.transaction.annotation.Transactional; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -422,7 +421,7 @@ private FileSource buildFileSource(FileMapping fileMapping) { } private List - buildVertexMappings(GraphConnection connection, + buildVertexMappings(GraphConnection connection, FileMapping fileMapping) { int connId = connection.getId(); List vMappings = @@ -477,7 +476,7 @@ private FileSource buildFileSource(FileMapping fileMapping) { } private List - buildEdgeMappings(GraphConnection connection, + buildEdgeMappings(GraphConnection connection, FileMapping fileMapping) { int connId = connection.getId(); List eMappings = diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/query/ExecuteHistoryService.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/query/ExecuteHistoryService.java index e51ba6f4f..c6fffac7e 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/query/ExecuteHistoryService.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/query/ExecuteHistoryService.java @@ -21,24 +21,23 @@ import java.time.Instant; import java.time.temporal.ChronoField; -import org.apache.hugegraph.exception.InternalException; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Async; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Isolation; -import org.springframework.transaction.annotation.Transactional; - import org.apache.hugegraph.config.HugeConfig; import org.apache.hugegraph.driver.HugeClient; import org.apache.hugegraph.entity.enums.AsyncTaskStatus; import org.apache.hugegraph.entity.enums.ExecuteType; import org.apache.hugegraph.entity.query.ExecuteHistory; +import org.apache.hugegraph.exception.InternalException; import org.apache.hugegraph.mapper.query.ExecuteHistoryMapper; import org.apache.hugegraph.options.HubbleOptions; import org.apache.hugegraph.service.HugeClientPoolService; import org.apache.hugegraph.structure.Task; import org.apache.hugegraph.util.HubbleUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Isolation; +import org.springframework.transaction.annotation.Transactional; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/query/GremlinCollectionService.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/query/GremlinCollectionService.java index 7116ac801..3ece3623a 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/query/GremlinCollectionService.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/query/GremlinCollectionService.java @@ -18,16 +18,16 @@ package org.apache.hugegraph.service.query; +import org.apache.hugegraph.entity.query.GremlinCollection; import org.apache.hugegraph.exception.InternalException; +import org.apache.hugegraph.mapper.query.GremlinCollectionMapper; +import org.apache.hugegraph.util.SQLUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Isolation; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.StringUtils; -import org.apache.hugegraph.entity.query.GremlinCollection; -import org.apache.hugegraph.mapper.query.GremlinCollectionMapper; -import org.apache.hugegraph.util.SQLUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/query/GremlinQueryService.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/query/GremlinQueryService.java index 6f87cca11..359a0bd66 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/query/GremlinQueryService.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/query/GremlinQueryService.java @@ -31,14 +31,6 @@ import java.util.stream.Collectors; import org.apache.commons.lang3.StringUtils; -import org.apache.hugegraph.exception.ExternalException; -import org.apache.hugegraph.exception.IllegalGremlinException; -import org.apache.hugegraph.exception.InternalException; -import org.apache.hugegraph.service.schema.VertexLabelService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - import org.apache.hugegraph.api.gremlin.GremlinRequest; import org.apache.hugegraph.config.HugeConfig; import org.apache.hugegraph.driver.HugeClient; @@ -51,10 +43,14 @@ import org.apache.hugegraph.entity.query.TableView; import org.apache.hugegraph.entity.query.TypedResult; import org.apache.hugegraph.entity.schema.VertexLabelEntity; +import org.apache.hugegraph.exception.ExternalException; +import org.apache.hugegraph.exception.IllegalGremlinException; +import org.apache.hugegraph.exception.InternalException; import org.apache.hugegraph.exception.ServerException; import org.apache.hugegraph.options.HubbleOptions; import org.apache.hugegraph.rest.ClientException; import org.apache.hugegraph.service.HugeClientPoolService; +import org.apache.hugegraph.service.schema.VertexLabelService; import org.apache.hugegraph.structure.constant.Direction; import org.apache.hugegraph.structure.constant.IdStrategy; import org.apache.hugegraph.structure.graph.Edge; @@ -64,6 +60,10 @@ import org.apache.hugegraph.structure.gremlin.ResultSet; import org.apache.hugegraph.util.Ex; import org.apache.hugegraph.util.GremlinUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; @@ -145,7 +145,7 @@ public GremlinResult expandVertex(int connId, AdjacentQuery query) { List vertices = new ArrayList<>(resultSet.size()); List edges = new ArrayList<>(resultSet.size()); - for (Iterator iter = resultSet.iterator(); iter.hasNext();) { + for (Iterator iter = resultSet.iterator(); iter.hasNext(); ) { Path path = iter.next().getPath(); List objects = path.objects(); assert objects.size() == 3; @@ -311,7 +311,7 @@ private TableView buildTableView(TypedResult typedResult) { return new TableView(TableView.PATH_HEADER, paths); default: throw new AssertionError(String.format( - "Unknown result type '%s'", typedResult.getType())); + "Unknown result type '%s'", typedResult.getType())); } } @@ -368,7 +368,7 @@ private GraphView buildGraphView(TypedResult result, HugeClient client) { private String buildGremlinQuery(int connId, AdjacentQuery query) { int degreeLimit = this.config.get( - HubbleOptions.GREMLIN_VERTEX_DEGREE_LIMIT); + HubbleOptions.GREMLIN_VERTEX_DEGREE_LIMIT); Object id = this.getRealVertexId(connId, query); StringBuilder sb = new StringBuilder("g.V("); @@ -453,7 +453,7 @@ private Map edgesOfVertex(TypedResult result, ResultSet resultSet = client.gremlin().gremlin(gremlin).execute(); // The edges count for per vertex Map degrees = new HashMap<>(resultSet.size()); - for (Iterator iter = resultSet.iterator(); iter.hasNext();) { + for (Iterator iter = resultSet.iterator(); iter.hasNext(); ) { Edge edge = iter.next().getEdge(); Object source = edge.sourceId(); Object target = edge.targetId(); @@ -498,7 +498,7 @@ private Map verticesOfEdge(TypedResult result, String ids = StringUtils.join(escapedIds, ","); String gremlin = String.format("g.V(%s)", ids); ResultSet resultSet = client.gremlin().gremlin(gremlin).execute(); - for (Iterator iter = resultSet.iterator(); iter.hasNext();) { + for (Iterator iter = resultSet.iterator(); iter.hasNext(); ) { Vertex vertex = iter.next().getVertex(); vertices.put(vertex.id(), vertex); } diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/schema/EdgeLabelService.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/schema/EdgeLabelService.java index a2fb8892e..a43d9dc2d 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/schema/EdgeLabelService.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/schema/EdgeLabelService.java @@ -30,11 +30,6 @@ import java.util.function.BiFunction; import java.util.stream.Collectors; -import org.apache.hugegraph.exception.ExternalException; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - import org.apache.hugegraph.common.Constant; import org.apache.hugegraph.driver.HugeClient; import org.apache.hugegraph.entity.schema.ConflictCheckEntity; @@ -48,6 +43,7 @@ import org.apache.hugegraph.entity.schema.SchemaConflict; import org.apache.hugegraph.entity.schema.SchemaEntity; import org.apache.hugegraph.entity.schema.SchemaType; +import org.apache.hugegraph.exception.ExternalException; import org.apache.hugegraph.exception.ServerException; import org.apache.hugegraph.structure.SchemaElement; import org.apache.hugegraph.structure.constant.Frequency; @@ -57,6 +53,9 @@ import org.apache.hugegraph.structure.schema.VertexLabel; import org.apache.hugegraph.util.Ex; import org.apache.hugegraph.util.JsonUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import lombok.extern.log4j.Log4j2; @@ -158,8 +157,8 @@ public void update(EdgeLabelUpdateEntity entity, int connId) { List addedIndexLabelNames = entity.getAppendPropertyIndexNames(); List addedIndexLabels = convertIndexLabels( - entity.getAppendPropertyIndexes(), - client, false, entity.getName()); + entity.getAppendPropertyIndexes(), + client, false, entity.getName()); List removedIndexLabelNames = entity.getRemovePropertyIndexes(); @@ -167,8 +166,8 @@ public void update(EdgeLabelUpdateEntity entity, int connId) { for (String name : addedIndexLabelNames) { if (existedIndexLabelNames.contains(name)) { throw new ExternalException( - "schema.edgelabel.update.append-index-existed", - entity.getName(), name); + "schema.edgelabel.update.append-index-existed", + entity.getName(), name); } } } @@ -176,8 +175,8 @@ public void update(EdgeLabelUpdateEntity entity, int connId) { for (String name : removedIndexLabelNames) { if (!existedIndexLabelNames.contains(name)) { throw new ExternalException( - "schema.edgelabel.update.remove-index-unexisted", - entity.getName(), name); + "schema.edgelabel.update.remove-index-unexisted", + entity.getName(), name); } } } @@ -234,7 +233,7 @@ public ConflictDetail checkConflict(ConflictCheckEntity entity, } // Then check conflict of edge label itself EdgeLabelEntity originElEntity = originElEntities.get( - elEntity.getName()); + elEntity.getName()); ConflictStatus status = SchemaEntity.compare(elEntity, originElEntity); detail.add(elEntity, status); @@ -354,7 +353,7 @@ private static EdgeLabel convert(EdgeLabelEntity entity, return null; } Frequency frequency = entity.isLinkMultiTimes() ? Frequency.MULTIPLE : - Frequency.SINGLE; + Frequency.SINGLE; EdgeLabelStyle style = entity.getStyle(); return client.schema().edgeLabel(entity.getName()) .sourceLabel(entity.getSourceLabel()) diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/schema/PropertyIndexService.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/schema/PropertyIndexService.java index ad27e025f..774d42df5 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/schema/PropertyIndexService.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/schema/PropertyIndexService.java @@ -28,10 +28,6 @@ import java.util.function.BiFunction; import java.util.stream.Collectors; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; -import org.springframework.util.StringUtils; - import org.apache.hugegraph.common.Constant; import org.apache.hugegraph.driver.HugeClient; import org.apache.hugegraph.entity.schema.ConflictDetail; @@ -44,6 +40,10 @@ import org.apache.hugegraph.structure.constant.HugeType; import org.apache.hugegraph.structure.schema.IndexLabel; import org.apache.hugegraph.util.PageUtil; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; + import com.baomidou.mybatisplus.core.metadata.IPage; import lombok.extern.log4j.Log4j2; @@ -112,13 +112,13 @@ public IPage list(int connId, HugeType type, * --------------+------------------------+--------------------------------- * xxxname | xxxByName | name * --------------+------------------------+--------------------------------- - * | personByName | name + * | personByName | name * person +------------------------+--------------------------------- - * | personByAgeAndName | age name + * | personByAgeAndName | age name * --------------+------------------------+--------------------------------- - * | softwareByName | name + * | softwareByName | name * software +------------------------+--------------------------------- - * | softwareByPriveAndName | price name + * | softwareByPriveAndName | price name * --------------+------------------------+--------------------------------- */ public IPage list(int connId, HugeType type, String content, @@ -138,10 +138,10 @@ public IPage list(int connId, HugeType type, String content, boolean match = baseValue.contains(content); if (match) { groupedIndexes = matchedResults.computeIfAbsent(baseValue, - k -> new ArrayList<>()); + k -> new ArrayList<>()); } else { groupedIndexes = unMatchResults.computeIfAbsent(baseValue, - k -> new ArrayList<>()); + k -> new ArrayList<>()); } match = match || indexLabel.name().contains(content) || indexLabel.indexFields().stream() @@ -154,11 +154,12 @@ public IPage list(int connId, HugeType type, String content, // Sort matched results by relevance if (!StringUtils.isEmpty(content)) { for (Map.Entry> entry : - matchedResults.entrySet()) { + matchedResults.entrySet()) { List groupedIndexes = entry.getValue(); groupedIndexes.sort(new Comparator() { final int highScore = 2; final int lowScore = 1; + @Override public int compare(PropertyIndex o1, PropertyIndex o2) { int o1Score = 0; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/schema/PropertyKeyService.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/schema/PropertyKeyService.java index 97252aba2..db5757d6c 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/schema/PropertyKeyService.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/schema/PropertyKeyService.java @@ -27,10 +27,6 @@ import java.util.function.BiConsumer; import java.util.stream.Collectors; -import org.apache.hugegraph.exception.ExternalException; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - import org.apache.hugegraph.common.Constant; import org.apache.hugegraph.driver.HugeClient; import org.apache.hugegraph.entity.schema.ConflictCheckEntity; @@ -40,11 +36,14 @@ import org.apache.hugegraph.entity.schema.SchemaConflict; import org.apache.hugegraph.entity.schema.SchemaEntity; import org.apache.hugegraph.entity.schema.SchemaType; +import org.apache.hugegraph.exception.ExternalException; import org.apache.hugegraph.exception.ServerException; import org.apache.hugegraph.structure.schema.EdgeLabel; import org.apache.hugegraph.structure.schema.PropertyKey; import org.apache.hugegraph.structure.schema.VertexLabel; import org.apache.hugegraph.util.Ex; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import lombok.extern.log4j.Log4j2; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/schema/SchemaService.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/schema/SchemaService.java index fb0228bbb..5494625eb 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/schema/SchemaService.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/schema/SchemaService.java @@ -29,10 +29,6 @@ import java.util.function.BiFunction; import java.util.stream.Collectors; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - import org.apache.hugegraph.config.HugeConfig; import org.apache.hugegraph.driver.HugeClient; import org.apache.hugegraph.driver.SchemaManager; @@ -49,6 +45,9 @@ import org.apache.hugegraph.structure.schema.IndexLabel; import org.apache.hugegraph.structure.schema.SchemaLabel; import org.apache.hugegraph.util.HubbleUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import lombok.extern.log4j.Log4j2; @@ -73,7 +72,7 @@ public HugeClient client(int connId) { } public static List collectNames( - List schemas) { + List schemas) { return schemas.stream().map(SchemaElement::name) .collect(Collectors.toList()); } @@ -89,8 +88,8 @@ public static Set collectProperties(SchemaLabel schemaLabel) { } public static List collectPropertyIndexes( - SchemaLabel schemaLabel, - List indexLabels) { + SchemaLabel schemaLabel, + List indexLabels) { List propertyIndexes = new ArrayList<>(); if (indexLabels == null) { return propertyIndexes; @@ -165,7 +164,7 @@ public static List convertIndexLabels(List entities, } public static - void compareWithEachOther(ConflictDetail detail, SchemaType type) { + void compareWithEachOther(ConflictDetail detail, SchemaType type) { List> conflicts = detail.getConflicts(type); for (int i = 0; i < conflicts.size(); i++) { SchemaConflict conflict = conflicts.get(i); @@ -178,8 +177,8 @@ void compareWithEachOther(ConflictDetail detail, SchemaType type) { } public static - ConflictStatus compareWithOthers(int currentIdx, - List> conflicts) { + ConflictStatus compareWithOthers(int currentIdx, + List> conflicts) { SchemaConflict current = conflicts.get(currentIdx); T currentEntity = current.getEntity(); // May changed @@ -205,8 +204,8 @@ ConflictStatus compareWithOthers(int currentIdx, } public static void addBatch( - List schemas, HugeClient client, - BiConsumer func, SchemaType type) { + List schemas, HugeClient client, + BiConsumer func, SchemaType type) { if (CollectionUtils.isEmpty(schemas)) { return; } @@ -221,8 +220,8 @@ public static void addBatch( } public static List addBatch( - List schemas, HugeClient client, - BiFunction func, SchemaType type) { + List schemas, HugeClient client, + BiFunction func, SchemaType type) { List tasks = new ArrayList<>(); if (CollectionUtils.isEmpty(schemas)) { return tasks; @@ -239,8 +238,8 @@ public static List addBatch( } public static List removeBatch( - List names, HugeClient client, - BiFunction func, SchemaType type) { + List names, HugeClient client, + BiFunction func, SchemaType type) { List tasks = new ArrayList<>(); if (CollectionUtils.isEmpty(names)) { return tasks; diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/schema/VertexLabelService.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/schema/VertexLabelService.java index 35773a128..0ab420bb5 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/schema/VertexLabelService.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/service/schema/VertexLabelService.java @@ -30,11 +30,6 @@ import java.util.function.BiFunction; import java.util.stream.Collectors; -import org.apache.hugegraph.exception.ExternalException; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - import org.apache.hugegraph.common.Constant; import org.apache.hugegraph.driver.HugeClient; import org.apache.hugegraph.entity.schema.ConflictCheckEntity; @@ -48,6 +43,7 @@ import org.apache.hugegraph.entity.schema.VertexLabelEntity; import org.apache.hugegraph.entity.schema.VertexLabelStyle; import org.apache.hugegraph.entity.schema.VertexLabelUpdateEntity; +import org.apache.hugegraph.exception.ExternalException; import org.apache.hugegraph.exception.ServerException; import org.apache.hugegraph.structure.SchemaElement; import org.apache.hugegraph.structure.schema.EdgeLabel; @@ -56,6 +52,9 @@ import org.apache.hugegraph.structure.schema.VertexLabel; import org.apache.hugegraph.util.Ex; import org.apache.hugegraph.util.JsonUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import lombok.extern.log4j.Log4j2; @@ -168,8 +167,8 @@ public void update(VertexLabelUpdateEntity entity, int connId) { List addedIndexLabelNames = entity.getAppendPropertyIndexNames(); List addedIndexLabels = convertIndexLabels( - entity.getAppendPropertyIndexes(), - client, true, entity.getName()); + entity.getAppendPropertyIndexes(), + client, true, entity.getName()); List removedIndexLabelNames = entity.getRemovePropertyIndexes(); @@ -177,8 +176,8 @@ public void update(VertexLabelUpdateEntity entity, int connId) { for (String name : addedIndexLabelNames) { if (existedIndexLabelNames.contains(name)) { throw new ExternalException( - "schema.vertexlabel.update.append-index-existed", - entity.getName(), name); + "schema.vertexlabel.update.append-index-existed", + entity.getName(), name); } } } @@ -186,8 +185,8 @@ public void update(VertexLabelUpdateEntity entity, int connId) { for (String name : removedIndexLabelNames) { if (!existedIndexLabelNames.contains(name)) { throw new ExternalException( - "schema.vertexlabel.update.remove-index-unexisted", - entity.getName(), name); + "schema.vertexlabel.update.remove-index-unexisted", + entity.getName(), name); } } } diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/util/FileUtil.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/util/FileUtil.java index 1157542ae..876b850a4 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/util/FileUtil.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/util/FileUtil.java @@ -38,7 +38,7 @@ public static int countLines(String path) { public static int countLines(File file) { if (!file.exists()) { throw new IllegalArgumentException(String.format( - "The file %s doesn't exist", file)); + "The file %s doesn't exist", file)); } long fileLength = file.length(); try (FileInputStream fis = new FileInputStream(file); diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/util/GremlinUtil.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/util/GremlinUtil.java index acd311814..352e1fc0c 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/util/GremlinUtil.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/util/GremlinUtil.java @@ -44,17 +44,17 @@ public final class GremlinUtil { ); private static final String[] COMPILE_SEARCH_LIST = new String[]{ - ".", "(", ")" + ".", "(", ")" }; private static final String[] COMPILE_TARGET_LIST = new String[]{ - "\\.", "\\(", "\\)" + "\\.", "\\(", "\\)" }; private static final String[] ESCAPE_SEARCH_LIST = new String[]{ - "\\", "\"", "'", "\n" + "\\", "\"", "'", "\n" }; private static final String[] ESCAPE_TARGET_LIST = new String[]{ - "\\\\", "\\\"", "\\'", "\\n" + "\\\\", "\\\"", "\\'", "\\n" }; private static final Set LIMIT_PATTERNS = compile(LIMIT_SUFFIXES); diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/util/HugeClientUtil.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/util/HugeClientUtil.java index b6c1f0ab4..ab5558040 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/util/HugeClientUtil.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/util/HugeClientUtil.java @@ -21,15 +21,15 @@ import java.util.Set; import org.apache.hugegraph.common.Constant; +import org.apache.hugegraph.driver.HugeClient; import org.apache.hugegraph.entity.GraphConnection; import org.apache.hugegraph.exception.ExternalException; -import org.springframework.web.util.UriComponentsBuilder; - -import org.apache.hugegraph.driver.HugeClient; import org.apache.hugegraph.exception.ServerException; import org.apache.hugegraph.rest.ClientException; import org.apache.hugegraph.structure.gremlin.Result; import org.apache.hugegraph.structure.gremlin.ResultSet; +import org.springframework.web.util.UriComponentsBuilder; + import com.google.common.collect.ImmutableSet; public final class HugeClientUtil { @@ -76,7 +76,7 @@ public static HugeClient tryConnect(GraphConnection connection) { throw new ExternalException("client-server.version.unmatched", e); } if (message != null && (message.startsWith("Error loading trust store from") || - message.startsWith("Cannot find trust store file"))) { + message.startsWith("Cannot find trust store file"))) { throw new ExternalException("https.load.truststore.error", e); } throw e; @@ -85,12 +85,12 @@ public static HugeClient tryConnect(GraphConnection connection) { if (Constant.STATUS_UNAUTHORIZED == e.status() || (message != null && message.startsWith("Authentication"))) { throw new ExternalException( - "graph-connection.username-or-password.incorrect", e); + "graph-connection.username-or-password.incorrect", e); } if (message != null && message.contains("Invalid syntax for " + "username and password")) { throw new ExternalException( - "graph-connection.missing-username-password", e); + "graph-connection.missing-username-password", e); } throw e; } catch (ClientException e) { @@ -117,7 +117,7 @@ public static HugeClient tryConnect(GraphConnection connection) { } catch (ServerException e) { if (Constant.STATUS_UNAUTHORIZED == e.status()) { throw new ExternalException( - "graph-connection.username-or-password.incorrect", e); + "graph-connection.username-or-password.incorrect", e); } String message = e.message(); if (message != null && message.contains("Could not rebind [g]")) { diff --git a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/util/SQLUtil.java b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/util/SQLUtil.java index 8ba416425..98dc5de7e 100644 --- a/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/util/SQLUtil.java +++ b/hugegraph-hubble/hubble-be/src/main/java/org/apache/hugegraph/util/SQLUtil.java @@ -19,7 +19,6 @@ package org.apache.hugegraph.util; import org.apache.commons.lang3.StringUtils; - import org.apache.hugegraph.common.Constant; public final class SQLUtil { diff --git a/hugegraph-hubble/hubble-be/src/main/resources/database/data.sql b/hugegraph-hubble/hubble-be/src/main/resources/database/data.sql index d23cb3446..b6f344278 100644 --- a/hugegraph-hubble/hubble-be/src/main/resources/database/data.sql +++ b/hugegraph-hubble/hubble-be/src/main/resources/database/data.sql @@ -1,19 +1,19 @@ SELECT 1; /* * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with this - * work for additional information regarding copyright ownership. The ASF - * licenses this file to You under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ -- INSERT INTO `graph_connection`(name, graph, host, port, timeout, create_time) VALUES ('s', 'hugegraph', 'localhost', 8080, 60, sysdate); diff --git a/hugegraph-hubble/hubble-be/src/main/resources/database/schema.sql b/hugegraph-hubble/hubble-be/src/main/resources/database/schema.sql index d8d1b9b81..c4c646f51 100644 --- a/hugegraph-hubble/hubble-be/src/main/resources/database/schema.sql +++ b/hugegraph-hubble/hubble-be/src/main/resources/database/schema.sql @@ -1,18 +1,18 @@ /* * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with this - * work for additional information regarding copyright ownership. The ASF - * licenses this file to You under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ CREATE TABLE IF NOT EXISTS `user_info` ( diff --git a/hugegraph-hubble/hubble-be/src/main/resources/log4j2.xml b/hugegraph-hubble/hubble-be/src/main/resources/log4j2.xml index fabc9216e..3410533ba 100644 --- a/hugegraph-hubble/hubble-be/src/main/resources/log4j2.xml +++ b/hugegraph-hubble/hubble-be/src/main/resources/log4j2.xml @@ -19,23 +19,23 @@ - + - + filePattern="logs/hugegraph-hubble-%d{yyyy-MM-dd}-%i.log"> + - + - + @@ -47,29 +47,29 @@ - - + + - - + + - - + + - - + + - - + + - - + + diff --git a/hugegraph-hubble/hubble-be/src/test/java/org/apache/hugegraph/unit/EntityUtilTest.java b/hugegraph-hubble/hubble-be/src/test/java/org/apache/hugegraph/unit/EntityUtilTest.java index 0f5622f63..f3f75ddd9 100644 --- a/hugegraph-hubble/hubble-be/src/test/java/org/apache/hugegraph/unit/EntityUtilTest.java +++ b/hugegraph-hubble/hubble-be/src/test/java/org/apache/hugegraph/unit/EntityUtilTest.java @@ -20,11 +20,10 @@ import java.util.Date; -import org.junit.Test; - import org.apache.hugegraph.entity.GraphConnection; import org.apache.hugegraph.testutil.Assert; import org.apache.hugegraph.util.EntityUtil; +import org.junit.Test; public class EntityUtilTest { @@ -34,7 +33,7 @@ public void testMerge() throws InterruptedException { GraphConnection newEntity; oldEntity = new GraphConnection(1, "conn1", "graph1", "host1", 8001, 30, "", "", true, "", - new Date(),"http","",""); + new Date(), "http", "", ""); Thread.sleep(10); newEntity = new GraphConnection(2, "conn2", "graph2", "host2", 8002, 40, "u", "p", false, "xxx", diff --git a/hugegraph-hubble/hubble-be/src/test/java/org/apache/hugegraph/unit/FileUtilTest.java b/hugegraph-hubble/hubble-be/src/test/java/org/apache/hugegraph/unit/FileUtilTest.java index f8154e7f2..ac959bf14 100644 --- a/hugegraph-hubble/hubble-be/src/test/java/org/apache/hugegraph/unit/FileUtilTest.java +++ b/hugegraph-hubble/hubble-be/src/test/java/org/apache/hugegraph/unit/FileUtilTest.java @@ -18,10 +18,9 @@ package org.apache.hugegraph.unit; -import org.junit.Test; - import org.apache.hugegraph.testutil.Assert; import org.apache.hugegraph.util.FileUtil; +import org.junit.Test; public class FileUtilTest { diff --git a/hugegraph-hubble/hubble-be/src/test/java/org/apache/hugegraph/unit/UnitTestSuite.java b/hugegraph-hubble/hubble-be/src/test/java/org/apache/hugegraph/unit/UnitTestSuite.java index c58ff48ee..6cdd3026a 100644 --- a/hugegraph-hubble/hubble-be/src/test/java/org/apache/hugegraph/unit/UnitTestSuite.java +++ b/hugegraph-hubble/hubble-be/src/test/java/org/apache/hugegraph/unit/UnitTestSuite.java @@ -23,8 +23,9 @@ @RunWith(Suite.class) @Suite.SuiteClasses({ - EntityUtilTest.class, - FileUtilTest.class + EntityUtilTest.class, + FileUtilTest.class }) public class UnitTestSuite { + } diff --git a/hugegraph-hubble/hubble-be/src/test/resources/application.properties b/hugegraph-hubble/hubble-be/src/test/resources/application.properties index 12d387be5..65eb287d2 100644 --- a/hugegraph-hubble/hubble-be/src/test/resources/application.properties +++ b/hugegraph-hubble/hubble-be/src/test/resources/application.properties @@ -44,4 +44,3 @@ mybatis.configuration.map-underscore-to-camel-case=true mybatis.configuration.use-generated-keys=true mybatis.configuration.default-executor-type=reuse mybatis.configuration.default-statement-timeout=600 - diff --git a/hugegraph-hubble/hubble-be/src/test/resources/database/schema.sql b/hugegraph-hubble/hubble-be/src/test/resources/database/schema.sql index d8d1b9b81..c4c646f51 100644 --- a/hugegraph-hubble/hubble-be/src/test/resources/database/schema.sql +++ b/hugegraph-hubble/hubble-be/src/test/resources/database/schema.sql @@ -1,18 +1,18 @@ /* * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with this - * work for additional information regarding copyright ownership. The ASF - * licenses this file to You under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ CREATE TABLE IF NOT EXISTS `user_info` ( diff --git a/hugegraph-hubble/hubble-be/src/test/resources/log4j2.xml b/hugegraph-hubble/hubble-be/src/test/resources/log4j2.xml index fabc9216e..3410533ba 100644 --- a/hugegraph-hubble/hubble-be/src/test/resources/log4j2.xml +++ b/hugegraph-hubble/hubble-be/src/test/resources/log4j2.xml @@ -19,23 +19,23 @@ - + - + filePattern="logs/hugegraph-hubble-%d{yyyy-MM-dd}-%i.log"> + - + - + @@ -47,29 +47,29 @@ - - + + - - + + - - + + - - + + - - + + - - + + diff --git a/hugegraph-hubble/hubble-dist/pom.xml b/hugegraph-hubble/hubble-dist/pom.xml index c11a470dd..66335e06f 100644 --- a/hugegraph-hubble/hubble-dist/pom.xml +++ b/hugegraph-hubble/hubble-dist/pom.xml @@ -141,7 +141,7 @@ rm -f ${top.level.dir}/dist.sh - +