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

ASF GitHub Bot logged work on HDDS-1586:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 03/Jul/19 07:37
            Start Date: 03/Jul/19 07:37
    Worklog Time Spent: 10m 
      Work Description: ChenSammi commented on pull request #931: HDDS-1586. 
Allow Ozone RPC client to read with topology awareness.
URL: https://github.com/apache/hadoop/pull/931#discussion_r299814986
 
 

 ##########
 File path: 
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestKeyManagerImpl.java
 ##########
 @@ -596,6 +620,81 @@ private OmKeyArgs createKeyArgs(String toKeyName) throws 
IOException {
     return createBuilder().setKeyName(toKeyName).build();
   }
 
+  @Test
+  public void testLookupKeyWithLocation() throws IOException {
+    String keyName = RandomStringUtils.randomAlphabetic(5);
+    OmKeyArgs keyArgs = createBuilder()
+        .setKeyName(keyName)
+        .build();
+
+    // lookup for a non-existent key
+    try {
+      keyManager.lookupKey(keyArgs, null);
+      Assert.fail("Lookup key should fail for non existent key");
+    } catch (OMException ex) {
+      if (ex.getResult() != OMException.ResultCodes.KEY_NOT_FOUND) {
+        throw ex;
+      }
+    }
+
+    // create a key
+    OpenKeySession keySession = keyManager.createFile(keyArgs, false, false);
+    // randomly select 3 datanodes
+    List<DatanodeDetails> nodeList = new ArrayList<>();
+    nodeList.add((DatanodeDetails)scm.getClusterMap().getNode(
+        0, null, null, null, null, 0));
+    nodeList.add((DatanodeDetails)scm.getClusterMap().getNode(
+        1, null, null, null, null, 0));
+    nodeList.add((DatanodeDetails)scm.getClusterMap().getNode(
+        2, null, null, null, null, 0));
+    Assume.assumeTrue(nodeList.get(0) != nodeList.get(1));
 
 Review comment:
   u'r right. 
 
----------------------------------------------------------------
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: 271449)
    Time Spent: 3h 10m  (was: 3h)

> Allow Ozone RPC client to read with topology awareness
> ------------------------------------------------------
>
>                 Key: HDDS-1586
>                 URL: https://issues.apache.org/jira/browse/HDDS-1586
>             Project: Hadoop Distributed Data Store
>          Issue Type: Sub-task
>            Reporter: Xiaoyu Yao
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 3h 10m
>  Remaining Estimate: 0h
>
> The idea is to leverage the node location from the block locations and perfer 
> read from closer block replicas. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to