mirror of https://github.com/apache/druid.git
Improved conciseness
This commit is contained in:
parent
10b5e0ca93
commit
8212a21caf
|
@ -200,7 +200,7 @@ public class ScanQueryQueryToolChest extends QueryToolChest<ScanResultValue, Sca
|
|||
|
||||
public ScanBatchedTimeOrderedQueueIterator(Iterator<ScanResultValue> iterator, int batchSize)
|
||||
{
|
||||
itr = iterator;
|
||||
this.itr = iterator;
|
||||
this.batchSize = batchSize;
|
||||
}
|
||||
|
||||
|
|
|
@ -75,5 +75,4 @@ public class ScanResultValueTimestampComparator implements Comparator<ScanResult
|
|||
ScanResultValueTimestampComparator comp = (ScanResultValueTimestampComparator) obj;
|
||||
return this.scanQuery.equals(comp.scanQuery);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ public class ScanQueryQueryToolChestTest
|
|||
private static ScanQueryQueryToolChest chest;
|
||||
private static ScanQueryConfig config;
|
||||
private static int numElements;
|
||||
private static QuerySegmentSpec emptySegmentSpec;
|
||||
|
||||
@Before
|
||||
public void setup()
|
||||
|
@ -55,6 +56,23 @@ public class ScanQueryQueryToolChestTest
|
|||
replay(config);
|
||||
chest = new ScanQueryQueryToolChest(config, null);
|
||||
numElements = 1000;
|
||||
emptySegmentSpec = new QuerySegmentSpec()
|
||||
{
|
||||
@Override
|
||||
public List<Interval> getIntervals()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> QueryRunner<T> lookup(
|
||||
Query<T> query,
|
||||
QuerySegmentWalker walker
|
||||
)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -76,23 +94,7 @@ public class ScanQueryQueryToolChestTest
|
|||
.resultFormat("list")
|
||||
.timeOrder(ScanQuery.TIME_ORDER_DESCENDING)
|
||||
.dataSource("some data source")
|
||||
.intervals(new QuerySegmentSpec()
|
||||
{
|
||||
@Override
|
||||
public List<Interval> getIntervals()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> QueryRunner<T> lookup(
|
||||
Query<T> query,
|
||||
QuerySegmentWalker walker
|
||||
)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.intervals(emptySegmentSpec)
|
||||
.limit(99999)
|
||||
.build();
|
||||
Iterator<ScanResultValue> sorted = chest.heapsortScanResultValues(inputs.iterator(), scanQuery);
|
||||
|
@ -129,23 +131,7 @@ public class ScanQueryQueryToolChestTest
|
|||
.resultFormat("list")
|
||||
.timeOrder(ScanQuery.TIME_ORDER_ASCENDING)
|
||||
.dataSource("some data source")
|
||||
.intervals(new QuerySegmentSpec()
|
||||
{
|
||||
@Override
|
||||
public List<Interval> getIntervals()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> QueryRunner<T> lookup(
|
||||
Query<T> query,
|
||||
QuerySegmentWalker walker
|
||||
)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.intervals(emptySegmentSpec)
|
||||
.limit(99999)
|
||||
.build();
|
||||
Iterator<ScanResultValue> sorted = chest.heapsortScanResultValues(inputs.iterator(), scanQuery);
|
||||
|
@ -180,23 +166,7 @@ public class ScanQueryQueryToolChestTest
|
|||
.resultFormat(ScanQuery.RESULT_FORMAT_COMPACTED_LIST)
|
||||
.timeOrder(ScanQuery.TIME_ORDER_DESCENDING)
|
||||
.dataSource("some data source")
|
||||
.intervals(new QuerySegmentSpec()
|
||||
{
|
||||
@Override
|
||||
public List<Interval> getIntervals()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> QueryRunner<T> lookup(
|
||||
Query<T> query,
|
||||
QuerySegmentWalker walker
|
||||
)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.intervals(emptySegmentSpec)
|
||||
.limit(99999)
|
||||
.build();
|
||||
Iterator<ScanResultValue> sorted = chest.heapsortScanResultValues(inputs.iterator(), scanQuery);
|
||||
|
@ -231,23 +201,7 @@ public class ScanQueryQueryToolChestTest
|
|||
.resultFormat(ScanQuery.RESULT_FORMAT_COMPACTED_LIST)
|
||||
.timeOrder(ScanQuery.TIME_ORDER_ASCENDING)
|
||||
.dataSource("some data source")
|
||||
.intervals(new QuerySegmentSpec()
|
||||
{
|
||||
@Override
|
||||
public List<Interval> getIntervals()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> QueryRunner<T> lookup(
|
||||
Query<T> query,
|
||||
QuerySegmentWalker walker
|
||||
)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.intervals(emptySegmentSpec)
|
||||
.limit(99999)
|
||||
.build();
|
||||
Iterator<ScanResultValue> sorted = chest.heapsortScanResultValues(inputs.iterator(), scanQuery);
|
||||
|
@ -264,5 +218,4 @@ public class ScanQueryQueryToolChestTest
|
|||
}
|
||||
Assert.assertEquals(numElements, count);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -66,7 +66,6 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@RunWith(Parameterized.class)
|
||||
public class ScanQueryRunnerTest
|
||||
|
|
|
@ -48,7 +48,6 @@ public class ScanResultValueTimestampComparatorTest
|
|||
);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void comparisonDescendingListTest()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue