Renamed sort function

This commit is contained in:
Justin Borromeo 2019-02-08 13:13:54 -08:00
parent 2e3577cd3d
commit 134041c479
2 changed files with 6 additions and 7 deletions

View File

@ -106,7 +106,7 @@ public class ScanQueryQueryToolChest extends QueryToolChest<ScanResultValue, Sca
public ScanBatchedTimeOrderedQueueIterator make()
{
return new ScanBatchedTimeOrderedQueueIterator(
heapsortScanResultValues(scanResultIterator, scanQuery),
sortScanResultValues(scanResultIterator, scanQuery),
scanQuery.getBatchSize()
);
}
@ -170,7 +170,7 @@ public class ScanQueryQueryToolChest extends QueryToolChest<ScanResultValue, Sca
}
@VisibleForTesting
Iterator<ScanResultValue> heapsortScanResultValues(Iterator<ScanResultValue> inputIterator, ScanQuery scanQuery)
Iterator<ScanResultValue> sortScanResultValues(Iterator<ScanResultValue> inputIterator, ScanQuery scanQuery)
{
Comparator<ScanResultValue> priorityQComparator = new ScanResultValueTimestampComparator(scanQuery);
@ -180,7 +180,6 @@ public class ScanQueryQueryToolChest extends QueryToolChest<ScanResultValue, Sca
PriorityQueue<ScanResultValue> q = new PriorityQueue<>(Math.toIntExact(scanQuery.getLimit()), priorityQComparator);
while (inputIterator.hasNext()) {
ScanResultValue next = inputIterator.next();
List<Object> events = (List<Object>) next.getEvents();
for (Object event : events) {

View File

@ -97,7 +97,7 @@ public class ScanQueryQueryToolChestTest
.intervals(emptySegmentSpec)
.limit(99999)
.build();
Iterator<ScanResultValue> sorted = chest.heapsortScanResultValues(inputs.iterator(), scanQuery);
Iterator<ScanResultValue> sorted = chest.sortScanResultValues(inputs.iterator(), scanQuery);
int count = 0;
Long previousTime = Long.MAX_VALUE;
@ -134,7 +134,7 @@ public class ScanQueryQueryToolChestTest
.intervals(emptySegmentSpec)
.limit(99999)
.build();
Iterator<ScanResultValue> sorted = chest.heapsortScanResultValues(inputs.iterator(), scanQuery);
Iterator<ScanResultValue> sorted = chest.sortScanResultValues(inputs.iterator(), scanQuery);
int count = 0;
Long previousTime = -1L;
@ -169,7 +169,7 @@ public class ScanQueryQueryToolChestTest
.intervals(emptySegmentSpec)
.limit(99999)
.build();
Iterator<ScanResultValue> sorted = chest.heapsortScanResultValues(inputs.iterator(), scanQuery);
Iterator<ScanResultValue> sorted = chest.sortScanResultValues(inputs.iterator(), scanQuery);
Long previousTime = Long.MAX_VALUE;
int count = 0;
@ -204,7 +204,7 @@ public class ScanQueryQueryToolChestTest
.intervals(emptySegmentSpec)
.limit(99999)
.build();
Iterator<ScanResultValue> sorted = chest.heapsortScanResultValues(inputs.iterator(), scanQuery);
Iterator<ScanResultValue> sorted = chest.sortScanResultValues(inputs.iterator(), scanQuery);
Long previousTime = -1L;
int count = 0;