private IBatchBolt newTransactionalBolt() { return Utils.javaDeserialize(_boltSer, IBatchBolt.class); } }
@Override public NimbusInfo getLeader(Runnable callback) { if (null != callback) { this.leaderInfoCallback.set(callback); } return Utils.javaDeserialize(this.stateStorage.get_data(ClusterUtils.LEADERINFO_SUBTREE, callback != null), NimbusInfo.class); }
public static Object deserializeComponentObject(ComponentObject obj) { if (obj.getSetField() != ComponentObject._Fields.SERIALIZED_JAVA) { throw new RuntimeException("Cannot deserialize non-java-serialized object"); } return Utils.javaDeserialize(obj.get_serialized_java(), Serializable.class); }
private List<IWorkerHook> deserializeWorkerHooks() { List<IWorkerHook> myHookList = new ArrayList<>(); if (topology.is_set_worker_hooks()) { for (ByteBuffer hook : topology.get_worker_hooks()) { byte[] hookBytes = Utils.toByteArray(hook); IWorkerHook hookObject = Utils.javaDeserialize(hookBytes, IWorkerHook.class); myHookList.add(hookObject); } } return myHookList; }
private static boolean isIdentityPartition(PartitionNode n) { Grouping g = n.thriftGrouping; if (g.is_set_custom_serialized()) { CustomStreamGrouping csg = (CustomStreamGrouping) Utils.javaDeserialize(g.get_custom_serialized(), Serializable.class); return csg instanceof IdentityGrouping; } return false; }
public static Object getSetComponentObject(ComponentObject obj) { if (obj.getSetField() == ComponentObject._Fields.SERIALIZED_JAVA) { return javaDeserialize(obj.get_serialized_java(), Serializable.class); } else if (obj.getSetField() == ComponentObject._Fields.JAVA_OBJECT) { return obj.get_java_object(); } else { return obj.get_shell(); } }
break; case CUSTOM_SERIALIZED: result = Utils.javaDeserialize(thriftGrouping.get_custom_serialized(), CustomStreamGrouping.class); break; case DIRECT:
private IBatchBolt newTransactionalBolt() { return Utils.javaDeserialize(_boltSer, IBatchBolt.class); } }
private void addTopologyInputs(Map<String, SpoutSpec> spouts, Map stormConf, String topologyOwner, AtlasEntity topology, AtlasEntityExtInfo entityExtInfo) { List<AtlasEntity> inputs = 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 dsType = instance.getClass().getSimpleName(); AtlasEntity dsEntity = addDataSet(dsType, topologyOwner, instance, stormConf, entityExtInfo); if (dsEntity != null) { inputs.add(dsEntity); } } topology.setAttribute("inputs", AtlasTypeUtil.getAtlasObjectIds(inputs)); }
private static boolean isIdentityPartition(PartitionNode n) { Grouping g = n.thriftGrouping; if(g.is_set_custom_serialized()) { CustomStreamGrouping csg = (CustomStreamGrouping) Utils.javaDeserialize(g.get_custom_serialized(), Serializable.class); return csg instanceof IdentityGrouping; } return false; }
private void addTopologyInputs(Map<String, SpoutSpec> spouts, Map stormConf, String topologyOwner, AtlasEntity topology, AtlasEntityExtInfo entityExtInfo) { List<AtlasEntity> inputs = 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 dsType = instance.getClass().getSimpleName(); AtlasEntity dsEntity = addDataSet(dsType, topologyOwner, instance, stormConf, entityExtInfo); if (dsEntity != null) { inputs.add(dsEntity); } } topology.setAttribute("inputs", AtlasTypeUtil.getAtlasObjectIds(inputs)); }
private void addTopologyOutputs(StormTopology stormTopology, String topologyOwner, Map stormConf, AtlasEntity topology, AtlasEntityExtInfo entityExtInfo) { List<AtlasEntity> outputs = new ArrayList<>(); Map<String, Bolt> bolts = stormTopology.get_bolts(); Set<String> boltNames = StormTopologyUtil.getTerminalUserBoltNames(stormTopology); for (String boltName : boltNames) { Serializable instance = Utils.javaDeserialize(bolts.get(boltName).get_bolt_object().get_serialized_java(), Serializable.class); String dsType = instance.getClass().getSimpleName(); AtlasEntity dsEntity = addDataSet(dsType, topologyOwner, instance, stormConf, entityExtInfo); if (dsEntity != null) { outputs.add(dsEntity); } } topology.setAttribute("outputs", AtlasTypeUtil.getAtlasObjectIds(outputs)); }
private AtlasEntity createBoltInstance(String boltName, Bolt stormBolt) { AtlasEntity bolt = new AtlasEntity(StormDataTypes.STORM_BOLT.getName()); Serializable instance = Utils.javaDeserialize(stormBolt.get_bolt_object().get_serialized_java(), Serializable.class); Map<String, String> flatConfigMap = StormTopologyUtil.getFieldValues(instance, true, null); bolt.setAttribute(AtlasClient.NAME, boltName); bolt.setAttribute("driverClass", instance.getClass().getName()); bolt.setAttribute("conf", flatConfigMap); return bolt; }
private AtlasEntity createSpoutInstance(String spoutName, SpoutSpec stormSpout) { AtlasEntity spout = new AtlasEntity(StormDataTypes.STORM_SPOUT.getName()); Serializable instance = Utils.javaDeserialize(stormSpout.get_spout_object().get_serialized_java(), Serializable.class); Map<String, String> flatConfigMap = StormTopologyUtil.getFieldValues(instance, true, null); spout.setAttribute(AtlasClient.NAME, spoutName); spout.setAttribute("driverClass", instance.getClass().getName()); spout.setAttribute("conf", flatConfigMap); return spout; }
public static Object getSetComponentObject(ComponentObject obj) { if (obj.getSetField() == ComponentObject._Fields.SERIALIZED_JAVA) { return Utils.javaDeserialize(obj.get_serialized_java(), Serializable.class); } else if (obj.getSetField() == ComponentObject._Fields.JAVA_OBJECT) { return obj.get_java_object(); } else { return obj.get_shell(); } }