yihua commented on code in PR #11951:
URL: https://github.com/apache/hudi/pull/11951#discussion_r1769466010
##########
hudi-spark-datasource/hudi-spark-common/src/main/java/org/apache/hudi/HoodieSparkIndexClient.java:
##########
@@ -56,24 +56,24 @@
import static
org.apache.hudi.metadata.HoodieTableMetadataUtil.PARTITION_NAME_SECONDARY_INDEX;
import static
org.apache.hudi.metadata.HoodieTableMetadataUtil.PARTITION_NAME_SECONDARY_INDEX_PREFIX;
-public class HoodieSparkFunctionalIndexClient extends
BaseHoodieFunctionalIndexClient {
+public class HoodieSparkIndexClient extends BaseHoodieIndexClient {
- private static final Logger LOG =
LoggerFactory.getLogger(HoodieSparkFunctionalIndexClient.class);
+ private static final Logger LOG =
LoggerFactory.getLogger(HoodieSparkIndexClient.class);
- private static volatile HoodieSparkFunctionalIndexClient _instance;
+ private static volatile HoodieSparkIndexClient _instance;
private final SparkSession sparkSession;
- private HoodieSparkFunctionalIndexClient(SparkSession sparkSession) {
+ private HoodieSparkIndexClient(SparkSession sparkSession) {
super();
this.sparkSession = sparkSession;
}
- public static HoodieSparkFunctionalIndexClient getInstance(SparkSession
sparkSession) {
+ public static HoodieSparkIndexClient getInstance(SparkSession sparkSession) {
if (_instance == null) {
- synchronized (HoodieSparkFunctionalIndexClient.class) {
+ synchronized (HoodieSparkIndexClient.class) {
if (_instance == null) {
- _instance = new HoodieSparkFunctionalIndexClient(sparkSession);
+ _instance = new HoodieSparkIndexClient(sparkSession);
Review Comment:
This logic is a bit weird for concurrency control. We should revisit it
later.
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/index/functional/BaseHoodieIndexClient.java:
##########
@@ -61,4 +62,9 @@ public void register(HoodieTableMetaClient metaClient, String
indexName, String
* Create a functional index.
*/
public abstract void create(HoodieTableMetaClient metaClient, String
indexName, String indexType, Map<String, Map<String, String>> columns,
Map<String, String> options);
+
+ /**
+ * Drop an index. By default, ignore drop if index does not exist.
+ */
+ public abstract void drop(HoodieTableMetaClient metaClient, String
indexName, MetadataPartitionType metadataPartitionType, boolean
ignoreIfNotExists);
Review Comment:
+1, could you consolidate `indexName` and `metadataPartitionType` into one
argument?
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/index/functional/BaseHoodieIndexClient.java:
##########
@@ -61,4 +62,9 @@ public void register(HoodieTableMetaClient metaClient, String
indexName, String
* Create a functional index.
*/
public abstract void create(HoodieTableMetaClient metaClient, String
indexName, String indexType, Map<String, Map<String, String>> columns,
Map<String, String> options);
+
+ /**
+ * Drop an index. By default, ignore drop if index does not exist.
+ */
+ public abstract void drop(HoodieTableMetaClient metaClient, String
indexName, MetadataPartitionType metadataPartitionType, boolean
ignoreIfNotExists);
Review Comment:
Is there a case we need to set different `ignoreIfNotExists`? If not, can
we remove the argument too?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]