core/src/main/java/com/digitalpebble/stormcrawler/ConfigurableTopology.java
protected int submit(String name, Config conf, TopologyBuilder builder) {

        // register Metadata for serialization with FieldsSerializer
        Config.registerSerialization(conf, Metadata.class);

        if (isLocal) {
            LocalCluster cluster = new LocalCluster();
            cluster.submitTopology(name, conf, builder.createTopology());
            if (ttl != -1) {
                Utils.sleep(ttl * 1000);
                cluster.shutdown();
            }
        }

        else {
            try {
                StormSubmitter.submitTopology(name, conf,
                        builder.createTopology());
            } catch (Exception e) {
                e.printStackTrace();
                return -1;
            }
        }
        return 0;
    }
protected int submit(String name, Config conf, TopologyBuilder builder) {

        // register Metadata for serialization with FieldsSerializer
        Config.registerSerialization(conf, Metadata.class);

        if (isLocal) {
            LocalCluster cluster = new LocalCluster();
            cluster.submitTopology(name, conf, builder.createTopology());
            if (ttl != -1) {
                Utils.sleep(ttl * 1000);
                cluster.shutdown();
            }
        }

        else {
            try {
                StormSubmitter.submitTopology(name, conf,
                        builder.createTopology());
            } catch (Exception e) {
                e.printStackTrace();
                return -1;
            }
        }
        return 0;
    }
protected int submit ( String name , Config conf , TopologyBuilder builder ) { // register Metadata for serialization with FieldsSerializer Config . registerSerialization ( conf , Metadata . class ) ; if ( isLocal ) { LocalCluster cluster = new LocalCluster ( ) ; cluster . submitTopology ( name , conf , builder . createTopology ( ) ) ; if ( ttl != - 1 ) { Utils . sleep ( ttl * 1000 ) ; cluster . shutdown ( ) ; } } else { try { StormSubmitter . submitTopology ( name , conf , builder . createTopology ( ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; return - 1 ; } } return 0 ; }
Submits the topology under a specific name *
Submits the topology under a specific name *