Contributor
冯嘉@vongosling
赵颖@flyhighzy
谢正清@feilaoda
温绍锦@wenshao
胡磊@qiyuan4f
@situfang
徐冠鹏@herberteuler
李家宏@Gvain
贺小桥@Hexiaoqiao
姜宪瑶@jxysoft
周小帆@njzhxf
Who are using JStorm
Getting help
Google Groups: jstorm-user
QQ群:228374502
JStorm is a distributed and fault-tolerant realtime computation system. Inspired by Apache Storm, JStorm has been completely rewritten in Java and provides many more enhanced features. JStorm has been widely used in many enterprise environments and proved robust and stable.
Chinese Documentation and tutorials can be found on the 中文文档.
English Document and tutorials can be found on the English JStorm Documentation
#PPT Introduction JStorm Chinese introduction
封仲淹(@longdafeng)
陈昱(@cycyyy)
刘键(@bastiliu)
方孝健(@hustfxj)
李鑫(@tumen)
母延年([email protected])
周鑫(@zhouxinxust)
罗实([email protected])
翟玉勇[email protected]
程明磊[email protected]
冯嘉@vongosling
赵颖@flyhighzy
谢正清@feilaoda
温绍锦@wenshao
胡磊@qiyuan4f
@situfang
徐冠鹏@herberteuler
李家宏@Gvain
贺小桥@Hexiaoqiao
姜宪瑶@jxysoft
周小帆@njzhxf
Google Groups: jstorm-user
QQ群:228374502
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package com.alipay.dw.jstorm.example.sequence; | ||
|
||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import backtype.storm.topology.TopologyBuilder; | ||
|
||
import com.alibaba.jstorm.client.ConfigExtension; | ||
import com.alibaba.jstorm.client.WorkerAssignment; | ||
|
||
public class SequenceTopologyUserDefine extends SequenceTopology { | ||
private static Logger LOG = LoggerFactory | ||
.getLogger(SequenceTopologyUserDefine.class); | ||
|
||
private static Map conf = new HashMap<Object, Object>(); | ||
|
||
public static void SetBuilder(TopologyBuilder builder, Map conf) { | ||
|
||
SequenceTopology.SetBuilder(builder, conf); | ||
|
||
List<WorkerAssignment> userDefinedWorks = new ArrayList<WorkerAssignment>(); | ||
WorkerAssignment spoutWorkerAssignment = new WorkerAssignment(); | ||
spoutWorkerAssignment.addComponent( | ||
SequenceTopologyDef.SEQUENCE_SPOUT_NAME, 1); | ||
spoutWorkerAssignment.setHostName((String) conf.get("spout.host")); | ||
userDefinedWorks.add(spoutWorkerAssignment); | ||
|
||
WorkerAssignment totalWorkerAssignment = new WorkerAssignment(); | ||
totalWorkerAssignment.addComponent(SequenceTopologyDef.TOTAL_BOLT_NAME, | ||
2); | ||
totalWorkerAssignment.setHostName((String) conf.get("total.host")); | ||
userDefinedWorks.add(totalWorkerAssignment); | ||
|
||
ConfigExtension.setUserDefineAssignment(conf, userDefinedWorks); | ||
|
||
} | ||
|
||
public static void main(String[] args) throws Exception { | ||
if (args.length == 0) { | ||
System.err.println("Please input configuration file"); | ||
System.exit(-1); | ||
} | ||
|
||
LoadConf(args[0]); | ||
|
||
if (local_mode(conf)) { | ||
SetLocalTopology(); | ||
} else { | ||
SetRemoteTopology(); | ||
} | ||
|
||
} | ||
|
||
} |