rdblue commented on a change in pull request #2466:
URL: https://github.com/apache/iceberg/pull/2466#discussion_r612043190



##########
File path: 
spark3/src/main/java/org/apache/iceberg/spark/DataCompactionJobCoordinator.java
##########
@@ -0,0 +1,108 @@
+/*
+ * 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.spark;
+
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.stream.Collectors;
+import org.apache.iceberg.DataFile;
+import org.apache.iceberg.FileScanTask;
+import org.apache.iceberg.HasTableOperations;
+import org.apache.iceberg.Table;
+import org.apache.iceberg.TableOperations;
+import org.apache.iceberg.relocated.com.google.common.collect.Maps;
+import org.apache.iceberg.util.Pair;
+
+public class DataCompactionJobCoordinator {
+
+  private static final Map<Pair<String, String>, List<FileScanTask>> TASKS = 
Maps.newHashMap();
+  private static final Map<Pair<String, String>, List<DataFile>> 
NEW_DATA_FILES = Maps.newHashMap();
+
+  private DataCompactionJobCoordinator() {
+  }

Review comment:
       Rather than using static maps, I think we should create a coordinator 
class and use a singleton instance. That adds flexibility because you can 
update it to have more than one instance when necessary. For example, Spark 
could use an instance per Spark session using a session object ID to lookup the 
coordinator in a static map.




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