Package org.apache.solr.util
Interface DynamicMap
- All Known Implementing Classes:
IntFloatDynamicMap,IntIntDynamicMap,IntLongDynamicMap
public interface DynamicMap
An efficient map for storing keys as integer in range from 0..n with n can be estimated up-front.
By automatically switching from a hashMap (which is memory efficient) to an array (which is
faster) on increasing number of keys. So it SHOULD not be used for other cases where key can be
any arbitrary integer.
-
Method Summary
Modifier and TypeMethodDescriptiondefault intmapExpectedElements(int expectedKeyMax) Compute expected elements for hppc maps, so resizing won't happen if we store less elements thanthresholddefault intthreshold(int expectedKeyMax) Compute threshold for switching from hashMap based to arraydefault booleanuseArrayBased(int expectedKeyMax)
-
Method Details
-
useArrayBased
default boolean useArrayBased(int expectedKeyMax) -
threshold
default int threshold(int expectedKeyMax) Compute threshold for switching from hashMap based to array -
mapExpectedElements
default int mapExpectedElements(int expectedKeyMax) Compute expected elements for hppc maps, so resizing won't happen if we store less elements thanthreshold
-