backtype.storm.task.TopologyContext.setSubscribedState()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(77)

本文整理了Java中backtype.storm.task.TopologyContext.setSubscribedState()方法的一些代码示例,展示了TopologyContext.setSubscribedState()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TopologyContext.setSubscribedState()方法的具体详情如下:
包路径:backtype.storm.task.TopologyContext
类名称:TopologyContext
方法名:setSubscribedState

TopologyContext.setSubscribedState介绍

[英]Synchronizes the default stream from the specified state spout component id with the provided ISubscribedState object.

The recommended usage of this method is as follows:

_myState = context.setSubscribedState(componentId, new MyState());
[中]将指定状态喷口组件id中的默认流与提供的IsSubscribedState对象同步。
此方法的建议用法如下:
_myState=上下文。setSubscribedState(componentId,new MyState());

代码示例

代码示例来源:origin: alibaba/jstorm

/**
 * Synchronizes the default stream from the specified state spout component id with the provided ISubscribedState object.
 *
 * The recommended usage of this method is as follows:
 * <pre>
 * _myState = context.setSubscribedState(componentId, new MyState());
 * </pre>
 *
 * @param componentId the id of the StateSpout component to subscribe to
 * @param obj         Provided ISubscribedState implementation
 * @return Returns the ISubscribedState object provided
 */
public <T extends ISubscribedState> T setSubscribedState(String componentId, T obj) {
  return setSubscribedState(componentId, Utils.DEFAULT_STREAM_ID, obj);
}

代码示例来源:origin: alibaba/mdrill

/**
 * Synchronizes the default stream from the specified state spout component
 * id with the provided ISubscribedState object.
 *
 * <p>The recommended usage of this method is as follows:</p>
 * <p>
 * _myState = context.setSubscribedState(componentId, new MyState());
 * </p>
 *
 * @param componentId the id of the StateSpout component to subscribe to
 * @param obj Provided ISubscribedState implementation
 * @return Returns the ISubscribedState object provided
 */
public <T extends ISubscribedState> T setSubscribedState(String componentId, T obj) {
  return setSubscribedState(componentId, Utils.DEFAULT_STREAM_ID, obj);
}

代码示例来源:origin: com.n3twork.storm/storm-core

/**
 * Synchronizes the default stream from the specified state spout component
 * id with the provided ISubscribedState object.
 *
 * <p>The recommended usage of this method is as follows:</p>
 * <p>
 * _myState = context.setSubscribedState(componentId, new MyState());
 * </p>
 *
 * @param componentId the id of the StateSpout component to subscribe to
 * @param obj Provided ISubscribedState implementation
 * @return Returns the ISubscribedState object provided
 */
public <T extends ISubscribedState> T setSubscribedState(String componentId, T obj) {
  return setSubscribedState(componentId, Utils.DEFAULT_STREAM_ID, obj);
}

代码示例来源:origin: com.alibaba.jstorm/jstorm-core

/**
 * Synchronizes the default stream from the specified state spout component id with the provided ISubscribedState object.
 * 
 * <p>
 * The recommended usage of this method is as follows:
 * </p>
 * <p>
 * _myState = context.setSubscribedState(componentId, new MyState());
 * </p>
 * 
 * @param componentId the id of the StateSpout component to subscribe to
 * @param obj Provided ISubscribedState implementation
 * @return Returns the ISubscribedState object provided
 */
public <T extends ISubscribedState> T setSubscribedState(String componentId, T obj) {
  return setSubscribedState(componentId, Utils.DEFAULT_STREAM_ID, obj);
}

相关文章

微信公众号

最新文章

更多