[
https://issues.apache.org/jira/browse/HIVE-24327?focusedWorklogId=506597&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-506597
]
ASF GitHub Bot logged work on HIVE-24327:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 30/Oct/20 09:21
Start Date: 30/Oct/20 09:21
Worklog Time Spent: 10m
Work Description: pkumarsinha commented on a change in pull request #1623:
URL: https://github.com/apache/hive/pull/1623#discussion_r514954497
##########
File path:
ql/src/test/org/apache/hadoop/hive/ql/exec/repl/TestAtlasDumpTask.java
##########
@@ -175,4 +174,58 @@ public void testRetryingClientTimeBasedExhausted() throws
AtlasServiceException
}
Assert.assertTrue(inputStream == null);
}
+
+ @Test
+ public void testAtlasServerEntity() throws AtlasServiceException,
SemanticException {
+ AtlasClientV2 atlasClientV2 = mock(AtlasClientV2.class);
+ AtlasServer atlasServer = mock(AtlasServer.class);
+ when(atlasClientV2.getServer(anyString())).thenReturn(atlasServer);
+ AtlasRestClient atlasClient = new AtlasRestClientImpl(atlasClientV2, conf);
+ AtlasServer atlasServerRet = atlasClient.getServer("src", conf);
+ Assert.assertTrue(atlasServer == atlasServerRet);
+ }
+
+ @Test
+ public void testAtlasServerEntityNotFound() throws AtlasServiceException,
SemanticException {
+ setupConfForRetry();
+ AtlasServiceException atlasServiceException =
mock(AtlasServiceException.class);
+ ClientResponse.Status status = mock(ClientResponse.Status.class);
+ when(atlasServiceException.getStatus()).thenReturn(status);
+ when(status.getStatusCode()).thenReturn(404);
+ AtlasClientV2 atlasClientV2 = mock(AtlasClientV2.class);
+
when(atlasClientV2.getServer(anyString())).thenThrow(atlasServiceException);
+ AtlasRestClient atlasClient = new AtlasRestClientImpl(atlasClientV2, conf);
+ AtlasServer atlasServerRet = atlasClient.getServer("src", conf);
+ Assert.assertNull(atlasServerRet);
+ ArgumentCaptor<String> getServerReqCaptor =
ArgumentCaptor.forClass(String.class);
+ Mockito.verify(atlasClientV2,
Mockito.times(1)).getServer(getServerReqCaptor.capture());
+ }
+
+ @Test
+ public void testAtlasServerEntityRetryExhausted() throws
AtlasServiceException {
+ setupConfForRetry();
+ AtlasServiceException atlasServiceException =
mock(AtlasServiceException.class);
+ ClientResponse.Status status = mock(ClientResponse.Status.class);
+ when(atlasServiceException.getStatus()).thenReturn(status);
+ when(status.getStatusCode()).thenReturn(400);
+ AtlasClientV2 atlasClientV2 = mock(AtlasClientV2.class);
+
when(atlasClientV2.getServer(anyString())).thenThrow(atlasServiceException);
+ AtlasRestClient atlasClient = new AtlasRestClientImpl(atlasClientV2, conf);
+ try {
+ atlasClient.getServer("src", conf);
+ Assert.fail("Should have thrown SemanticException.");
+ } catch (SemanticException ex) {
+ Assert.assertTrue(ex.getMessage().contains("Retry exhausted for
retryable error code"));
Review comment:
Assert.assertTrue(atlasServiceException == ex.getCause()); is there
which I think is stronger check for atlas exception.
Do we still need additional check?
----------------------------------------------------------------
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 506597)
Time Spent: 40m (was: 0.5h)
> AtlasServer entity may not be present during first Atlas metadata dump
> ----------------------------------------------------------------------
>
> Key: HIVE-24327
> URL: https://issues.apache.org/jira/browse/HIVE-24327
> Project: Hive
> Issue Type: Bug
> Reporter: Pravin Sinha
> Assignee: Pravin Sinha
> Priority: Major
> Labels: pull-request-available
> Attachments: HIVE-24327.01.patch
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)