MCPcopy Create free account
hub / github.com/OpenTSDB/asynchbase / createOrTruncateTable

Method createOrTruncateTable

test/TestIntegration.java:145–156  ·  view source on GitHub ↗

Creates or truncates the given table name.

(final HBaseClient client,
                                            final String table,
                                            final String family)

Source from the content-addressed store, hash-verified

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

Calls 3

truncateTableMethod · 0.95
createTableMethod · 0.95

Tested by

no test coverage detected