You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ji...@apache.org on 2020/01/15 11:23:56 UTC
[incubator-iotdb] branch master updated: [IOTDB-423] Using Raw type
rather than generic feature in PrimitiveArrayPool (#745)
This is an automated email from the ASF dual-hosted git repository.
jiangtian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 3033b52 [IOTDB-423] Using Raw type rather than generic feature in PrimitiveArrayPool (#745)
3033b52 is described below
commit 3033b5226db085f2c1b83ba07be6dfbc46c2b9f5
Author: SilverNarcissus <15...@smail.nju.edu.cn>
AuthorDate: Wed Jan 15 05:23:49 2020 -0600
[IOTDB-423] Using Raw type rather than generic feature in PrimitiveArrayPool (#745)
* Using Raw type rather than generic feature in PrimitiveArrayPool
---
.../org/apache/iotdb/db/rescon/PrimitiveArrayPool.java | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/server/src/main/java/org/apache/iotdb/db/rescon/PrimitiveArrayPool.java b/server/src/main/java/org/apache/iotdb/db/rescon/PrimitiveArrayPool.java
index a5de880..d010ed6 100644
--- a/server/src/main/java/org/apache/iotdb/db/rescon/PrimitiveArrayPool.java
+++ b/server/src/main/java/org/apache/iotdb/db/rescon/PrimitiveArrayPool.java
@@ -32,17 +32,17 @@ public class PrimitiveArrayPool {
/**
* data type -> Array<PrimitiveArray>
*/
- private static final EnumMap<TSDataType, ArrayDeque> primitiveArraysMap = new EnumMap<>(TSDataType.class);
+ private static final EnumMap<TSDataType, ArrayDeque<Object>> primitiveArraysMap = new EnumMap<>(TSDataType.class);
public static final int ARRAY_SIZE = 128;
static {
- primitiveArraysMap.put(TSDataType.BOOLEAN, new ArrayDeque());
- primitiveArraysMap.put(TSDataType.INT32, new ArrayDeque());
- primitiveArraysMap.put(TSDataType.INT64, new ArrayDeque());
- primitiveArraysMap.put(TSDataType.FLOAT, new ArrayDeque());
- primitiveArraysMap.put(TSDataType.DOUBLE, new ArrayDeque());
- primitiveArraysMap.put(TSDataType.TEXT, new ArrayDeque());
+ primitiveArraysMap.put(TSDataType.BOOLEAN, new ArrayDeque<>());
+ primitiveArraysMap.put(TSDataType.INT32, new ArrayDeque<>());
+ primitiveArraysMap.put(TSDataType.INT64, new ArrayDeque<>());
+ primitiveArraysMap.put(TSDataType.FLOAT, new ArrayDeque<>());
+ primitiveArraysMap.put(TSDataType.DOUBLE, new ArrayDeque<>());
+ primitiveArraysMap.put(TSDataType.TEXT, new ArrayDeque<>());
}
public static PrimitiveArrayPool getInstance() {
@@ -55,7 +55,7 @@ public class PrimitiveArrayPool {
private PrimitiveArrayPool() {}
public synchronized Object getPrimitiveDataListByType(TSDataType dataType) {
- ArrayDeque dataListQueue = primitiveArraysMap.computeIfAbsent(dataType, k ->new ArrayDeque<>());
+ ArrayDeque<Object> dataListQueue = primitiveArraysMap.computeIfAbsent(dataType, k ->new ArrayDeque<>());
Object dataArray = dataListQueue.poll();
switch (dataType) {
case BOOLEAN: