wangxianghu commented on a change in pull request #1827:
URL: https://github.com/apache/hudi/pull/1827#discussion_r485016294



##########
File path: 
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/client/embedded/SparkEmbeddedTimelineService.java
##########
@@ -0,0 +1,51 @@
+/*
+ * 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.client.embedded;
+
+import org.apache.hudi.client.embebbed.BaseEmbeddedTimelineService;
+import org.apache.hudi.common.HoodieEngineContext;
+import org.apache.hudi.common.HoodieSparkEngineContext;
+import org.apache.hudi.common.table.view.FileSystemViewStorageConfig;
+import org.apache.log4j.LogManager;
+import org.apache.log4j.Logger;
+import org.apache.spark.SparkConf;
+
+/**
+ * Spark implementation of Timeline Service.
+ */
+public class SparkEmbeddedTimelineService extends BaseEmbeddedTimelineService {
+
+  private static final Logger LOG = 
LogManager.getLogger(SparkEmbeddedTimelineService.class);
+
+  public SparkEmbeddedTimelineService(HoodieEngineContext context, 
FileSystemViewStorageConfig config) {
+    super(context, config);
+  }
+
+  @Override
+  public void setHostAddrFromContext(HoodieEngineContext context) {
+    SparkConf sparkConf = 
HoodieSparkEngineContext.getSparkContext(context).getConf();
+    String hostAddr = sparkConf.get("spark.driver.host", null);

Review comment:
       > I think we can eliminate the need for breaking this up into spark vs 
non-spark, by just passing in the host. This class does not make much sense 
being broken up.
   
   done, add `hoodie.embed.timeline.server.host` to `HoodieWriteConfig`,  it 
can be obtained via method `getEmbeddedServerHost()`
   This is not the same as before(acquired from sparkConf). users who enabled 
the embedded timeline service should config this `hostaddr` additionally.




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