Replace deprecated usage for StringInputRowParser and JSONParseSpec (#3215)

This commit is contained in:
Hyukjin Kwon 2016-07-15 01:19:17 +09:00 committed by Charles Allen
parent a1715c8cda
commit 55e7a52475
19 changed files with 92 additions and 39 deletions

View File

@ -66,7 +66,8 @@ public class FileIteratingFirehoseTest
new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("x")), null, null), new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("x")), null, null),
",", ",",
ImmutableList.of("ts", "x") ImmutableList.of("ts", "x")
) ),
null
); );
final FileIteratingFirehose firehose = new FileIteratingFirehose(lineIterators.iterator(), parser); final FileIteratingFirehose firehose = new FileIteratingFirehose(lineIterators.iterator(), parser);

View File

@ -49,7 +49,8 @@ public class InputRowParserSerdeTest
new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("foo", "bar")), null, null), new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("foo", "bar")), null, null),
null, null,
null null
) ),
null
); );
final ByteBufferInputRowParser parser2 = jsonMapper.readValue( final ByteBufferInputRowParser parser2 = jsonMapper.readValue(
jsonMapper.writeValueAsBytes(parser), jsonMapper.writeValueAsBytes(parser),
@ -197,7 +198,8 @@ public class InputRowParserSerdeTest
new DimensionsSpec(null, null, null), new DimensionsSpec(null, null, null),
flattenSpec, flattenSpec,
null null
) ),
null
); );
final StringInputRowParser parser2 = jsonMapper.readValue( final StringInputRowParser parser2 = jsonMapper.readValue(

View File

@ -38,7 +38,7 @@ public class HadoopyStringInputRowParser implements InputRowParser<Object>
public HadoopyStringInputRowParser(@JsonProperty("parseSpec") ParseSpec parseSpec) public HadoopyStringInputRowParser(@JsonProperty("parseSpec") ParseSpec parseSpec)
{ {
this.parser = new StringInputRowParser(parseSpec); this.parser = new StringInputRowParser(parseSpec, null);
} }
@Override @Override

View File

@ -349,7 +349,8 @@ public class BatchDeltaIngestionTest
new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("host")), null, null), new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("host")), null, null),
null, null,
ImmutableList.of("timestamp", "host", "host2", "visited_num") ImmutableList.of("timestamp", "host", "host2", "visited_num")
) ),
null
), ),
Map.class Map.class
), ),

View File

@ -126,7 +126,8 @@ public class DetermineHashedPartitionsJobTest
"placementish", "placementish",
"index" "index"
) )
) ),
null
), ),
Map.class Map.class
), ),

View File

@ -230,7 +230,8 @@ public class DeterminePartitionsJobTest
new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("host", "country")), null, null), new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("host", "country")), null, null),
null, null,
ImmutableList.of("timestamp", "host", "country", "visited_num") ImmutableList.of("timestamp", "host", "country", "visited_num")
) ),
null
), ),
Map.class Map.class
), ),

View File

@ -70,7 +70,8 @@ public class IndexGeneratorCombinerTest
new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("host")), null, null), new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("host")), null, null),
null, null,
ImmutableList.of("timestamp", "host", "visited") ImmutableList.of("timestamp", "host", "visited")
) ),
null
), ),
Map.class Map.class
), ),

View File

@ -143,7 +143,8 @@ public class IndexGeneratorJobTest
new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("host")), null, null), new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("host")), null, null),
null, null,
ImmutableList.of("timestamp", "host", "visited_num") ImmutableList.of("timestamp", "host", "visited_num")
) ),
null
), ),
null, null,
aggs1, aggs1,
@ -233,7 +234,8 @@ public class IndexGeneratorJobTest
new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("host")), null, null), new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("host")), null, null),
null, null,
ImmutableList.of("timestamp", "host", "visited_num") ImmutableList.of("timestamp", "host", "visited_num")
) ),
null
), ),
null, null,
aggs1, aggs1,
@ -316,8 +318,11 @@ public class IndexGeneratorJobTest
new StringInputRowParser( new StringInputRowParser(
new JSONParseSpec( new JSONParseSpec(
new TimestampSpec("ts", "yyyyMMddHH", null), new TimestampSpec("ts", "yyyyMMddHH", null),
new DimensionsSpec(null, null, null) new DimensionsSpec(null, null, null),
) null,
null
),
null
), ),
1, // force 1 row max per index for easier testing 1, // force 1 row max per index for easier testing
aggs2, aggs2,
@ -345,8 +350,11 @@ public class IndexGeneratorJobTest
new StringInputRowParser( new StringInputRowParser(
new JSONParseSpec( new JSONParseSpec(
new TimestampSpec("ts", "yyyyMMddHH", null), new TimestampSpec("ts", "yyyyMMddHH", null),
new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("B", "F", "M", "Q", "X", "Y")), null, null) new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("B", "F", "M", "Q", "X", "Y")), null, null),
) null,
null
),
null
), ),
1, // force 1 row max per index for easier testing 1, // force 1 row max per index for easier testing
aggs2, aggs2,

