@Override public HTableDescriptorBuilder buildHTableDescriptor(HTableDescriptor tableDescriptorToCopy) { Preconditions.checkArgument(tableDescriptorToCopy != null, "Table descriptor should not be null"); return new HTableDescriptorBuilder(tableDescriptorToCopy); }
@Override public HTable createTable(TableId tableId) throws Exception { HBaseTableUtil tableUtil = new HBaseTableUtilFactory(cConf).get(); HTableDescriptorBuilder tableDesc = tableUtil.buildHTableDescriptor(tableId); HColumnDescriptor columnDesc = new HColumnDescriptor(FAMILY); columnDesc.setMaxVersions(Integer.MAX_VALUE); columnDesc.setValue(IncrementHandlerState.PROPERTY_TRANSACTIONAL, "false"); tableDesc.addFamily(columnDesc); tableDesc.addCoprocessor(IncrementHandler.class.getName()); HTableDescriptor htd = tableDesc.build(); TEST_HBASE.getHBaseAdmin().createTable(htd); TEST_HBASE.waitUntilTableAvailable(htd.getName(), 5000); return tableUtil.createHTable(conf, tableId); }
newDescriptor.removeCoprocessor(coprocessorEntry.getValue().getClassName()); coprocessorManager.getCoprocessorDescriptor(coprocessor, Coprocessor.PRIORITY_USER); Path path = coprocessorDescriptor.getPath() == null ? null : new Path(coprocessorDescriptor.getPath()); newDescriptor.addCoprocessor(coprocessorDescriptor.getClassName(), path, coprocessorDescriptor.getPriority(), coprocessorDescriptor.getProperties()); HBaseTableUtil.setTablePrefix(newDescriptor, cConf); newDescriptor.setValue(HTableDescriptor.SPLIT_POLICY, cConf.get(Constants.MessagingSystem.TABLE_HBASE_SPLIT_POLICY)); tableUtil.modifyTable(ddlExecutor, newDescriptor.build()); LOG.debug("Enabling table '{}'...", tableId); enableTable(ddlExecutor, tableId);
public HTableDescriptor setVersion(HTableDescriptor tableDescriptor) { HTableDescriptorBuilder builder = buildHTableDescriptor(tableDescriptor); setVersion(builder); return builder.build(); }
newDescriptor.removeCoprocessor(info.getClassName()); addCoprocessor(newDescriptor, coprocessor, coprocessorJar.getPriority(coprocessor)); CLASS_TO_NAME)); for (String remove : Sets.difference(coprocessorInfo.keySet(), coprocessorNames)) { newDescriptor.removeCoprocessor(remove); tableUtil.modifyTable(ddlExecutor, newDescriptor.build()); if (enableTable) { LOG.debug("Enabling table '{}'...", tableId);
protected void addCoprocessor(HTableDescriptorBuilder tableDescriptor, Class<? extends Coprocessor> coprocessor, Integer priority) throws IOException { CoprocessorDescriptor descriptor = coprocessorManager.getCoprocessorDescriptor(coprocessor, priority); Path path = descriptor.getPath() == null ? null : new Path(descriptor.getPath()); tableDescriptor.addCoprocessor(descriptor.getClassName(), path, descriptor.getPriority(), descriptor.getProperties()); }
public static void setTablePrefix(HTableDescriptorBuilder tableDescriptorBuilder, CConfiguration cConf) { tableDescriptorBuilder.setValue(Constants.Dataset.TABLE_PREFIX, getTablePrefix(cConf)); }
@Override public HTable createTable(TableId tableId) throws Exception { HBaseTableUtil tableUtil = new HBaseTableUtilFactory(cConf).get(); HTableDescriptorBuilder tableDesc = tableUtil.buildHTableDescriptor(tableId); HColumnDescriptor columnDesc = new HColumnDescriptor(FAMILY); columnDesc.setMaxVersions(Integer.MAX_VALUE); columnDesc.setValue(IncrementHandlerState.PROPERTY_TRANSACTIONAL, "false"); tableDesc.addFamily(columnDesc); tableDesc.addCoprocessor(IncrementHandler.class.getName()); HTableDescriptor htd = tableDesc.build(); TEST_HBASE.getHBaseAdmin().createTable(htd); TEST_HBASE.waitUntilTableAvailable(htd.getName(), 5000); return tableUtil.createHTable(conf, tableId); }
newDescriptor.removeCoprocessor(coprocessorEntry.getValue().getClassName()); coprocessorManager.getCoprocessorDescriptor(coprocessor, Coprocessor.PRIORITY_USER); Path path = coprocessorDescriptor.getPath() == null ? null : new Path(coprocessorDescriptor.getPath()); newDescriptor.addCoprocessor(coprocessorDescriptor.getClassName(), path, coprocessorDescriptor.getPriority(), coprocessorDescriptor.getProperties()); HBaseTableUtil.setTablePrefix(newDescriptor, cConf); newDescriptor.setValue(HTableDescriptor.SPLIT_POLICY, cConf.get(Constants.MessagingSystem.TABLE_HBASE_SPLIT_POLICY)); tableUtil.modifyTable(ddlExecutor, newDescriptor.build()); LOG.debug("Enabling table '{}'...", tableId); enableTable(ddlExecutor, tableId);
public HTableDescriptor setHBaseVersion(HTableDescriptor tableDescriptor) { HTableDescriptorBuilder builder = buildHTableDescriptor(tableDescriptor); setHBaseVersion(builder); return builder.build(); }
newDescriptor.removeCoprocessor(info.getClassName()); addCoprocessor(newDescriptor, coprocessor, coprocessorJar.getPriority(coprocessor)); CLASS_TO_NAME)); for (String remove : Sets.difference(coprocessorInfo.keySet(), coprocessorNames)) { newDescriptor.removeCoprocessor(remove); tableUtil.modifyTable(ddlExecutor, newDescriptor.build()); if (enableTable) { LOG.debug("Enabling table '{}'...", tableId);
protected void addCoprocessor(HTableDescriptorBuilder tableDescriptor, Class<? extends Coprocessor> coprocessor, Integer priority) throws IOException { CoprocessorDescriptor descriptor = coprocessorManager.getCoprocessorDescriptor(coprocessor, priority); Path path = descriptor.getPath() == null ? null : new Path(descriptor.getPath()); tableDescriptor.addCoprocessor(descriptor.getClassName(), path, descriptor.getPriority(), descriptor.getProperties()); }
public static void setTablePrefix(HTableDescriptorBuilder tableDescriptorBuilder, CConfiguration cConf) { tableDescriptorBuilder.setValue(Constants.Dataset.TABLE_PREFIX, getTablePrefix(cConf)); }
@Override public HTable createTable(TableId tableId) throws Exception { HBaseTableUtil tableUtil = new HBaseTableUtilFactory(cConf).get(); HTableDescriptorBuilder tableDesc = tableUtil.buildHTableDescriptor(tableId); HColumnDescriptor columnDesc = new HColumnDescriptor(FAMILY); columnDesc.setMaxVersions(Integer.MAX_VALUE); columnDesc.setValue(IncrementHandlerState.PROPERTY_TRANSACTIONAL, "false"); tableDesc.addFamily(columnDesc); tableDesc.addCoprocessor(IncrementHandler.class.getName()); HTableDescriptor htd = tableDesc.build(); TEST_HBASE.getHBaseAdmin().createTable(htd); TEST_HBASE.waitUntilTableAvailable(htd.getName(), 5000); return tableUtil.createHTable(conf, tableId); }
public HTableDescriptor setHBaseVersion(HTableDescriptor tableDescriptor) { HTableDescriptorBuilder builder = buildHTableDescriptor(tableDescriptor); setHBaseVersion(builder); return builder.build(); }
@Override public HTableDescriptorBuilder buildHTableDescriptor(HTableDescriptor tableDescriptorToCopy) { Preconditions.checkArgument(tableDescriptorToCopy != null, "Table descriptor should not be null"); return new HTableDescriptorBuilder(tableDescriptorToCopy); }
public static void setHBaseVersion(HTableDescriptorBuilder tableDescriptorBuilder) { tableDescriptorBuilder.setValue(CDAP_HBASE_VERSION, HBaseVersion.get().getMajorVersion()); }
@Override public HTable createTable(TableId tableId) throws Exception { HBaseTableUtil tableUtil = new HBaseTableUtilFactory(cConf).get(); HTableDescriptorBuilder tableDesc = tableUtil.buildHTableDescriptor(tableId); HColumnDescriptor columnDesc = new HColumnDescriptor(FAMILY); columnDesc.setMaxVersions(Integer.MAX_VALUE); columnDesc.setValue(IncrementHandlerState.PROPERTY_TRANSACTIONAL, "false"); tableDesc.addFamily(columnDesc); tableDesc.addCoprocessor(IncrementHandler.class.getName()); HTableDescriptor htd = tableDesc.build(); TEST_HBASE.getHBaseAdmin().createTable(htd); TEST_HBASE.waitUntilTableAvailable(htd.getName(), 5000); return tableUtil.createHTable(conf, tableId); }