@Override protected Ratio getRatio() { ThreadPoolExecutor metaPool = (ThreadPoolExecutor) conn.getCurrentMetaLookupPool(); if (metaPool == null) { return Ratio.of(0, 0); } return Ratio.of(metaPool.getActiveCount(), metaPool.getMaximumPoolSize()); } });
@Test public void testMetaLookupThreadPoolCreated() throws Exception { final TableName tableName = TableName.valueOf(name.getMethodName()); byte[][] FAMILIES = new byte[][] { Bytes.toBytes("foo") }; if (TEST_UTIL.getAdmin().tableExists(tableName)) { TEST_UTIL.getAdmin().disableTable(tableName); TEST_UTIL.getAdmin().deleteTable(tableName); } try (Table htable = TEST_UTIL.createTable(tableName, FAMILIES)) { byte[] row = "test".getBytes(); ConnectionImplementation c = ((ConnectionImplementation) TEST_UTIL.getConnection()); // check that metalookup pool would get created c.relocateRegion(tableName, row); ExecutorService ex = c.getCurrentMetaLookupPool(); assert(ex != null); } }
@Override protected Ratio getRatio() { ThreadPoolExecutor metaPool = (ThreadPoolExecutor) conn.getCurrentMetaLookupPool(); if (metaPool == null) { return Ratio.of(0, 0); } return Ratio.of(metaPool.getActiveCount(), metaPool.getMaximumPoolSize()); } });
@Override protected Ratio getRatio() { ThreadPoolExecutor metaPool = (ThreadPoolExecutor) conn.getCurrentMetaLookupPool(); if (metaPool == null) { return Ratio.of(0, 0); } return Ratio.of(metaPool.getActiveCount(), metaPool.getMaximumPoolSize()); } });
@Test public void testMetaLookupThreadPoolCreated() throws Exception { final TableName tableName = TableName.valueOf(name.getMethodName()); byte[][] FAMILIES = new byte[][] { Bytes.toBytes("foo") }; if (TEST_UTIL.getAdmin().tableExists(tableName)) { TEST_UTIL.getAdmin().disableTable(tableName); TEST_UTIL.getAdmin().deleteTable(tableName); } try (Table htable = TEST_UTIL.createTable(tableName, FAMILIES);) { byte[] row = "test".getBytes(); ConnectionImplementation c = ((ConnectionImplementation) TEST_UTIL.getConnection()); // check that metalookup pool would get created c.relocateRegion(tableName, row); ExecutorService ex = c.getCurrentMetaLookupPool(); assert(ex != null); } }