Creates or truncates the given table name.
(final HBaseClient client,
final String table,
final String family)
| 143 | |
| 144 | /** Creates or truncates the given table name. */ |
| 145 | private static void createOrTruncateTable(final HBaseClient client, |
| 146 | final String table, |
| 147 | final String family) |
| 148 | throws Exception { |
| 149 | try { |
| 150 | client.ensureTableFamilyExists(table, family).join(); |
| 151 | truncateTable(table); |
| 152 | } catch (TableNotFoundException e) { |
| 153 | createTable(table, family); |
| 154 | createOrTruncateTable(client, table, family); // Check again. |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | /** Write a single thing to HBase and read it back. */ |
| 159 | @Test |
no test coverage detected