Package org.apache.gravitino.policy
Class PolicyContents
java.lang.Object
org.apache.gravitino.policy.PolicyContents
Utility class for creating instances of
PolicyContent.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA custom content implementation ofPolicyContentthat holds custom rules and properties. -
Method Summary
Modifier and TypeMethodDescriptionstatic PolicyContentcustom(Map<String, Object> rules, Set<MetadataObject.Type> supportedObjectTypes, Map<String, String> properties) Creates a custom policy content with the given rules and properties.static PolicyContentCreates an iceberg compaction policy content with default values.static PolicyContenticebergDataCompaction(long minDataFileMse, long minDeleteFileNumber, long dataFileMseWeight, long deleteFileNumberWeight, long maxPartitionNum, Map<String, String> rewriteOptions) Creates an iceberg compaction policy content with configurable score weights.static PolicyContenticebergDataCompaction(long minDataFileMse, long minDeleteFileNumber, Map<String, String> rewriteOptions) Creates an iceberg compaction policy content.
-
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
PolicyContentwith the specified rules and properties.
-
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-mseminDeleteFileNumber- minimum threshold for custom-delete-file-numberrewriteOptions- 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-mseminDeleteFileNumber- minimum threshold for custom-delete-file-numberdataFileMseWeight- weight used for custom-data-file-mse score contributiondeleteFileNumberWeight- weight used for custom-delete-file-number score contributionmaxPartitionNum- maximum partition number selected for compactionrewriteOptions- rewrite options forwarded as job.options.*- Returns:
- iceberg compaction policy content
-