From d5da3796e1b1d994b2ce6f7e60985277a189255f Mon Sep 17 00:00:00 2001 From: Balazs Meszaros Date: Thu, 23 Nov 2017 14:42:39 +0100 Subject: [PATCH] HBASE-19242 Add MOB compact support for AsyncAdmin --- .../java/org/apache/hadoop/hbase/client/Admin.java | 130 ++++++------ .../org/apache/hadoop/hbase/client/AsyncAdmin.java | 46 +++++ .../hadoop/hbase/client/AsyncHBaseAdmin.java | 30 +++ .../org/apache/hadoop/hbase/client/HBaseAdmin.java | 2 +- .../hadoop/hbase/client/RawAsyncHBaseAdmin.java | 230 +++++++++++++++------ .../hbase/client/TestAsyncRegionAdminApi.java | 38 ++++ 6 files changed, 342 insertions(+), 134 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java index 6f1190e573..7398eb6a47 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java @@ -871,6 +871,33 @@ public interface Admin extends Abortable, Closeable { void compactRegion(byte[] regionName, byte[] columnFamily) throws IOException; + /** + * Compact a table. Asynchronous operation in that this method requests that a + * Compaction run and then it returns. It does not wait on the completion of Compaction + * (it can take a while). + * + * @param tableName table to compact + * @param compactType {@link org.apache.hadoop.hbase.client.CompactType} + * @throws IOException + * @throws InterruptedException + */ + void compact(TableName tableName, CompactType compactType) + throws IOException, InterruptedException; + + /** + * Compact a column family within a table. Asynchronous operation in that this method requests that a + * Compaction run and then it returns. It does not wait on the completion of Compaction + * (it can take a while). + * + * @param tableName table to compact + * @param columnFamily column family within a table + * @param compactType {@link org.apache.hadoop.hbase.client.CompactType} + * @throws IOException if not a mob column family or if a remote or network exception occurs + * @throws InterruptedException + */ + void compact(TableName tableName, byte[] columnFamily, CompactType compactType) + throws IOException, InterruptedException; + /** * Major compact a table. Asynchronous operation in that this method requests * that a Compaction run and then it returns. It does not wait on the completion of Compaction @@ -915,6 +942,33 @@ public interface Admin extends Abortable, Closeable { void majorCompactRegion(byte[] regionName, byte[] columnFamily) throws IOException; + /** + * Major compact a table. Asynchronous operation in that this method requests that a + * Compaction run and then it returns. It does not wait on the completion of Compaction + * (it can take a while). + * + * @param tableName table to compact + * @param compactType {@link org.apache.hadoop.hbase.client.CompactType} + * @throws IOException + * @throws InterruptedException + */ + void majorCompact(TableName tableName, CompactType compactType) + throws IOException, InterruptedException; + + /** + * Major compact a column family within a table. Asynchronous operation in that this method requests that a + * Compaction run and then it returns. It does not wait on the completion of Compaction + * (it can take a while). + * + * @param tableName table to compact + * @param columnFamily column family within a table + * @param compactType {@link org.apache.hadoop.hbase.client.CompactType} + * @throws IOException if not a mob column family or if a remote or network exception occurs + * @throws InterruptedException + */ + void majorCompact(TableName tableName, byte[] columnFamily, CompactType compactType) + throws IOException, InterruptedException; + /** * Compact all regions on the region server. Asynchronous operation in that this method requests * that a Compaction run and then it returns. It does not wait on the completion of Compaction (it @@ -1735,6 +1789,17 @@ public interface Admin extends Abortable, Closeable { */ CompactionState getCompactionState(TableName tableName) throws IOException; + /** + * Get the current compaction state of a table. It could be in a compaction, or none. + * + * @param tableName table to examine + * @param compactType {@link org.apache.hadoop.hbase.client.CompactType} + * @return the current compaction state + * @throws IOException if a remote or network exception occurs + */ + CompactionState getCompactionState(TableName tableName, + CompactType compactType) throws IOException; + /** * Get the current compaction state of region. It could be in a major compaction, a minor * compaction, both, or none. @@ -2310,71 +2375,6 @@ public interface Admin extends Abortable, Closeable { return getClusterStatus(EnumSet.of(Option.MASTER_INFO_PORT)).getMasterInfoPort(); } - /** - * Compact a table. Asynchronous operation in that this method requests that a - * Compaction run and then it returns. It does not wait on the completion of Compaction - * (it can take a while). - * - * @param tableName table to compact - * @param compactType {@link org.apache.hadoop.hbase.client.CompactType} - * @throws IOException - * @throws InterruptedException - */ - void compact(TableName tableName, CompactType compactType) - throws IOException, InterruptedException; - - /** - * Compact a column family within a table. Asynchronous operation in that this method requests that a - * Compaction run and then it returns. It does not wait on the completion of Compaction - * (it can take a while). - * - * @param tableName table to compact - * @param columnFamily column family within a table - * @param compactType {@link org.apache.hadoop.hbase.client.CompactType} - * @throws IOException if not a mob column family or if a remote or network exception occurs - * @throws InterruptedException - */ - void compact(TableName tableName, byte[] columnFamily, CompactType compactType) - throws IOException, InterruptedException; - - /** - * Major compact a table. Asynchronous operation in that this method requests that a - * Compaction run and then it returns. It does not wait on the completion of Compaction - * (it can take a while). - * - * @param tableName table to compact - * @param compactType {@link org.apache.hadoop.hbase.client.CompactType} - * @throws IOException - * @throws InterruptedException - */ - void majorCompact(TableName tableName, CompactType compactType) - throws IOException, InterruptedException; - - /** - * Major compact a column family within a table. Asynchronous operation in that this method requests that a - * Compaction run and then it returns. It does not wait on the completion of Compaction - * (it can take a while). - * - * @param tableName table to compact - * @param columnFamily column family within a table - * @param compactType {@link org.apache.hadoop.hbase.client.CompactType} - * @throws IOException if not a mob column family or if a remote or network exception occurs - * @throws InterruptedException - */ - void majorCompact(TableName tableName, byte[] columnFamily, CompactType compactType) - throws IOException, InterruptedException; - - /** - * Get the current compaction state of a table. It could be in a compaction, or none. - * - * @param tableName table to examine - * @param compactType {@link org.apache.hadoop.hbase.client.CompactType} - * @return the current compaction state - * @throws IOException if a remote or network exception occurs - */ - CompactionState getCompactionState(TableName tableName, - CompactType compactType) throws IOException; - /** * Return the set of supported security capabilities. * @throws IOException diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncAdmin.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncAdmin.java index abd8e5a60b..7738b397a0 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncAdmin.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncAdmin.java @@ -311,6 +311,24 @@ public interface AsyncAdmin { */ CompletableFuture compact(TableName tableName, byte[] columnFamily); + /** + * Compact a table. When the returned CompletableFuture is done, it only means the compact request + * was sent to HBase and may need some time to finish the compact operation. + * @param tableName table to compact + * @param compactType {@link org.apache.hadoop.hbase.client.CompactType} + */ + CompletableFuture compact(TableName tableName, CompactType compactType); + + /** + * Compact a column family within a table. When the returned CompletableFuture is done, it only + * means the compact request was sent to HBase and may need some time to finish the compact + * operation. + * @param tableName table to compact + * @param columnFamily column family within a table + * @param compactType {@link org.apache.hadoop.hbase.client.CompactType} + */ + CompletableFuture compact(TableName tableName, byte[] columnFamily, CompactType compactType); + /** * Compact an individual region. When the returned CompletableFuture is done, it only means the * compact request was sent to HBase and may need some time to finish the compact operation. @@ -345,6 +363,25 @@ public interface AsyncAdmin { */ CompletableFuture majorCompact(TableName tableName, byte[] columnFamily); + /** + * Major compact a table. When the returned CompletableFuture is done, it only means the compact + * request was sent to HBase and may need some time to finish the compact operation. + * @param tableName table to major compact + * @param compactType {@link org.apache.hadoop.hbase.client.CompactType} + */ + CompletableFuture majorCompact(TableName tableName, CompactType compactType); + + /** + * Major compact a column family within a table. When the returned CompletableFuture is done, it + * only means the compact request was sent to HBase and may need some time to finish the compact + * operation. + * @param tableName table to major compact + * @param columnFamily column family within a table. If not present, major compact the table's all + * column families. + * @param compactType {@link org.apache.hadoop.hbase.client.CompactType} + */ + CompletableFuture majorCompact(TableName tableName, byte[] columnFamily, CompactType compactType); + /** * Major compact a region. When the returned CompletableFuture is done, it only means the compact * request was sent to HBase and may need some time to finish the compact operation. @@ -962,6 +999,15 @@ public interface AsyncAdmin { */ CompletableFuture getCompactionState(TableName tableName); + /** + * Get the current compaction state of a table. It could be in a major compaction, a minor + * compaction, both, or none. + * @param tableName table to examine + * @param compactType {@link org.apache.hadoop.hbase.client.CompactType} + * @return the current compaction state wrapped by a {@link CompletableFuture} + */ + CompletableFuture getCompactionState(TableName tableName, CompactType compactType); + /** * Get the current compaction state of region. It could be in a major compaction, a minor * compaction, both, or none. diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncHBaseAdmin.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncHBaseAdmin.java index fb16fcedd4..be81b52563 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncHBaseAdmin.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncHBaseAdmin.java @@ -253,6 +253,18 @@ class AsyncHBaseAdmin implements AsyncAdmin { return wrap(rawAdmin.compact(tableName, columnFamily)); } + @Override + public CompletableFuture compact(TableName tableName, + CompactType compactType) { + return wrap(rawAdmin.compact(tableName, compactType)); + } + + @Override + public CompletableFuture compact(TableName tableName, + byte[] columnFamily, CompactType compactType) { + return wrap(rawAdmin.compact(tableName, columnFamily, compactType)); + } + @Override public CompletableFuture compactRegion(byte[] regionName) { return wrap(rawAdmin.compactRegion(regionName)); @@ -273,6 +285,18 @@ class AsyncHBaseAdmin implements AsyncAdmin { return wrap(rawAdmin.majorCompact(tableName, columnFamily)); } + @Override + public CompletableFuture majorCompact(TableName tableName, + CompactType compactType) { + return wrap(rawAdmin.majorCompact(tableName, compactType)); + } + + @Override + public CompletableFuture majorCompact(TableName tableName, + byte[] columnFamily, CompactType compactType) { + return wrap(rawAdmin.majorCompact(tableName, columnFamily, compactType)); + } + @Override public CompletableFuture majorCompactRegion(byte[] regionName) { return wrap(rawAdmin.majorCompactRegion(regionName)); @@ -636,6 +660,12 @@ class AsyncHBaseAdmin implements AsyncAdmin { return wrap(rawAdmin.getCompactionState(tableName)); } + @Override + public CompletableFuture getCompactionState( + TableName tableName, CompactType compactType) { + return wrap(rawAdmin.getCompactionState(tableName, compactType)); + } + @Override public CompletableFuture getCompactionStateForRegion(byte[] regionName) { return wrap(rawAdmin.getCompactionStateForRegion(regionName)); diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java index 05157dd99d..9072a79789 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java @@ -3304,7 +3304,7 @@ public class HBaseAdmin implements Admin { } break; default: - throw new IllegalArgumentException("Unknowne compactType: " + compactType); + throw new IllegalArgumentException("Unknown compactType: " + compactType); } if (state != null) { return ProtobufUtil.createCompactionState(state); diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RawAsyncHBaseAdmin.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RawAsyncHBaseAdmin.java index f56e7cafc1..063fc06868 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RawAsyncHBaseAdmin.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/RawAsyncHBaseAdmin.java @@ -853,6 +853,19 @@ class RawAsyncHBaseAdmin implements AsyncAdmin { return compact(tableName, columnFamily, false, CompactType.NORMAL); } + @Override + public CompletableFuture compact(TableName tableName, CompactType compactType) { + return compact(tableName, null, false, compactType); + } + + @Override + public CompletableFuture compact(TableName tableName, + byte[] columnFamily, CompactType compactType) { + Preconditions.checkNotNull(columnFamily, + "columnFamily is null. If you don't specify a columnFamily, use compact(TableName) instead"); + return compact(tableName, columnFamily, false, compactType); + } + @Override public CompletableFuture compactRegion(byte[] regionName) { return compactRegion(regionName, null, false); @@ -877,6 +890,19 @@ class RawAsyncHBaseAdmin implements AsyncAdmin { return compact(tableName, columnFamily, true, CompactType.NORMAL); } + @Override + public CompletableFuture majorCompact(TableName tableName, CompactType compactType) { + return compact(tableName, null, true, compactType); + } + + @Override + public CompletableFuture majorCompact(TableName tableName, + byte[] columnFamily, CompactType compactType) { + Preconditions.checkNotNull(columnFamily, + "columnFamily is null. If you don't specify a columnFamily, use compact(TableName) instead"); + return compact(tableName, columnFamily, true, compactType); + } + @Override public CompletableFuture majorCompactRegion(byte[] regionName) { return compactRegion(regionName, null, true); @@ -926,6 +952,7 @@ class RawAsyncHBaseAdmin implements AsyncAdmin { private CompletableFuture compactRegion(byte[] regionName, byte[] columnFamily, boolean major) { CompletableFuture future = new CompletableFuture<>(); + getRegionLocation(regionName).whenComplete( (location, err) -> { if (err != null) { @@ -950,6 +977,11 @@ class RawAsyncHBaseAdmin implements AsyncAdmin { return future; } + private RegionInfo getMobRegionInfo(TableName tableName) { + return RegionInfoBuilder.newBuilder(tableName) + .setStartKey(Bytes.toBytes(".mob")).setRegionId(0).build(); + } + /** * List all region locations for the specific table. */ @@ -983,32 +1015,54 @@ class RawAsyncHBaseAdmin implements AsyncAdmin { */ private CompletableFuture compact(TableName tableName, byte[] columnFamily, boolean major, CompactType compactType) { - if (CompactType.MOB.equals(compactType)) { - // TODO support MOB compact. - return failedFuture(new UnsupportedOperationException("MOB compact does not support")); - } CompletableFuture future = new CompletableFuture<>(); - getTableHRegionLocations(tableName).whenComplete((locations, err) -> { - if (err != null) { - future.completeExceptionally(err); - return; - } - CompletableFuture[] compactFutures = locations.stream().filter(l -> l.getRegion() != null) - .filter(l -> !l.getRegion().isOffline()).filter(l -> l.getServerName() != null) - .map(l -> compact(l.getServerName(), l.getRegion(), major, columnFamily)) - .toArray(CompletableFuture[]::new); - // future complete unless all of the compact futures are completed. - CompletableFuture.allOf(compactFutures).whenComplete((ret, err2) -> { - if (err2 != null) { - future.completeExceptionally(err2); - } else { - future.complete(ret); + + switch (compactType) { + case MOB: + connection.registry.getMasterAddress().whenComplete((serverName, err) -> { + if (err != null) { + future.completeExceptionally(err); + return; } + RegionInfo regionInfo = getMobRegionInfo(tableName); + compact(serverName, regionInfo, major, columnFamily) + .whenComplete((ret, err2) -> { + if (err2 != null) { + future.completeExceptionally(err2); + } else { + future.complete(ret); + } + }); }); - }); + break; + case NORMAL: + getTableHRegionLocations(tableName).whenComplete((locations, err) -> { + if (err != null) { + future.completeExceptionally(err); + return; + } + CompletableFuture[] compactFutures = locations.stream().filter(l -> l.getRegion() != null) + .filter(l -> !l.getRegion().isOffline()).filter(l -> l.getServerName() != null) + .map(l -> compact(l.getServerName(), l.getRegion(), major, columnFamily)) + .toArray(CompletableFuture[]::new); + // future complete unless all of the compact futures are completed. + CompletableFuture.allOf(compactFutures).whenComplete((ret, err2) -> { + if (err2 != null) { + future.completeExceptionally(err2); + } else { + future.complete(ret); + } + }); + }); + break; + default: + throw new IllegalArgumentException("Unknown compactType: " + compactType); + } return future; } + + /** * Compact the region at specific region server. */ @@ -2742,63 +2796,103 @@ class RawAsyncHBaseAdmin implements AsyncAdmin { @Override public CompletableFuture getCompactionState(TableName tableName) { + return getCompactionState(tableName, CompactType.NORMAL); + } + + @Override + public CompletableFuture getCompactionState(TableName tableName, + CompactType compactType) { CompletableFuture future = new CompletableFuture<>(); - getTableHRegionLocations(tableName).whenComplete( - (locations, err) -> { + + switch (compactType) { + case MOB: + connection.registry.getMasterAddress().whenComplete((serverName, err) -> { if (err != null) { future.completeExceptionally(err); return; } - List regionStates = new ArrayList<>(); - List> futures = new ArrayList<>(); - locations.stream().filter(loc -> loc.getServerName() != null) - .filter(loc -> loc.getRegion() != null) - .filter(loc -> !loc.getRegion().isOffline()) - .map(loc -> loc.getRegion().getRegionName()).forEach(region -> { - futures.add(getCompactionStateForRegion(region).whenComplete((regionState, err2) -> { - // If any region compaction state is MAJOR_AND_MINOR - // the table compaction state is MAJOR_AND_MINOR, too. - if (err2 != null) { - future.completeExceptionally(err2); - } else if (regionState == CompactionState.MAJOR_AND_MINOR) { - - future.complete(regionState); - } else { - regionStates.add(regionState); - } - })); - }); - CompletableFuture.allOf(futures.toArray(new CompletableFuture[futures.size()])) - .whenComplete((ret, err3) -> { - // If future not completed, check all regions's compaction state - if (!future.isCompletedExceptionally() && !future.isDone()) { - CompactionState state = CompactionState.NONE; - for (CompactionState regionState : regionStates) { - switch (regionState) { - case MAJOR: - if (state == CompactionState.MINOR) { - future.complete(CompactionState.MAJOR_AND_MINOR); - } else { - state = CompactionState.MAJOR; + RegionInfo regionInfo = getMobRegionInfo(tableName); + + this. newAdminCaller().serverName(serverName).action( + (controller, stub) -> this + . adminCall( + controller, stub, + RequestConverter.buildGetRegionInfoRequest(regionInfo.getRegionName(), true), + (s, c, req, done) -> s.getRegionInfo(controller, req, done), resp -> resp) + ).call().whenComplete((resp2, err2) -> { + if (err2 != null) { + future.completeExceptionally(err2); + } else { + if (resp2.hasCompactionState()) { + future.complete(ProtobufUtil.createCompactionState(resp2.getCompactionState())); + } else { + future.complete(CompactionState.NONE); + } + } + }); + }); + break; + case NORMAL: + getTableHRegionLocations(tableName).whenComplete( + (locations, err) -> { + if (err != null) { + future.completeExceptionally(err); + return; + } + List regionStates = new ArrayList<>(); + List> futures = new ArrayList<>(); + locations.stream().filter(loc -> loc.getServerName() != null) + .filter(loc -> loc.getRegion() != null) + .filter(loc -> !loc.getRegion().isOffline()) + .map(loc -> loc.getRegion().getRegionName()).forEach(region -> { + futures.add(getCompactionStateForRegion(region).whenComplete((regionState, err2) -> { + // If any region compaction state is MAJOR_AND_MINOR + // the table compaction state is MAJOR_AND_MINOR, too. + if (err2 != null) { + future.completeExceptionally(err2); + } else if (regionState == CompactionState.MAJOR_AND_MINOR) { + future.complete(regionState); + } else { + regionStates.add(regionState); + } + })); + }); + CompletableFuture.allOf(futures.toArray(new CompletableFuture[futures.size()])) + .whenComplete((ret, err3) -> { + // If future not completed, check all regions's compaction state + if (!future.isCompletedExceptionally() && !future.isDone()) { + CompactionState state = CompactionState.NONE; + for (CompactionState regionState : regionStates) { + switch (regionState) { + case MAJOR: + if (state == CompactionState.MINOR) { + future.complete(CompactionState.MAJOR_AND_MINOR); + } else { + state = CompactionState.MAJOR; + } + break; + case MINOR: + if (state == CompactionState.MAJOR) { + future.complete(CompactionState.MAJOR_AND_MINOR); + } else { + state = CompactionState.MINOR; + } + break; + case NONE: + default: } - break; - case MINOR: - if (state == CompactionState.MAJOR) { - future.complete(CompactionState.MAJOR_AND_MINOR); - } else { - state = CompactionState.MINOR; + if (!future.isDone()) { + future.complete(state); } - break; - case NONE: - default: - } - if (!future.isDone()) { - future.complete(state); } } - } - }); - }); + }); + }); + break; + default: + throw new IllegalArgumentException("Unknown compactType: " + compactType); + } + return future; } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncRegionAdminApi.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncRegionAdminApi.java index 8a1afab60a..e6cffd6333 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncRegionAdminApi.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncRegionAdminApi.java @@ -20,6 +20,7 @@ package org.apache.hadoop.hbase.client; import static org.apache.hadoop.hbase.TableName.META_TABLE_NAME; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -47,6 +48,7 @@ import org.apache.hadoop.hbase.regionserver.Region; import org.apache.hadoop.hbase.testclassification.ClientTests; import org.apache.hadoop.hbase.testclassification.LargeTests; import org.apache.hadoop.hbase.util.Bytes; +import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; import org.apache.hadoop.hbase.util.JVMClusterUtil; import org.apache.hadoop.hbase.util.Threads; import org.junit.Assert; @@ -422,6 +424,42 @@ public class TestAsyncRegionAdminApi extends TestAsyncAdminBase { assertEquals(count, 2); } + private void waitUntilMobCompactionFinished(TableName tableName) + throws ExecutionException, InterruptedException { + long finished = EnvironmentEdgeManager.currentTime() + 60000; + CompactionState state = admin.getCompactionState(tableName, CompactType.MOB).get(); + while (EnvironmentEdgeManager.currentTime() < finished) { + if (state == CompactionState.NONE) { + break; + } + Thread.sleep(10); + state = admin.getCompactionState(tableName, CompactType.MOB).get(); + } + assertEquals(CompactionState.NONE, state); + } + + @Test + public void testCompactMob() throws Exception { + ColumnFamilyDescriptor columnDescriptor = + ColumnFamilyDescriptorBuilder.newBuilder(Bytes.toBytes("mob")) + .setMobEnabled(true).setMobThreshold(0).build(); + + TableDescriptor tableDescriptor = TableDescriptorBuilder.newBuilder(tableName) + .addColumnFamily(columnDescriptor).build(); + + admin.createTable(tableDescriptor).get(); + + byte[][] families = { Bytes.toBytes("mob") }; + loadData(tableName, families, 3000, 8); + + admin.majorCompact(tableName, CompactType.MOB).get(); + + CompactionState state = admin.getCompactionState(tableName, CompactType.MOB).get(); + assertNotEquals(CompactionState.NONE, state); + + waitUntilMobCompactionFinished(tableName); + } + @Test public void testCompactRegionServer() throws Exception { byte[][] families = { Bytes.toBytes("f1"), Bytes.toBytes("f2"), Bytes.toBytes("f3") }; -- 2.15.0