Class ImmutableSegmentLoader
- java.lang.Object
-
- org.apache.pinot.segment.local.indexsegment.immutable.ImmutableSegmentLoader
-
public class ImmutableSegmentLoader extends Object
-
-
Method Summary
Modifier and Type Method Description static ImmutableSegmentload(File indexDir, IndexLoadingConfig indexLoadingConfig)Loads the segment with empty schema but a specified IndexLoadingConfig.static ImmutableSegmentload(File indexDir, IndexLoadingConfig indexLoadingConfig, Schema schema)Loads the segment with specified schema and IndexLoadingConfig, usually from Zookeeper.static ImmutableSegmentload(File indexDir, IndexLoadingConfig indexLoadingConfig, Schema schema, boolean needPreprocess)Loads the segment with specified schema and IndexLoadingConfig, and allows to control whether to modify the segment like to convert segment format, add or remove indices.static ImmutableSegmentload(File indexDir, ReadMode readMode)Loads the segment with empty schema and IndexLoadingConfig.static ImmutableSegmentload(SegmentDirectory segmentDirectory, IndexLoadingConfig indexLoadingConfig, Schema schema)Load the segment represented by the SegmentDirectory object to serve queries.static booleanneedPreprocess(SegmentDirectory segmentDirectory, IndexLoadingConfig indexLoadingConfig, Schema schema)Check segment directory against the table config and schema to see if any preprocessing is needed, like changing segment format, adding new indices or updating default columns.static voidpreprocess(File indexDir, IndexLoadingConfig indexLoadingConfig, Schema schema)Preprocess the local segment directory according to the current table config and schema.
-
-
-
Method Detail
-
load
public static ImmutableSegment load(File indexDir, ReadMode readMode) throws Exception
Loads the segment with empty schema and IndexLoadingConfig. This method is used to access the segment without modifying it, i.e. in read-only mode.- Throws:
Exception
-
load
public static ImmutableSegment load(File indexDir, IndexLoadingConfig indexLoadingConfig) throws Exception
Loads the segment with empty schema but a specified IndexLoadingConfig. This method modifies the segment like to convert segment format, add or remove indices. Mostly used by UT cases to add some specific index for testing purpose.- Throws:
Exception
-
load
public static ImmutableSegment load(File indexDir, IndexLoadingConfig indexLoadingConfig, @Nullable Schema schema) throws Exception
Loads the segment with specified schema and IndexLoadingConfig, usually from Zookeeper. This method modifies the segment like to convert segment format, add or remove indices. Mainly used during segment reloading.- Throws:
Exception
-
load
public static ImmutableSegment load(File indexDir, IndexLoadingConfig indexLoadingConfig, @Nullable Schema schema, boolean needPreprocess) throws Exception
Loads the segment with specified schema and IndexLoadingConfig, and allows to control whether to modify the segment like to convert segment format, add or remove indices.- Throws:
Exception
-
preprocess
public static void preprocess(File indexDir, IndexLoadingConfig indexLoadingConfig, @Nullable Schema schema) throws Exception
Preprocess the local segment directory according to the current table config and schema.- Throws:
Exception
-
load
public static ImmutableSegment load(SegmentDirectory segmentDirectory, IndexLoadingConfig indexLoadingConfig, @Nullable Schema schema) throws Exception
Load the segment represented by the SegmentDirectory object to serve queries.- Throws:
Exception
-
needPreprocess
public static boolean needPreprocess(SegmentDirectory segmentDirectory, IndexLoadingConfig indexLoadingConfig, @Nullable Schema schema) throws Exception
Check segment directory against the table config and schema to see if any preprocessing is needed, like changing segment format, adding new indices or updating default columns.- Throws:
Exception
-
-