Search in sources :

Example 1 with SolrJsonSpout

use of org.apache.storm.solr.spout.SolrJsonSpout in project storm by apache.

the class SolrJsonTopology method getTopology.

protected StormTopology getTopology() throws IOException {
    TopologyBuilder builder = new TopologyBuilder();
    builder.setSpout("SolrJsonSpout", new SolrJsonSpout());
    builder.setBolt("SolrUpdateBolt", new SolrUpdateBolt(getSolrConfig(), getSolrMapper(), getSolrCommitStgy())).shuffleGrouping("SolrJsonSpout");
    return builder.createTopology();
}
Also used : TopologyBuilder(org.apache.storm.topology.TopologyBuilder) SolrUpdateBolt(org.apache.storm.solr.bolt.SolrUpdateBolt) SolrJsonSpout(org.apache.storm.solr.spout.SolrJsonSpout)

Example 2 with SolrJsonSpout

use of org.apache.storm.solr.spout.SolrJsonSpout in project storm by apache.

the class SolrJsonTridentTopology method getTopology.

protected StormTopology getTopology() throws IOException {
    final TridentTopology topology = new TridentTopology();
    final SolrJsonSpout spout = new SolrJsonSpout();
    final Stream stream = topology.newStream("SolrJsonSpout", spout);
    final StateFactory solrStateFactory = new SolrStateFactory(getSolrConfig(), getSolrMapper());
    stream.partitionPersist(solrStateFactory, spout.getOutputFields(), new SolrUpdater(), new Fields());
    return topology.build();
}
Also used : StateFactory(org.apache.storm.trident.state.StateFactory) Fields(org.apache.storm.tuple.Fields) TridentTopology(org.apache.storm.trident.TridentTopology) SolrJsonSpout(org.apache.storm.solr.spout.SolrJsonSpout) Stream(org.apache.storm.trident.Stream)

Aggregations

SolrJsonSpout (org.apache.storm.solr.spout.SolrJsonSpout)2 SolrUpdateBolt (org.apache.storm.solr.bolt.SolrUpdateBolt)1 TopologyBuilder (org.apache.storm.topology.TopologyBuilder)1 Stream (org.apache.storm.trident.Stream)1 TridentTopology (org.apache.storm.trident.TridentTopology)1 StateFactory (org.apache.storm.trident.state.StateFactory)1 Fields (org.apache.storm.tuple.Fields)1