Class CompactConfig

  • All Implemented Interfaces:
    JobConfig, PlanConfig, java.io.Serializable

    @ThreadSafe
    public final class CompactConfig
    extends java.lang.Object
    implements PlanConfig
    Configuration for a job to compact files directly under a directory. Files will be compacted into a certain number of files, if the number of existing files is less than the specified number, then no compaction happens, otherwise, assume we want to compact 100 files to 10 files, then every 10 files will be compacted into one file. The original order of rows is preserved.
    See Also:
    Serialized Form
    • Constructor Detail

      • CompactConfig

        public CompactConfig​(PartitionInfo inputPartitionInfo,
                             java.lang.String input,
                             PartitionInfo outputPartitionInfo,
                             java.lang.String output,
                             java.lang.Integer maxNumFiles,
                             java.lang.Long minFileSize)
        Parameters:
        inputPartitionInfo - the input partition info
        input - the input directory
        outputPartitionInfo - the output partition info
        output - the output directory
        maxNumFiles - the maximum number of files after compaction
        minFileSize - the minimum file size for coalescing
    • Method Detail

      • getInputPartitionInfo

        public PartitionInfo getInputPartitionInfo()
        Returns:
        the input partition info
      • getOutputPartitionInfo

        public PartitionInfo getOutputPartitionInfo()
        Returns:
        the output partition info
      • getInput

        public java.lang.String getInput()
        Returns:
        the input directory
      • getOutput

        public java.lang.String getOutput()
        Returns:
        the output directory
      • getMaxNumFiles

        public int getMaxNumFiles()
        Returns:
        the number of files after compaction
      • getMinFileSize

        public long getMinFileSize()
        Returns:
        the file size
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface JobConfig
        Returns:
        the name of the job
      • affectedPaths

        public java.util.Collection<java.lang.String> affectedPaths()
        Specified by:
        affectedPaths in interface JobConfig
        Returns:
        list of affected paths