Class TimeBoundaryManager


  • public class TimeBoundaryManager
    extends Object
    The TimeBoundaryManager class manages the time boundary information for a table.

    TODO: Support SDF (simple date format) time column

    • Constructor Summary

      Constructors 
      Constructor Description
      TimeBoundaryManager​(org.apache.pinot.spi.config.table.TableConfig tableConfig, org.apache.helix.store.zk.ZkHelixPropertyStore<org.apache.helix.zookeeper.datamodel.ZNRecord> propertyStore, org.apache.pinot.common.metrics.BrokerMetrics brokerMetrics)  
    • Method Summary

      Modifier and Type Method Description
      TimeBoundaryInfo getTimeBoundaryInfo()  
      void init​(org.apache.helix.model.IdealState idealState, org.apache.helix.model.ExternalView externalView, Set<String> onlineSegments)
      Initializes the time boundary manager with the ideal state, external view and online segments (segments with ONLINE/CONSUMING instances in the ideal state and pre-selected by the SegmentPreSelector).
      void onAssignmentChange​(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 the SegmentPreSelector).
      void refreshSegment​(String segment)
      Refreshes the metadata for the given segment (called when segment is getting refreshed).
    • Constructor Detail

      • TimeBoundaryManager

        public TimeBoundaryManager​(org.apache.pinot.spi.config.table.TableConfig tableConfig,
                                   org.apache.helix.store.zk.ZkHelixPropertyStore<org.apache.helix.zookeeper.datamodel.ZNRecord> propertyStore,
                                   org.apache.pinot.common.metrics.BrokerMetrics brokerMetrics)
    • Method Detail

      • init

        public void init​(org.apache.helix.model.IdealState idealState,
                         org.apache.helix.model.ExternalView externalView,
                         Set<String> onlineSegments)
        Initializes the time boundary manager with the ideal state, external view and online segments (segments with ONLINE/CONSUMING instances in the ideal state and pre-selected by the SegmentPreSelector). Should be called only once before calling other methods.

        NOTE: idealState and externalView are unused, but intentionally passed in in case they are needed in the future.

      • onAssignmentChange

        public void onAssignmentChange​(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 the SegmentPreSelector).

        NOTE: We don't update all the segment ZK metadata for every external view change, but only the new added/removed ones. The refreshed segment ZK metadata change won't be picked up.

        NOTE: idealState is unused, but intentionally passed in in case it is needed in the future.

      • refreshSegment

        public void refreshSegment​(String segment)
        Refreshes the metadata for the given segment (called when segment is getting refreshed).