Class ExternalCompactionUtil


  • public class ExternalCompactionUtil
    extends Object
    • Constructor Detail

      • ExternalCompactionUtil

        public ExternalCompactionUtil()
    • Method Detail

      • getHostPortString

        public static String getHostPortString​(HostAndPort address)
        Utility for returning the address of a service in the form host:port
        Parameters:
        address - HostAndPort of service
        Returns:
        host and port
      • findCompactionCoordinator

        public static Optional<HostAndPort> findCompactionCoordinator​(ClientContext context)
        Returns:
        Optional HostAndPort of Coordinator node if found
      • getRunningCompaction

        public static TExternalCompactionJob getRunningCompaction​(HostAndPort compactorAddr,
                                                                  ClientContext context)
        Get the compaction currently running on the Compactor
        Parameters:
        compactorAddr - compactor address
        context - context
        Returns:
        external compaction job or null if none running
      • getCompactionsRunningOnCompactors

        public static List<RunningCompaction> getCompactionsRunningOnCompactors​(ClientContext context)
        This method returns information from the Compactor about the job that is currently running. The RunningCompactions are not fully populated. This method is used from the CompactionCoordinator on a restart to re-populate the set of running compactions on the compactors.
        Parameters:
        context - server context
        Returns:
        map of compactor and external compaction jobs
      • countCompactors

        public static int countCompactors​(String queueName,
                                          ClientContext context)