Interface BalancerStrategy

    • Method Detail

      • findDestinationServerToMoveSegment

        @Nullable
        ServerHolder findDestinationServerToMoveSegment​(org.apache.druid.timeline.DataSegment segmentToMove,
                                                        ServerHolder sourceServer,
                                                        List<ServerHolder> destinationServers)
        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.

        Returns:
        The server to move to, or null if the segment is already optimally placed.
      • findServersToLoadSegment

        Iterator<ServerHolder> findServersToLoadSegment​(org.apache.druid.timeline.DataSegment segmentToLoad,
                                                        List<ServerHolder> serverHolders)
        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.
        Returns:
        Iterator over the best servers (in order of preference) to load the segment.
      • findServersToDropSegment

        Iterator<ServerHolder> findServersToDropSegment​(org.apache.druid.timeline.DataSegment segmentToDrop,
                                                        List<ServerHolder> serverHolders)
        Finds the best servers to drop the given segment.
        Returns:
        Iterator over the servers (in order of preference) to drop the segment