@Override public Admin getAdmin() throws IOException { return new HBaseAdmin(this); }
@Override public AdminMask getAdmin() throws IOException { return new HBaseAdmin0_98(new HBaseAdmin(cnx)); }
@Override public AdminMask getAdmin() throws IOException { return new HBaseAdmin0_94(new HBaseAdmin(cnx)); }
@Override public AdminMask getAdmin() throws IOException { return new HBaseAdmin1_0(new HBaseAdmin(cnx)); }
@Override public AdminMask getAdmin() throws IOException { return new HBaseAdmin0_96(new HBaseAdmin(cnx)); }
@SuppressWarnings("deprecation") public static List<String> cleanUnusedHBaseTables(boolean delete, int deleteTimeout) throws IOException { try (HBaseAdmin hbaseAdmin = new HBaseAdmin(HBaseConfiguration.create())) { return cleanUnusedHBaseTables(hbaseAdmin, delete, deleteTimeout); } }
public CubeMigrationCheckCLI(KylinConfig kylinConfig, Boolean isFix) throws IOException { this.dstCfg = kylinConfig; this.ifFix = isFix; Configuration conf = HBaseConnection.getCurrentHBaseConfiguration(); hbaseAdmin = new HBaseAdmin(conf); issueExistHTables = Lists.newArrayList(); inconsistentHTables = Lists.newArrayList(); }
admin = Mockito.spy(new HBaseAdmin(connection));
thenThrow(new ServiceException("Test fail").initCause(new PleaseHoldException("test"))); Mockito.when(connection.getMaster()).thenReturn(masterAdmin); Admin admin = new HBaseAdmin(connection); try { HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(name.getMethodName()));
@Override public Admin getAdmin() throws IOException { return new HBaseAdmin(this); }
Admin admin = new HBaseAdmin(mockConnection); String snapshot = "snapshot"; final TableName table = TableName.valueOf(name.getMethodName());
Mockito.when(mockConnection.getRpcRetryingCallerFactory()).thenReturn(callerFactory); Mockito.when(mockConnection.getRpcControllerFactory()).thenReturn(controllerFactory); Admin admin = new HBaseAdmin(mockConnection);
hbaseAdmin = new HBaseAdmin(conf); hdfsFS = HadoopUtil.getWorkingFileSystem(); operations = new ArrayList<Opt>();
@Override public HBaseAdmin getAdmin() throws SQLException { try { return new HBaseAdmin(config); } catch (IOException e) { throw new PhoenixIOException(e); } }
/** * Computes size of each region for table and given column families. * */ public HBaseRegionSizeCalculator(HTable table) throws IOException { this(table, new HBaseAdmin(table.getConfiguration())); }
/** * Instantiates a new h base data handler. * * @param conf * the conf * @param hTablePool * the h table pool */ public HBaseDataHandler(final KunderaMetadata kunderaMetadata, Configuration conf, HTablePool hTablePool) { try { this.kunderaMetadata = kunderaMetadata; this.conf = conf; this.hTablePool = hTablePool; this.admin = new HBaseAdmin(conf); } catch (Exception e) { // TODO We need a generic ExceptionTranslator throw new PersistenceException(e); } }
private void clean() throws IOException { Configuration conf = HBaseConfiguration.create(); HBaseAdmin hbaseAdmin = new HBaseAdmin(conf); for (HTableDescriptor descriptor : hbaseAdmin.listTables()) { String name = descriptor.getNameAsString().toLowerCase(); if (name.startsWith("kylin") || name.startsWith("_kylin")) { String x = descriptor.getValue("KYLIN_HOST"); System.out.println("table name " + descriptor.getNameAsString() + " host: " + x); System.out.println(descriptor); System.out.println(); } } hbaseAdmin.close(); }
private void alter() throws IOException { Configuration conf = HBaseConfiguration.create(); HBaseAdmin hbaseAdmin = new HBaseAdmin(conf); HTableDescriptor table = hbaseAdmin.getTableDescriptor(TableName.valueOf(tableName)); hbaseAdmin.disableTable(table.getTableName()); table.setValue(metadataKey, metadataValue); hbaseAdmin.modifyTable(table.getTableName(), table); hbaseAdmin.enableTable(table.getTableName()); hbaseAdmin.close(); }
@Test public void testCreateHtable() throws IOException { HTableDescriptor tableDesc = new HTableDescriptor(TableName.valueOf("testhbase")); tableDesc.setValue("KYLIN_HOST", "dev01"); HColumnDescriptor cf = new HColumnDescriptor("f"); cf.setMaxVersions(1); cf.setInMemory(true); cf.setBlocksize(4 * 1024 * 1024); // set to 4MB tableDesc.addFamily(cf); Configuration conf = HBaseConfiguration.create(); HBaseAdmin admin = new HBaseAdmin(conf); admin.createTable(tableDesc); admin.close(); }
@Test public void testRetriveHtableHost() throws IOException { Configuration conf = HBaseConfiguration.create(); HBaseAdmin hbaseAdmin = new HBaseAdmin(conf); HTableDescriptor[] tableDescriptors = hbaseAdmin.listTables(); for (HTableDescriptor table : tableDescriptors) { String value = table.getValue("KYLIN_HOST"); if (value != null) { System.out.println(table.getTableName()); System.out.println("host is " + value); hbaseAdmin.disableTable(table.getTableName()); table.setValue("KYLIN_HOST_ANOTHER", "dev02"); hbaseAdmin.modifyTable(table.getTableName(), table); hbaseAdmin.enableTable(table.getTableName()); } } hbaseAdmin.close(); } }