Class CloudObject
java.lang.Object
java.util.AbstractMap<String,Object>
com.google.api.client.util.GenericData
com.google.api.client.json.GenericJson
org.apache.beam.runners.dataflow.util.CloudObject
A representation of an arbitrary Java object to be instantiated by Dataflow workers.
Typically, an object to be written by the SDK to the Dataflow service will implement a method
(typically called asCloudObject()) that returns a CloudObject to represent the
object in the protocol. Once the CloudObject is constructed, the method should explicitly
add additional properties to be presented during deserialization, representing child objects by
building additional CloudObjects.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.api.client.util.GenericData
com.google.api.client.util.GenericData.FlagsNested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Method Summary
Modifier and TypeMethodDescriptionclone()booleanstatic CloudObjectforBoolean(Boolean value) Constructs aCloudObjectrepresenting the given value.static CloudObjectConstructs aCloudObjectto be used for serializing an instance of the supplied class for transport via the Dataflow API.static CloudObjectforClassName(String className) Constructs aCloudObjectto be used for serializing data to be deserialized using the supplied class name the supplied class name for transport via the Dataflow API.static CloudObjectConstructs aCloudObjectrepresenting the given value.static CloudObjectConstructs aCloudObjectrepresenting the given value.static CloudObjectforInteger(Integer value) Constructs aCloudObjectrepresenting the given value.static CloudObjectforInteger(Long value) Constructs aCloudObjectrepresenting the given value.static CloudObjectforKnownType(Object value) Constructs aCloudObjectrepresenting the given value of a well-known cloud object type.static CloudObjectConstructs aCloudObjectrepresenting the given value.static CloudObjectConstructs aCloudObjectby copying the supplied serialized object spec, which must represent an SDK object serialized for transport via the Dataflow API.Gets the name of the Java class that this CloudObject represents.inthashCode()Methods inherited from class com.google.api.client.json.GenericJson
getFactory, set, setFactory, toPrettyString, toStringMethods inherited from class com.google.api.client.util.GenericData
entrySet, get, getClassInfo, getUnknownKeys, put, putAll, remove, setUnknownKeysMethods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, isEmpty, keySet, size, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Method Details
-
fromSpec
Constructs aCloudObjectby copying the supplied serialized object spec, which must represent an SDK object serialized for transport via the Dataflow API.The most common use of this method is during deserialization on the worker, where it's used as a binding type during instance construction.
- Parameters:
spec- supplies the serialized form of the object as a nested map- Throws:
RuntimeException- if the supplied map does not represent an SDK object
-
forClass
Constructs aCloudObjectto be used for serializing an instance of the supplied class for transport via the Dataflow API. The instance parameters to be serialized must be supplied explicitly after theCloudObjectis created, by usingGenericData.put(java.lang.String, java.lang.Object).- Parameters:
cls- the class to use when deserializing the object on the worker
-
forClassName
Constructs aCloudObjectto be used for serializing data to be deserialized using the supplied class name the supplied class name for transport via the Dataflow API. The instance parameters to be serialized must be supplied explicitly after theCloudObjectis created, by usingGenericData.put(java.lang.String, java.lang.Object).- Parameters:
className- the class to use when deserializing the object on the worker
-
forString
Constructs aCloudObjectrepresenting the given value.- Parameters:
value- the scalar value to represent.
-
forBoolean
Constructs aCloudObjectrepresenting the given value.- Parameters:
value- the scalar value to represent.
-
forInteger
Constructs aCloudObjectrepresenting the given value.- Parameters:
value- the scalar value to represent.
-
forInteger
Constructs aCloudObjectrepresenting the given value.- Parameters:
value- the scalar value to represent.
-
forFloat
Constructs aCloudObjectrepresenting the given value.- Parameters:
value- the scalar value to represent.
-
forFloat
Constructs aCloudObjectrepresenting the given value.- Parameters:
value- the scalar value to represent.
-
forKnownType
Constructs aCloudObjectrepresenting the given value of a well-known cloud object type.- Parameters:
value- the scalar value to represent.- Throws:
RuntimeException- if the value does not have aCloudKnownTypemapping
-
getClassName
Gets the name of the Java class that this CloudObject represents. -
clone
- Overrides:
clonein classcom.google.api.client.json.GenericJson
-
equals
-
hashCode
public int hashCode()
-