Apache9 commented on a change in pull request #2494:
URL: https://github.com/apache/hbase/pull/2494#discussion_r499241229



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ReopenTableRegionsProcedure.java
##########
@@ -224,6 +225,9 @@ protected void serializeStateData(ProcedureStateSerializer 
serializer) throws IO
     ReopenTableRegionsStateData.Builder builder = 
ReopenTableRegionsStateData.newBuilder()
       .setTableName(ProtobufUtil.toProtoTableName(tableName));
     
regions.stream().map(ProtobufUtil::toRegionLocation).forEachOrdered(builder::addRegion);
+    if (CollectionUtils.isNotEmpty(regionNames)) {

Review comment:
       Since the regionsNames will not be null, we do not need test whether it 
is null or empty here? If it is empty, the below stream will add nothing.

##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ReopenTableRegionsProcedure.java
##########
@@ -234,5 +238,12 @@ protected void 
deserializeStateData(ProcedureStateSerializer serializer) throws
     tableName = ProtobufUtil.toTableName(data.getTableName());
     regions = data.getRegionList().stream().map(ProtobufUtil::toRegionLocation)
       .collect(Collectors.toList());
+    if (CollectionUtils.isNotEmpty(data.getRegionNamesList())) {

Review comment:
       Ditto here? And please use collect(Collectors.toList()), instead of 
creating an ArrayList?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to