Skip to content

Commit

Permalink
fixup for branch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
ndimiduk committed Sep 25, 2024
1 parent bfda2a0 commit bf551b0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> noSuchFamilies = columnFamilies.stream()
.filter(cf -> !tableDescriptor.hasColumnFamily(cf)).map(Bytes::toString).toList();
List<String> 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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -163,7 +164,8 @@ public void execProcedure(ProcedureDescription desc) throws IOException {
TableDescriptor tableDescriptor = master.getTableDescriptors().get(tableName);
List<String> 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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1779,8 +1780,9 @@ public FlushRegionResponse flushRegion(final RpcController controller,
List<byte[]> families = new ArrayList();
families.add(request.getFamily().toByteArray());
TableDescriptor tableDescriptor = region.getTableDescriptor();
List<String> noSuchFamilies = families.stream()
.filter(f -> !tableDescriptor.hasColumnFamily(f)).map(Bytes::toString).toList();
List<String> 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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit bf551b0

Please sign in to comment.