Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id EDBB5200CB6 for ; Thu, 29 Jun 2017 21:41:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id EC7A1160BED; Thu, 29 Jun 2017 19:41:05 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 3D757160BC6 for ; Thu, 29 Jun 2017 21:41:05 +0200 (CEST) Received: (qmail 57077 invoked by uid 500); 29 Jun 2017 19:41:04 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 57066 invoked by uid 99); 29 Jun 2017 19:41:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Jun 2017 19:41:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id F0E77CD730 for ; Thu, 29 Jun 2017 19:41:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.211 X-Spam-Level: X-Spam-Status: No, score=-99.211 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 5hBLdw75rDvc for ; Thu, 29 Jun 2017 19:41:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 6375F5FDAD for ; Thu, 29 Jun 2017 19:41:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 90681E0BCB for ; Thu, 29 Jun 2017 19:41:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 13423245B6 for ; Thu, 29 Jun 2017 19:41:01 +0000 (UTC) Date: Thu, 29 Jun 2017 19:41:01 +0000 (UTC) From: "Chen Liang (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (HDFS-12063) Ozone: Ozone shell: Multiple RPC calls for put/get key MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 29 Jun 2017 19:41:06 -0000 [ https://issues.apache.org/jira/browse/HDFS-12063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16068839#comment-16068839 ] Chen Liang edited comment on HDFS-12063 at 6/29/17 7:40 PM: ------------------------------------------------------------ Thanks [~linyiqun] for working on this! v001 LGTM overall, with some comments: 1. In the original code {code} OzoneVolume vol = client.getVolume(volumeName); OzoneBucket bucket = vol.getBucket(bucketName); bucket.putKey(keyName, dataFile); {code} in {{getVolume()}} and {{getBucket()}}, there are calls {{OzoneUtils.verifyBucketName(volumeName);}} and {{OzoneUtils.verifyBucketName(bucketName);}} which verifies the format of volume name and bucket name, could you please also add them to the them accordingly? (e.g. in new {{putKey()}}, after checking bucket name is not null, call verifyBucketName to see if it's valid.) Also, although the function is called verifyBucketName but it's also used to verify volume names. Please feel free to rename this method if you want, it's up to you. 2. In new {{putKey()}}, there is {{IOUtils.closeStream(fis);}} I'm not sure about the detail in {{.closeStream()}} , do need to we check fis is null or not before calling it? 3. One thing about the original three RPC call is that, if the volume/bucket does not exist, it throws exception, but the exceptions were somewhat confusing, that's what led us to filing this JIRA in the beginning. So could you please add unit test to see the behaviour of new put and get? e.g. try to put/get from non-existing volumes/buckets and see if it does throw exceptions as expected? was (Author: vagarychen): Thanks [~linyiqun] for working on this! v001 LGTM overall, with some comments: 1. In the original code {code} OzoneVolume vol = client.getVolume(volumeName); OzoneBucket bucket = vol.getBucket(bucketName); bucket.putKey(keyName, dataFile); {code} in {{getVolume()}} and {{getBucket()}}, there are calls {{OzoneUtils.verifyBucketName(volumeName);}} and {{OzoneUtils.verifyBucketName(bucketName);}} which verifies the format of volume name and bucket name, could you please also add them to the them accordingly? (e.g. in new {{putKey()}}, after checking bucket name is not null, call verifyBucketName to see if it's valid.) Also, although the function is called verifyBucketName but it's also used to verify volume names. Please feel free to rename this method if you want, it's up to you. 2. In new {{putKey()}}, there is {{IOUtils.closeStream(fis);}} I'm not sure about the detail in {{.closeStream()}} , do need to we check fis is null or not before calling it? 3. One thing about the original three RPC call is that, I think if the volume does not exist, it throws exception. So could you please add unit test to see the behaviour of new put and get? e.g. try to put/get from non-existing volumes/buckets and see if it does throw exceptions as expected? > Ozone: Ozone shell: Multiple RPC calls for put/get key > ------------------------------------------------------ > > Key: HDFS-12063 > URL: https://issues.apache.org/jira/browse/HDFS-12063 > Project: Hadoop HDFS > Issue Type: Sub-task > Reporter: Nandakumar > Assignee: Yiqun Lin > Attachments: HDFS-12063-HDFS-7240.001.patch > > > With current implementation multiple RPC calls are made for each put/get key ozone shell call > {code:title=org.apache.hadoop.ozone.web.ozShell.keys.PutKeyHandler#execute} > OzoneVolume vol = client.getVolume(volumeName); > OzoneBucket bucket = vol.getBucket(bucketName); > bucket.putKey(keyName, dataFile); > {code} > {code:title=org.apache.hadoop.ozone.web.ozShell.keys.GetKeyHandler#execute} > OzoneVolume vol = client.getVolume(volumeName); > OzoneBucket bucket = vol.getBucket(bucketName); > bucket.getKey(keyName, dataFilePath); > {code} > This can be optimized. -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org