[ 
https://issues.apache.org/jira/browse/HIVE-24729?focusedWorklogId=573379&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-573379
 ]

ASF GitHub Bot logged work on HIVE-24729:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 29/Mar/21 09:31
            Start Date: 29/Mar/21 09:31
    Worklog Time Spent: 10m 
      Work Description: szlta commented on a change in pull request #2106:
URL: https://github.com/apache/hive/pull/2106#discussion_r603131868



##########
File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
##########
@@ -4648,6 +4648,12 @@ private static void 
populateLlapDaemonVarsSet(Set<String> llapDaemonVarsSetLocal
     LLAP_LRFU_BP_WRAPPER_SIZE("hive.llap.io.lrfu.bp.wrapper.size", 64, "thread 
local queue "
         + "used to amortize the lock contention, the idea hear is to try 
locking as soon we reach max size / 2 "
         + "and block when max queue size reached"),
+    LLAP_CACHE_REPL_STRATEGY_CLASS("hive.llap.cache.repl.strategy.class", "", 
"Strategy class for managing the "

Review comment:
       Isn't this feature rather about the more general 'hydration' than 
replication?

##########
File path: 
llap-server/src/java/org/apache/hadoop/hive/llap/cache/BasicLlapCacheReplication.java
##########
@@ -0,0 +1,125 @@
+/*
+ * 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.hadoop.hive.llap.cache;
+
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hive.conf.HiveConf;
+import org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos;
+import org.apache.hadoop.hive.llap.io.api.LlapIo;
+import org.apache.hadoop.hive.llap.io.api.LlapProxy;
+import org.apache.hadoop.hive.registry.RegistryUtilities;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+
+import static org.apache.hadoop.hive.conf.HiveConf.ConfVars;
+
+/**
+ * Simple cache replication strategy which saves the content info of the cache 
to a file on the local filesystem on
+ * shutdown, and loads it when the daemon starts.
+ */
+public class BasicLlapCacheReplication implements LlapCacheReplication {

Review comment:
       Same question of naming like above in HiveConf

##########
File path: 
llap-server/src/java/org/apache/hadoop/hive/llap/cache/LlapCacheReplication.java
##########
@@ -0,0 +1,79 @@
+/*
+ * 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.hadoop.hive.llap.cache;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.hadoop.conf.Configurable;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hive.conf.HiveConf;
+import org.apache.hadoop.hive.conf.HiveConf.ConfVars;
+import org.apache.hive.common.util.ReflectionUtil;
+import org.apache.hive.common.util.ShutdownHookManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Interface to manage the cache content info, so that it can be saved on 
shutdown and loaded on startup.
+ */
+public interface LlapCacheReplication extends Configurable {
+
+  Logger LOG = LoggerFactory.getLogger(LlapCacheReplication.class);
+
+  /**
+   * Save the state of the cache. Will be attached to the shutdown hook.

Review comment:
       Perhaps we could make it configurable: certain strategies will want to 
have save() invoked in a shutdown hook, other maybe don't. This could be easily 
achieved by adding a new method in this API that strategies could implement, 
such as:
   default boolean shouldSaveDuringShutdown() { return false/true;}




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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 573379)
    Time Spent: 20m  (was: 10m)

> Implement strategy for llap cache hydration
> -------------------------------------------
>
>                 Key: HIVE-24729
>                 URL: https://issues.apache.org/jira/browse/HIVE-24729
>             Project: Hive
>          Issue Type: Sub-task
>            Reporter: Antal Sinkovits
>            Assignee: Antal Sinkovits
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to