View File

@ -75,7 +75,8 @@ public class JobHelperTest
new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("host")), null, null), new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("host")), null, null),
null, null,
ImmutableList.of("timestamp", "host", "visited_num") ImmutableList.of("timestamp", "host", "visited_num")
) ),
null
), ),
Map.class Map.class
), ),

View File

@ -268,7 +268,8 @@ public class DatasourcePathSpecTest
new DimensionsSpec(null, null, null), new DimensionsSpec(null, null, null),
null, null,
ImmutableList.of("timestamp", "host", "visited") ImmutableList.of("timestamp", "host", "visited")
) ),
null
), ),
Map.class Map.class
), ),

View File

@ -164,7 +164,8 @@ public class HadoopConverterJobTest
"\t", "\t",
"\u0001", "\u0001",
Arrays.asList(TestIndex.COLUMNS) Arrays.asList(TestIndex.COLUMNS)
) ),
null
), ),
Map.class Map.class
), ),

View File

@ -117,7 +117,8 @@ public class IndexTaskTest
), ),
null, null,
Arrays.asList("ts", "dim", "val") Arrays.asList("ts", "dim", "val")
) ),
null
), ),
Map.class Map.class
), ),
@ -189,7 +190,8 @@ public class IndexTaskTest
), ),
null, null,
Arrays.asList("ts", "dim", "val") Arrays.asList("ts", "dim", "val")
) ),
null
), ),
Map.class Map.class
), ),
@ -302,7 +304,8 @@ public class IndexTaskTest
), ),
null, null,
Arrays.asList("ts", "dim", "val") Arrays.asList("ts", "dim", "val")
) ),
null
), ),
Map.class Map.class
), ),

View File

@ -298,7 +298,9 @@ public class IngestSegmentFirehoseFactoryTest
DimensionsSpec.getDefaultSchemas(ImmutableList.<String>of()), DimensionsSpec.getDefaultSchemas(ImmutableList.<String>of()),
ImmutableList.of(DIM_FLOAT_NAME, DIM_LONG_NAME), ImmutableList.of(DIM_FLOAT_NAME, DIM_LONG_NAME),
ImmutableList.<SpatialDimensionSchema>of() ImmutableList.<SpatialDimensionSchema>of()
) ),
null,
null
) )
) )
)) { )) {
@ -416,7 +418,9 @@ public class IngestSegmentFirehoseFactoryTest
DimensionsSpec.getDefaultSchemas(ImmutableList.of(DIM_NAME)), DimensionsSpec.getDefaultSchemas(ImmutableList.of(DIM_NAME)),
ImmutableList.of(DIM_FLOAT_NAME, DIM_LONG_NAME), ImmutableList.of(DIM_FLOAT_NAME, DIM_LONG_NAME),
ImmutableList.<SpatialDimensionSchema>of() ImmutableList.<SpatialDimensionSchema>of()
) ),
null,
null
) )
); );

View File

@ -100,7 +100,9 @@ public class IngestSegmentFirehoseFactoryTimelineTest
DimensionsSpec.getDefaultSchemas(Arrays.asList(DIMENSIONS)), DimensionsSpec.getDefaultSchemas(Arrays.asList(DIMENSIONS)),
null, null,
null null
) ),
null,
null
) )
); );

View File

