From hdfs-issues-return-274263-archive-asf-public=cust-asf.ponee.io@hadoop.apache.org Mon Jul 29 18:49:05 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 18670180642 for ; Mon, 29 Jul 2019 20:49:05 +0200 (CEST) Received: (qmail 58452 invoked by uid 500); 29 Jul 2019 18:49:01 -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 58425 invoked by uid 99); 29 Jul 2019 18:49:01 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Jul 2019 18:49:01 +0000 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 6C9DDE2EA0 for ; Mon, 29 Jul 2019 18:49:00 +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 2BBC82662E for ; Mon, 29 Jul 2019 18:49:00 +0000 (UTC) Date: Mon, 29 Jul 2019 18:49:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Work logged] (HDDS-1863) Freon RandomKeyGenerator even if keySize is set to 0, it returns some random data to key MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDDS-1863?focusedWorklogId=3D2= 84469&page=3Dcom.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpan= el#worklog-284469 ] ASF GitHub Bot logged work on HDDS-1863: ---------------------------------------- Author: ASF GitHub Bot Created on: 29/Jul/19 18:48 Start Date: 29/Jul/19 18:48 Worklog Time Spent: 10m=20 Work Description: bharatviswa504 commented on pull request #1167: HDD= S-1863. Freon RandomKeyGenerator even if keySize is set to 0, it returns so= me random data to key. URL: https://github.com/apache/hadoop/pull/1167#discussion_r308382286 =20 =20 ########## File path: hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/= RandomKeyGenerator.java ########## @@ -697,12 +697,11 @@ private boolean createKey(long globalKeyNumber) { try (Scope writeScope =3D GlobalTracer.get().buildSpan("writeKeyDa= ta") .startActive(true)) { long keyWriteStart =3D System.nanoTime(); - for (long nrRemaining =3D keySize - randomValue.length; + for (long nrRemaining =3D keySize; nrRemaining > 0; nrRemaining -=3D bufferSize) { int curSize =3D (int) Math.min(bufferSize, nrRemaining); os.write(keyValueBuffer, 0, curSize); } - os.write(randomValue); =20 Review comment: Fixed it. =20 ---------------------------------------------------------------- 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. =20 For queries about this service, please contact Infrastructure at: users@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 284469) Time Spent: 1h 20m (was: 1h 10m) > Freon RandomKeyGenerator even if keySize is set to 0, it returns some ran= dom data to key > -------------------------------------------------------------------------= --------------- > > Key: HDDS-1863 > URL: https://issues.apache.org/jira/browse/HDDS-1863 > Project: Hadoop Distributed Data Store > Issue Type: Bug > Reporter: Bharat Viswanadham > Assignee: Bharat Viswanadham > Priority: Major > Labels: pull-request-available > Time Spent: 1h 20m > Remaining Estimate: 0h > > =C2=A0 > {code:java} > *************************************************** > Status: Success > Git Base Revision: e97acb3bd8f3befd27418996fa5d4b50bf2e17bf > Number of Volumes created: 1 > Number of Buckets created: 1 > Number of Keys added: 1 > Ratis replication factor: THREE > Ratis replication type: STAND_ALONE > Average Time spent in volume creation: 00:00:00,002 > Average Time spent in bucket creation: 00:00:00,000 > Average Time spent in key creation: 00:00:00,002 > Average Time spent in key write: 00:00:00,101 > Total bytes written: 0 > Total Execution time: 00:00:05,699 > =C2=A0 > {code} > *************************************************** > [root@ozoneha-2 ozone-0.5.0-SNAPSHOT]# bin/ozone sh key list /vol-0-28271= /bucket-0-95211 > [ > { =C2=A0 "version" : 0, =C2=A0 "md5hash" : null, =C2=A0 "createdOn" : "Fr= i, 26 Jul 2019 01:02:08 GMT", =C2=A0 "modifiedOn" : "Fri, 26 Jul 2019 01:02= :09 GMT", =C2=A0 "size" : 36, =C2=A0 "keyName" : "key-0-98235", =C2=A0 "typ= e" : null } > ] > =C2=A0 > This is because of the below code in RandomKeyGenerator: > {code:java} > for (long nrRemaining =3D keySize - randomValue.length; > nrRemaining > 0; nrRemaining -=3D bufferSize) { > int curSize =3D (int) Math.min(bufferSize, nrRemaining); > os.write(keyValueBuffer, 0, curSize); > } > os.write(randomValue); > os.close();{code} > =C2=A0 -- This message was sent by Atlassian JIRA (v7.6.14#76016) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org