...

Big Data - HBASE

Back to Course

Lesson Description


Lession - #869 HBase Enabling Table


Enabling

Enabling a Table utilizing HBase Shell

syntax to empower a table:



verification

After enabling the table, check it. In the event that you can see the outline, your table is effectively enabled.


is_enabled

This order is utilized to observe whether a table is enabled. Its syntax is as per the following:



The following code confirms whether the table named emp is enabled. In the event that it is enabled, it will return valid and if not, it will get back false.


Enable a Table Using Java API

To check whether a table is enabled, isTableEnabled(>
technique is utilized; and to enable a table, enableTable(>
strategy is utilized. These techniques have a place with HBaseAdmin class. Follow the means given below to empower a table.


Step 1 Start up HBaseAdmin class as displayed beneath/below.



Stage 2
Confirm whether the table is enabled utilizing isTableEnabled(>
technique as displayed underneath/below.



Stage 3
If the table isn't enabled, disable it as displayed underneath.


Given below is the finished program to check whether the table is enabled and in the event that it isn't, then how to enable it.


Compile and execute the above program as displayed beneath.



The following should be the result: