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

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

                Author: ASF GitHub Bot
            Created on: 19/Dec/22 22:58
            Start Date: 19/Dec/22 22:58
    Worklog Time Spent: 10m 
      Work Description: saihemanth-cloudera commented on code in PR #3861:
URL: https://github.com/apache/hive/pull/3861#discussion_r1052713752


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/events/ReloadEvent.java:
##########
@@ -0,0 +1,106 @@
+/*
+ * 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.metastore.events;
+
+import com.google.common.collect.Lists;
+import org.apache.hadoop.classification.InterfaceAudience;
+import org.apache.hadoop.classification.InterfaceStability;
+import org.apache.hadoop.hive.metastore.IHMSHandler;
+import org.apache.hadoop.hive.metastore.api.ClientCapabilities;
+import org.apache.hadoop.hive.metastore.api.ClientCapability;
+import org.apache.hadoop.hive.metastore.api.GetTableRequest;
+import org.apache.hadoop.hive.metastore.api.MetaException;
+import org.apache.hadoop.hive.metastore.api.NoSuchObjectException;
+import org.apache.hadoop.hive.metastore.api.Partition;
+import org.apache.hadoop.hive.metastore.api.Table;
+import org.apache.hadoop.hive.metastore.utils.MetaStoreUtils;
+import org.apache.thrift.TException;
+
+import java.util.List;
+import java.util.Map;
+
[email protected]
[email protected]
+public class ReloadEvent extends ListenerEvent {
+    private final Table tableObj;
+    private final Partition ptnObj;
+    private final boolean refreshEvent;
+
+    /**
+     * @param catName name of the catalog
+     * @param db name of the database the table is in
+     * @param table name of the table being inserted into
+     * @param partVals list of partition values, can be null
+     * @param status status of insert, true = success, false = failure
+     * @param refreshEvent status of insert,
+     * @param handler handler that is firing the event
+     */
+    public ReloadEvent(String catName, String db, String table, List<String> 
partVals, boolean status,
+                       boolean refreshEvent, Map<String, String> tblParams, 
IHMSHandler handler) throws MetaException,
+            NoSuchObjectException {
+        super(status, handler);
+
+        GetTableRequest req = new GetTableRequest(db, table);

Review Comment:
   The client will use this table/partition object from the event for further 
processing. The Client will check if the table in the event is up-to-date using 
the latest notification id of the table, if so it'll directly use this table 
object from the event, or else it'll fetch from HMS.





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

    Worklog Id:     (was: 834627)
    Time Spent: 1h 40m  (was: 1.5h)

> Add a new event to improve cache performance in external systems that 
> communicates with HMS.
> --------------------------------------------------------------------------------------------
>
>                 Key: HIVE-26838
>                 URL: https://issues.apache.org/jira/browse/HIVE-26838
>             Project: Hive
>          Issue Type: New Feature
>          Components: Hive, Standalone Metastore
>            Reporter: Sai Hemanth Gantasala
>            Assignee: Sai Hemanth Gantasala
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> Adding support for a new event "Reload event" in the HMS (HiveMetaStore). 
> This event can be used by external services that depend on HMS for metadata 
> operations to improve its cache performance. In the distributed environment 
> where there are replicas of an external service (with its own cache in each 
> of these replicas) talking to HMS for metadata operations, the reload event 
> can be used to address the cache performance and ensure consistency among all 
> the replicas for a given table/partition.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to