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


Java Utils.javaDeserialize方法代码示例

本文整理汇总了Java中org.apache.storm.utils.Utils.javaDeserialize方法的典型用法代码示例。如果您正苦于以下问题:Java Utils.javaDeserialize方法的具体用法?Java Utils.javaDeserialize怎么用?Java Utils.javaDeserialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.storm.utils.Utils的用法示例。


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

示例1: addTopologyInputs

import org.apache.storm.utils.Utils; //导入方法依赖的package包/类
private void addTopologyInputs(Referenceable topologyReferenceable,
                               Map<String, SpoutSpec> spouts,
                               Map stormConf,
                               String topologyOwner, List<Referenceable> dependentEntities) throws IllegalAccessException {
    final ArrayList<Referenceable> inputDataSets = new ArrayList<>();
    for (Map.Entry<String, SpoutSpec> entry : spouts.entrySet()) {
        Serializable instance = Utils.javaDeserialize(
                entry.getValue().get_spout_object().get_serialized_java(), Serializable.class);

        String simpleName = instance.getClass().getSimpleName();
        final Referenceable datasetRef = createDataSet(simpleName, topologyOwner, instance, stormConf, dependentEntities);
        if (datasetRef != null) {
            inputDataSets.add(datasetRef);
        }
    }

    topologyReferenceable.set("inputs", inputDataSets);
}
 
开发者ID:apache,项目名称:incubator-atlas,代码行数:19,代码来源:StormAtlasHook.java

示例2: addTopologyOutputs

import org.apache.storm.utils.Utils; //导入方法依赖的package包/类
private void addTopologyOutputs(Referenceable topologyReferenceable,
                                StormTopology stormTopology, String topologyOwner,
                                Map stormConf, List<Referenceable> dependentEntities) throws Exception {
    final ArrayList<Referenceable> outputDataSets = new ArrayList<>();

    Map<String, Bolt> bolts = stormTopology.get_bolts();
    Set<String> terminalBoltNames = StormTopologyUtil.getTerminalUserBoltNames(stormTopology);
    for (String terminalBoltName : terminalBoltNames) {
        Serializable instance = Utils.javaDeserialize(bolts.get(terminalBoltName)
                .get_bolt_object().get_serialized_java(), Serializable.class);

        String dataSetType = instance.getClass().getSimpleName();
        final Referenceable datasetRef = createDataSet(dataSetType, topologyOwner, instance, stormConf, dependentEntities);
        if (datasetRef != null) {
            outputDataSets.add(datasetRef);
        }
    }

    topologyReferenceable.set("outputs", outputDataSets);
}
 
开发者ID:apache,项目名称:incubator-atlas,代码行数:21,代码来源:StormAtlasHook.java

示例3: createSpoutInstance

import org.apache.storm.utils.Utils; //导入方法依赖的package包/类
private Referenceable createSpoutInstance(String spoutName,
                                          SpoutSpec stormSpout) throws IllegalAccessException {
    Referenceable spoutReferenceable = new Referenceable(StormDataTypes.STORM_SPOUT.getName());
    spoutReferenceable.set(AtlasClient.NAME, spoutName);

    Serializable instance = Utils.javaDeserialize(
            stormSpout.get_spout_object().get_serialized_java(), Serializable.class);
    spoutReferenceable.set("driverClass", instance.getClass().getName());

    Map<String, String> flatConfigMap = StormTopologyUtil.getFieldValues(instance, true, null);
    spoutReferenceable.set("conf", flatConfigMap);

    return spoutReferenceable;
}
 
开发者ID:apache,项目名称:incubator-atlas,代码行数:15,代码来源:StormAtlasHook.java

示例4: createBoltInstance

import org.apache.storm.utils.Utils; //导入方法依赖的package包/类
private Referenceable createBoltInstance(String boltName,
                                         Bolt stormBolt) throws IllegalAccessException {
    Referenceable boltReferenceable = new Referenceable(StormDataTypes.STORM_BOLT.getName());

    boltReferenceable.set(AtlasClient.NAME, boltName);

    Serializable instance = Utils.javaDeserialize(
            stormBolt.get_bolt_object().get_serialized_java(), Serializable.class);
    boltReferenceable.set("driverClass", instance.getClass().getName());

    Map<String, String> flatConfigMap = StormTopologyUtil.getFieldValues(instance, true, null);
    boltReferenceable.set("conf", flatConfigMap);

    return boltReferenceable;
}
 
开发者ID:apache,项目名称:incubator-atlas,代码行数:16,代码来源:StormAtlasHook.java


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