Apache9 commented on a change in pull request #2095:
URL: https://github.com/apache/hbase/pull/2095#discussion_r457015373
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java
##########
@@ -3305,24 +3324,31 @@ public GetAllMetaRegionLocationsResponse
getAllMetaRegionLocations(RpcController
GetAllMetaRegionLocationsRequest request) throws ServiceException {
boolean excludeOfflinedSplitParents =
request.getExcludeOfflinedSplitParents();
try {
- master.checkServiceStarted();
if (master.getMasterCoprocessorHost() != null) {
master.getMasterCoprocessorHost().preGetAllMetaRegionLocations(excludeOfflinedSplitParents);
}
- List<RegionLocations> locs =
master.getAllMetaRegionLocations(excludeOfflinedSplitParents);
- List<HRegionLocation> list = new ArrayList<>();
- GetAllMetaRegionLocationsResponse.Builder builder =
- GetAllMetaRegionLocationsResponse.newBuilder();
- if (locs != null) {
- for (RegionLocations ls : locs) {
- for (HRegionLocation loc : ls) {
- if (loc != null) {
- builder.addMetaLocations(ProtobufUtil.toRegionLocation(loc));
- list.add(loc);
+ MetaLocationCache cache = master.getMetaLocationCache();
+ List<HRegionLocation> list;
+ if (cache != null) {
Review comment:
For backup masters it will not be null. Active master will set it to
null to let requests go to the master local region directly.
----------------------------------------------------------------
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]