3.1. Creating HA Tables with the HBase Java API

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

HTableDescriptor htd = new HTableDescriptor(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. To replicate test_table to two secondary regions, pass 3 as a parameter to the setRegionReplication() method.


loading table of contents...