Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@

package org.apache.iotdb.db.query.dataset;

import java.io.IOException;
import java.util.HashSet;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Set;
import org.apache.iotdb.db.query.reader.IPointReader;
import org.apache.iotdb.db.utils.TimeValuePair;
import org.apache.iotdb.db.utils.TsPrimitiveType;
Expand All @@ -34,6 +29,10 @@
import org.apache.iotdb.tsfile.read.common.RowRecord;
import org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet;

import java.io.IOException;
import java.util.List;
import java.util.TreeSet;

/**
* TODO implement this class as TsFile DataSetWithoutTimeGenerator.
*/
Expand All @@ -43,9 +42,7 @@ public class EngineDataSetWithoutValueFilter extends QueryDataSet {

private TimeValuePair[] cacheTimeValueList;

private PriorityQueue<Long> timeHeap;

private Set<Long> timeSet;
private TreeSet<Long> timeHeap;

/**
* constructor of EngineDataSetWithoutValueFilter.
Expand All @@ -64,8 +61,7 @@ public EngineDataSetWithoutValueFilter(List<Path> paths, List<TSDataType> dataTy
}

private void initHeap() throws IOException {
timeSet = new HashSet<>();
timeHeap = new PriorityQueue<>();
timeHeap = new TreeSet<>();
cacheTimeValueList = new TimeValuePair[seriesReaderWithoutValueFilterList.size()];

for (int i = 0; i < seriesReaderWithoutValueFilterList.size(); i++) {
Expand Down Expand Up @@ -143,16 +139,11 @@ private Field getField(TsPrimitiveType tsPrimitiveType, TSDataType dataType) {
* keep heap from storing duplicate time.
*/
private void timeHeapPut(long time) {
if (!timeSet.contains(time)) {
timeSet.add(time);
timeHeap.add(time);
}
timeHeap.add(time);
}

private Long timeHeapGet() {
Long t = timeHeap.poll();
timeSet.remove(t);
return t;
return timeHeap.pollFirst();
}

public List<IPointReader> getReaders() {
Expand Down