Package org.opennms.nephron
Class CompoundKey
- java.lang.Object
-
- org.opennms.nephron.CompoundKey
-
@DefaultCoder(CompoundKeyCoder.class) public class CompoundKey extends Object
Represents a compound key. A compound key is used to group flows into different dimensions. A compound key consists of a type that defines the used dimensions and a data class that contains the fields that determine the value of the key in these dimensions. TheCompoundKeyDataclass can store the fields for all dimensions in order to reduce memory churn. Instances of theCompoundKeyDataclass can be shared between different compound key instances because the equality check and hashCode calculation does only consider the fields that correspond to the dimension that are used in the referencing key.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCompoundKey.CompoundKeyCoder
-
Field Summary
Fields Modifier and Type Field Description CompoundKeyDatadataCompoundKeyTypetype
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringasString()CompoundKeycast(CompoundKeyType targetType)Cast this key into a key of the given type.booleanequals(Object o)CompoundKeygetOuterKey()Build the parent, or "outer" key for the current key.CompoundKeyTypegetType()StringgroupedByKey()inthashCode()booleanisCompleteConversationKey()Checks if this key includes the conversation dimension as its last part and that all required fields for the conversation dimension are set.voidpopulate(org.opennms.nephron.cortex.TimeSeriesBuilder builder)voidpopulate(FlowSummary flow)StringtoString()
-
-
-
Field Detail
-
type
public final CompoundKeyType type
-
data
public final CompoundKeyData data
-
-
Method Detail
-
getType
public CompoundKeyType getType()
-
getOuterKey
public CompoundKey getOuterKey()
Build the parent, or "outer" key for the current key.- Returns:
- the outer key, or null if no such key exists
-
cast
public CompoundKey cast(CompoundKeyType targetType)
Cast this key into a key of the given type. It is required that theCompoundKeyDatainstance of this key has all fields set that are required by the target type.
-
groupedByKey
public String groupedByKey()
-
populate
public void populate(FlowSummary flow)
-
populate
public void populate(org.opennms.nephron.cortex.TimeSeriesBuilder builder)
-
isCompleteConversationKey
public boolean isCompleteConversationKey()
Checks if this key includes the conversation dimension as its last part and that all required fields for the conversation dimension are set. This check is used to determine if a conversation is considered in the TopK aggregation for conversations. If the key of a conversation is not complete then it is not considered there.
-
asString
public String asString()
-
-