Class OffHeapH3IndexCreator
- java.lang.Object
-
- org.apache.pinot.segment.local.segment.creator.impl.inv.geospatial.BaseH3IndexCreator
-
- org.apache.pinot.segment.local.segment.creator.impl.inv.geospatial.OffHeapH3IndexCreator
-
- All Implemented Interfaces:
Closeable,AutoCloseable,GeoSpatialIndexCreator
public class OffHeapH3IndexCreator extends BaseH3IndexCreator
H3 index creator that uses off-heap memory.The posting lists (map from H3 id to doc ids) are initially stored in a TreeMap, then flushed into a file for every 100,000 entries. After all the documents are added, we read all the posting lists from the file and merge them using a priority queue to calculate the final posting lists.
Off-heap creator uses less heap memory, but is more expensive on computation and needs flush data to disk which can slow down the creation because of the IO latency. Use off-heap creator in the environment where there is limited heap memory or garbage collection can cause performance issue (e.g. index creation at loading time on Pinot Server).
-
-
Field Summary
-
Fields inherited from class org.apache.pinot.segment.local.segment.creator.impl.inv.geospatial.BaseH3IndexCreator
HEADER_LENGTH, VERSION
-
-
Constructor Summary
Constructors Constructor Description OffHeapH3IndexCreator(File indexDir, String columnName, H3IndexResolution resolution)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(org.locationtech.jts.geom.Geometry geometry)voidclose()voidseal()
-
-
-
Constructor Detail
-
OffHeapH3IndexCreator
public OffHeapH3IndexCreator(File indexDir, String columnName, H3IndexResolution resolution) throws IOException
- Throws:
IOException
-
-
Method Detail
-
add
public void add(org.locationtech.jts.geom.Geometry geometry) throws IOException- Specified by:
addin interfaceGeoSpatialIndexCreator- Overrides:
addin classBaseH3IndexCreator- Throws:
IOException
-
seal
public void seal() throws IOException- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classBaseH3IndexCreator- Throws:
IOException
-
-