From d8d8fe2fa12cb16f035cc2b87e955d6047adf014 Mon Sep 17 00:00:00 2001 From: Linary Date: Fri, 19 Apr 2019 18:37:05 +0800 Subject: [PATCH] Improve some comments (#472) Change-Id: I237f3e4175eec538aff01c521ec6e93cc8c2fc87 --- .../hugegraph/backend/store/cassandra/CassandraShard.java | 4 ++-- .../src/main/java/com/baidu/hugegraph/HugeGraph.java | 6 +----- .../java/com/baidu/hugegraph/backend/page/IdHolder.java | 3 +++ .../baidu/hugegraph/backend/tx/GraphIndexTransaction.java | 3 +++ .../java/com/baidu/hugegraph/job/schema/SchemaCallable.java | 4 ++++ .../main/java/com/baidu/hugegraph/schema/PropertyKey.java | 1 + .../java/com/baidu/hugegraph/example/PerfExampleBase.java | 4 ++-- 7 files changed, 16 insertions(+), 9 deletions(-) diff --git a/hugegraph-cassandra/src/main/java/com/baidu/hugegraph/backend/store/cassandra/CassandraShard.java b/hugegraph-cassandra/src/main/java/com/baidu/hugegraph/backend/store/cassandra/CassandraShard.java index 6cba6da9ba..4e3387b995 100644 --- a/hugegraph-cassandra/src/main/java/com/baidu/hugegraph/backend/store/cassandra/CassandraShard.java +++ b/hugegraph-cassandra/src/main/java/com/baidu/hugegraph/backend/store/cassandra/CassandraShard.java @@ -129,13 +129,13 @@ public List getSplits(long splitPartitions, long splitSize) { /** * Get splits of a table in specified range * NOTE: maybe we don't need this method - * @param start, end: the specified range + * @param start: the start of range + * @param end: the end of range * @param splitPartitions: expected partitions count per split * @param splitSize: expected size(bytes) per split, * splitPartitions will be ignored if splitSize is passed * @return a list of Shard */ - public List getSplits(String start, String end, int splitPartitions, int splitSize) { diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/HugeGraph.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/HugeGraph.java index c7c43edf21..7e096e68db 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/HugeGraph.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/HugeGraph.java @@ -186,9 +186,6 @@ public EventHub indexEventHub() { return this.indexEventHub; } - /** - * @SuppressWarnings("UnstableApiUsage") - */ public RateLimiter rateLimiter() { return this.rateLimiter; } @@ -574,8 +571,7 @@ public Id[] mapVlName2Id(String[] vertexLabels) { /** * Stop all the daemon threads - * @param timout seconds - * @throws InterruptedException when be interrupted + * @param timeout seconds */ public static void shutdown(long timeout) { try { diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/page/IdHolder.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/page/IdHolder.java index 41bcebabda..9a065cd846 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/page/IdHolder.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/page/IdHolder.java @@ -38,6 +38,7 @@ public final class IdHolder { /** * For non-paging situation + * @param ids all ids */ public IdHolder(Set ids) { this.query = null; @@ -52,6 +53,8 @@ public IdHolder(Set ids) { /** * For paging situation + * @param query original query + * @param idsFetcher function to fetch one page ids */ public IdHolder(ConditionQuery query, Function idsFetcher) { diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/tx/GraphIndexTransaction.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/tx/GraphIndexTransaction.java index ec491d1ede..e30f9e251a 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/tx/GraphIndexTransaction.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/tx/GraphIndexTransaction.java @@ -141,6 +141,9 @@ public void updateEdgeIndex(HugeEdge edge, boolean removed) { /** * Update index(user properties) of vertex or edge + * @param ilId the id of index label + * @param element the properties owner + * @param removed remove or add index */ protected void updateIndex(Id ilId, HugeElement element, boolean removed) { SchemaTransaction schema = graph().schemaTransaction(); diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/job/schema/SchemaCallable.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/job/schema/SchemaCallable.java index 03f7ec624c..fc98586804 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/job/schema/SchemaCallable.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/job/schema/SchemaCallable.java @@ -66,6 +66,8 @@ protected static void removeIndexLabelFromBaseLabel(SchemaTransaction tx, /** * Use reflection to call SchemaTransaction.removeSchema(), * which is protected + * @param tx The remove operation actual executer + * @param schema the schema to be removed */ protected static void removeSchema(SchemaTransaction tx, SchemaElement schema) { @@ -86,6 +88,8 @@ protected static void removeSchema(SchemaTransaction tx, /** * Use reflection to call SchemaTransaction.updateSchema(), * which is protected + * @param tx The update operation actual executer + * @param schema the schema to be update */ protected static void updateSchema(SchemaTransaction tx, SchemaElement schema) { diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/schema/PropertyKey.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/schema/PropertyKey.java index 832c36dac9..e0cbc41f65 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/schema/PropertyKey.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/schema/PropertyKey.java @@ -108,6 +108,7 @@ public Class clazz() { /** * Check type of the value valid * @param value the property value to be checked data type + * @param the property value original data type * @return true if the value is or can convert to the data type, * otherwise false */ diff --git a/hugegraph-example/src/main/java/com/baidu/hugegraph/example/PerfExampleBase.java b/hugegraph-example/src/main/java/com/baidu/hugegraph/example/PerfExampleBase.java index 76a0ad8fff..4c8f82eb7a 100644 --- a/hugegraph-example/src/main/java/com/baidu/hugegraph/example/PerfExampleBase.java +++ b/hugegraph-example/src/main/java/com/baidu/hugegraph/example/PerfExampleBase.java @@ -89,7 +89,7 @@ public int test(String[] args) throws Exception { /** * Multi-threaded and multi-commits and batch insertion test - * @param graph + * @param graph graph * @param threadCount * The count of threads that perform the insert operation at the * same time @@ -98,7 +98,7 @@ public int test(String[] args) throws Exception { * @param multiple * The coefficient to multiple number of vertices(100) and edges(100) * for each transaction commit - * @throws InterruptedException + * @throws Exception execute may throw Exception */ public void testInsertPerf(GraphManager graph, int threadCount,