public Collection<HRegion> getOnlineRegionsLocalContext() {
    Collection<HRegion> regions = this.onlineRegions.values();
    return Collections.unmodifiableCollection(regions);
  }
For tests, web ui and metrics. This method will only work if HRegionServer is in the same JVM
as client; HRegion cannot be serialized to cross an rpc.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java