RussellSpitzer commented on a change in pull request #2501: URL: https://github.com/apache/iceberg/pull/2501#discussion_r618531447
########## File path: api/src/main/java/org/apache/iceberg/actions/compaction/DataCompactionStrategy.java ########## @@ -0,0 +1,85 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.iceberg.actions.compaction; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.apache.iceberg.DataFile; +import org.apache.iceberg.FileScanTask; +import org.apache.iceberg.Table; +import org.apache.iceberg.expressions.Expression; + +public interface DataCompactionStrategy extends Serializable { + /** + * Returns the name of this compaction strategy + */ + String name(); + + /** + * Returns a set of options which this compaction strategy can use. This is an allowed-list and any options not + * specified here will be rejected at runtime. + */ + Set<String> validOptions(); Review comment: I have a personal dislike of noop options, that is you can pass an option which cannot do anything. I feel like leads to a lot of errors with typos or using an option which is only valid in a separate configuration. In this case we may have a bunch of parameters for Sort that don't apply to BinPack, we don't want someone to think they are doing something if the options are actually useless. So mainly 1. Avoid typos doing nothing 2. Avoid options which are only valid for another compaction strategy -- 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. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
