hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (Jira)" <j...@apache.org>
Subject [jira] [Work logged] (HIVE-23955) Classification of Error Codes in Replication
Date Thu, 06 Aug 2020 17:32:00 GMT

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

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

                Author: ASF GitHub Bot
            Created on: 06/Aug/20 17:31
            Start Date: 06/Aug/20 17:31
    Worklog Time Spent: 10m 
      Work Description: aasha commented on a change in pull request #1358:
URL: https://github.com/apache/hive/pull/1358#discussion_r466574105



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/AtlasDumpTask.java
##########
@@ -132,31 +130,40 @@ private AtlasReplInfo createAtlasReplInfo() throws SemanticException,
MalformedU
 
   private long lastStoredTimeStamp() throws SemanticException {
     Path prevMetadataPath = new Path(work.getPrevAtlasDumpDir(), EximUtil.METADATA_NAME);
-    BufferedReader br = null;
+    Retryable retryable = Retryable.builder()
+      .withHiveConf(conf)
+      .withRetryOnException(IOException.class)
+      .withFailOnException(FileNotFoundException.class).build();
     try {
-      FileSystem fs = prevMetadataPath.getFileSystem(conf);
-      br = new BufferedReader(new InputStreamReader(fs.open(prevMetadataPath), Charset.defaultCharset()));
-      String line = br.readLine();
-      if (line == null) {
-        throw new SemanticException("Could not read lastStoredTimeStamp from atlas metadata
file");
-      }
-      String[] lineContents = line.split("\t", 5);
-      return Long.parseLong(lineContents[1]);
-    } catch (Exception ex) {
-      throw new SemanticException(ex);
-    } finally {
-      if (br != null) {
+      return retryable.executeCallable(() -> {
+        BufferedReader br = null;
         try {
-          br.close();
-        } catch (IOException e) {
-          throw new SemanticException(e);
+          FileSystem fs = prevMetadataPath.getFileSystem(conf);
+          br = new BufferedReader(new InputStreamReader(fs.open(prevMetadataPath), Charset.defaultCharset()));
+          String line = br.readLine();
+          if (line == null) {
+            throw new SemanticException(ErrorMsg.REPL_INVALID_CONFIG_FOR_SERVICE

Review comment:
       Named it as REPL_INVALID_INTERNAL_CONFIG_FOR_SERVICE




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


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

    Worklog Id:     (was: 467445)
    Time Spent: 1h  (was: 50m)

> Classification of Error Codes in Replication
> --------------------------------------------
>
>                 Key: HIVE-23955
>                 URL: https://issues.apache.org/jira/browse/HIVE-23955
>             Project: Hive
>          Issue Type: Task
>            Reporter: Aasha Medhi
>            Assignee: Aasha Medhi
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-23955.01.patch, HIVE-23955.02.patch, Retry Logic for Replication.pdf
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>




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

Mime
View raw message