[ 
https://issues.apache.org/jira/browse/HDDS-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16986228#comment-16986228
 ] 

Ayush Saxena commented on HDDS-2657:
------------------------------------

HDDS-2580, Could be a reason for this,
The output stream was created before the input stream, so if there is no key, 
still the output stream creates the empty file.
Uploaded fix.
Verified :

{noformat}
ayush@ayushpc:~/ozone/hadoop-ozone/hadoop-ozone/dist/target/ozone-0.5.0-SNAPSHOT/bin$
 ./ozone sh key get "hive/bucket/key 21" "file 21"
KEY_NOT_FOUND Key not found
ayush@ayushpc:~/ozone/hadoop-ozone/hadoop-ozone/dist/target/ozone-0.5.0-SNAPSHOT/bin$
 ll
total 24
drwxr-xr-x  2 ayush ayush  4096 Dec  2 22:55 ./
drwxr-xr-x 13 ayush ayush  4096 Dec  2 23:05 ../
-rwxr-xr-x  1 ayush ayush 12786 Dec  2 22:55 ozone*
{noformat}

Pls Review!!!

> Key get command creates the output file even in case of KEY_NOT_FOUND
> ---------------------------------------------------------------------
>
>                 Key: HDDS-2657
>                 URL: https://issues.apache.org/jira/browse/HDDS-2657
>             Project: Hadoop Distributed Data Store
>          Issue Type: Bug
>            Reporter: Ayush Saxena
>            Priority: Major
>         Attachments: HDDS-2657-01.patch
>
>
> If a key isn't found, the key get command still creates an output file of 0 
> size.
> {noformat}
> ayush@ayushpc:~/ozone/hadoop-ozone/hadoop-ozone/dist/target/ozone-0.5.0-SNAPSHOT/bin$
>  ll
> total 36
> drwxr-xr-x  3 ayush ayush  4096 Dec  2 22:41 ./
> drwxr-xr-x 13 ayush ayush  4096 Nov 30 19:39 ../
> -rwxr-xr-x  1 ayush ayush 12786 Nov 30 19:35 ozone*
> ayush@ayushpc:~/ozone/hadoop-ozone/hadoop-ozone/dist/target/ozone-0.5.0-SNAPSHOT/bin$
>  ./ozone sh key get "hive/bucket/key 21" "file 21"
> KEY_NOT_FOUND Key not found
> ayush@ayushpc:~/ozone/hadoop-ozone/hadoop-ozone/dist/target/ozone-0.5.0-SNAPSHOT/bin$
>  ll
> total 36
> drwxr-xr-x  3 ayush ayush  4096 Dec  2 22:42  ./
> drwxr-xr-x 13 ayush ayush  4096 Nov 30 19:39  ../
> -rw-r--r--  1 ayush ayush     0 Dec  2 22:42 'file 21'
> -rwxr-xr-x  1 ayush ayush 12786 Nov 30 19:35  ozone*
> {noformat}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org

Reply via email to