jsbali commented on a change in pull request #2542:
URL: https://github.com/apache/hudi/pull/2542#discussion_r651114060



##########
File path: 
hudi-common/src/main/java/org/apache/hudi/common/table/HoodieTableGloballyConsistentMetaClient.java
##########
@@ -0,0 +1,114 @@
+/*
+ * 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.hudi.common.table;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.mapred.JobConf;
+import org.apache.hudi.common.fs.ConsistencyGuardConfig;
+import org.apache.hudi.common.table.timeline.versioning.TimelineLayoutVersion;
+import org.apache.hudi.common.table.timeline.HoodieTimeline;
+import org.apache.hudi.common.table.timeline.HoodieInstant;
+import org.apache.hudi.common.util.Option;
+import org.apache.hudi.common.util.StringUtils;
+import org.apache.hudi.exception.TableNotFoundException;
+import org.apache.log4j.LogManager;
+import org.apache.log4j.Logger;
+
+/*
+ * Uber specific version of HoodieTableMetaClient to make sure when a table 
level property is set
+ * to indicate a commit timestamp that is present across DC make sure to limit 
the local .hoodie
+ * timeline to upto that commit timestamp.
+ *
+ * Note: There is an assumption that this means every other commit
+ * that is present upto this commit is present globally. This assumption makes 
it easier to just
+ * trim the commit timeline at the head. Otherwise we will have to store the 
valid commit timeline
+ * in the table as a property.
+ *
+ * Note: This object should not be cached between mapreduce jobs since the 
jobConf can change
+ */
+public class HoodieTableGloballyConsistentMetaClient extends 
HoodieTableMetaClient {

Review comment:
       The file can be removed which I have done. There are few issues which 
are there if hoodie.consume is used for trimming the timeline. For example 
suppose the following confs are set. 
   1. read global as true
   2. last_rep time as 100
   3. include_pending commit true
   4. commit time 200. 
   Now the question is what takes precedence over what. Do we check if 3 and 4 
are set before using consume.commit for global reads. What should the order be. 
   For now I have kept both separate and global read takes precedence but happy 
to hear your thoughts. 




-- 
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:
us...@infra.apache.org


Reply via email to