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

ramkrishna.s.vasudevan commented on HBASE-4175:
-----------------------------------------------

@Ted,
Currently as you mentioned FSUtils.createTableDescriptor() doesnot throw IOE.  
So I will make it throw IOE.  
Reg if the table already exists there is a check 
{code}
     if (fs.exists(tableInfoPath)
          && fs.getFileStatus(tableInfoPath).getLen() > 0) {
        LOG.info("TableInfo already exists.. Skipping creation");
}
{code}

So we need not add any FSTableDescriptor.get() I think. Pls suggest.

Also what should be the behaviour if the table already exists.  As you had 
already told do we need to forcefully create? So for that we need to introduce 
a new api for forceful creation. 
In my current patch I am planning to return true or false and if IOE happens 
will throw the IOE to the caller.



> Fix FSUtils.createTableDescriptor()
> -----------------------------------
>
>                 Key: HBASE-4175
>                 URL: https://issues.apache.org/jira/browse/HBASE-4175
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 0.92.0
>            Reporter: Ted Yu
>            Assignee: ramkrishna.s.vasudevan
>
> Currently createTableDescriptor() doesn't return anything.
> The caller wouldn't know whether the descriptor is created or not. See 
> exception handling:
> {code}
>    } catch(IOException ioe) {
>      LOG.info("IOException while trying to create tableInfo in HDFS", ioe);
>    }
> {code}
> We should return a boolean.
> If the table descriptor exists already, maybe we should deserialize from hdfs 
> and compare with htableDescriptor argument. If they differ, I am not sure 
> what the proper action would be.
> Maybe we can add a boolean argument, force, to createTableDescriptor(). When 
> force is true, existing table descriptor would be overwritten.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to