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

Chia-Ping Tsai commented on HBASE-15583:
----------------------------------------

Shell we avoid the obscure immutable HTableDescriptor ? The 
UnsupportedOperationException is a runtime error. I'd think that we should 
introduce a "explicit" immutable HTableDescriptor. Two solutions are shown 
below.
# a public interface called ImmutableHTableDescriptor, and HTableDescriptor 
implement it. The returned type of getTableDescriptor() is changed from 
HTableDescriptor to ImmutableHTableDescriptor (interface). The 
getTableDescriptor() return the HTD directly, but user can modify the HTD by 
casting.
# fix the UnmodifyableHTableDescriptor. It will be renamed and don't inherit 
the HTableDescriptor to get rid of the "modify methods". The returned type of 
getTableDescriptor() is changed from HTableDescriptor to 
UnmodifyableHTableDescriptor.

If we don't want to introduce an new public class into client library, a bit 
fix of UnmodifyableHTableDescriptor is another solution.

> Discuss mutable vs immutable HTableDescriptor
> ---------------------------------------------
>
>                 Key: HBASE-15583
>                 URL: https://issues.apache.org/jira/browse/HBASE-15583
>             Project: HBase
>          Issue Type: Sub-task
>    Affects Versions: 2.0.0
>            Reporter: Gabor Liptak
>            Priority: Minor
>              Labels: beginner
>             Fix For: 2.0.0
>
>
> From [~enis] in https://issues.apache.org/jira/browse/HBASE-15505:
>     PS Should UnmodifyableHTableDescriptor be renamed to 
> UnmodifiableHTableDescriptor?
> It should be named ImmutableHTableDescriptor to be consistent with 
> collections naming. Let's do this as a subtask of the parent jira, not here. 
> Thinking about it though, why would we return an Immutable HTD in 
> HTable.getTableDescriptor() versus a mutable HTD in 
> Admin.getTableDescriptor(). It does not make sense. Should we just get rid of 
> the Immutable ones?
> We also have UnmodifyableHRegionInfo which is not used at the moment it 
> seems. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to