Search in sources :

Example 1 with SolrFieldsSpout

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

the class SolrFieldsTopology method getTopology.

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

Example 2 with SolrFieldsSpout

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

the class SolrFieldsTridentTopology method getTopology.

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

Aggregations

SolrFieldsSpout (org.apache.storm.solr.spout.SolrFieldsSpout)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