client.ensureTableFamilyExists( tableName.getBytes(Charsets.UTF_8), columnFamily).addCallbacks( new Callback<Object, Object>() {
/** * Ensures that a specific table exists. * * @param table the table to check. * * @return a {@link Deferred} indicating the completion of the assertion. * * @throws TableNotFoundException (Deferred) if the table does not exist. * @throws NoSuchColumnFamilyException (Deferred) if the family doesn't exist. * * @see org.hbase.async.HBaseClient#ensureTableFamilyExists(byte[], byte[]) */ public Deferred<Object> ensureTableFamilyExists(final byte[] table, final byte[] family) { return client.ensureTableFamilyExists(table, family); }
/** * Ensures that a specific table exists. * * @param table the table to check. * * @return a {@link Deferred} indicating the completion of the assertion. * * @throws TableNotFoundException (Deferred) if the table does not exist. * @throws NoSuchColumnFamilyException (Deferred) if the family doesn't exist. * * @see org.hbase.async.HBaseClient#ensureTableFamilyExists(String, String) */ public Deferred<Object> ensureTableFamilyExists(final String table, final String family) { return client.ensureTableFamilyExists(table, family); }
/** * Ensures that a given table really exists. * <p> * It's recommended to call this method in the startup code of your * application if you know ahead of time which tables / families you're * going to need, because it'll allow you to "fail fast" if they're missing. * <p> * @param table The name of the table you intend to use. * @return A deferred object that indicates the completion of the request. * The {@link Object} has not special meaning and can be {@code null} * (think of it as {@code Deferred<Void>}). But you probably want to attach * at least an errback to this {@code Deferred} to handle failures. * @throws TableNotFoundException (deferred) if the table doesn't exist. */ public Deferred<Object> ensureTableExists(final byte[] table) { return ensureTableFamilyExists(table, EMPTY_ARRAY); }
/** * Ensures that a given table really exists. * <p> * It's recommended to call this method in the startup code of your * application if you know ahead of time which tables / families you're * going to need, because it'll allow you to "fail fast" if they're missing. * <p> * @param table The name of the table you intend to use. * The string is assumed to use the platform's default charset. * @return A deferred object that indicates the completion of the request. * The {@link Object} has not special meaning and can be {@code null} * (think of it as {@code Deferred<Void>}). But you probably want to attach * at least an errback to this {@code Deferred} to handle failures. * @throws TableNotFoundException (deferred) if the table doesn't exist. */ public Deferred<Object> ensureTableExists(final String table) { return ensureTableFamilyExists(table.getBytes(), EMPTY_ARRAY); }
/** * Ensures that a given table/family pair really exists. * <p> * It's recommended to call this method in the startup code of your * application if you know ahead of time which tables / families you're * going to need, because it'll allow you to "fail fast" if they're missing. * <p> * Both strings are assumed to use the platform's default charset. * @param table The name of the table you intend to use. * @param family The column family you intend to use in that table. * @return A deferred object that indicates the completion of the request. * The {@link Object} has not special meaning and can be {@code null} * (think of it as {@code Deferred<Void>}). But you probably want to attach * at least an errback to this {@code Deferred} to handle failures. * @throws TableNotFoundException (deferred) if the table doesn't exist. * @throws NoSuchColumnFamilyException (deferred) if the family doesn't exist. */ public Deferred<Object> ensureTableFamilyExists(final String table, final String family) { return ensureTableFamilyExists(table.getBytes(), family.getBytes()); }
client.ensureTableFamilyExists( tableName.getBytes(Charsets.UTF_8), columnFamily).addCallbacks( new Callback<Object, Object>() {