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

Rui Li commented on HIVE-14323:
-------------------------------

It's a little different from the FS specification [~cnauroth] mentioned, but 
the JavaDoc of FileSystem doesn't specify whether to return false or throw 
exception if the file to be deleted doesn't exist. Not sure if all 
implementations will comply with the specification.
{code}
  /** Delete a file.
   *
   * @param f the path to delete.
   * @param recursive if path is a directory and set to 
   * true, the directory is deleted else throws an exception. In
   * case of a file the recursive can be set to either true or false. 
   * @return  true if delete is successful else false. 
   * @throws IOException
   */
  public abstract boolean delete(Path f, boolean recursive) throws IOException;
{code}

> Reduce number of FS permissions and redundant FS operations
> -----------------------------------------------------------
>
>                 Key: HIVE-14323
>                 URL: https://issues.apache.org/jira/browse/HIVE-14323
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Rajesh Balamohan
>            Assignee: Rajesh Balamohan
>            Priority: Minor
>         Attachments: HIVE-14323.1.patch
>
>
> Some examples are given below.
> 1. When creating stage directory, FileUtils sets the directory permissions by 
> running a set of chgrp and chmod commands. In systems like S3, this would not 
> be relevant.
> 2. In some cases, fs.delete() is followed by fs.exists(). In this case, it 
> might be redundant to check for exists() (lookup ops are expensive in systems 
> like S3). 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to