3.1. Creating HA Tables with the HBase Java API

HBase application developers create highly-available HBase tables programmaticaly using the Java API, as shown in the following example:

HTableDescriptor htd = new HTableDesscriptor(TableName.valueOf("test_table"));
htd.setRegionReplication(2);
...
admin.createTable(htd);

This example creates a table named test_table that is replicated to one secondary region server. To replicate test_table to two secondary region servers, pass 3 as a parameter to the setRegionReplication() method.


loading table of contents...