Class EmptySegmentPruner
- java.lang.Object
-
- org.apache.pinot.broker.routing.segmentpruner.EmptySegmentPruner
-
- All Implemented Interfaces:
SegmentPruner
public class EmptySegmentPruner extends Object implements SegmentPruner
TheEmptySegmentPrunerprunes segments if they have 0 total docs. It does not prune segments with -1 total docs (that can be either error case or CONSUMING segment).
-
-
Constructor Summary
Constructors Constructor Description EmptySegmentPruner(org.apache.pinot.spi.config.table.TableConfig tableConfig, org.apache.helix.store.zk.ZkHelixPropertyStore<org.apache.helix.zookeeper.datamodel.ZNRecord> propertyStore)
-
Method Summary
Modifier and Type Method Description voidinit(org.apache.helix.model.IdealState idealState, org.apache.helix.model.ExternalView externalView, Set<String> onlineSegments)Initializes the segment pruner with the ideal state, external view and online segments (segments with ONLINE/CONSUMING instances in the ideal state and pre-selected by theSegmentPreSelector).voidonAssignmentChange(org.apache.helix.model.IdealState idealState, org.apache.helix.model.ExternalView externalView, Set<String> onlineSegments)Processes the segment assignment (ideal state or external view) change based on the given online segments (segments with ONLINE/CONSUMING instances in the ideal state and pre-selected by theSegmentPreSelector).Set<String>prune(org.apache.pinot.common.request.BrokerRequest brokerRequest, Set<String> segments)Prunes the segments queried by the given broker request, returns the selected segments to be queried.voidrefreshSegment(String segment)Refreshes the metadata for the given segment (called when segment is getting refreshed).
-
-
-
Method Detail
-
init
public void init(org.apache.helix.model.IdealState idealState, org.apache.helix.model.ExternalView externalView, Set<String> onlineSegments)Description copied from interface:SegmentPrunerInitializes the segment pruner with the ideal state, external view and online segments (segments with ONLINE/CONSUMING instances in the ideal state and pre-selected by theSegmentPreSelector). Should be called only once before calling other methods.- Specified by:
initin interfaceSegmentPruner
-
onAssignmentChange
public void onAssignmentChange(org.apache.helix.model.IdealState idealState, org.apache.helix.model.ExternalView externalView, Set<String> onlineSegments)Description copied from interface:SegmentPrunerProcesses the segment assignment (ideal state or external view) change based on the given online segments (segments with ONLINE/CONSUMING instances in the ideal state and pre-selected by theSegmentPreSelector).- Specified by:
onAssignmentChangein interfaceSegmentPruner
-
refreshSegment
public void refreshSegment(String segment)
Description copied from interface:SegmentPrunerRefreshes the metadata for the given segment (called when segment is getting refreshed).- Specified by:
refreshSegmentin interfaceSegmentPruner
-
prune
public Set<String> prune(org.apache.pinot.common.request.BrokerRequest brokerRequest, Set<String> segments)
Description copied from interface:SegmentPrunerPrunes the segments queried by the given broker request, returns the selected segments to be queried.- Specified by:
prunein interfaceSegmentPruner
-
-