Skip to content

Commit

Permalink
Change partition to Long
Browse files Browse the repository at this point in the history
  • Loading branch information
samperson1997 committed Feb 26, 2020
1 parent c4fc9c3 commit afc2d78
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Expand Up @@ -34,7 +34,7 @@ public class PriorityMergeReader implements IPointReader {
// largest end time of all added readers
private long currentLargestEndTime;

private final static IoTDBConfig config = IoTDBDescriptor.getInstance().getConfig();
private static final IoTDBConfig config = IoTDBDescriptor.getInstance().getConfig();

PriorityQueue<Element> heap = new PriorityQueue<>((o1, o2) -> {
int timeCompare = Long.compare(o1.timeValuePair.getTimestamp(),
Expand Down Expand Up @@ -75,7 +75,7 @@ public void addReader(IPointReader reader, long priority, long endTime) throws I
}
if (reader.hasNextTimeValuePair()) {
heap.add(new Element(reader, reader.nextTimeValuePair(), priority));
int partition = Math.round(reader.currentTimeValuePair().getTimestamp() / partitionInterval);
long partition = reader.currentTimeValuePair().getTimestamp() / partitionInterval;
// set end time before current partition ends
currentLargestEndTime = Math.min((partition + 1) * partitionInterval - 1,
Math.max(currentLargestEndTime, endTime));
Expand Down
Expand Up @@ -81,7 +81,7 @@ public static void setUp() throws Exception {
IoTDBDescriptor.getInstance().getConfig().setMemtableSizeThreshold(1024 * 16);

// test result of IBatchReader should not cross partition
IoTDBDescriptor.getInstance().getConfig().setPartitionInterval(6);
IoTDBDescriptor.getInstance().getConfig().setPartitionInterval(2);

EnvironmentUtils.envSetUp();

Expand Down

0 comments on commit afc2d78

Please sign in to comment.