Class PolicyContents

java.lang.Object
org.apache.gravitino.policy.PolicyContents

public class PolicyContents extends Object
Utility class for creating instances of PolicyContent.
  • Method Details

    • custom

      public static PolicyContent custom(Map<String,Object> rules, Set<MetadataObject.Type> supportedObjectTypes, Map<String,String> properties)
      Creates a custom policy content with the given rules and properties.
      Parameters:
      rules - The custom rules of the policy.
      supportedObjectTypes - The set of metadata object types that the policy can be applied to.
      properties - The additional properties of the policy.
      Returns:
      A new instance of PolicyContent with the specified rules and properties.
    • icebergDataCompaction

      public static PolicyContent icebergDataCompaction()
      Creates an iceberg compaction policy content with default values.
      Returns:
      iceberg compaction policy content with defaults
    • icebergDataCompaction

      public static PolicyContent icebergDataCompaction(long minDataFileMse, long minDeleteFileNumber, Map<String,String> rewriteOptions)
      Creates an iceberg compaction policy content.
      Parameters:
      minDataFileMse - minimum threshold for custom-data-file-mse
      minDeleteFileNumber - minimum threshold for custom-delete-file-number
      rewriteOptions - rewrite options forwarded as job.options.*
      Returns:
      iceberg compaction policy content
    • icebergDataCompaction

      public static PolicyContent icebergDataCompaction(long minDataFileMse, long minDeleteFileNumber, long dataFileMseWeight, long deleteFileNumberWeight, long maxPartitionNum, Map<String,String> rewriteOptions)
      Creates an iceberg compaction policy content with configurable score weights.
      Parameters:
      minDataFileMse - minimum threshold for custom-data-file-mse
      minDeleteFileNumber - minimum threshold for custom-delete-file-number
      dataFileMseWeight - weight used for custom-data-file-mse score contribution
      deleteFileNumberWeight - weight used for custom-delete-file-number score contribution
      maxPartitionNum - maximum partition number selected for compaction
      rewriteOptions - rewrite options forwarded as job.options.*
      Returns:
      iceberg compaction policy content