Package org.apache.druid.segment
Class IdMapping.Builder
java.lang.Object
org.apache.druid.segment.IdMapping.Builder
- Enclosing class:
- IdMapping
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddForwardMapping(int forwardId) Adds a lookup for the 'forwarded' index to the current highest index value.voidaddMapping(int forwardId) Adds a lookup for the 'forwarded' index to the current highest index value, and a reverse lookup from this substitute index back to the original.build()static IdMapping.BuilderofCardinality(int cardinality) Create aIdMappingwhere the cardinality is known, to use withaddMapping(int)to simultaneously populate bothforwardMappingandreverseMapping.static IdMapping.BuilderCreate anIdMappingwhere the cardinality is not known up front.
-
Method Details
-
ofCardinality
Create aIdMappingwhere the cardinality is known, to use withaddMapping(int)to simultaneously populate bothforwardMappingandreverseMapping. -
ofUnknownCardinality
Create anIdMappingwhere the cardinality is not known up front. Since cardinality is unknown,reverseMappingis initialized to an empty array, andaddForwardMapping(int)should be used to build theforwardMapping, whenbuild()is calledreverseMappingwill be computed to produce the completedIdMapping. This is less efficient thanofCardinality(int), so it should be preferred if the value cardinality is in fact known -
addMapping
public void addMapping(int forwardId) Adds a lookup for the 'forwarded' index to the current highest index value, and a reverse lookup from this substitute index back to the original. This method can only be called when cardinality is known, to ensure thatreverseMappingis initialized correctly. -
addForwardMapping
public void addForwardMapping(int forwardId) Adds a lookup for the 'forwarded' index to the current highest index value. This method can only be used when the cardinality is unknown, otherwiseaddMapping(int)should be used instead since thereverseMappingis only computed ifknownCardinalityis false -
build
-