mirror of https://github.com/apache/druid.git
Inspection fixes (#4809)
This commit is contained in:
parent
0fe734805b
commit
3f92184dd8
|
@ -101,7 +101,7 @@ public class TimestampAggregationSelectTest
|
||||||
temporaryFolder
|
temporaryFolder
|
||||||
);
|
);
|
||||||
|
|
||||||
selector = new TestObjectColumnSelector(values);
|
selector = new TestObjectColumnSelector<>(values);
|
||||||
selectorFactory = EasyMock.createMock(ColumnSelectorFactory.class);
|
selectorFactory = EasyMock.createMock(ColumnSelectorFactory.class);
|
||||||
EasyMock.expect(selectorFactory.makeObjectColumnSelector("test")).andReturn(selector);
|
EasyMock.expect(selectorFactory.makeObjectColumnSelector("test")).andReturn(selector);
|
||||||
EasyMock.replay(selectorFactory);
|
EasyMock.replay(selectorFactory);
|
||||||
|
@ -144,7 +144,7 @@ public class TimestampAggregationSelectTest
|
||||||
" }\n" +
|
" }\n" +
|
||||||
"]";
|
"]";
|
||||||
ZipFile zip = new ZipFile(new File(this.getClass().getClassLoader().getResource("druid.sample.tsv.zip").toURI()));
|
ZipFile zip = new ZipFile(new File(this.getClass().getClassLoader().getResource("druid.sample.tsv.zip").toURI()));
|
||||||
Sequence seq = helper.createIndexAndRunQueryOnSegment(
|
Sequence<?> seq = helper.createIndexAndRunQueryOnSegment(
|
||||||
zip.getInputStream(zip.getEntry("druid.sample.tsv")),
|
zip.getInputStream(zip.getEntry("druid.sample.tsv")),
|
||||||
recordParser,
|
recordParser,
|
||||||
aggregator,
|
aggregator,
|
||||||
|
|
|
@ -111,7 +111,7 @@ public class TimestampGroupByAggregationTest
|
||||||
temporaryFolder
|
temporaryFolder
|
||||||
);
|
);
|
||||||
|
|
||||||
selector = new TestObjectColumnSelector(values);
|
selector = new TestObjectColumnSelector<>(values);
|
||||||
selectorFactory = EasyMock.createMock(ColumnSelectorFactory.class);
|
selectorFactory = EasyMock.createMock(ColumnSelectorFactory.class);
|
||||||
EasyMock.expect(selectorFactory.makeObjectColumnSelector("test")).andReturn(selector);
|
EasyMock.expect(selectorFactory.makeObjectColumnSelector("test")).andReturn(selector);
|
||||||
EasyMock.replay(selectorFactory);
|
EasyMock.replay(selectorFactory);
|
||||||
|
|
|
@ -123,7 +123,7 @@ public class TimestampMinMaxAggregatorTest
|
||||||
String json = "{\"type\":\"" + aggType + "\",\"name\":\"" + aggType + "\",\"fieldName\":\"test\"}";
|
String json = "{\"type\":\"" + aggType + "\",\"name\":\"" + aggType + "\",\"fieldName\":\"test\"}";
|
||||||
|
|
||||||
aggregatorFactory = mapper.readValue(json, aggClass);
|
aggregatorFactory = mapper.readValue(json, aggClass);
|
||||||
selector = new TestObjectColumnSelector(values);
|
selector = new TestObjectColumnSelector<>(values);
|
||||||
selectorFactory = EasyMock.createMock(ColumnSelectorFactory.class);
|
selectorFactory = EasyMock.createMock(ColumnSelectorFactory.class);
|
||||||
EasyMock.expect(selectorFactory.makeObjectColumnSelector("test")).andReturn(selector);
|
EasyMock.expect(selectorFactory.makeObjectColumnSelector("test")).andReturn(selector);
|
||||||
EasyMock.replay(selectorFactory);
|
EasyMock.replay(selectorFactory);
|
||||||
|
|
|
@ -66,7 +66,8 @@ public class VarianceAggregatorTest
|
||||||
{
|
{
|
||||||
selector = new TestFloatColumnSelector(values);
|
selector = new TestFloatColumnSelector(values);
|
||||||
colSelectorFactory = EasyMock.createMock(ColumnSelectorFactory.class);
|
colSelectorFactory = EasyMock.createMock(ColumnSelectorFactory.class);
|
||||||
EasyMock.expect(colSelectorFactory.makeObjectColumnSelector("nilly")).andReturn(new TestObjectColumnSelector(0.0f));
|
EasyMock.expect(colSelectorFactory.makeObjectColumnSelector("nilly"))
|
||||||
|
.andReturn(new TestObjectColumnSelector<>(new Object[] {0.0f}));
|
||||||
EasyMock.expect(colSelectorFactory.makeFloatColumnSelector("nilly")).andReturn(selector);
|
EasyMock.expect(colSelectorFactory.makeFloatColumnSelector("nilly")).andReturn(selector);
|
||||||
EasyMock.replay(colSelectorFactory);
|
EasyMock.replay(colSelectorFactory);
|
||||||
}
|
}
|
||||||
|
|
|
@ -223,7 +223,7 @@ public class ScanQuery extends BaseQuery<ScanResultValue>
|
||||||
* .build();
|
* .build();
|
||||||
* </code></pre>
|
* </code></pre>
|
||||||
*
|
*
|
||||||
* @see io.druid.query.scan.ScanQuery
|
* @see ScanQuery
|
||||||
*/
|
*/
|
||||||
public static class ScanQueryBuilder
|
public static class ScanQueryBuilder
|
||||||
{
|
{
|
||||||
|
|
|
@ -54,9 +54,9 @@ public class Capabilities
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public io.druid.segment.Capabilities build()
|
public Capabilities build()
|
||||||
{
|
{
|
||||||
return new io.druid.segment.Capabilities(
|
return new Capabilities(
|
||||||
dimensionValuesSorted
|
dimensionValuesSorted
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -240,7 +240,9 @@ public class JavaScriptAggregatorTest
|
||||||
@Test
|
@Test
|
||||||
public void testAggregateStrings()
|
public void testAggregateStrings()
|
||||||
{
|
{
|
||||||
final TestObjectColumnSelector ocs = new TestObjectColumnSelector("what", null, new String[]{"hey", "there"});
|
final TestObjectColumnSelector ocs = new TestObjectColumnSelector<>(
|
||||||
|
new Object[]{"what", null, new String[]{"hey", "there"}}
|
||||||
|
);
|
||||||
final JavaScriptAggregator agg = new JavaScriptAggregator(
|
final JavaScriptAggregator agg = new JavaScriptAggregator(
|
||||||
Collections.<ObjectColumnSelector>singletonList(ocs),
|
Collections.<ObjectColumnSelector>singletonList(ocs),
|
||||||
JavaScriptAggregatorFactory.compileScript(
|
JavaScriptAggregatorFactory.compileScript(
|
||||||
|
|
|
@ -23,13 +23,13 @@ import io.druid.segment.ObjectColumnSelector;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
public class TestObjectColumnSelector implements ObjectColumnSelector
|
public class TestObjectColumnSelector<T> implements ObjectColumnSelector
|
||||||
{
|
{
|
||||||
private final Object[] objects;
|
private final Object[] objects;
|
||||||
|
|
||||||
private int index = 0;
|
private int index = 0;
|
||||||
|
|
||||||
public TestObjectColumnSelector(Object... objects)
|
public TestObjectColumnSelector(T[] objects)
|
||||||
{
|
{
|
||||||
this.objects = objects;
|
this.objects = objects;
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class DoubleFirstAggregationTest
|
||||||
combiningAggFactory = (DoubleFirstAggregatorFactory) doubleFirstAggFactory.getCombiningFactory();
|
combiningAggFactory = (DoubleFirstAggregatorFactory) doubleFirstAggFactory.getCombiningFactory();
|
||||||
timeSelector = new TestLongColumnSelector(times);
|
timeSelector = new TestLongColumnSelector(times);
|
||||||
valueSelector = new TestDoubleColumnSelectorImpl(doubleValues);
|
valueSelector = new TestDoubleColumnSelectorImpl(doubleValues);
|
||||||
objectSelector = new TestObjectColumnSelector(pairs);
|
objectSelector = new TestObjectColumnSelector<>(pairs);
|
||||||
colSelectorFactory = EasyMock.createMock(ColumnSelectorFactory.class);
|
colSelectorFactory = EasyMock.createMock(ColumnSelectorFactory.class);
|
||||||
EasyMock.expect(colSelectorFactory.makeLongColumnSelector(Column.TIME_COLUMN_NAME)).andReturn(timeSelector);
|
EasyMock.expect(colSelectorFactory.makeLongColumnSelector(Column.TIME_COLUMN_NAME)).andReturn(timeSelector);
|
||||||
EasyMock.expect(colSelectorFactory.makeDoubleColumnSelector("nilly")).andReturn(valueSelector);
|
EasyMock.expect(colSelectorFactory.makeDoubleColumnSelector("nilly")).andReturn(valueSelector);
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class FloatFirstAggregationTest
|
||||||
combiningAggFactory = (FloatFirstAggregatorFactory) floatFirstAggregatorFactory.getCombiningFactory();
|
combiningAggFactory = (FloatFirstAggregatorFactory) floatFirstAggregatorFactory.getCombiningFactory();
|
||||||
timeSelector = new TestLongColumnSelector(times);
|
timeSelector = new TestLongColumnSelector(times);
|
||||||
valueSelector = new TestFloatColumnSelector(floats);
|
valueSelector = new TestFloatColumnSelector(floats);
|
||||||
objectSelector = new TestObjectColumnSelector(pairs);
|
objectSelector = new TestObjectColumnSelector<>(pairs);
|
||||||
colSelectorFactory = EasyMock.createMock(ColumnSelectorFactory.class);
|
colSelectorFactory = EasyMock.createMock(ColumnSelectorFactory.class);
|
||||||
EasyMock.expect(colSelectorFactory.makeLongColumnSelector(Column.TIME_COLUMN_NAME)).andReturn(timeSelector);
|
EasyMock.expect(colSelectorFactory.makeLongColumnSelector(Column.TIME_COLUMN_NAME)).andReturn(timeSelector);
|
||||||
EasyMock.expect(colSelectorFactory.makeFloatColumnSelector("nilly")).andReturn(valueSelector);
|
EasyMock.expect(colSelectorFactory.makeFloatColumnSelector("nilly")).andReturn(valueSelector);
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class LongFirstAggregationTest
|
||||||
combiningAggFactory = (LongFirstAggregatorFactory) longFirstAggFactory.getCombiningFactory();
|
combiningAggFactory = (LongFirstAggregatorFactory) longFirstAggFactory.getCombiningFactory();
|
||||||
timeSelector = new TestLongColumnSelector(times);
|
timeSelector = new TestLongColumnSelector(times);
|
||||||
valueSelector = new TestLongColumnSelector(longValues);
|
valueSelector = new TestLongColumnSelector(longValues);
|
||||||
objectSelector = new TestObjectColumnSelector(pairs);
|
objectSelector = new TestObjectColumnSelector<>(pairs);
|
||||||
colSelectorFactory = EasyMock.createMock(ColumnSelectorFactory.class);
|
colSelectorFactory = EasyMock.createMock(ColumnSelectorFactory.class);
|
||||||
EasyMock.expect(colSelectorFactory.makeLongColumnSelector(Column.TIME_COLUMN_NAME)).andReturn(timeSelector);
|
EasyMock.expect(colSelectorFactory.makeLongColumnSelector(Column.TIME_COLUMN_NAME)).andReturn(timeSelector);
|
||||||
EasyMock.expect(colSelectorFactory.makeLongColumnSelector("nilly")).andReturn(valueSelector);
|
EasyMock.expect(colSelectorFactory.makeLongColumnSelector("nilly")).andReturn(valueSelector);
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class DoubleLastAggregationTest
|
||||||
combiningAggFactory = (DoubleLastAggregatorFactory) doubleLastAggFactory.getCombiningFactory();
|
combiningAggFactory = (DoubleLastAggregatorFactory) doubleLastAggFactory.getCombiningFactory();
|
||||||
timeSelector = new TestLongColumnSelector(times);
|
timeSelector = new TestLongColumnSelector(times);
|
||||||
valueSelector = new TestDoubleColumnSelectorImpl(doubles);
|
valueSelector = new TestDoubleColumnSelectorImpl(doubles);
|
||||||
objectSelector = new TestObjectColumnSelector(pairs);
|
objectSelector = new TestObjectColumnSelector<>(pairs);
|
||||||
colSelectorFactory = EasyMock.createMock(ColumnSelectorFactory.class);
|
colSelectorFactory = EasyMock.createMock(ColumnSelectorFactory.class);
|
||||||
EasyMock.expect(colSelectorFactory.makeLongColumnSelector(Column.TIME_COLUMN_NAME)).andReturn(timeSelector);
|
EasyMock.expect(colSelectorFactory.makeLongColumnSelector(Column.TIME_COLUMN_NAME)).andReturn(timeSelector);
|
||||||
EasyMock.expect(colSelectorFactory.makeDoubleColumnSelector("nilly")).andReturn(valueSelector);
|
EasyMock.expect(colSelectorFactory.makeDoubleColumnSelector("nilly")).andReturn(valueSelector);
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class FloatLastAggregationTest
|
||||||
combiningAggFactory = (FloatLastAggregatorFactory) floatLastAggregatorFactory.getCombiningFactory();
|
combiningAggFactory = (FloatLastAggregatorFactory) floatLastAggregatorFactory.getCombiningFactory();
|
||||||
timeSelector = new TestLongColumnSelector(times);
|
timeSelector = new TestLongColumnSelector(times);
|
||||||
valueSelector = new TestFloatColumnSelector(floats);
|
valueSelector = new TestFloatColumnSelector(floats);
|
||||||
objectSelector = new TestObjectColumnSelector(pairs);
|
objectSelector = new TestObjectColumnSelector<>(pairs);
|
||||||
colSelectorFactory = EasyMock.createMock(ColumnSelectorFactory.class);
|
colSelectorFactory = EasyMock.createMock(ColumnSelectorFactory.class);
|
||||||
EasyMock.expect(colSelectorFactory.makeLongColumnSelector(Column.TIME_COLUMN_NAME)).andReturn(timeSelector);
|
EasyMock.expect(colSelectorFactory.makeLongColumnSelector(Column.TIME_COLUMN_NAME)).andReturn(timeSelector);
|
||||||
EasyMock.expect(colSelectorFactory.makeFloatColumnSelector("nilly")).andReturn(valueSelector);
|
EasyMock.expect(colSelectorFactory.makeFloatColumnSelector("nilly")).andReturn(valueSelector);
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class LongLastAggregationTest
|
||||||
combiningAggFactory = (LongLastAggregatorFactory) longLastAggFactory.getCombiningFactory();
|
combiningAggFactory = (LongLastAggregatorFactory) longLastAggFactory.getCombiningFactory();
|
||||||
timeSelector = new TestLongColumnSelector(times);
|
timeSelector = new TestLongColumnSelector(times);
|
||||||
valueSelector = new TestLongColumnSelector(longValues);
|
valueSelector = new TestLongColumnSelector(longValues);
|
||||||
objectSelector = new TestObjectColumnSelector(pairs);
|
objectSelector = new TestObjectColumnSelector<>(pairs);
|
||||||
colSelectorFactory = EasyMock.createMock(ColumnSelectorFactory.class);
|
colSelectorFactory = EasyMock.createMock(ColumnSelectorFactory.class);
|
||||||
EasyMock.expect(colSelectorFactory.makeLongColumnSelector(Column.TIME_COLUMN_NAME)).andReturn(timeSelector);
|
EasyMock.expect(colSelectorFactory.makeLongColumnSelector(Column.TIME_COLUMN_NAME)).andReturn(timeSelector);
|
||||||
EasyMock.expect(colSelectorFactory.makeLongColumnSelector("nilly")).andReturn(valueSelector);
|
EasyMock.expect(colSelectorFactory.makeLongColumnSelector("nilly")).andReturn(valueSelector);
|
||||||
|
|
Loading…
Reference in New Issue