Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(hstore): translate CJK comments to English #2616

Merged
merged 8 commits into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public EdgesQueryIterator(Iterator<Id> 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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ public BinaryId parseId(HugeType type, boolean enablePartition) {
}

/**
* 解析 olap id
* Analyze olap id
* @param type
* @param isOlap
* @return
Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ private static void setCreateTimeIfNeeded(SchemaElement schema) {
}

/**
* 异步任务系列
* Asynchronous Task Series
*/
private static Id asyncRun(HugeGraph graph, SchemaElement schema,
SchemaJob job) {
Expand Down Expand Up @@ -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())) {
Expand Down Expand Up @@ -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,
Expand All @@ -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:
Expand Down Expand Up @@ -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 ||
Expand Down Expand Up @@ -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);
}
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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());
Expand All @@ -749,7 +749,7 @@ public Id rebuildIndex(SchemaElement schema, Set<Id> dependencies) {
}

/**
* 清除所有的schema信息
* Clear all schema information
*/
public void clear() {
this.schemaMetaManager.clearAllSchema(this.graphSpace, graph);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,8 @@ public static synchronized CoreOptions instance() {

/**
* The schema name rule:
* 1Not allowed end with spaces
* 2Not allowed start with '~'
* 1. Not allowed end with spaces
* 2. Not allowed start with '~'
*/
public static final ConfigOption<String> SCHEMA_ILLEGAL_NAME_REGEX =
new ConfigOption<>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 deserializerit is
* Graphson, and seems need to implement edge deserializer, it is
* a little complicated.
*/
module.addSerializer(HugeVertex.class, new HugeVertexSerializer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ public <T> void listenGraphCacheClear(Consumer<T> consumer) {
}

/**
* 监听vertex label变化, graph vertex cache clear
* Listen for vertex label changes, graph vertex cache clear
*
* @param consumer
* @param <T>
Expand All @@ -260,7 +260,7 @@ public <T> void listenGraphVertexCacheClear(Consumer<T> consumer) {
}

/**
* 监听edge label变化, graph edge cache clear
* Listen to edge label changes, graph edge cache clear
*
* @param consumer
* @param <T>
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void notifyGraphCacheClear(String graphSpace, String graph) {
}

/**
* 通知 点信息 cache clear
* Notice point information cache clear
*
* @param graphSpace
* @param graph
Expand All @@ -112,7 +112,7 @@ public void notifyGraphVertexCacheClear(String graphSpace, String graph) {
}

/**
* 通知 边信息 cache clear
* Notice Edge Information cache clear
*
* @param graphSpace
* @param graph
Expand Down Expand Up @@ -249,7 +249,7 @@ private String graphCacheClearKey() {
}

/**
* pd监听 vertex label更新的key
* pd listen to vertex label updated key
*
* @return
*/
Expand All @@ -266,7 +266,7 @@ private String graphVertexCacheClearKey() {
}

/**
* pd监听 edge label更新的key
* pd listen edge label updated key
*
* @return
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Loading
Loading