aokolnychyi commented on a change in pull request #2255:
URL: https://github.com/apache/iceberg/pull/2255#discussion_r579493447



##########
File path: api/src/main/java/org/apache/iceberg/actions/ConfigurableAction.java
##########
@@ -0,0 +1,46 @@
+/*
+ * 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;
+
+import java.util.Map;
+
+/**
+ * An action performed on a table that accepts options that control the 
execution.
+ *
+ * @param <R> the Java type of the result produced by this action
+ */
+public interface ConfigurableAction<ThisT, R> extends Action<R> {
+  /**
+   * Configures this action with an extra option.
+   *
+   * @param name an option name
+   * @param value an option value
+   * @return this for method chaining
+   */
+  ThisT withOption(String name, String value);

Review comment:
       There will be configs specific to engines. For example, whether to use 
`toLocalIterator` in Spark or not. It does not make sense to expose such a 
method in this API as other engines may not support it.
   
   There are two approaches we can take:
   - Support a map of options in the API and parse those options in 
implementations.
   - Have engine-specific interfaces that extend base action interfaces. For 
example, `ExpireSnapshotsSparkAction` will extend `ExpireSnapshotsAction`.
   
   I went with the first option as it seems simpler. I can reconsider depending 
on what the community thinks.




----------------------------------------------------------------
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]

Reply via email to