FakeSourceNode(final String name) { super( new PlanNodeId("fake"), new KsqlStream<>( STATEMENT, name, SCHEMA, SCHEMA.fields().get(0), new MetadataTimestampExtractionPolicy(), new KsqlTopic(name, name, new KsqlJsonTopicSerDe(), false), Serdes.String()), SCHEMA); } }
@Test public void testTopicMap() { final KsqlTopic ksqlTopic1 = new KsqlTopic("testTopic", "testTopicKafka", new KsqlJsonTopicSerDe(), false); metaStore.putTopic(ksqlTopic1); final KsqlTopic ksqlTopic2 = metaStore.getTopic("testTopic"); Assert.assertNotNull(ksqlTopic2); // Check non-existent topic final KsqlTopic ksqlTopic3 = metaStore.getTopic("TESTTOPIC_"); Assert.assertNull(ksqlTopic3); }
private StructuredDataSource buildDataSource(final String kafkaTopicName) { final Schema schema = SchemaBuilder.struct() .field("field0", Schema.OPTIONAL_INT32_SCHEMA) .build(); final KsqlTopic topic = new KsqlTopic("internal", kafkaTopicName, new KsqlJsonTopicSerDe(), true); return new KsqlStream<>( "query", "stream", schema, schema.fields().get(0), new MetadataTimestampExtractionPolicy(), topic, Serdes.String()); }
expect(topology.describe()).andReturn(topologyDescription); replay(topology, topologyDescription); final KsqlTopic sinkTopic = new KsqlTopic("fake_sink", "fake_sink", new KsqlJsonTopicSerDe(), true); final KsqlStream fakeSink = new KsqlStream<>( STATEMENT, "fake_sink", SCHEMA, SCHEMA.fields().get(0),
private void ensureSource( final DataSource.DataSourceType type, final String sourceName, final String topicName, final String ksqlTopicName, final Schema schema ) { if (metaStore.getTopic(ksqlTopicName) != null) { return; } final KsqlTopic ksqlTopic = new KsqlTopic( ksqlTopicName, topicName, new KsqlJsonTopicSerDe(), false); givenTopicExists(topicName); metaStore.putTopic(ksqlTopic); if (type == DataSource.DataSourceType.KSTREAM) { metaStore.putSource( new KsqlStream<>( "statementText", sourceName, schema, schema.fields().get(0), new MetadataTimestampExtractionPolicy(), ksqlTopic, Serdes.String())); } if (type == DataSource.DataSourceType.KTABLE) { metaStore.putSource( new KsqlTable<>( "statementText", sourceName, schema, schema.fields().get(0), new MetadataTimestampExtractionPolicy(), ksqlTopic, "statestore", Serdes.String())); } }
new KsqlTopic("ADDRESS_TOPIC", "orders_topic", new KsqlJsonTopicSerDe(), false); new KsqlTopic("ITEMS_TOPIC", "item_topic", new KsqlJsonTopicSerDe(), false); final KsqlTable<String> ksqlTableOrders = new KsqlTable<>( "sqlexpression",
new KsqlTopic("ADDRESS_TOPIC", "orders_topic", new KsqlJsonTopicSerDe(), false); new KsqlTopic("ITEMS_TOPIC", "item_topic", new KsqlJsonTopicSerDe(), false); final KsqlTable<String> ksqlTableOrders = new KsqlTable<>( "sqlexpression",