本文整理汇总了Java中org.apache.storm.Constants类的典型用法代码示例。如果您正苦于以下问题:Java Constants类的具体用法?Java Constants怎么用?Java Constants使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Constants类属于org.apache.storm包,在下文中一共展示了Constants类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initMocks
import org.apache.storm.Constants; //导入依赖的package包/类
private void initMocks(String topo_input_topic) {
Fields switchSchema = new Fields(OFEMessageUtils.FIELD_SWITCH_ID, OFEMessageUtils.FIELD_STATE);
when(topologyContext.getComponentId(0)).thenReturn(topo_input_topic);
when(topologyContext.getComponentOutputFields(topo_input_topic,
topo_input_topic)).thenReturn(switchSchema);
Fields portSchema = new Fields(OFEMessageUtils.FIELD_SWITCH_ID,
OFEMessageUtils.FIELD_PORT_ID, OFEMessageUtils.FIELD_STATE);
when(topologyContext.getComponentId(1)).thenReturn(topo_input_topic);
when(topologyContext.getComponentOutputFields(topo_input_topic,
topo_input_topic)).thenReturn(portSchema);
Fields tickSchema = new Fields();
when(topologyContext.getComponentId(2)).thenReturn(Constants.SYSTEM_COMPONENT_ID);
when(topologyContext.getComponentOutputFields(Constants.SYSTEM_COMPONENT_ID, Constants.SYSTEM_TICK_STREAM_ID))
.thenReturn(tickSchema);
Fields islSchema = new Fields(topo_input_topic);
when(topologyContext.getComponentId(3)).thenReturn(topo_input_topic);
when(topologyContext.getComponentOutputFields(topo_input_topic,
topo_input_topic)).thenReturn(islSchema);
when(topologyContext.getComponentId(4)).thenReturn(OFEventWFMTopology.SPOUT_ID_INPUT);
when(topologyContext.getComponentOutputFields(
OFEventWFMTopology.SPOUT_ID_INPUT, AbstractTopology.MESSAGE_FIELD))
.thenReturn(AbstractTopology.fieldMessage);
}
示例2: createTickTuple
import org.apache.storm.Constants; //导入依赖的package包/类
private Tuple createTickTuple() {
final MkTupleParam tupleParam = new MkTupleParam();
tupleParam.setComponent(Constants.SYSTEM_COMPONENT_ID);
tupleParam.setStream(Constants.SYSTEM_TICK_STREAM_ID);
final Tuple tickTuple = Testing.testTuple(Arrays.asList(), tupleParam);
return tickTuple;
}
示例3: isTickTuple
import org.apache.storm.Constants; //导入依赖的package包/类
protected boolean isTickTuple(Tuple tuple) {
return (tuple.getSourceComponent().equals(Constants.SYSTEM_COMPONENT_ID)
&& tuple.getSourceStreamId().equals(Constants.SYSTEM_TICK_STREAM_ID));
}
示例4: isTickTuple
import org.apache.storm.Constants; //导入依赖的package包/类
protected static boolean isTickTuple(Tuple tuple) {
return tuple.getSourceComponent().equals(Constants.SYSTEM_COMPONENT_ID)
&& tuple.getSourceStreamId().equals(Constants.SYSTEM_TICK_STREAM_ID);
}
示例5: isTickTuple
import org.apache.storm.Constants; //导入依赖的package包/类
protected static boolean isTickTuple(Tuple tuple)
{
return tuple.getSourceComponent().equals(Constants.SYSTEM_COMPONENT_ID) && tuple.getSourceStreamId().equals(Constants.SYSTEM_TICK_STREAM_ID);
}
示例6: isTickTuple
import org.apache.storm.Constants; //导入依赖的package包/类
public static boolean isTickTuple(Tuple tuple) {
return tuple.getSourceComponent().equals(Constants.SYSTEM_COMPONENT_ID) && tuple.getSourceStreamId().equals(
Constants.SYSTEM_TICK_STREAM_ID);
}
示例7: isTickTuple
import org.apache.storm.Constants; //导入依赖的package包/类
public static boolean isTickTuple(Tuple tuple) {
return tuple != null && tuple.getSourceComponent().equals(Constants.SYSTEM_COMPONENT_ID)
&& tuple.getSourceStreamId().equals(Constants.SYSTEM_TICK_STREAM_ID);
}
示例8: makeTickTuple
import org.apache.storm.Constants; //导入依赖的package包/类
public Tuple makeTickTuple() {
MockTopologyContext context = new MockTopologyContext(new String[]{StreamlineEvent.STREAMLINE_EVENT}, Constants.SYSTEM_COMPONENT_ID );
return new TupleImpl(context, new Values(1000), (int) Constants.SYSTEM_TASK_ID, Constants.SYSTEM_TICK_STREAM_ID);
}
示例9: isTick
import org.apache.storm.Constants; //导入依赖的package包/类
public boolean isTick(Tuple tuple) {
return tuple != null &&
Constants.SYSTEM_COMPONENT_ID.equals(tuple.getSourceComponent()) &&
Constants.SYSTEM_TICK_STREAM_ID.equals(tuple.getSourceStreamId());
}
示例10: mockTickTuple
import org.apache.storm.Constants; //导入依赖的package包/类
private static Tuple mockTickTuple() {
return mockTuple(Constants.SYSTEM_COMPONENT_ID, Constants.SYSTEM_TICK_STREAM_ID);
}
示例11: mockTickTuple
import org.apache.storm.Constants; //导入依赖的package包/类
public static Tuple mockTickTuple() {
Tuple tuple = mock(Tuple.class);
when(tuple.getSourceComponent()).thenReturn(Constants.SYSTEM_COMPONENT_ID);
when(tuple.getSourceStreamId()).thenReturn(Constants.SYSTEM_TICK_STREAM_ID);
return tuple;
}
示例12: isTick
import org.apache.storm.Constants; //导入依赖的package包/类
public static boolean isTick(Tuple tuple) {
return tuple != null
&& Constants.SYSTEM_COMPONENT_ID.equals(tuple.getSourceComponent())
&& Constants.SYSTEM_TICK_STREAM_ID.equals(tuple.getSourceStreamId());
}
示例13: isTickTuple
import org.apache.storm.Constants; //导入依赖的package包/类
public static boolean isTickTuple(Tuple tuple) {
return tuple.getSourceComponent().equals(Constants.SYSTEM_COMPONENT_ID)
&& tuple.getSourceStreamId().equals(Constants.SYSTEM_TICK_STREAM_ID);
}
示例14: isTickTuple
import org.apache.storm.Constants; //导入依赖的package包/类
public static boolean isTickTuple(Tuple tuple) {
return tuple.getSourceComponent().equals(Constants.SYSTEM_COMPONENT_ID)
&& tuple.getSourceStreamId().equals(Constants.SYSTEM_TICK_STREAM_ID);
}