public HTableDescriptor createTableDescriptor(final TableName tableName, byte[][] families, int maxVersions) { HTableDescriptor desc = new HTableDescriptor(tableName); for (byte[] family : families) { HColumnDescriptor hcd = new HColumnDescriptor(family) .setMaxVersions(maxVersions); if (isNewVersionBehaviorEnabled()) { hcd.setNewVersionBehavior(true); } desc.addFamily(hcd); } return desc; }
private Table createTable() throws IOException { TableName tableName = TableName.valueOf(name.getMethodName()); HTableDescriptor table = new HTableDescriptor(tableName); HColumnDescriptor fam = new HColumnDescriptor(FAMILY); fam.setNewVersionBehavior(true); fam.setMaxVersions(3); table.addFamily(fam); TEST_UTIL.getHBaseAdmin().createTable(table); return TEST_UTIL.getConnection().getTable(tableName); }
public HTableDescriptor createTableDescriptor(final TableName name, final int minVersions, final int versions, final int ttl, KeepDeletedCells keepDeleted) { HTableDescriptor htd = new HTableDescriptor(name); for (byte[] cfName : new byte[][]{ fam1, fam2, fam3 }) { HColumnDescriptor hcd = new HColumnDescriptor(cfName) .setMinVersions(minVersions) .setMaxVersions(versions) .setKeepDeletedCells(keepDeleted) .setBlockCacheEnabled(false) .setTimeToLive(ttl); if (isNewVersionBehaviorEnabled()) { hcd.setNewVersionBehavior(true); } htd.addFamily(hcd); } return htd; }
/** * Create a table. * @param tableName * @param family * @param splitRows * @return A Table instance for the created table. * @throws IOException */ public Table createTable(TableName tableName, byte[] family, byte[][] splitRows) throws IOException { HTableDescriptor desc = new HTableDescriptor(tableName); HColumnDescriptor hcd = new HColumnDescriptor(family); if (isNewVersionBehaviorEnabled()) { hcd.setNewVersionBehavior(true); } desc.addFamily(hcd); getAdmin().createTable(desc, splitRows); // HBaseAdmin only waits for regions to appear in hbase:meta we should wait until they are // assigned waitUntilAllRegionsAssigned(tableName); return getConnection().getTable(tableName); }
/** * Create a table. * @param tableName * @param families * @param numVersions * @param splitKeys * @return A Table instance for the created table. * @throws IOException */ public Table createTable(TableName tableName, byte[][] families, int numVersions, byte[][] splitKeys) throws IOException { HTableDescriptor desc = new HTableDescriptor(tableName); for (byte[] family : families) { HColumnDescriptor hcd = new HColumnDescriptor(family).setMaxVersions(numVersions); if (isNewVersionBehaviorEnabled()) { hcd.setNewVersionBehavior(true); } desc.addFamily(hcd); } getAdmin().createTable(desc, splitKeys); // HBaseAdmin only waits for regions to appear in hbase:meta we should wait until they are // assigned waitUntilAllRegionsAssigned(tableName); return getConnection().getTable(tableName); }
/** * Create a table. * @param tableName * @param families * @param numVersions * @return A Table instance for the created table. * @throws IOException */ public Table createTable(TableName tableName, byte[][] families, int[] numVersions) throws IOException { HTableDescriptor desc = new HTableDescriptor(tableName); int i = 0; for (byte[] family : families) { HColumnDescriptor hcd = new HColumnDescriptor(family) .setMaxVersions(numVersions[i]); if (isNewVersionBehaviorEnabled()) { hcd.setNewVersionBehavior(true); } desc.addFamily(hcd); i++; } getAdmin().createTable(desc); // HBaseAdmin only waits for regions to appear in hbase:meta we should wait until they are // assigned waitUntilAllRegionsAssigned(tableName); return getConnection().getTable(tableName); }
public Table createTable(TableName tableName, byte[][] families, int numVersions, int blockSize, String cpName) throws IOException { HTableDescriptor desc = new HTableDescriptor(tableName); for (byte[] family : families) { HColumnDescriptor hcd = new HColumnDescriptor(family) .setMaxVersions(numVersions) .setBlocksize(blockSize); if (isNewVersionBehaviorEnabled()) { hcd.setNewVersionBehavior(true); } desc.addFamily(hcd); } if(cpName != null) { desc.addCoprocessor(cpName); } getAdmin().createTable(desc); // HBaseAdmin only waits for regions to appear in hbase:meta we should wait until they are // assigned waitUntilAllRegionsAssigned(tableName); return getConnection().getTable(tableName); }
/** * Create a table. * @param tableName * @param families * @param numVersions * @param blockSize * @return A Table instance for the created table. * @throws IOException */ public Table createTable(TableName tableName, byte[][] families, int numVersions, int blockSize) throws IOException { HTableDescriptor desc = new HTableDescriptor(tableName); for (byte[] family : families) { HColumnDescriptor hcd = new HColumnDescriptor(family) .setMaxVersions(numVersions) .setBlocksize(blockSize); if (isNewVersionBehaviorEnabled()) { hcd.setNewVersionBehavior(true); } desc.addFamily(hcd); } getAdmin().createTable(desc); // HBaseAdmin only waits for regions to appear in hbase:meta we should wait until they are // assigned waitUntilAllRegionsAssigned(tableName); return getConnection().getTable(tableName); }
public HTableDescriptor createTableDescriptor(final TableName tableName, byte[][] families, int maxVersions) { HTableDescriptor desc = new HTableDescriptor(tableName); for (byte[] family : families) { HColumnDescriptor hcd = new HColumnDescriptor(family) .setMaxVersions(maxVersions); if (isNewVersionBehaviorEnabled()) { hcd.setNewVersionBehavior(true); } desc.addFamily(hcd); } return desc; }
private Table createTable() throws IOException { TableName tableName = TableName.valueOf(name.getMethodName()); HTableDescriptor table = new HTableDescriptor(tableName); HColumnDescriptor fam = new HColumnDescriptor(FAMILY); fam.setNewVersionBehavior(true); fam.setMaxVersions(3); table.addFamily(fam); TEST_UTIL.getHBaseAdmin().createTable(table); return TEST_UTIL.getConnection().getTable(tableName); }
public HTableDescriptor createTableDescriptor(final TableName name, final int minVersions, final int versions, final int ttl, KeepDeletedCells keepDeleted) { HTableDescriptor htd = new HTableDescriptor(name); for (byte[] cfName : new byte[][]{ fam1, fam2, fam3 }) { HColumnDescriptor hcd = new HColumnDescriptor(cfName) .setMinVersions(minVersions) .setMaxVersions(versions) .setKeepDeletedCells(keepDeleted) .setBlockCacheEnabled(false) .setTimeToLive(ttl); if (isNewVersionBehaviorEnabled()) { hcd.setNewVersionBehavior(true); } htd.addFamily(hcd); } return htd; }
/** * Create a table. * @param tableName * @param family * @param splitRows * @return A Table instance for the created table. * @throws IOException */ public Table createTable(TableName tableName, byte[] family, byte[][] splitRows) throws IOException { HTableDescriptor desc = new HTableDescriptor(tableName); HColumnDescriptor hcd = new HColumnDescriptor(family); if (isNewVersionBehaviorEnabled()) { hcd.setNewVersionBehavior(true); } desc.addFamily(hcd); getAdmin().createTable(desc, splitRows); // HBaseAdmin only waits for regions to appear in hbase:meta we should wait until they are // assigned waitUntilAllRegionsAssigned(tableName); return getConnection().getTable(tableName); }
/** * Create a table. * @param tableName * @param families * @param numVersions * @param splitKeys * @return A Table instance for the created table. * @throws IOException */ public Table createTable(TableName tableName, byte[][] families, int numVersions, byte[][] splitKeys) throws IOException { HTableDescriptor desc = new HTableDescriptor(tableName); for (byte[] family : families) { HColumnDescriptor hcd = new HColumnDescriptor(family).setMaxVersions(numVersions); if (isNewVersionBehaviorEnabled()) { hcd.setNewVersionBehavior(true); } desc.addFamily(hcd); } getAdmin().createTable(desc, splitKeys); // HBaseAdmin only waits for regions to appear in hbase:meta we should wait until they are // assigned waitUntilAllRegionsAssigned(tableName); return getConnection().getTable(tableName); }
/** * Create a table. * @param tableName * @param families * @param numVersions * @return A Table instance for the created table. * @throws IOException */ public Table createTable(TableName tableName, byte[][] families, int[] numVersions) throws IOException { HTableDescriptor desc = new HTableDescriptor(tableName); int i = 0; for (byte[] family : families) { HColumnDescriptor hcd = new HColumnDescriptor(family) .setMaxVersions(numVersions[i]); if (isNewVersionBehaviorEnabled()) { hcd.setNewVersionBehavior(true); } desc.addFamily(hcd); i++; } getAdmin().createTable(desc); // HBaseAdmin only waits for regions to appear in hbase:meta we should wait until they are // assigned waitUntilAllRegionsAssigned(tableName); return getConnection().getTable(tableName); }
public Table createTable(TableName tableName, byte[][] families, int numVersions, int blockSize, String cpName) throws IOException { HTableDescriptor desc = new HTableDescriptor(tableName); for (byte[] family : families) { HColumnDescriptor hcd = new HColumnDescriptor(family) .setMaxVersions(numVersions) .setBlocksize(blockSize); if (isNewVersionBehaviorEnabled()) { hcd.setNewVersionBehavior(true); } desc.addFamily(hcd); } if(cpName != null) { desc.addCoprocessor(cpName); } getAdmin().createTable(desc); // HBaseAdmin only waits for regions to appear in hbase:meta we should wait until they are // assigned waitUntilAllRegionsAssigned(tableName); return getConnection().getTable(tableName); }
/** * Create a table. * @param tableName * @param families * @param numVersions * @param blockSize * @return A Table instance for the created table. * @throws IOException */ public Table createTable(TableName tableName, byte[][] families, int numVersions, int blockSize) throws IOException { HTableDescriptor desc = new HTableDescriptor(tableName); for (byte[] family : families) { HColumnDescriptor hcd = new HColumnDescriptor(family) .setMaxVersions(numVersions) .setBlocksize(blockSize); if (isNewVersionBehaviorEnabled()) { hcd.setNewVersionBehavior(true); } desc.addFamily(hcd); } getAdmin().createTable(desc); // HBaseAdmin only waits for regions to appear in hbase:meta we should wait until they are // assigned waitUntilAllRegionsAssigned(tableName); return getConnection().getTable(tableName); }