mirror of https://github.com/apache/druid.git
Fix missed travis failures from PR 3567 and 2798 (#3761)
* Fix checkstyle failures from PR 3567 * Fix GranularityPathSpecTest compile failure
This commit is contained in:
parent
f794246ec1
commit
880a021a7a
|
@ -49,6 +49,27 @@ import java.util.Arrays;
|
||||||
|
|
||||||
public class GranularityPathSpecTest
|
public class GranularityPathSpecTest
|
||||||
{
|
{
|
||||||
|
private static final HadoopTuningConfig DEFAULT_TUNING_CONFIG = new HadoopTuningConfig(
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
null,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
private GranularityPathSpec granularityPathSpec;
|
private GranularityPathSpec granularityPathSpec;
|
||||||
private final String TEST_STRING_PATH = "TEST";
|
private final String TEST_STRING_PATH = "TEST";
|
||||||
private final String TEST_STRING_PATTERN = "*.TEST";
|
private final String TEST_STRING_PATTERN = "*.TEST";
|
||||||
|
@ -59,35 +80,41 @@ public class GranularityPathSpecTest
|
||||||
@Rule
|
@Rule
|
||||||
public final TemporaryFolder testFolder = new TemporaryFolder();
|
public final TemporaryFolder testFolder = new TemporaryFolder();
|
||||||
|
|
||||||
@Before public void setUp()
|
@Before
|
||||||
|
public void setUp()
|
||||||
{
|
{
|
||||||
granularityPathSpec = new GranularityPathSpec();
|
granularityPathSpec = new GranularityPathSpec();
|
||||||
}
|
}
|
||||||
|
|
||||||
@After public void tearDown()
|
@After
|
||||||
|
public void tearDown()
|
||||||
{
|
{
|
||||||
granularityPathSpec = null;
|
granularityPathSpec = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test public void testSetInputPath()
|
@Test
|
||||||
|
public void testSetInputPath()
|
||||||
{
|
{
|
||||||
granularityPathSpec.setInputPath(TEST_STRING_PATH);
|
granularityPathSpec.setInputPath(TEST_STRING_PATH);
|
||||||
Assert.assertEquals(TEST_STRING_PATH,granularityPathSpec.getInputPath());
|
Assert.assertEquals(TEST_STRING_PATH, granularityPathSpec.getInputPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test public void testSetFilePattern()
|
@Test
|
||||||
|
public void testSetFilePattern()
|
||||||
{
|
{
|
||||||
granularityPathSpec.setFilePattern(TEST_STRING_PATTERN);
|
granularityPathSpec.setFilePattern(TEST_STRING_PATTERN);
|
||||||
Assert.assertEquals(TEST_STRING_PATTERN,granularityPathSpec.getFilePattern());
|
Assert.assertEquals(TEST_STRING_PATTERN, granularityPathSpec.getFilePattern());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test public void testSetPathFormat()
|
@Test
|
||||||
|
public void testSetPathFormat()
|
||||||
{
|
{
|
||||||
granularityPathSpec.setPathFormat(TEST_STRING_FORMAT);
|
granularityPathSpec.setPathFormat(TEST_STRING_FORMAT);
|
||||||
Assert.assertEquals(TEST_STRING_FORMAT,granularityPathSpec.getPathFormat());
|
Assert.assertEquals(TEST_STRING_FORMAT, granularityPathSpec.getPathFormat());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test public void testSetDataGranularity()
|
@Test
|
||||||
|
public void testSetDataGranularity()
|
||||||
{
|
{
|
||||||
Granularity granularity = Granularity.DAY;
|
Granularity granularity = Granularity.DAY;
|
||||||
granularityPathSpec.setDataGranularity(granularity);
|
granularityPathSpec.setDataGranularity(granularity);
|
||||||
|
@ -123,26 +150,7 @@ public class GranularityPathSpecTest
|
||||||
jsonMapper
|
jsonMapper
|
||||||
),
|
),
|
||||||
new HadoopIOConfig(null, null, null),
|
new HadoopIOConfig(null, null, null),
|
||||||
new HadoopTuningConfig(
|
DEFAULT_TUNING_CONFIG
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
null,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
false,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
granularityPathSpec.setDataGranularity(Granularity.HOUR);
|
granularityPathSpec.setDataGranularity(Granularity.HOUR);
|
||||||
|
@ -187,13 +195,13 @@ public class GranularityPathSpecTest
|
||||||
new AggregatorFactory[0],
|
new AggregatorFactory[0],
|
||||||
new UniformGranularitySpec(
|
new UniformGranularitySpec(
|
||||||
Granularity.DAY,
|
Granularity.DAY,
|
||||||
QueryGranularity.ALL,
|
QueryGranularities.ALL,
|
||||||
ImmutableList.of(new Interval("2015-01-01T11Z/2015-01-02T05Z"))
|
ImmutableList.of(new Interval("2015-01-01T11Z/2015-01-02T05Z"))
|
||||||
),
|
),
|
||||||
jsonMapper
|
jsonMapper
|
||||||
),
|
),
|
||||||
new HadoopIOConfig(null, null, null),
|
new HadoopIOConfig(null, null, null),
|
||||||
new HadoopTuningConfig(null, null, null, null, null, null, false, false, false, false, null, false, false, null, null, null)
|
DEFAULT_TUNING_CONFIG
|
||||||
);
|
);
|
||||||
|
|
||||||
granularityPathSpec.setDataGranularity(Granularity.HOUR);
|
granularityPathSpec.setDataGranularity(Granularity.HOUR);
|
||||||
|
@ -242,7 +250,8 @@ public class GranularityPathSpecTest
|
||||||
String filePattern,
|
String filePattern,
|
||||||
String pathFormat,
|
String pathFormat,
|
||||||
Granularity granularity,
|
Granularity granularity,
|
||||||
Class inputFormat) throws Exception
|
Class inputFormat
|
||||||
|
) throws Exception
|
||||||
{
|
{
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("{\"inputPath\" : \"");
|
sb.append("{\"inputPath\" : \"");
|
||||||
|
@ -258,7 +267,7 @@ public class GranularityPathSpecTest
|
||||||
// Double-check Jackson's lower-case enum support
|
// Double-check Jackson's lower-case enum support
|
||||||
sb.append(granularity.toString().toLowerCase());
|
sb.append(granularity.toString().toLowerCase());
|
||||||
sb.append("\",");
|
sb.append("\",");
|
||||||
if(inputFormat != null) {
|
if (inputFormat != null) {
|
||||||
sb.append("\"inputFormat\" : \"");
|
sb.append("\"inputFormat\" : \"");
|
||||||
sb.append(inputFormat.getName());
|
sb.append(inputFormat.getName());
|
||||||
sb.append("\",");
|
sb.append("\",");
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
|
|
||||||
package io.druid.query.aggregation.post;
|
package io.druid.query.aggregation.post;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JacksonInject;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
|
|
||||||
package io.druid.query.aggregation.post;
|
package io.druid.query.aggregation.post;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JacksonInject;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
|
|
||||||
package io.druid.query.aggregation.post;
|
package io.druid.query.aggregation.post;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JacksonInject;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
|
|
||||||
package io.druid.query.aggregation.post;
|
package io.druid.query.aggregation.post;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JacksonInject;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
|
|
Loading…
Reference in New Issue