@ -58,8 +58,11 @@ public class DataSchemaTest
new StringInputRowParser( new StringInputRowParser(
new JSONParseSpec( new JSONParseSpec(
new TimestampSpec("time", "auto", null), new TimestampSpec("time", "auto", null),
new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("dimB", "dimA")), null, null) new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("dimB", "dimA")), null, null),
) null,
null
),
null
), new TypeReference<Map<String, Object>>() {} ), new TypeReference<Map<String, Object>>() {}
); );
@ -87,8 +90,11 @@ public class DataSchemaTest
new StringInputRowParser( new StringInputRowParser(
new JSONParseSpec( new JSONParseSpec(
new TimestampSpec("time", "auto", null), new TimestampSpec("time", "auto", null),
new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("time", "dimA", "dimB", "col2")), ImmutableList.of("dimC"), null) new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("time", "dimA", "dimB", "col2")), ImmutableList.of("dimC"), null),
) null,
null
),
null
), new TypeReference<Map<String, Object>>() {} ), new TypeReference<Map<String, Object>>() {}
); );
@ -116,8 +122,11 @@ public class DataSchemaTest
new StringInputRowParser( new StringInputRowParser(
new JSONParseSpec( new JSONParseSpec(
new TimestampSpec("time", "auto", null), new TimestampSpec("time", "auto", null),
new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("time", "dimA", "dimB", "metric1")), ImmutableList.of("dimC"), null) new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("time", "dimA", "dimB", "metric1")), ImmutableList.of("dimC"), null),
) null,
null
),
null
), new TypeReference<Map<String, Object>>() {} ), new TypeReference<Map<String, Object>>() {}
); );
@ -197,7 +206,9 @@ public class DataSchemaTest
actual.getParser().getParseSpec(), actual.getParser().getParseSpec(),
new JSONParseSpec( new JSONParseSpec(
new TimestampSpec("xXx", null, null), new TimestampSpec("xXx", null, null),
new DimensionsSpec(null, Arrays.asList("metric1", "xXx", "col1"), null) new DimensionsSpec(null, Arrays.asList("metric1", "xXx", "col1"), null),
null,
null
) )
); );
Assert.assertEquals( Assert.assertEquals(

View File

@ -86,8 +86,11 @@ public class FireDepartmentTest
DimensionsSpec.getDefaultSchemas(Arrays.asList("dim1", "dim2")), DimensionsSpec.getDefaultSchemas(Arrays.asList("dim1", "dim2")),
null, null,
null null
) ),
) null,
null
),
null
), ),
Map.class Map.class
), ),

View File

@ -103,7 +103,9 @@ public class AppenderatorTester implements AutoCloseable
new MapInputRowParser( new MapInputRowParser(
new JSONParseSpec( new JSONParseSpec(
new TimestampSpec("ts", "auto", null), new TimestampSpec("ts", "auto", null),
new DimensionsSpec(null, null, null) new DimensionsSpec(null, null, null),
null,
null
) )
), ),
Map.class Map.class

View File

@ -83,7 +83,9 @@ public class EventReceiverFirehoseTest
"timestamp", "timestamp",
"auto", "auto",
null null
), new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("d1")), null, null) ), new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("d1")), null, null),
null,
null
) )
) )
); );
@ -213,7 +215,9 @@ public class EventReceiverFirehoseTest
"timestamp", "timestamp",
"auto", "auto",
null null
), new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("d1")), null, null) ), new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("d1")), null, null),
null,
null
) )
) )
); );

View File

@ -135,8 +135,11 @@ public class RealtimePlumberSchoolTest
new StringInputRowParser( new StringInputRowParser(
new JSONParseSpec( new JSONParseSpec(
new TimestampSpec("timestamp", "auto", null), new TimestampSpec("timestamp", "auto", null),
new DimensionsSpec(null, null, null) new DimensionsSpec(null, null, null),
) null,
null
),
null
), ),
Map.class Map.class
), ),
@ -151,8 +154,11 @@ public class RealtimePlumberSchoolTest
new StringInputRowParser( new StringInputRowParser(
new JSONParseSpec( new JSONParseSpec(
new TimestampSpec("timestamp", "auto", null), new TimestampSpec("timestamp", "auto", null),
new DimensionsSpec(null, null, null) new DimensionsSpec(null, null, null),
) null,
null
),
null
), ),
Map.class Map.class
), ),