diff --git a/hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/row/stats/RowStatisticsCompactionObserver.java b/hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/row/stats/RowStatisticsCompactionObserver.java index 78e92aa18ae2..78ead4f17def 100644 --- a/hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/row/stats/RowStatisticsCompactionObserver.java +++ b/hbase-examples/src/main/java/org/apache/hadoop/hbase/coprocessor/example/row/stats/RowStatisticsCompactionObserver.java @@ -168,9 +168,8 @@ public void postStartMaster(ObserverContext ctx) LOG.info("Table {} already exists. Skipping table creation process.", NAMESPACED_TABLE_NAME); } else { - boolean shouldCreateNamespace = - Arrays.stream(admin.listNamespaces()).filter(namespace -> namespace.equals(NAMESPACE)) - .collect(Collectors.toUnmodifiableSet()).isEmpty(); + boolean shouldCreateNamespace = Arrays.stream(admin.listNamespaces()) + .filter(namespace -> namespace.equals(NAMESPACE)).collect(Collectors.toSet()).isEmpty(); if (shouldCreateNamespace) { NamespaceDescriptor nd = NamespaceDescriptor.create(NAMESPACE).build(); try { @@ -180,7 +179,7 @@ public void postStartMaster(ObserverContext ctx) } } ColumnFamilyDescriptor cfd = ColumnFamilyDescriptorBuilder.newBuilder(CF).setMaxVersions(25) - .setTimeToLive((int) Duration.ofDays(7).toSeconds()).build(); + .setTimeToLive((int) Duration.ofDays(7).getSeconds()).build(); TableDescriptor td = TableDescriptorBuilder.newBuilder(NAMESPACED_TABLE_NAME).setColumnFamily(cfd).build(); LOG.info("Creating table {}", NAMESPACED_TABLE_NAME); @@ -197,7 +196,7 @@ public void postStartMaster(ObserverContext ctx) } @Override - public InternalScanner preCompact(ObserverContext context, + public InternalScanner preCompact(ObserverContext context, Store store, InternalScanner scanner, ScanType scanType, CompactionLifeCycleTracker tracker, CompactionRequest request) { if (store.getTableName().isSystemTable()) { @@ -242,15 +241,14 @@ public RowStatisticsScanner(InternalScanner scanner, RowStatisticsImpl rowStatis } @Override - public boolean next(List result, ScannerContext scannerContext) - throws IOException { + public boolean next(List result, ScannerContext scannerContext) throws IOException { boolean ret = scanner.next(result, scannerContext); consumeCells(result); return ret; } @Override - public boolean next(List result) throws IOException { + public boolean next(List result) throws IOException { boolean ret = scanner.next(result); consumeCells(result); return ret; diff --git a/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/row/stats/TestRowStatisticsCompactionObserver.java b/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/row/stats/TestRowStatisticsCompactionObserver.java index d0ee8d3bc578..f763ba40f9fa 100644 --- a/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/row/stats/TestRowStatisticsCompactionObserver.java +++ b/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/row/stats/TestRowStatisticsCompactionObserver.java @@ -28,7 +28,7 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellScanner; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.SingleProcessHBaseCluster; +import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Connection; import org.apache.hadoop.hbase.client.ConnectionFactory; @@ -47,7 +47,7 @@ public class TestRowStatisticsCompactionObserver { public static final TestableRowStatisticsRecorder RECORDER = new TestableRowStatisticsRecorder(); private static final TableName TABLE_NAME = TableName.valueOf("test-table"); private static final byte[] FAMILY = Bytes.toBytes("0"); - private static SingleProcessHBaseCluster cluster; + private static MiniHBaseCluster cluster; private static Connection connection; private static Table table; diff --git a/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/row/stats/TestRowStatisticsTableRecorder.java b/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/row/stats/TestRowStatisticsTableRecorder.java index 39a7e36c2022..a45e01fc9d97 100644 --- a/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/row/stats/TestRowStatisticsTableRecorder.java +++ b/hbase-examples/src/test/java/org/apache/hadoop/hbase/coprocessor/example/row/stats/TestRowStatisticsTableRecorder.java @@ -28,8 +28,8 @@ import java.io.IOException; import java.util.Optional; import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.NamespaceDescriptor; -import org.apache.hadoop.hbase.SingleProcessHBaseCluster; import org.apache.hadoop.hbase.client.BufferedMutatorParams; import org.apache.hadoop.hbase.client.Connection; import org.apache.hadoop.hbase.client.ConnectionFactory; @@ -50,7 +50,7 @@ public class TestRowStatisticsTableRecorder { private static final NamespaceDescriptor NAMESPACE_DESCRIPTOR = NamespaceDescriptor.create(RowStatisticsTableUtil.NAMESPACE).build(); private static final byte[] FULL_REGION_NAME = Bytes.toBytes("fullRegionName"); - private static SingleProcessHBaseCluster cluster; + private static MiniHBaseCluster cluster; private static Connection connection; private RowStatisticsImpl rowStatistics; private Counter counter;