@@ -2048,18 +2048,78 @@ public boolean useBloomIndexBucketizedChecking() {
2048
2048
return getBoolean (HoodieIndexConfig .BLOOM_INDEX_BUCKETIZED_CHECKING );
2049
2049
}
2050
2050
2051
+ /**
2052
+ * Determines if the metadata bloom filter index is enabled.
2053
+ *
2054
+ * <p>The bloom filter index is enabled if:
2055
+ * <ul>
2056
+ * <li>The metadata table is enabled and bloom filter index is enabled in the metadata configuration, or</li>
2057
+ * <li>The bloom filter index is not explicitly marked for dropping in the metadata configuration.</li>
2058
+ * </ul>
2059
+ *
2060
+ * @return {@code true} if the metadata bloom filter index is enabled, {@code false} otherwise.
2061
+ */
2051
2062
public boolean isMetadataBloomFilterIndexEnabled () {
2052
2063
return isMetadataTableEnabled () && getMetadataConfig ().isBloomFilterIndexEnabled () || !isDropMetadataIndex (MetadataPartitionType .BLOOM_FILTERS .getPartitionPath ());
2053
2064
}
2054
2065
2066
+ /**
2067
+ * Determines if the metadata column stats index is enabled.
2068
+ *
2069
+ * <p>The column stats index is enabled if:
2070
+ * <ul>
2071
+ * <li>The metadata table is enabled and column stats index is enabled in the metadata configuration, or</li>
2072
+ * <li>The column stats index is not explicitly marked for dropping in the metadata configuration.</li>
2073
+ * </ul>
2074
+ *
2075
+ * @return {@code true} if the metadata column stats index is enabled, {@code false} otherwise.
2076
+ */
2055
2077
public boolean isMetadataColumnStatsIndexEnabled () {
2056
2078
return isMetadataTableEnabled () && getMetadataConfig ().isColumnStatsIndexEnabled () || !isDropMetadataIndex (MetadataPartitionType .COLUMN_STATS .getPartitionPath ());
2057
2079
}
2058
2080
2081
+ /**
2082
+ * Determines if the partition stats index is enabled.
2083
+ *
2084
+ * <p>The partition stats index is enabled if:
2085
+ * <ul>
2086
+ * <li>The metadata table is enabled and partition stats index is enabled in the metadata configuration, or</li>
2087
+ * <li>The partition stats index is not explicitly marked for dropping in the metadata configuration.</li>
2088
+ * </ul>
2089
+ *
2090
+ * @return {@code true} if the partition stats index is enabled, {@code false} otherwise.
2091
+ */
2059
2092
public boolean isPartitionStatsIndexEnabled () {
2060
2093
return isMetadataTableEnabled () && getMetadataConfig ().isPartitionStatsIndexEnabled () || !isDropMetadataIndex (MetadataPartitionType .PARTITION_STATS .getPartitionPath ());
2061
2094
}
2062
2095
2096
+ /**
2097
+ * Determines if the record index is enabled.
2098
+ *
2099
+ * <p>The record index is enabled if:
2100
+ * <ul>
2101
+ * <li>The record index is enabled in the metadata configuration, or</li>
2102
+ * <li>The record index is not explicitly marked for dropping in the metadata configuration.</li>
2103
+ * </ul>
2104
+ *
2105
+ * @return {@code true} if the record index is enabled, {@code false} otherwise.
2106
+ */
2107
+ public boolean isRecordIndexEnabled () {
2108
+ return metadataConfig .isRecordIndexEnabled () || !isDropMetadataIndex (MetadataPartitionType .RECORD_INDEX .getPartitionPath ());
2109
+ }
2110
+
2111
+ /**
2112
+ * Checks if a specific metadata index is marked for dropping based on the metadata configuration.
2113
+ *
2114
+ * <p>An index is considered marked for dropping if:
2115
+ * <ul>
2116
+ * <li>The metadata configuration specifies a non-empty index to drop, and</li>
2117
+ * <li>The specified index matches the given index name.</li>
2118
+ * </ul>
2119
+ *
2120
+ * @param indexName the name of the metadata index to check
2121
+ * @return {@code true} if the specified metadata index is marked for dropping, {@code false} otherwise.
2122
+ */
2063
2123
public boolean isDropMetadataIndex (String indexName ) {
2064
2124
return StringUtils .nonEmpty (getMetadataConfig ().getMetadataIndexToDrop ()) && getMetadataConfig ().getMetadataIndexToDrop ().equals (indexName );
2065
2125
}
@@ -2569,10 +2629,6 @@ public boolean isLogCompactionEnabledOnMetadata() {
2569
2629
return getBoolean (HoodieMetadataConfig .ENABLE_LOG_COMPACTION_ON_METADATA_TABLE );
2570
2630
}
2571
2631
2572
- public boolean isRecordIndexEnabled () {
2573
- return metadataConfig .isRecordIndexEnabled () || !isDropMetadataIndex (MetadataPartitionType .RECORD_INDEX .getPartitionPath ());
2574
- }
2575
-
2576
2632
public int getRecordIndexMinFileGroupCount () {
2577
2633
return metadataConfig .getRecordIndexMinFileGroupCount ();
2578
2634
}
0 commit comments