Search in sources :

Example 1 with Avro1124RESTRepositoryClientWrapper

use of org.apache.druid.data.input.schemarepo.Avro1124RESTRepositoryClientWrapper in project druid by druid-io.

the class AvroStreamInputFormatTest method testSerdeNonDefault.

@Test
public void testSerdeNonDefault() throws IOException {
    Repository repository = new Avro1124RESTRepositoryClientWrapper("http://github.io");
    AvroStreamInputFormat inputFormat = new AvroStreamInputFormat(flattenSpec, new SchemaRepoBasedAvroBytesDecoder<>(new Avro1124SubjectAndIdConverter(TOPIC), repository), true, true);
    NestedInputFormat inputFormat2 = jsonMapper.readValue(jsonMapper.writeValueAsString(inputFormat), NestedInputFormat.class);
    Assert.assertEquals(inputFormat, inputFormat2);
}
Also used : Avro1124SubjectAndIdConverter(org.apache.druid.data.input.schemarepo.Avro1124SubjectAndIdConverter) NestedInputFormat(org.apache.druid.data.input.impl.NestedInputFormat) Repository(org.schemarepo.Repository) InMemoryRepository(org.schemarepo.InMemoryRepository) TypedSchemaRepository(org.schemarepo.api.TypedSchemaRepository) Avro1124RESTRepositoryClientWrapper(org.apache.druid.data.input.schemarepo.Avro1124RESTRepositoryClientWrapper) AvroStreamInputFormat(org.apache.druid.data.input.avro.AvroStreamInputFormat) Test(org.junit.Test)

Example 2 with Avro1124RESTRepositoryClientWrapper

use of org.apache.druid.data.input.schemarepo.Avro1124RESTRepositoryClientWrapper in project druid by druid-io.

the class AvroStreamInputFormatTest method testSerde.

@Test
public void testSerde() throws IOException {
    Repository repository = new Avro1124RESTRepositoryClientWrapper("http://github.io");
    AvroStreamInputFormat inputFormat = new AvroStreamInputFormat(flattenSpec, new SchemaRepoBasedAvroBytesDecoder<>(new Avro1124SubjectAndIdConverter(TOPIC), repository), false, false);
    NestedInputFormat inputFormat2 = jsonMapper.readValue(jsonMapper.writeValueAsString(inputFormat), NestedInputFormat.class);
    Assert.assertEquals(inputFormat, inputFormat2);
}
Also used : Avro1124SubjectAndIdConverter(org.apache.druid.data.input.schemarepo.Avro1124SubjectAndIdConverter) NestedInputFormat(org.apache.druid.data.input.impl.NestedInputFormat) Repository(org.schemarepo.Repository) InMemoryRepository(org.schemarepo.InMemoryRepository) TypedSchemaRepository(org.schemarepo.api.TypedSchemaRepository) Avro1124RESTRepositoryClientWrapper(org.apache.druid.data.input.schemarepo.Avro1124RESTRepositoryClientWrapper) AvroStreamInputFormat(org.apache.druid.data.input.avro.AvroStreamInputFormat) Test(org.junit.Test)

Example 3 with Avro1124RESTRepositoryClientWrapper

use of org.apache.druid.data.input.schemarepo.Avro1124RESTRepositoryClientWrapper in project druid by druid-io.

the class AvroStreamInputRowParserTest method testSerdeNonDefault.

@Test
public void testSerdeNonDefault() throws IOException {
    Repository repository = new Avro1124RESTRepositoryClientWrapper("http://github.io");
    AvroStreamInputRowParser parser = new AvroStreamInputRowParser(PARSE_SPEC, new SchemaRepoBasedAvroBytesDecoder<>(new Avro1124SubjectAndIdConverter(TOPIC), repository), true, true);
    ByteBufferInputRowParser parser2 = jsonMapper.readValue(jsonMapper.writeValueAsString(parser), ByteBufferInputRowParser.class);
    Assert.assertEquals(parser, parser2);
}
Also used : Avro1124SubjectAndIdConverter(org.apache.druid.data.input.schemarepo.Avro1124SubjectAndIdConverter) Repository(org.schemarepo.Repository) InMemoryRepository(org.schemarepo.InMemoryRepository) TypedSchemaRepository(org.schemarepo.api.TypedSchemaRepository) Avro1124RESTRepositoryClientWrapper(org.apache.druid.data.input.schemarepo.Avro1124RESTRepositoryClientWrapper) Test(org.junit.Test)

Example 4 with Avro1124RESTRepositoryClientWrapper

use of org.apache.druid.data.input.schemarepo.Avro1124RESTRepositoryClientWrapper in project druid by druid-io.

the class AvroStreamInputRowParserTest method testSerde.

@Test
public void testSerde() throws IOException {
    Repository repository = new Avro1124RESTRepositoryClientWrapper("http://github.io");
    AvroStreamInputRowParser parser = new AvroStreamInputRowParser(PARSE_SPEC, new SchemaRepoBasedAvroBytesDecoder<>(new Avro1124SubjectAndIdConverter(TOPIC), repository), false, false);
    ByteBufferInputRowParser parser2 = jsonMapper.readValue(jsonMapper.writeValueAsString(parser), ByteBufferInputRowParser.class);
    Assert.assertEquals(parser, parser2);
}
Also used : Avro1124SubjectAndIdConverter(org.apache.druid.data.input.schemarepo.Avro1124SubjectAndIdConverter) Repository(org.schemarepo.Repository) InMemoryRepository(org.schemarepo.InMemoryRepository) TypedSchemaRepository(org.schemarepo.api.TypedSchemaRepository) Avro1124RESTRepositoryClientWrapper(org.apache.druid.data.input.schemarepo.Avro1124RESTRepositoryClientWrapper) Test(org.junit.Test)

Aggregations

Avro1124RESTRepositoryClientWrapper (org.apache.druid.data.input.schemarepo.Avro1124RESTRepositoryClientWrapper)4 Avro1124SubjectAndIdConverter (org.apache.druid.data.input.schemarepo.Avro1124SubjectAndIdConverter)4 Test (org.junit.Test)4 InMemoryRepository (org.schemarepo.InMemoryRepository)4 Repository (org.schemarepo.Repository)4 TypedSchemaRepository (org.schemarepo.api.TypedSchemaRepository)4 AvroStreamInputFormat (org.apache.druid.data.input.avro.AvroStreamInputFormat)2 NestedInputFormat (org.apache.druid.data.input.impl.NestedInputFormat)2