• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Node类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中storm.trident.planner.Node的典型用法代码示例。如果您正苦于以下问题:Java Node类的具体用法?Java Node怎么用?Java Node使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Node类属于storm.trident.planner包,在下文中一共展示了Node类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: outgoingGroups

import storm.trident.planner.Node; //导入依赖的package包/类
public Collection<Group> outgoingGroups(Group g) {
    Set<Group> ret = new HashSet();
    for(Node n: g.outgoingNodes()) {
        Group other = nodeGroup(n);
        if(other==null || !other.equals(g)) {
            ret.add(other);                
        }
    }
    return ret;
}
 
开发者ID:songtk,项目名称:learn_jstorm,代码行数:11,代码来源:GraphGrouper.java


示例2: checkValidJoins

import storm.trident.planner.Node; //导入依赖的package包/类
private static void checkValidJoins(Collection<Node> g) {
    boolean hasDRPCSpout = false;
    boolean hasBatchSpout = false;
    for(Node n: g) {
        if(n instanceof SpoutNode) {
            SpoutNode.SpoutType type = ((SpoutNode) n).type;
            if(type==SpoutNode.SpoutType.BATCH) {
                hasBatchSpout = true;
            } else if(type==SpoutNode.SpoutType.DRPC) {
                hasDRPCSpout = true;
            }
        }
    }
    if(hasBatchSpout && hasDRPCSpout) {
        throw new RuntimeException("Cannot join DRPC stream with streams originating from other spouts");
    }
}
 
开发者ID:greeenSY,项目名称:Tstream,代码行数:18,代码来源:TridentTopology.java


示例3: stateQuery

