diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/FlushTableProcedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/FlushTableProcedure.java index 39873681acdb..bf05dfe54c45 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/FlushTableProcedure.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/FlushTableProcedure.java @@ -123,8 +123,9 @@ protected void preflightChecks(MasterProcedureEnv env, Boolean enabled) throws H MasterServices master = env.getMasterServices(); try { TableDescriptor tableDescriptor = master.getTableDescriptors().get(tableName); - List noSuchFamilies = columnFamilies.stream() - .filter(cf -> !tableDescriptor.hasColumnFamily(cf)).map(Bytes::toString).toList(); + List noSuchFamilies = + columnFamilies.stream().filter(cf -> !tableDescriptor.hasColumnFamily(cf)) + .map(Bytes::toString).collect(Collectors.toList()); if (!noSuchFamilies.isEmpty()) { throw new NoSuchColumnFamilyException("Column families " + noSuchFamilies + " don't exist in table " + tableName.getNameAsString()); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/flush/MasterFlushTableProcedureManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/flush/MasterFlushTableProcedureManager.java index ecc8d9fc5208..12a3809fb749 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/flush/MasterFlushTableProcedureManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/procedure/flush/MasterFlushTableProcedureManager.java @@ -24,6 +24,7 @@ import java.util.Map; import java.util.Set; import java.util.concurrent.ThreadPoolExecutor; +import java.util.stream.Collectors; import java.util.stream.StreamSupport; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseInterfaceAudience; @@ -163,7 +164,8 @@ public void execProcedure(ProcedureDescription desc) throws IOException { TableDescriptor tableDescriptor = master.getTableDescriptors().get(tableName); List noSuchFamilies = StreamSupport.stream(Strings.SPLITTER.split(families.getValue()).spliterator(), false) - .filter(cf -> !tableDescriptor.hasColumnFamily(Bytes.toBytes(cf))).toList(); + .filter(cf -> !tableDescriptor.hasColumnFamily(Bytes.toBytes(cf))) + .collect(Collectors.toList()); if (!noSuchFamilies.isEmpty()) { throw new NoSuchColumnFamilyException("Column families " + noSuchFamilies + " don't exist in table " + tableName.getNameAsString()); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java index 99fb3d34a318..b77fcf338a50 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java @@ -44,6 +44,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.LongAdder; +import java.util.stream.Collectors; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -1779,8 +1780,9 @@ public FlushRegionResponse flushRegion(final RpcController controller, List families = new ArrayList(); families.add(request.getFamily().toByteArray()); TableDescriptor tableDescriptor = region.getTableDescriptor(); - List noSuchFamilies = families.stream() - .filter(f -> !tableDescriptor.hasColumnFamily(f)).map(Bytes::toString).toList(); + List noSuchFamilies = + families.stream().filter(f -> !tableDescriptor.hasColumnFamily(f)).map(Bytes::toString) + .collect(Collectors.toList()); if (!noSuchFamilies.isEmpty()) { throw new NoSuchColumnFamilyException("Column families " + noSuchFamilies + " don't exist in table " + tableDescriptor.getTableName().getNameAsString()); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFlushFromClientWithDisabledFlushProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFlushFromClientWithDisabledFlushProcedure.java index 732e1c53c54b..453f1223b047 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFlushFromClientWithDisabledFlushProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFlushFromClientWithDisabledFlushProcedure.java @@ -25,7 +25,7 @@ import java.util.concurrent.CompletableFuture; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseClassTestRule; -import org.apache.hadoop.hbase.HBaseTestingUtil; +import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.procedure.flush.MasterFlushTableProcedureManager; import org.apache.hadoop.hbase.regionserver.HRegion; @@ -57,7 +57,7 @@ public class TestFlushFromClientWithDisabledFlushProcedure { private static final Logger LOG = LoggerFactory.getLogger(TestFlushFromClientWithDisabledFlushProcedure.class); - private final static HBaseTestingUtil TEST_UTIL = new HBaseTestingUtil(); + private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); private static AsyncConnection asyncConn; private static final byte[] FAMILY = Bytes.toBytes("info"); private static final byte[] QUALIFIER = Bytes.toBytes("name");