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(); } }
@Override public void read(org.apache.storm.thrift.protocol.TProtocol prot, Bolt struct) throws org.apache.storm.thrift.TException { org.apache.storm.thrift.protocol.TTupleProtocol iprot = (org.apache.storm.thrift.protocol.TTupleProtocol) prot; struct.bolt_object = new ComponentObject(); struct.bolt_object.read(iprot); struct.set_bolt_object_isSet(true); struct.common = new ComponentCommon(); struct.common.read(iprot); struct.set_common_isSet(true); } }
public byte[] get_serialized_java() { set_serialized_java(org.apache.storm.thrift.TBaseHelper.rightSize(buffer_for_serialized_java())); java.nio.ByteBuffer b = buffer_for_serialized_java(); return b == null ? null : b.array(); }
public static ComponentObject serialized_java(java.nio.ByteBuffer value) { ComponentObject x = new ComponentObject(); x.set_serialized_java(value); return x; }
public static ComponentObject shell(ShellComponent value) { ComponentObject x = new ComponentObject(); x.set_shell(value); return x; }
public static ComponentObject java_object(JavaObject value) { ComponentObject x = new ComponentObject(); x.set_java_object(value); return x; }
public JavaObject get_java_object() { if (getSetField() == _Fields.JAVA_OBJECT) { return (JavaObject)getFieldValue(); } else { throw new java.lang.RuntimeException("Cannot get field 'java_object' because union is currently set to " + getFieldDesc(getSetField()).name); } }
public boolean equals(ComponentObject other) { return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); }
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 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)); }
public ComponentObject deepCopy() { return new ComponentObject(this); }
public boolean equals(java.lang.Object other) { if (other instanceof ComponentObject) { return equals((ComponentObject)other); } else { return false; } }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.storm.thrift.protocol.TCompactProtocol(new org.apache.storm.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.storm.thrift.TException te) { throw new java.io.IOException(te); } }
public ShellComponent get_shell() { if (getSetField() == _Fields.SHELL) { return (ShellComponent)getFieldValue(); } else { throw new java.lang.RuntimeException("Cannot get field 'shell' because union is currently set to " + getFieldDesc(getSetField()).name); } }
@Override public int compareTo(ComponentObject other) { int lastComparison = org.apache.storm.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); if (lastComparison == 0) { return org.apache.storm.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); } return lastComparison; }
public static ComponentObject serialized_java(byte[] value) { ComponentObject x = new ComponentObject(); x.set_serialized_java(java.nio.ByteBuffer.wrap(value.clone())); return x; }
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)); }
/** * Performs a deep copy on <i>other</i>. */ public SpoutSpec(SpoutSpec other) { if (other.is_set_spout_object()) { this.spout_object = new ComponentObject(other.spout_object); } if (other.is_set_common()) { this.common = new ComponentCommon(other.common); } }
public boolean equals(Bolt that) { if (that == null) return false; if (this == that) return true; boolean this_present_bolt_object = true && this.is_set_bolt_object(); boolean that_present_bolt_object = true && that.is_set_bolt_object(); if (this_present_bolt_object || that_present_bolt_object) { if (!(this_present_bolt_object && that_present_bolt_object)) return false; if (!this.bolt_object.equals(that.bolt_object)) return false; } boolean this_present_common = true && this.is_set_common(); boolean that_present_common = true && that.is_set_common(); if (this_present_common || that_present_common) { if (!(this_present_common && that_present_common)) return false; if (!this.common.equals(that.common)) return false; } return true; }
public static ComponentObject shell(ShellComponent value) { ComponentObject x = new ComponentObject(); x.set_shell(value); return x; }