Skip to content

Commit 0c0d9b4

Browse files
committed
address feedback, javadoc
1 parent 7020573 commit 0c0d9b4

File tree

1 file changed

+60
-4
lines changed

1 file changed

+60
-4
lines changed

Diff for: hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieWriteConfig.java

+60-4
Original file line numberDiff line numberDiff line change
@@ -2048,18 +2048,78 @@ public boolean useBloomIndexBucketizedChecking() {
20482048
return getBoolean(HoodieIndexConfig.BLOOM_INDEX_BUCKETIZED_CHECKING);
20492049
}
20502050

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+
*/
20512062
public boolean isMetadataBloomFilterIndexEnabled() {
20522063
return isMetadataTableEnabled() && getMetadataConfig().isBloomFilterIndexEnabled() || !isDropMetadataIndex(MetadataPartitionType.BLOOM_FILTERS.getPartitionPath());
20532064
}
20542065

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+
*/
20552077
public boolean isMetadataColumnStatsIndexEnabled() {
20562078
return isMetadataTableEnabled() && getMetadataConfig().isColumnStatsIndexEnabled() || !isDropMetadataIndex(MetadataPartitionType.COLUMN_STATS.getPartitionPath());
20572079
}
20582080

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+
*/
20592092
public boolean isPartitionStatsIndexEnabled() {
20602093
return isMetadataTableEnabled() && getMetadataConfig().isPartitionStatsIndexEnabled() || !isDropMetadataIndex(MetadataPartitionType.PARTITION_STATS.getPartitionPath());
20612094
}
20622095

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+
*/
20632123
public boolean isDropMetadataIndex(String indexName) {
20642124
return StringUtils.nonEmpty(getMetadataConfig().getMetadataIndexToDrop()) && getMetadataConfig().getMetadataIndexToDrop().equals(indexName);
20652125
}
@@ -2569,10 +2629,6 @@ public boolean isLogCompactionEnabledOnMetadata() {
25692629
return getBoolean(HoodieMetadataConfig.ENABLE_LOG_COMPACTION_ON_METADATA_TABLE);
25702630
}
25712631

2572-
public boolean isRecordIndexEnabled() {
2573-
return metadataConfig.isRecordIndexEnabled() || !isDropMetadataIndex(MetadataPartitionType.RECORD_INDEX.getPartitionPath());
2574-
}
2575-
25762632
public int getRecordIndexMinFileGroupCount() {
25772633
return metadataConfig.getRecordIndexMinFileGroupCount();
25782634
}

0 commit comments

Comments
 (0)