Class ExecutionPropertyMap<T extends ExecutionProperty>
- java.lang.Object
-
- org.apache.nemo.common.ir.executionproperty.ExecutionPropertyMap<T>
-
- Type Parameters:
T
- Type ofExecutionProperty
this map stores.
- All Implemented Interfaces:
java.io.Serializable
@NotThreadSafe public final class ExecutionPropertyMap<T extends ExecutionProperty> extends java.lang.Object implements java.io.Serializable
ExecutionPropertyMap Class, which uses HashMap for keeping track of ExecutionProperties for vertices and edges.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ExecutionPropertyMap(java.lang.String id)
Constructor for ExecutionPropertyMap class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.fasterxml.jackson.databind.node.ObjectNode
asJsonNode()
boolean
containsKey(java.lang.Class<? extends T> key)
boolean
equals(java.lang.Object obj)
void
forEachProperties(java.util.function.Consumer<? super T> action)
Same as forEach function in Java 8, but for execution properties.<U extends java.io.Serializable>
java.util.Optional<U>get(java.lang.Class<? extends ExecutionProperty<U>> executionPropertyKey)
Get the value of the given execution property type.java.lang.String
getId()
ID of the item this ExecutionPropertyMap class is keeping track of.int
hashCode()
static ExecutionPropertyMap<EdgeExecutionProperty>
of(IREdge irEdge, CommunicationPatternProperty.Value commPattern)
Static initializer for irEdges.static ExecutionPropertyMap<VertexExecutionProperty>
of(IRVertex irVertex)
Static initializer for irVertex.T
put(T executionProperty)
Put the given execution property in the ExecutionPropertyMap.T
put(T executionProperty, java.lang.Boolean finalize)
Put the given execution property in the ExecutionPropertyMap.T
remove(java.lang.Class<? extends T> key)
remove the execution property.java.util.stream.Stream<T>
stream()
java.lang.String
toString()
-
-
-
Method Detail
-
of
public static ExecutionPropertyMap<EdgeExecutionProperty> of(IREdge irEdge, CommunicationPatternProperty.Value commPattern)
Static initializer for irEdges.- Parameters:
irEdge
- irEdge to keep the execution property of.commPattern
- Data communication pattern type of the edge.- Returns:
- The corresponding ExecutionPropertyMap.
-
of
public static ExecutionPropertyMap<VertexExecutionProperty> of(IRVertex irVertex)
Static initializer for irVertex.- Parameters:
irVertex
- irVertex to keep the execution property of.- Returns:
- The corresponding ExecutionPropertyMap.
-
getId
public java.lang.String getId()
ID of the item this ExecutionPropertyMap class is keeping track of.- Returns:
- the ID of the item this ExecutionPropertyMap class is keeping track of.
-
put
public T put(T executionProperty)
Put the given execution property in the ExecutionPropertyMap. By default, it does not finalize the property.- Parameters:
executionProperty
- execution property to insert.- Returns:
- the previous execution property, or null if there was no execution property with the specified property key.
-
put
public T put(T executionProperty, java.lang.Boolean finalize)
Put the given execution property in the ExecutionPropertyMap.- Parameters:
executionProperty
- execution property to insert.finalize
- whether or not to finalize the execution property.- Returns:
- the previous execution property, or null if there was no execution property with the specified property key.
-
get
public <U extends java.io.Serializable> java.util.Optional<U> get(java.lang.Class<? extends ExecutionProperty<U>> executionPropertyKey)
Get the value of the given execution property type.- Type Parameters:
U
- Type of the return value.- Parameters:
executionPropertyKey
- the execution property type to find the value of.- Returns:
- the value of the given execution property.
-
remove
public T remove(java.lang.Class<? extends T> key)
remove the execution property.- Parameters:
key
- key of the execution property to remove.- Returns:
- the removed execution property
-
containsKey
public boolean containsKey(java.lang.Class<? extends T> key)
- Parameters:
key
- key to look for.- Returns:
- whether or not the execution property map contains the key.
-
forEachProperties
public void forEachProperties(java.util.function.Consumer<? super T> action)
Same as forEach function in Java 8, but for execution properties.- Parameters:
action
- action to apply to each of the execution properties.
-
stream
public java.util.stream.Stream<T> stream()
- Returns:
Stream
of execution properties.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
asJsonNode
public com.fasterxml.jackson.databind.node.ObjectNode asJsonNode()
- Returns:
JsonNode
for this execution property map.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-