You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/03/29 10:14:59 UTC

[GitHub] [hive] asinkovits commented on a change in pull request #2106: HIVE-24729: Implement strategy for llap cache hydration

asinkovits commented on a change in pull request #2106:
URL: https://github.com/apache/hive/pull/2106#discussion_r603173702



##########
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:
       I do have a feeling that shouldSaveDuringShutdown is a bit too specific to be exposed on the interface. 
   As an alternative suggestion would be, to expose an init method on the interface which will be called after the reflection initialises the configured class. So the class can decide what to do. eg subscribe itself to the shutdown hook or not etc.
   What do you think?




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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org