Class RandomBalancerStrategy

    • Constructor Detail

      • RandomBalancerStrategy

        public RandomBalancerStrategy()
    • Method Detail

      • findServersToLoadSegment

        public Iterator<ServerHolder> findServersToLoadSegment​(org.apache.druid.timeline.DataSegment segmentToLoad,
                                                               List<ServerHolder> serverHolders)
        Description copied from interface: BalancerStrategy
        Finds the best servers to load the given segment. This method can be used both for placing the first copy of a segment in a tier or a replica of an already available segment.
        Specified by:
        findServersToLoadSegment in interface BalancerStrategy
        Returns:
        Iterator over the best servers (in order of preference) to load the segment.
      • findDestinationServerToMoveSegment

        public ServerHolder findDestinationServerToMoveSegment​(org.apache.druid.timeline.DataSegment segmentToMove,
                                                               ServerHolder sourceServer,
                                                               List<ServerHolder> serverHolders)
        Description copied from interface: BalancerStrategy
        Finds the best server from the list of destinationServers to load the segmentToMove, if it is moved from the sourceServer.

        In order to avoid unnecessary moves when the segment is already optimally placed, include the sourceServer in the list of destinationServers.

        Specified by:
        findDestinationServerToMoveSegment in interface BalancerStrategy
        Returns:
        The server to move to, or null if the segment is already optimally placed.