Search in sources :

Example 11 with ISqlStreamsDataSource

use of org.apache.storm.sql.runtime.ISqlStreamsDataSource in project storm by apache.

the class TestMongoDataSourcesProvider method testMongoSink.

@SuppressWarnings("unchecked")
@Test
public void testMongoSink() throws Exception {
    ISqlStreamsDataSource ds = DataSourcesRegistry.constructStreamsDataSource(URI.create("mongodb://127.0.0.1:27017/test"), null, null, TBL_PROPERTIES, FIELDS);
    Assert.assertNotNull(ds);
    IRichBolt consumer = ds.getConsumer();
    Assert.assertEquals(MongoInsertBolt.class, consumer.getClass());
}
Also used : IRichBolt(org.apache.storm.topology.IRichBolt) ISqlStreamsDataSource(org.apache.storm.sql.runtime.ISqlStreamsDataSource) Test(org.junit.Test)

Example 12 with ISqlStreamsDataSource

use of org.apache.storm.sql.runtime.ISqlStreamsDataSource in project storm by apache.

the class TestRedisDataSourcesProvider method testRedisSink.

@SuppressWarnings("unchecked")
@Test
public void testRedisSink() throws Exception {
    ISqlStreamsDataSource ds = DataSourcesRegistry.constructStreamsDataSource(URI.create("redis://:foobared@localhost:6380/2"), null, null, TBL_PROPERTIES, FIELDS);
    Assert.assertNotNull(ds);
    IRichBolt consumer = ds.getConsumer();
    Assert.assertEquals(RedisStoreBolt.class, consumer.getClass());
}
Also used : IRichBolt(org.apache.storm.topology.IRichBolt) ISqlStreamsDataSource(org.apache.storm.sql.runtime.ISqlStreamsDataSource) Test(org.junit.Test)

Example 13 with ISqlStreamsDataSource

use of org.apache.storm.sql.runtime.ISqlStreamsDataSource in project storm by apache.

the class TestRedisDataSourcesProvider method testRedisClusterSink.

@SuppressWarnings("unchecked")
@Test
public void testRedisClusterSink() throws Exception {
    ISqlStreamsDataSource ds = DataSourcesRegistry.constructStreamsDataSource(URI.create("redis://localhost:6380"), null, null, CLUSTER_TBL_PROPERTIES, FIELDS);
    Assert.assertNotNull(ds);
    IRichBolt consumer = ds.getConsumer();
    Assert.assertEquals(RedisStoreBolt.class, consumer.getClass());
}
Also used : IRichBolt(org.apache.storm.topology.IRichBolt) ISqlStreamsDataSource(org.apache.storm.sql.runtime.ISqlStreamsDataSource) Test(org.junit.Test)

Aggregations

ISqlStreamsDataSource (org.apache.storm.sql.runtime.ISqlStreamsDataSource)13 Values (org.apache.storm.tuple.Values)7 HashMap (java.util.HashMap)6 StormTopology (org.apache.storm.generated.StormTopology)6 AbstractStreamsProcessor (org.apache.storm.sql.AbstractStreamsProcessor)6 TestUtils (org.apache.storm.sql.TestUtils)6 QueryPlanner (org.apache.storm.sql.planner.streams.QueryPlanner)6 Test (org.junit.jupiter.api.Test)6 IRichBolt (org.apache.storm.topology.IRichBolt)5 Test (org.junit.Test)5 ImmutableMap (com.google.common.collect.ImmutableMap)1 ArrayList (java.util.ArrayList)1 Map (java.util.Map)1 DataContext (org.apache.calcite.DataContext)1 RelDataType (org.apache.calcite.rel.type.RelDataType)1 Table (org.apache.calcite.schema.Table)1 SqlOperatorTable (org.apache.calcite.sql.SqlOperatorTable)1 SqlStdOperatorTable (org.apache.calcite.sql.fun.SqlStdOperatorTable)1 ChainedSqlOperatorTable (org.apache.calcite.sql.util.ChainedSqlOperatorTable)1 CompilerUtil (org.apache.storm.sql.compiler.CompilerUtil)1