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 2022/07/28 17:10:37 UTC

[GitHub] [hive] zabetak commented on a diff in pull request #3478: HIVE-22417: Remove stringifyException from MetaStore

zabetak commented on code in PR #3478:
URL: https://github.com/apache/hive/pull/3478#discussion_r932413646


##########
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/ReplChangeManager.java:
##########
@@ -205,7 +205,7 @@ private ReplChangeManager(Configuration conf) throws MetaException {
         inited = true;
       }
     } catch (IOException e) {
-      throw new MetaException(StringUtils.stringifyException(e));
+      throw new MetaException(e.getMessage());

Review Comment:
   Should we `LOG.error("..", e)` before throwing to avoid losing the complete stacktrace?



##########
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/ReplChangeManager.java:
##########
@@ -378,32 +378,28 @@ static Path getCMPath(Configuration conf, String name, String checkSum, String c
    * @return Corresponding FileInfo object
    */
   public static FileInfo getFileInfo(Path src, String checksumString, String srcCMRootURI, String subDir,
-                                     Configuration conf) throws MetaException {
-    try {
-      FileSystem srcFs = src.getFileSystem(conf);
-      if (checksumString == null) {
-        return new FileInfo(srcFs, src, subDir);
-      }
+      Configuration conf) throws IOException {
+    FileSystem srcFs = src.getFileSystem(conf);
+    if (checksumString == null) {
+      return new FileInfo(srcFs, src, subDir);
+    }
 
-      Path cmPath = getCMPath(conf, src.getName(), checksumString, srcCMRootURI);
-      if (!srcFs.exists(src)) {
-        return new FileInfo(srcFs, src, cmPath, checksumString, false, subDir);
-      }
+    Path cmPath = getCMPath(conf, src.getName(), checksumString, srcCMRootURI);
+    if (!srcFs.exists(src)) {
+      return new FileInfo(srcFs, src, cmPath, checksumString, false, subDir);
+    }
 
-      String currentChecksumString;
-      try {
-        currentChecksumString = checksumFor(src, srcFs);
-      } catch (IOException ex) {
-        // If the file is missing or getting modified, then refer CM path
-        return new FileInfo(srcFs, src, cmPath, checksumString, false, subDir);
-      }
-      if ((currentChecksumString == null) || checksumString.equals(currentChecksumString)) {
-        return new FileInfo(srcFs, src, cmPath, checksumString, true, subDir);
-      } else {
-        return new FileInfo(srcFs, src, cmPath, checksumString, false, subDir);
-      }
-    } catch (IOException e) {
-      throw new MetaException(StringUtils.stringifyException(e));

Review Comment:
   Dropping the `MetaException` from this method seems like a good idea to me but do we understand why it was added in the first place?



-- 
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: gitbox-unsubscribe@hive.apache.org

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