import storm.trident.planner.Node; //导入依赖的package包/类
public Stream stateQuery(TridentState state, Fields inputFields, QueryFunction function, Fields functionFields) {
    projectionValidation(inputFields);
    String stateId = state._node.stateInfo.id;
    Node n = new ProcessorNode(_topology.getUniqueStreamId(),
                    _name,
                    TridentUtils.fieldsConcat(getOutputFields(), functionFields),
                    functionFields,
                    new StateQueryProcessor(stateId, inputFields, function));
    _topology._colocate.get(stateId).add(n);
    return _topology.addSourcedNode(this, n);
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:12,代码来源:Stream.java


示例4: reindex

import storm.trident.planner.Node; //导入依赖的package包/类
public void reindex() {
    groupIndex.clear();
    for(Group g: currGroups) {
        for(Node n: g.nodes) {
            groupIndex.put(n, g);
        }
    }  
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:9,代码来源:GraphGrouper.java


示例5: merge

import storm.trident.planner.Node; //导入依赖的package包/类
private void merge(Group g1, Group g2) {
    Group newGroup = new Group(g1, g2);
    currGroups.remove(g1);
    currGroups.remove(g2);
    currGroups.add(newGroup);
    for(Node n: newGroup.nodes) {
        groupIndex.put(n, newGroup);
    }
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:10,代码来源:GraphGrouper.java


示例6: incomingGroups

import storm.trident.planner.Node; //导入依赖的package包/类
public Collection<Group> incomingGroups(Group g) {
    Set<Group> ret = new HashSet();
    for(Node n: g.incomingNodes()) {
        Group other = nodeGroup(n);
        if(other==null || !other.equals(g)) {
            ret.add(other);                
        }
    }
    return ret;        
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:11,代码来源:GraphGrouper.java


示例7: registerSourcedNode

import storm.trident.planner.Node; //导入依赖的package包/类
protected void registerSourcedNode(List<Stream> sources, Node newNode) {
    registerNode(newNode);
    int streamIndex = 0;
    for(Stream s: sources) {
        _graph.addEdge(s._node, newNode, new IndexedEdge(s._node, newNode, streamIndex));
        streamIndex++;
    }        
}
 
开发者ID:greeenSY,项目名称:Tstream,代码行数:9,代码来源:TridentTopology.java


示例8: outgoingNodes

import storm.trident.planner.Node; //导入依赖的package包/类
public Set<Node> outgoingNodes() {
    Set<Node> ret = new HashSet<Node>();
    for(Node n: nodes) {
        ret.addAll(TridentUtils.getChildren(graph, n));
    }
    return ret;
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:8,代码来源:Group.java


示例9: incomingNodes

import storm.trident.planner.Node; //导入依赖的package包/类
public Set<Node> incomingNodes() {
    Set<Node> ret = new HashSet<Node>();
    for(Node n: nodes) {
        ret.addAll(TridentUtils.getParents(graph, n));
    }        
    return ret;        
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:8,代码来源:Group.java


示例10: newDRPCStream

import storm.trident.planner.Node; //导入依赖的package包/类
private Stream newDRPCStream(DRPCSpout spout) {
    // : consider adding a shuffle grouping after the spout to avoid so much routing of the args/return-info all over the place
    // (at least until its possible to just pack bolt logic into the spout itself)

    Node n = new SpoutNode(getUniqueStreamId(), TridentUtils.getSingleOutputStreamFields(spout), null, spout, SpoutNode.SpoutType.DRPC);
    Stream nextStream = addNode(n);
    // later on, this will be joined back with return-info and all the results
    return nextStream.project(new Fields("args"));
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:10,代码来源:TridentTopology.java


示例11: newStaticState

import storm.trident.planner.Node; //导入依赖的package包/类
public TridentState newStaticState(StateSpec spec) {
    String stateId = getUniqueStateId();
    Node n = new Node(getUniqueStreamId(), null, new Fields());
    n.stateInfo = new NodeStateInfo(stateId, spec);
    registerNode(n);
    return new TridentState(this, n);
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:8,代码来源:TridentTopology.java


示例12: multiReduce

import storm.trident.planner.Node; //导入依赖的package包/类
public Stream multiReduce(List<Fields> inputFields, List<Stream> streams, MultiReducer function, Fields outputFields) {
    List<String> names = new ArrayList<String>();
    for(Stream s: streams) {
        if(s._name!=null) {
            names.add(s._name);
        }
    }
    Node n = new ProcessorNode(getUniqueStreamId(), Utils.join(names, "-"), outputFields, outputFields, new MultiReducerProcessor(inputFields, function));
    return addSourcedNode(streams, n);
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:11,代码来源:TridentTopology.java


示例13: externalGroupInputs

import storm.trident.planner.Node; //导入依赖的package包/类
private static Set<PartitionNode> externalGroupInputs(Group g) {
    Set<PartitionNode> ret = new HashSet();
    for(Node n: g.incomingNodes()) {
        if(n instanceof PartitionNode) {
            ret.add((PartitionNode) n);
        }
    }
    return ret;
}
 
开发者ID:greeenSY,项目名称:Tstream,代码行数:10,代码来源:TridentTopology.java


示例14: getDRPCSpoutNode

import storm.trident.planner.Node; //导入依赖的package包/类
private static SpoutNode getDRPCSpoutNode(Collection<Node> g) {
    for(Node n: g) {
        if(n instanceof SpoutNode) {
            SpoutNode.SpoutType type = ((SpoutNode) n).type;
            if(type==SpoutNode.SpoutType.DRPC) {
                return (SpoutNode) n;
            }
        }
    }
    return null;
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:12,代码来源:TridentTopology.java


示例15: genSpoutIds

import storm.trident.planner.Node; //导入依赖的package包/类
private static Map<Node, String> genSpoutIds(Collection<SpoutNode> spoutNodes) {
    Map<Node, String> ret = new HashMap();
    int ctr = 0;
    for(SpoutNode n: spoutNodes) {
        ret.put(n, "spout" + ctr);
        ctr++;
    }
    return ret;
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:10,代码来源:TridentTopology.java


示例16: getOutputStreamBatchGroups

import storm.trident.planner.Node; //导入依赖的package包/类
private static Map<String, String> getOutputStreamBatchGroups(Group g, Map<Node, String> batchGroupMap) {
    Map<String, String> ret = new HashMap();
    Set<PartitionNode> externalGroupOutputs = externalGroupOutputs(g);
    for(PartitionNode n: externalGroupOutputs) {
        ret.put(n.streamId, batchGroupMap.get(n));
    }        
    return ret;
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:9,代码来源:TridentTopology.java


示例17: committerBatches

import storm.trident.planner.Node; //导入依赖的package包/类
private static Set<String> committerBatches(Group g, Map<Node, String> batchGroupMap) {
    Set<String> ret = new HashSet();
    for(Node n: g.nodes) {
       if(n instanceof ProcessorNode) {
           if(((ProcessorNode) n).committer) {
               ret.add(batchGroupMap.get(n));
           }
       } 
    }
    return ret;
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:12,代码来源:TridentTopology.java


示例18: getFixedParallelism

import storm.trident.planner.Node; //导入依赖的package包/类
private static Integer getFixedParallelism(Set<Group> groups) {
    Integer ret = null;
    for(Group g: groups) {
        for(Node n: g.nodes) {
            if(n.stateInfo != null && n.stateInfo.spec.requiredNumPartitions!=null) {
                int reqPartitions = n.stateInfo.spec.requiredNumPartitions;
                if(ret!=null && ret!=reqPartitions) {
                    throw new RuntimeException("Cannot have one group have fixed parallelism of two different values");
                }
                ret = reqPartitions;
            }
        }
    }
    return ret;
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:16,代码来源:TridentTopology.java


示例19: externalGroupOutputs

import storm.trident.planner.Node; //导入依赖的package包/类
private static Set<PartitionNode> externalGroupOutputs(Group g) {
    Set<PartitionNode> ret = new HashSet();
    for(Node n: g.outgoingNodes()) {
        if(n instanceof PartitionNode) {
            ret.add((PartitionNode) n);
        }
    }
    return ret;
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:10,代码来源:TridentTopology.java


示例20: registerNode

import storm.trident.planner.Node; //导入依赖的package包/类
protected void registerNode(Node n) {
    _graph.addVertex(n);
    if(n.stateInfo!=null) {
        String id = n.stateInfo.id;
        if(!_colocate.containsKey(id)) {
            _colocate.put(id, new ArrayList());
        }
        _colocate.get(id).add(n);
    }
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:11,代码来源:TridentTopology.java



注:本文中的storm.trident.planner.Node类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java InterpreterException类代码示例发布时间:2022-05-23
下一篇:
Java DRPCRequest类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap