You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by li...@apache.org on 2019/06/14 13:10:20 UTC
[incubator-iotdb] branch add_log_for_memTableWrite updated: try
double
This is an automated email from the ASF dual-hosted git repository.
liurui pushed a commit to branch add_log_for_memTableWrite
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
The following commit(s) were added to refs/heads/add_log_for_memTableWrite by this push:
new d201637 try double
d201637 is described below
commit d201637523bbfb55a245cb63ac877036d8965c59
Author: liuruiyiyang <24...@qq.com>
AuthorDate: Fri Jun 14 21:10:05 2019 +0800
try double
---
.../src/main/java/org/apache/iotdb/db/utils/PrimitiveArrayList.java | 2 +-
.../test/java/org/apache/iotdb/db/utils/PrimitiveArrayListTest.java | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/utils/PrimitiveArrayList.java b/iotdb/src/main/java/org/apache/iotdb/db/utils/PrimitiveArrayList.java
index f884d77..7fbfa2e 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/utils/PrimitiveArrayList.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/utils/PrimitiveArrayList.java
@@ -97,7 +97,7 @@ public class PrimitiveArrayList {
MemTableWriteTimeCost.getInstance().measure(MemTableWriteTimeCostType.PUT_TIMESTAMP_2, start);
start = System.currentTimeMillis();
//Array.set(values.get(currentIndex), currentArrayIndex, value);
- ((Object[])values.get(currentIndex))[currentArrayIndex] = value;
+ ((double[])values.get(currentIndex))[currentArrayIndex] = (double) value;
length++;
MemTableWriteTimeCost.getInstance().measure(MemTableWriteTimeCostType.PUT_TIMESTAMP_3, start);
}
diff --git a/iotdb/src/test/java/org/apache/iotdb/db/utils/PrimitiveArrayListTest.java b/iotdb/src/test/java/org/apache/iotdb/db/utils/PrimitiveArrayListTest.java
index 44c4751..9dbb766 100644
--- a/iotdb/src/test/java/org/apache/iotdb/db/utils/PrimitiveArrayListTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/utils/PrimitiveArrayListTest.java
@@ -18,6 +18,7 @@
*/
package org.apache.iotdb.db.utils;
+import org.apache.iotdb.db.monitor.collector.MemTableWriteTimeCost;
import org.junit.Assert;
import org.junit.Test;
@@ -35,9 +36,10 @@ public class PrimitiveArrayListTest {
@Test
public void test1() {
-
+ MemTableWriteTimeCost.getInstance().init();
long timestamp = System.currentTimeMillis();
- int count = 10000;
+ int count = 3200;
+
PrimitiveArrayList primitiveArrayList = new PrimitiveArrayList(int.class);
for (int i = 0; i < count; i++) {
primitiveArrayList.putTimestamp(i, i);