diff --git a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/query/EdgesQueryIterator.java b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/query/EdgesQueryIterator.java index 3d03c84a43..a3edd28c42 100644 --- a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/query/EdgesQueryIterator.java +++ b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/query/EdgesQueryIterator.java @@ -38,7 +38,7 @@ public EdgesQueryIterator(Iterator sources, this.sources = sources; this.labels = labels; this.directions = directions; - // Traverse NO_LIMIT 和 Query.NO_LIMIT 不同 + // Traverse NO_LIMIT and Query.NO_LIMIT are different this.limit = limit < 0 ? Query.NO_LIMIT : limit; } diff --git a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/query/Query.java b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/query/Query.java index 593887d92f..4d8e39ccb7 100644 --- a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/query/Query.java +++ b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/query/Query.java @@ -617,10 +617,10 @@ public static void checkForceCapacity(long count) throws LimitExceedException { } public enum OrderType { - // 批量接口下,返回顺序的要求 - ORDER_NONE, // 允许无序 - ORDER_WITHIN_VERTEX, // 一个点内的边不会被打断,单不同点之间为无序 - ORDER_STRICT // 保证原始的输入点顺序 + // Under batch interface, the requirement for return order + ORDER_NONE, // Allow unordered + ORDER_WITHIN_VERTEX, // Edges within a vertex will not be broken, but there is no order between different vertices. + ORDER_STRICT // Ensure the original input point order } public enum Order { diff --git a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/serializer/BinaryBackendEntry.java b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/serializer/BinaryBackendEntry.java index 6f8fc21c93..ca605f0b65 100644 --- a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/serializer/BinaryBackendEntry.java +++ b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/serializer/BinaryBackendEntry.java @@ -174,7 +174,7 @@ public boolean mergeable(BackendEntry other) { return false; } if (!this.id().equals(other.id())) { - // 兼容从ap查回的数据, vertex id + // Compatible with data retrieved from ap, vertex id if (!this.id().origin().equals(other.originId())) { return false; } diff --git a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/serializer/BytesBuffer.java b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/serializer/BytesBuffer.java index f293dd2873..b99c2c8b5e 100644 --- a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/serializer/BytesBuffer.java +++ b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/serializer/BytesBuffer.java @@ -795,7 +795,7 @@ public BinaryId parseId(HugeType type, boolean enablePartition) { } /** - * 解析 olap id + * Analyze olap id * @param type * @param isOlap * @return @@ -811,7 +811,7 @@ public BinaryId parseOlapId(HugeType type, boolean isOlap) { * {PropertyKey}{VertexId} */ if (isOlap) { - // 先 read olap property id + // First read olap property id Id pkId = this.readId(); } Id id = this.readId(); diff --git a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/store/BackendMutation.java b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/store/BackendMutation.java index 02b3429006..5b17fdf8e9 100644 --- a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/store/BackendMutation.java +++ b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/store/BackendMutation.java @@ -71,7 +71,7 @@ public void put(BackendEntry entry, Action action) { } /** - * The optimized scenes include but are not limited to: + * The optimized scenes include but are not limited to: * 1.If you want to delete an entry, the other mutations previously * can be ignored. * 2.As similar to the No.1 item, If you want to insert an entry, diff --git a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/tx/SchemaTransactionV2.java b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/tx/SchemaTransactionV2.java index c199cfa129..8bf0a68b20 100644 --- a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/tx/SchemaTransactionV2.java +++ b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/tx/SchemaTransactionV2.java @@ -94,7 +94,7 @@ private static void setCreateTimeIfNeeded(SchemaElement schema) { } /** - * 异步任务系列 + * Asynchronous Task Series */ private static Id asyncRun(HugeGraph graph, SchemaElement schema, SchemaJob job) { @@ -354,7 +354,7 @@ public Id removeIndexLabel(Id id) { return asyncRun(this.graph(), schema, job); } - // 通用性 的schema处理函数 + // Generality of schema processing functions @Watched(prefix = "schema") public void updateSchemaStatus(SchemaElement schema, SchemaStatus status) { if (!this.existsSchemaId(schema.type(), schema.id())) { @@ -429,7 +429,7 @@ private void saveSchema(SchemaElement schema, boolean update, // NOTE: Do schema update in the lock block updateCallback.accept(schema); } - // 调对应的方法 + // Call the corresponding method switch (schema.type()) { case PROPERTY_KEY: this.schemaMetaManager.addPropertyKey(this.graphSpace, @@ -440,14 +440,14 @@ private void saveSchema(SchemaElement schema, boolean update, this.schemaMetaManager.addVertexLabel(this.graphSpace, this.graph, (VertexLabel) schema); - // 点的label发生变化, 清空对应图的点缓存信息 + // Point's label changes, clear the corresponding graph's point cache information MetaManager.instance().notifyGraphVertexCacheClear(this.graphSpace, this.graph); break; case EDGE_LABEL: this.schemaMetaManager.addEdgeLabel(this.graphSpace, this.graph, (EdgeLabel) schema); - // 边的label发生变化, 清空对应图的边缓存信息 + // Side label changes, clear the corresponding edge cache information of the graph. MetaManager.instance().notifyGraphEdgeCacheClear(this.graphSpace, this.graph); break; case INDEX_LABEL: @@ -575,7 +575,7 @@ public void removeSchema(SchemaElement schema) { } } - // olap 相关的方法 + // OLAP related methods public void createIndexLabelForOlapPk(PropertyKey propertyKey) { WriteType writeType = propertyKey.writeType(); if (writeType == WriteType.OLTP || @@ -627,8 +627,8 @@ public Id createOlapPk(PropertyKey propertyKey) { return asyncRun(this.graph(), propertyKey, job); } - // -- store 相关的方法,分为两类:1、olaptable相关 2、id生成策略 - // - 1、olaptable相关 + // -- store related methods, divided into two categories: 1. olap table related 2. ID generation strategy + // - 1. olap table related public void createOlapPk(Id id) { this.graphParams().loadGraphStore().createOlapTable(id); } @@ -645,7 +645,7 @@ public void initAndRegisterOlapTables() { } } - // - 2、id生成策略 + // - 2. ID generation strategy @Watched(prefix = "schema") public Id getNextId(HugeType type) { LOG.debug("SchemaTransaction get next id for {}", type); @@ -698,7 +698,7 @@ private void checkIdAndUpdateNextId(HugeType type, Id id, this.setNextIdLowest(type, id.asLong()); } - // 功能型函数 + // Functional functions public void checkSchemaName(String name) { String illegalReg = this.graphParams().configuration() .get(CoreOptions.SCHEMA_ILLEGAL_NAME_REGEX); @@ -729,12 +729,12 @@ public GraphMode graphMode() { return this.graphParams().mode(); } - // 获取字段的方法 + // Get field method public HugeGraph graph() { return this.graphParams.graph(); } - // 重建索引 + // Rebuild index @Watched(prefix = "schema") public Id rebuildIndex(SchemaElement schema) { return this.rebuildIndex(schema, ImmutableSet.of()); @@ -749,7 +749,7 @@ public Id rebuildIndex(SchemaElement schema, Set dependencies) { } /** - * 清除所有的schema信息 + * Clear all schema information */ public void clear() { this.schemaMetaManager.clearAllSchema(this.graphSpace, graph); diff --git a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/config/CoreOptions.java b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/config/CoreOptions.java index f17853d4a5..21054902c2 100644 --- a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/config/CoreOptions.java +++ b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/config/CoreOptions.java @@ -521,8 +521,8 @@ public static synchronized CoreOptions instance() { /** * The schema name rule: - * 1、Not allowed end with spaces - * 2、Not allowed start with '~' + * 1. Not allowed end with spaces + * 2. Not allowed start with '~' */ public static final ConfigOption SCHEMA_ILLEGAL_NAME_REGEX = new ConfigOption<>( diff --git a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/io/HugeGraphSONModule.java b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/io/HugeGraphSONModule.java index 416c3b0e4c..168a966a27 100644 --- a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/io/HugeGraphSONModule.java +++ b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/io/HugeGraphSONModule.java @@ -198,7 +198,7 @@ public static void registerSchemaSerializers(SimpleModule module) { public static void registerGraphSerializers(SimpleModule module) { /* * Use customized serializer need to be compatible with V1 and V2 - * Graphson, and seems need to implement edge deserializer,it is + * Graphson, and seems need to implement edge deserializer, it is * a little complicated. */ module.addSerializer(HugeVertex.class, new HugeVertexSerializer()); diff --git a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/meta/MetaManager.java b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/meta/MetaManager.java index 4824b5fb44..faa1367e3c 100644 --- a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/meta/MetaManager.java +++ b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/meta/MetaManager.java @@ -250,7 +250,7 @@ public void listenGraphCacheClear(Consumer consumer) { } /** - * 监听vertex label变化, graph vertex cache clear + * Listen for vertex label changes, graph vertex cache clear * * @param consumer * @param @@ -260,7 +260,7 @@ public void listenGraphVertexCacheClear(Consumer consumer) { } /** - * 监听edge label变化, graph edge cache clear + * Listen to edge label changes, graph edge cache clear * * @param consumer * @param @@ -491,7 +491,7 @@ public void notifyGraphCacheClear(String graphSpace, String graph) { } /** - * 通知 需要进行 graph vertex cache clear + * Notice Requires graph vertex cache clear * * @param graphSpace * @param graph @@ -501,7 +501,7 @@ public void notifyGraphVertexCacheClear(String graphSpace, String graph) { } /** - * 通知 需要进行 graph edge cache clear + * Notice Requires graph edge cache clear * * @param graphSpace * @param graph diff --git a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/meta/lock/EtcdDistributedLock.java b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/meta/lock/EtcdDistributedLock.java index ed62a429f0..3e9a830581 100644 --- a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/meta/lock/EtcdDistributedLock.java +++ b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/meta/lock/EtcdDistributedLock.java @@ -108,7 +108,7 @@ public LockResult tryLock(String lockName, long ttl, long timeout) { this.revokeLease(leaseId); return lockResult; } catch (TimeoutException e) { - // 获取锁超时 + // Acquire lock timeout LOG.warn("Thread {} timeout to lock {}", Thread.currentThread().getName(), lockName); service.shutdown(); diff --git a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/meta/managers/GraphMetaManager.java b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/meta/managers/GraphMetaManager.java index 859746bd9b..6ddd9d82e6 100644 --- a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/meta/managers/GraphMetaManager.java +++ b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/meta/managers/GraphMetaManager.java @@ -101,7 +101,7 @@ public void notifyGraphCacheClear(String graphSpace, String graph) { } /** - * 通知 点信息 cache clear + * Notice point information cache clear * * @param graphSpace * @param graph @@ -112,7 +112,7 @@ public void notifyGraphVertexCacheClear(String graphSpace, String graph) { } /** - * 通知 边信息 cache clear + * Notice Edge Information cache clear * * @param graphSpace * @param graph @@ -249,7 +249,7 @@ private String graphCacheClearKey() { } /** - * pd监听 vertex label更新的key + * pd listen to vertex label updated key * * @return */ @@ -266,7 +266,7 @@ private String graphVertexCacheClearKey() { } /** - * pd监听 edge label更新的key + * pd listen edge label updated key * * @return */ diff --git a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/meta/managers/TaskMetaManager.java b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/meta/managers/TaskMetaManager.java index 3ab16eced5..9af234c866 100644 --- a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/meta/managers/TaskMetaManager.java +++ b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/meta/managers/TaskMetaManager.java @@ -47,7 +47,7 @@ public boolean isLockedTask(String graphSpace, String graphName, String taskId) { String key = taskLockKey(graphSpace, graphName, taskId); - // 判断当前任务是否锁定 + // Check if the current task is locked return metaDriver.isLocked(key); } diff --git a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/DistributedTaskScheduler.java b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/DistributedTaskScheduler.java index c29d7a3b82..677314ca79 100644 --- a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/DistributedTaskScheduler.java +++ b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/DistributedTaskScheduler.java @@ -94,7 +94,7 @@ public DistributedTaskScheduler(HugeGraphParams graph, // LockUtil.lock(this.graph().spaceGraphName(), LockUtil.GRAPH_LOCK); LockUtil.lock("", LockUtil.GRAPH_LOCK); try { - // TODO: 使用超级管理员权限,查询任务 + // TODO: Use super administrator privileges to query tasks. // TaskManager.useAdmin(); this.cronSchedule(); } catch (Throwable t) { @@ -121,13 +121,13 @@ private static boolean sleep(long ms) { } public void cronSchedule() { - // 执行周期调度任务 + // Perform periodic scheduling tasks if (!this.graph.started() || this.graph.closed()) { return; } - // 处理 NEW 状态的任务 + // Handle tasks in NEW status Iterator> news = queryTaskWithoutResultByStatus( TaskStatus.NEW); @@ -136,12 +136,12 @@ public void cronSchedule() { LOG.info("Try to start task({})@({}/{})", newTask.id(), this.graphSpace, this.graphName); if (!tryStartHugeTask(newTask)) { - // 任务提交失败时,线程池已打满 + // Task submission failed when the thread pool is full. break; } } - // 处理 RUNNING 状态的任务 + // Handling tasks in RUNNING state Iterator> runnings = queryTaskWithoutResultByStatus(TaskStatus.RUNNING); @@ -163,7 +163,7 @@ public void cronSchedule() { } } - // 处理 FAILED/HANGING 状态的任务 + // Handle tasks in FAILED/HANGING state Iterator> faileds = queryTaskWithoutResultByStatus(TaskStatus.FAILED); @@ -178,7 +178,7 @@ public void cronSchedule() { } } - // 处理 CANCELLING 状态的任务 + // Handling tasks in CANCELLING state Iterator> cancellings = queryTaskWithoutResultByStatus( TaskStatus.CANCELLING); @@ -193,7 +193,7 @@ public void cronSchedule() { runningTasks.remove(cancellingId); } else { - // 本地没有执行任务,但是当前任务已经无节点在执行 + // Local no execution task, but the current task has no nodes executing. if (!isLockedTask(cancellingId.toString())) { updateStatusWithLock(cancellingId, TaskStatus.CANCELLING, TaskStatus.CANCELLED); @@ -201,7 +201,7 @@ public void cronSchedule() { } } - // 处理 DELETING 状态的任务 + // Handling tasks in DELETING status Iterator> deletings = queryTaskWithoutResultByStatus( TaskStatus.DELETING); @@ -212,12 +212,12 @@ public void cronSchedule() { initTaskParams(deleting); deleting.cancel(true); - // 删除存储信息 + // Delete storage information deleteFromDB(deletingId); runningTasks.remove(deletingId); } else { - // 本地没有执行任务,但是当前任务已经无节点在执行 + // Local has no task execution, but the current task has no nodes executing anymore. if (!isLockedTask(deletingId.toString())) { deleteFromDB(deletingId); } @@ -254,14 +254,14 @@ public Future schedule(HugeTask task) { initTaskParams(task); if (task.ephemeralTask()) { - // 处理 ephemeral 任务,不需要调度,直接执行 + // Handle ephemeral tasks, no scheduling needed, execute directly return this.ephemeralTaskExecutor.submit(task); } - // 处理 schema 任务 - // 处理 gremlin 任务 - // 处理 olap 计算任务 - // 添加任务到 DB,当前任务状态为 NEW + // Process schema task + // Handle gremlin task + // Handle OLAP calculation tasks + // Add task to DB, current task status is NEW // TODO: save server id for task this.save(task); @@ -277,8 +277,8 @@ public Future schedule(HugeTask task) { } protected void initTaskParams(HugeTask task) { - // 绑定当前任务执行所需的环境变量 - // 在任务反序列化和执行之前,均需要调用该方法 + // Bind the environment variables required for the current task execution + // Before task deserialization and execution, this method needs to be called. task.scheduler(this); TaskCallable callable = task.callable(); callable.task(task); @@ -291,9 +291,9 @@ protected void initTaskParams(HugeTask task) { @Override public void cancel(HugeTask task) { - // 更新状态为 CANCELLING + // Update status to CANCELLING if (!task.completed()) { - // 任务未完成,才可执行状态未 CANCELLING + // Task not completed, can only execute status not CANCELLING this.updateStatus(task.id(), null, TaskStatus.CANCELLING); } else { LOG.info("cancel task({}) error, task has completed", task.id()); @@ -306,7 +306,7 @@ public void init() { } protected HugeTask deleteFromDB(Id id) { - // 从 DB 中删除 Task,不检查任务状态 + // Delete Task from DB, without checking task status return this.call(() -> { Iterator vertices = this.tx().queryTaskInfos(id); HugeVertex vertex = (HugeVertex) QueryResults.one(vertices); @@ -322,7 +322,7 @@ protected HugeTask deleteFromDB(Id id) { @Override public HugeTask delete(Id id, boolean force) { if (!force) { - // 更改状态为 DELETING,通过自动调度实现删除操作 + // Change status to DELETING, perform the deletion operation through automatic scheduling. this.updateStatus(id, null, TaskStatus.DELETING); return null; } else { @@ -404,7 +404,7 @@ private HugeTask waitUntilTaskCompleted(Id id, long seconds, if (task.completed()) { // Wait for task result being set after status is completed sleep(intervalMs); - // 查询带有结果的任务信息 + // Query task information with results task = this.task(id); return task; } @@ -473,7 +473,7 @@ protected boolean updateStatus(Id id, TaskStatus prestatus, initTaskParams(task); if (prestatus == null || task.status() == prestatus) { task.overwriteStatus(status); - // 如果状态更新为 FAILED -> NEW,则增加重试次数 + // If the status is updated to FAILED -> NEW, then increase the retry count. if (prestatus == TaskStatus.FAILED && status == TaskStatus.NEW) { task.retry(); } @@ -626,7 +626,7 @@ public void run() { runningTasks.put(task.id(), task); - // 任务执行不会抛出异常,HugeTask 在执行过程中,会捕获异常,并存储到 DB 中 + // Task execution will not throw exceptions, HugeTask will catch exceptions during execution and store them in the DB. task.run(); } catch (Throwable t) { LOG.warn("exception when execute task", t); diff --git a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/HugeTask.java b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/HugeTask.java index bfd79f6f22..c07b9e8d47 100644 --- a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/HugeTask.java +++ b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/HugeTask.java @@ -760,7 +760,7 @@ public void syncWait() { } assert task != null; /* - * This can be enabled for debug to expose schema-clear errors early, + * This can be enabled for debug to expose schema-clear errors early, * but also lead to some negative tests failed, */ boolean debugTest = false; diff --git a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/TaskAndResultScheduler.java b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/TaskAndResultScheduler.java index f076f6c466..d3ffece041 100644 --- a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/TaskAndResultScheduler.java +++ b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/TaskAndResultScheduler.java @@ -89,7 +89,7 @@ public void save(HugeTask task) { return this.tx().addVertex(vertex); }); - // 保存 result 结果 + // Save result outcome if (rawResult != null) { HugeTaskResult result = new HugeTaskResult(HugeTaskResult.genId(task.id())); diff --git a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/TaskManager.java b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/TaskManager.java index afc5c9d49b..f8e5602048 100644 --- a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/TaskManager.java +++ b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/TaskManager.java @@ -111,7 +111,7 @@ public void addScheduler(HugeGraphParams graph) { E.checkArgumentNotNull(graph, "The graph can't be null"); LOG.info("Use {} as the scheduler of graph ({})", graph.schedulerType(), graph.name()); - // TODO: 如当前服务绑定到指定的非 DEFAULT 图空间,非当前图空间的图不再创建任务调度器 (graph space) + // TODO: If the current service is bound to a specified non-DEFAULT graph space, the graph outside of the current graph space will no longer create task schedulers (graph space) switch (graph.schedulerType()) { case "distributed": { TaskScheduler scheduler = diff --git a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/traversal/optimize/HugeVertexStepByBatch.java b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/traversal/optimize/HugeVertexStepByBatch.java index 112052e725..62d6a2b921 100644 --- a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/traversal/optimize/HugeVertexStepByBatch.java +++ b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/traversal/optimize/HugeVertexStepByBatch.java @@ -80,7 +80,7 @@ public void reset() { @Override public Iterator lastTimeResults() { /* - * NOTE: fetch page from this iterator, can only get page info of + * NOTE: fetch page from this iterator, can only get page info of * the lowest level, may lost info of upper levels. */ return this.iterator; diff --git a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/type/HugeTableType.java b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/type/HugeTableType.java index a3edf746ff..925f32b29f 100644 --- a/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/type/HugeTableType.java +++ b/hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/type/HugeTableType.java @@ -27,13 +27,13 @@ public enum HugeTableType implements SerialEnum { UNKNOWN(0, "UNKNOWN"), /* Schema types */ - VERTEX(1, "V"), // 顶点表 - OUT_EDGE(2, "OE"), // 出边表 - IN_EDGE(3, "IE"), // 入边表 - ALL_INDEX_TABLE(4, "INDEX"), // 索引表 - TASK_INFO_TABLE(5, "TASK"), // 任务信息表 - OLAP_TABLE(6, "OLAP"), // OLAP 表 - SERVER_INFO_TABLE(7, "SERVER"); // SERVER 信息表 + VERTEX(1, "V"), // Vertex table + OUT_EDGE(2, "OE"), // Out-edge table + IN_EDGE(3, "IE"), // In-edge table + ALL_INDEX_TABLE(4, "INDEX"), // Index Table + TASK_INFO_TABLE(5, "TASK"), // Task Information Table + OLAP_TABLE(6, "OLAP"), // OLAP table + SERVER_INFO_TABLE(7, "SERVER"); // Server Information Table private static final Map ALL_NAME = new HashMap<>(); diff --git a/hugegraph-server/hugegraph-hstore/src/main/java/org/apache/hugegraph/backend/store/hstore/HstoreStore.java b/hugegraph-server/hugegraph-hstore/src/main/java/org/apache/hugegraph/backend/store/hstore/HstoreStore.java index 603ef3a936..954fe35076 100644 --- a/hugegraph-server/hugegraph-hstore/src/main/java/org/apache/hugegraph/backend/store/hstore/HstoreStore.java +++ b/hugegraph-server/hugegraph-hstore/src/main/java/org/apache/hugegraph/backend/store/hstore/HstoreStore.java @@ -396,8 +396,8 @@ public Iterator query(Query query) { // for (ConditionQuery conditionQuery : // ConditionQueryFlatten.flatten(cq)) { // Id label = conditionQuery.condition(HugeKeys.LABEL); - // /* 父类型 + sortKeys: g.V("V.id").outE("parentLabel").has - // ("sortKey","value")转成 所有子类型 + sortKeys*/ + // /* Parent type + sortKeys: g.V("V.id").outE("parentLabel").has + // ("sortKey","value") converted to all subtypes + sortKeys */ // if ((this.subEls == null || // !this.subEls.hasNext()) && label != null && // hugeGraph.edgeLabel(label).isFather() && @@ -563,7 +563,7 @@ private Iterator getBackendEntryIterator( if (this.isGraphStore && !olapPks.isEmpty()) { List> iterators = new ArrayList<>(); for (Id pk : olapPks) { - // 构造olap表查询query condition + // Construct OLAP table query query condition Query q = this.constructOlapQueryCondition(pk, query); table = this.table(HugeType.OLAP); iterators.add(table.queryOlap(this.session(HugeType.OLAP), q)); @@ -575,10 +575,10 @@ private Iterator getBackendEntryIterator( } /** - * 重新构造 查询olap表 query - * 由于 olap合并成一张表, 在写入olap数据, key在后面增加了pk - * 所以在此进行查询的时候,需要重新构造pk前缀 - * 写入参考 BinarySerializer.writeOlapVertex + * Reconstruct the query OLAP table query + * Due to the olap merged into one table, when writing olap data, the key has a pk added at the end. + * So when making inquiries here, it is necessary to reconstruct the pk prefix. + * Write reference BinarySerializer.writeOlapVertex * * @param pk * @param query diff --git a/hugegraph-server/hugegraph-hstore/src/main/java/org/apache/hugegraph/backend/store/hstore/HstoreTable.java b/hugegraph-server/hugegraph-hstore/src/main/java/org/apache/hugegraph/backend/store/hstore/HstoreTable.java index 894964aa46..e1830111c3 100755 --- a/hugegraph-server/hugegraph-hstore/src/main/java/org/apache/hugegraph/backend/store/hstore/HstoreTable.java +++ b/hugegraph-server/hugegraph-hstore/src/main/java/org/apache/hugegraph/backend/store/hstore/HstoreTable.java @@ -190,7 +190,7 @@ public byte[] getInsertEdgeOwner(BackendEntry entry) { } public byte[] getInsertOwner(BackendEntry entry) { - // 为适应 label 索引散列,不聚焦在一个分区 + // To adapt label index hashing, do not focus on a single partition if (entry.type().isLabelIndex() && (entry.columns().size() == 1)) { Iterator iterator = entry.columns().iterator(); while (iterator.hasNext()) { @@ -204,7 +204,7 @@ public byte[] getInsertOwner(BackendEntry entry) { } /** - * 返回 Id 所属的点 ID + * Return the owner ID of the Id * * @param id * @return @@ -221,7 +221,7 @@ protected byte[] getOwnerId(Id id) { } /** - * 返回 Id 所属的点 ID + * Return the owner ID of the Id * * @param id * @return @@ -425,7 +425,7 @@ protected BackendColumnIterator queryBy(Session session, Query query) { // Query by id if (query.conditions().isEmpty()) { assert !query.ids().isEmpty(); - // 单个 id 查询 走 get 接口查询 + // Single id query uses the get interface to query if (query.ids().size() == 1) { return this.getById(session, query.ids().iterator().next()); } @@ -503,7 +503,7 @@ protected BackendColumnIterator queryByPrefix(Session session, byte[] ownerKeyTo = this.ownerByQueryDelegate.apply(query.resultType(), query.prefix()); byte[] keyFrom = query.start().asBytes(); - // 前缀分页查询中,start 为最初的位置。因为在不同的分区 都是从 start 位置开始查询 + // In the prefix pagination query, start is the initial position. Because in different partitions, the query starts from the start position. if (query.paging()) { keyFrom = query.prefix().asBytes(); } diff --git a/hugegraph-server/hugegraph-hstore/src/main/java/org/apache/hugegraph/backend/store/hstore/HstoreTables.java b/hugegraph-server/hugegraph-hstore/src/main/java/org/apache/hugegraph/backend/store/hstore/HstoreTables.java index 7042046707..fe8c324f19 100644 --- a/hugegraph-server/hugegraph-hstore/src/main/java/org/apache/hugegraph/backend/store/hstore/HstoreTables.java +++ b/hugegraph-server/hugegraph-hstore/src/main/java/org/apache/hugegraph/backend/store/hstore/HstoreTables.java @@ -49,7 +49,7 @@ protected BackendColumnIterator queryById(Session session, Id id) { } /** - * task信息存储表 + * task information storage table */ public static class TaskInfo extends HstoreTable { @@ -131,7 +131,7 @@ public void delete(Session session, BackendEntry entry) { } /** - * 主要用于 range类型的index处理 + * Mainly used for range-type index processing * * @param session * @param query @@ -199,7 +199,7 @@ public static class OlapTable extends HstoreTable { public static final String TABLE = HugeTableType.OLAP_TABLE.string(); public OlapTable(String database) { - // 由原先多个ap_{pk_id} 合并成一个ap表 + // Originally multiple ap_{pk_id} merged into one ap table super(database, TABLE); } diff --git a/hugegraph-server/hugegraph-test/src/main/java/org/apache/hugegraph/core/EdgeCoreTest.java b/hugegraph-server/hugegraph-test/src/main/java/org/apache/hugegraph/core/EdgeCoreTest.java index c7353e4a7c..b79cae1963 100644 --- a/hugegraph-server/hugegraph-test/src/main/java/org/apache/hugegraph/core/EdgeCoreTest.java +++ b/hugegraph-server/hugegraph-test/src/main/java/org/apache/hugegraph/core/EdgeCoreTest.java @@ -5221,7 +5221,7 @@ public void testScanEdgeInPaging() { query.scan(String.valueOf(Long.MIN_VALUE), String.valueOf(Long.MAX_VALUE)); } else { - // QUESTION:The query method may not be well adapted + // QUESTION: The query method may not be well adapted query.scan(BackendTable.ShardSplitter.START, BackendTable.ShardSplitter.END); }