dengzhhu653 commented on code in PR #4194:
URL: https://github.com/apache/hive/pull/4194#discussion_r1204973416


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/PropertyServlet.java:
##########
@@ -194,34 +217,34 @@ private void runPost(HttpServletRequest request,
 
   @Override
   protected void doPut(HttpServletRequest request,
-                        HttpServletResponse response) throws ServletException, 
IOException {
+                       HttpServletResponse response) throws ServletException, 
IOException {
     security.execute(request, response, PropertyServlet.this::runGet);
   }
   private void runGet(HttpServletRequest request,
                        HttpServletResponse response) throws ServletException, 
IOException {
-
-    String ns = getNamespace(request.getRequestURI());
-    PropertyManager mgr;
+    final RawStore ms =  getMS();
+    final String ns = getNamespace(request.getRequestURI());
+    final PropertyManager mgr = getPropertyManager(ms, ns);
     try {
-      mgr = getPropertyManager(ns);
-    } catch (MetaException | NoSuchObjectException exception) {
-      throw new ServletException(exception);
-    }
-    Object json = readJson(request);
-    if (json instanceof Map) {
-      try {
-        @SuppressWarnings("unchecked")
-        Map<String, ?> cast = (Map<String, ?>) json;
-        mgr.setProperties(cast);
-        mgr.commit();
-        response.setStatus(HttpServletResponse.SC_OK);
-        return;
-      } catch (Exception any) {
-        mgr.rollback();
-        response.sendError(HttpServletResponse.SC_BAD_REQUEST, "select fail " 
+ any);
+      Object json = readJson(request);
+      if (json instanceof Map) {
+        try {
+          @SuppressWarnings("unchecked")
+          Map<String, ?> cast = (Map<String, ?>) json;
+          mgr.setProperties(cast);
+          mgr.commit();
+          response.setStatus(HttpServletResponse.SC_OK);
+          return;
+        } catch (Exception any) {
+          mgr.rollback();
+          LOGGER.error("select fail", any);

Review Comment:
   nit: should it better to rename the method to `runPut`, also the error 
message seems a bit confusing.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to