shizy818 commented on code in PR #14265:
URL: https://github.com/apache/iotdb/pull/14265#discussion_r1867715387
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/datastructure/TVList.java:
##########
@@ -136,6 +186,105 @@ public long getTime(int index) {
return timestamps.get(arrayIndex)[elementIndex];
}
+ protected void set(int index, long timestamp, int value) {
+ if (index >= rowCount) {
+ throw new ArrayIndexOutOfBoundsException(index);
+ }
+ int arrayIndex = index / ARRAY_SIZE;
+ int elementIndex = index % ARRAY_SIZE;
+ timestamps.get(arrayIndex)[elementIndex] = timestamp;
+ indices.get(arrayIndex)[elementIndex] = value;
+ }
+
+ @SuppressWarnings("squid:S3776") // Suppress high Cognitive Complexity
warning
+ protected int[] cloneIndex(int[] array) {
+ int[] cloneArray = new int[array.length];
+ System.arraycopy(array, 0, cloneArray, 0, array.length);
+ return cloneArray;
+ }
+
+ /**
+ * Get the row index value in index column.
+ *
+ * @param index row index
+ */
+ public int getValueIndex(int index) {
+ if (index >= rowCount) {
+ throw new ArrayIndexOutOfBoundsException(index);
+ }
+ int arrayIndex = index / ARRAY_SIZE;
+ int elementIndex = index % ARRAY_SIZE;
+ return indices.get(arrayIndex)[elementIndex];
+ }
+
+ protected void markNullValue(int arrayIndex, int elementIndex) {
+ // init bitMap if doesn't have
+ if (bitMap == null) {
+ bitMap = new CopyOnWriteArrayList<>();
+ for (int i = 0; i < timestamps.size(); i++) {
+ bitMap.add(new BitMap(ARRAY_SIZE));
+ }
+ }
Review Comment:
```
protected List<BitMap> bitMap; <- Do you mean we should define BitMap
instead of List<BitMap>?
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]