This is an automated email from the ASF dual-hosted git repository.
jiangtian pushed a commit to branch cluster_new
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
The following commit(s) were added to refs/heads/cluster_new by this push:
new 1f9760c code refine
new ac5b58a Merge pull request #1608 from
neuyilan/apache_cluster_new_0810_code_refine
1f9760c is described below
commit 1f9760c29fdbb8a04492675ca3e4a96f55d6c65f
Author: HouliangQi <[email protected]>
AuthorDate: Mon Aug 10 16:08:08 2020 +0800
code refine
---
.../src/main/java/org/apache/iotdb/cluster/server/NodeReport.java | 2 +-
.../src/main/java/org/apache/iotdb/cluster/utils/PartitionUtils.java | 5 ++---
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git
a/cluster/src/main/java/org/apache/iotdb/cluster/server/NodeReport.java
b/cluster/src/main/java/org/apache/iotdb/cluster/server/NodeReport.java
index 3c5d4da..1cc6c6d 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/server/NodeReport.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/server/NodeReport.java
@@ -148,7 +148,7 @@ public class NodeReport {
", commitIndex=" + commitIndex +
", commitTerm=" + commitTerm +
", readOnly=" + isReadOnly +
- ", headerLatency=" + headerLatency +
+ ", headerLatency=" + headerLatency + "ns" +
", lastHeartbeat=" + (System.currentTimeMillis() -
lastHeartbeatReceivedTime) + "ms ago" +
'}';
}
diff --git
a/cluster/src/main/java/org/apache/iotdb/cluster/utils/PartitionUtils.java
b/cluster/src/main/java/org/apache/iotdb/cluster/utils/PartitionUtils.java
index 58c9fe6..c30d735 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/utils/PartitionUtils.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/utils/PartitionUtils.java
@@ -111,9 +111,8 @@ public class PartitionUtils {
public static int calculateStorageGroupSlotByTime(String storageGroupName,
long timestamp,
int slotNum) {
- long partitionInstance = StorageEngine.getTimePartition(timestamp);
- int hash = Murmur128Hash.hash(storageGroupName, partitionInstance,
HASH_SALT);
- return Math.abs(hash % slotNum);
+ long partitionNum = StorageEngine.getTimePartition(timestamp);
+ return calculateStorageGroupSlotByPartition(storageGroupName,
partitionNum, slotNum);
}
public static int calculateStorageGroupSlotByPartition(String
storageGroupName, long partitionNum,