hasFamily() just checks the in-memory Map:
public boolean hasFamily(final byte [] familyName) {
return families.containsKey(familyName);
bq. try to create it I will have an exception stating that the CF is
already existing.
In this case you can catch the exception and proceed, right ?
Cheers
On Fri, Dec 4, 2015 at 2:09 AM, Mehdi Ben Haj Abbes <[email protected]>
wrote:
> Hi folks,
>
> I'm new to HBase client java API and using 0.98.4-hadoop2 version.
>
> I need to check if a column family does exit even if it does not have any
> rows in it.
> The problem is that HTableDescriptor.hasFamily returns false for an empty
> column family so if I try to create it I will have an exception stating
> that the CF is already existing.
>
> Any help will be more than appreciated.
>
> Regard,
>
>
> --
> Mehdi BEN HAJ ABBES
>