Class BrokerRoutingManager

    • Constructor Detail

      • BrokerRoutingManager

        public BrokerRoutingManager​(org.apache.pinot.common.metrics.BrokerMetrics brokerMetrics,
                                    ServerRoutingStatsManager serverRoutingStatsManager,
                                    org.apache.pinot.spi.env.PinotConfiguration pinotConfig)
    • Method Detail

      • init

        public void init​(org.apache.helix.HelixManager helixManager)
        Description copied from interface: ClusterChangeHandler
        Initializes the cluster change handler with the given connected Helix manager.
        Specified by:
        init in interface ClusterChangeHandler
      • processClusterChange

        public void processClusterChange​(org.apache.helix.HelixConstants.ChangeType changeType)
        Description copied from interface: ClusterChangeHandler
        Processes the cluster change of the given type (e.g. EXTERNAL_VIEW, INSTANCE_CONFIG, LIVE_INSTANCE).
        Specified by:
        processClusterChange in interface ClusterChangeHandler
      • excludeServerFromRouting

        public void excludeServerFromRouting​(String instanceId)
        Excludes a server from the routing.
      • includeServerToRouting

        public void includeServerToRouting​(String instanceId)
        Includes a previous excluded server to the routing.
      • buildRouting

        public void buildRouting​(String tableNameWithType)
        Builds/rebuilds the routing for the given table.
      • removeRouting

        public void removeRouting​(String tableNameWithType)
        Removes the routing for the given table.
      • refreshSegment

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

        public boolean routingExists​(String tableNameWithType)
        Returns true if the routing exists for the given table.
        Specified by:
        routingExists in interface RoutingManager
      • getRoutingTable

        @Nullable
        public RoutingTable getRoutingTable​(org.apache.pinot.common.request.BrokerRequest brokerRequest,
                                            long requestId)
        Returns the routing table (a map from server instance to list of segments hosted by the server, and a list of unavailable segments) based on the broker request, or null if the routing does not exist.

        NOTE: The broker request should already have the table suffix (_OFFLINE or _REALTIME) appended.

        Specified by:
        getRoutingTable in interface RoutingManager
      • getTimeBoundaryInfo

        @Nullable
        public TimeBoundaryInfo getTimeBoundaryInfo​(String offlineTableName)
        Returns the time boundary info for the given offline table, or null if the routing or time boundary does not exist.

        NOTE: Time boundary info is only available for the offline part of the hybrid table.

        Specified by:
        getTimeBoundaryInfo in interface RoutingManager
      • getQueryTimeoutMs

        @Nullable
        public Long getQueryTimeoutMs​(String tableNameWithType)
        Returns the table-level query timeout in milliseconds for the given table, or null if the timeout is not configured in the table config.