当前位置: 首页>>代码示例>>Java>>正文


Java Group类代码示例

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


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

示例1: genBoltIds

import storm.trident.graph.Group; //导入依赖的package包/类
private static Map<Group, String> genBoltIds(Collection<Group> groups) {
    Map<Group, String> ret = new HashMap();
    int ctr = 0;
    for(Group g: groups) {
        if(!isSpoutGroup(g)) {
            List<String> name = new ArrayList();
            name.add("b");
            name.add("" + ctr);
            String groupName = getGroupName(g);
            if(groupName!=null && !groupName.isEmpty()) {
                name.add(getGroupName(g));                
            }
            ret.put(g, Utils.join(name, "-"));
            ctr++;
        }
    }
    return ret;
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:19,代码来源:TridentTopology.java

示例2: getMaxParallelism

import storm.trident.graph.Group; //导入依赖的package包/类
private static Integer getMaxParallelism(Set<Group> groups) {
    Integer ret = null;
    for(Group g: groups) {
        if(isSpoutGroup(g)) {
            SpoutNode n = (SpoutNode) g.nodes.iterator().next();
            Map conf = getSpoutComponentConfig(n.spout);
            if(conf==null) conf = new HashMap();
            Number maxP = (Number) conf.get(Config.TOPOLOGY_MAX_TASK_PARALLELISM);
            if(maxP!=null) {
                if(ret==null) ret = maxP.intValue();
                else ret = Math.min(ret, maxP.intValue());
            }
        }
    }
    return ret;
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:17,代码来源:TridentTopology.java

示例3: getOutputStreamBatchGroups

import storm.trident.graph.Group; //导入依赖的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:greeenSY,项目名称:Tstream,代码行数:9,代码来源:TridentTopology.java

示例4: genBoltIds

import storm.trident.graph.Group; //导入依赖的package包/类
private static Map<Group, String> genBoltIds(Collection<Group> groups) {
    Map<Group, String> ret = new HashMap<>();
    int ctr = 0;
    for(Group g: groups) {
        if(!isSpoutGroup(g)) {
            List<String> name = new ArrayList<>();
            name.add("b");
            name.add("" + ctr);
            String groupName = getGroupName(g);
            if(groupName!=null && !groupName.isEmpty()) {
                name.add(getGroupName(g));                
            }
            ret.put(g, Utils.join(name, "-"));
            ctr++;
        }
    }
    return ret;
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:19,代码来源:TridentTopology.java

示例5: committerBatches

import storm.trident.graph.Group; //导入依赖的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

示例6: getFixedParallelism

import storm.trident.graph.Group; //导入依赖的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

示例7: externalGroupInputs

import storm.trident.graph.Group; //导入依赖的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:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:10,代码来源:TridentTopology.java

示例8: externalGroupOutputs

import storm.trident.graph.Group; //导入依赖的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


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