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



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ReopenTableRegionsProcedure.java
##########
@@ -57,7 +58,7 @@
 
   // Specify specific regions of a table to reopen.
   // if specified null, all regions of the table will be reopened.
-  private final List<byte[]> regionNames;
+  private List<byte[]> regionNames;

Review comment:
       So here, null means reopen all the regions, and an empty regionNames 
means do not reopen any regions? Then I think the current serialize and 
deserialize will have trouble? You can not tell whether regionNames is null or 
empty after serializing...

##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ReopenTableRegionsProcedure.java
##########
@@ -234,5 +238,11 @@ 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())) {
+      regionNames = new ArrayList<>();
+      data.getRegionNamesList().forEach(regionName -> 
regionNames.add(regionName.toByteArray()));

Review comment:
       Why not just use stream and then collect?




----------------------------------------------------------------
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