@@ -101,11 +101,7 @@ public static CompletableFuture<Optional<TableState>> getTableState(AsyncTable<?
101101 return future ;
102102 }
103103
104- /**
105- * Returns the HRegionLocation from meta for the given region n * @param regionName region we're
106- * looking for
107- * @return HRegionLocation for the given region
108- */
104+ /** Returns the HRegionLocation from meta for the given region */
109105 public static CompletableFuture <Optional <HRegionLocation >>
110106 getRegionLocation (AsyncTable <?> metaTable , byte [] regionName ) {
111107 CompletableFuture <Optional <HRegionLocation >> future = new CompletableFuture <>();
@@ -127,11 +123,7 @@ public static CompletableFuture<Optional<TableState>> getTableState(AsyncTable<?
127123 return future ;
128124 }
129125
130- /**
131- * Returns the HRegionLocation from meta for the given encoded region name n * @param
132- * encodedRegionName region we're looking for
133- * @return HRegionLocation for the given region
134- */
126+ /** Returns the HRegionLocation from meta for the given encoded region name */
135127 public static CompletableFuture <Optional <HRegionLocation >>
136128 getRegionLocationWithEncodedName (AsyncTable <?> metaTable , byte [] encodedRegionName ) {
137129 CompletableFuture <Optional <HRegionLocation >> future = new CompletableFuture <>();
@@ -176,8 +168,9 @@ private static Optional<TableState> getTableState(Result r) throws IOException {
176168 }
177169
178170 /**
179- * Used to get all region locations for the specific table. n * @param tableName table we're
180- * looking for, can be null for getting all regions
171+ * Used to get all region locations for the specific table
172+ * @param metaTable scanner over meta table
173+ * @param tableName table we're looking for, can be null for getting all regions
181174 * @return the list of region locations. The return value will be wrapped by a
182175 * {@link CompletableFuture}.
183176 */
@@ -200,8 +193,9 @@ public static CompletableFuture<List<HRegionLocation>> getTableHRegionLocations(
200193 }
201194
202195 /**
203- * Used to get table regions' info and server. n * @param tableName table we're looking for, can
204- * be null for getting all regions
196+ * Used to get table regions' info and server.
197+ * @param metaTable scanner over meta table
198+ * @param tableName table we're looking for, can be null for getting all regions
205199 * @param excludeOfflinedSplitParents don't return split parents
206200 * @return the list of regioninfos and server. The return value will be wrapped by a
207201 * {@link CompletableFuture}.
@@ -259,9 +253,11 @@ void add(Result r) {
259253 }
260254
261255 /**
262- * Performs a scan of META table for given table. n * @param tableName table withing we scan
263- * @param type scanned part of meta
264- * @param visitor Visitor invoked against each row
256+ * Performs a scan of META table for given table.
257+ * @param metaTable scanner over meta table
258+ * @param tableName table within we scan
259+ * @param type scanned part of meta
260+ * @param visitor Visitor invoked against each row
265261 */
266262 private static CompletableFuture <Void > scanMeta (AsyncTable <AdvancedScanResultConsumer > metaTable ,
267263 TableName tableName , QueryType type , final Visitor visitor ) {
@@ -270,11 +266,13 @@ private static CompletableFuture<Void> scanMeta(AsyncTable<AdvancedScanResultCon
270266 }
271267
272268 /**
273- * Performs a scan of META table for given table. n * @param startRow Where to start the scan
274- * @param stopRow Where to stop the scan
275- * @param type scanned part of meta
276- * @param maxRows maximum rows to return
277- * @param visitor Visitor invoked against each row
269+ * Performs a scan of META table for given table.
270+ * @param metaTable scanner over meta table
271+ * @param startRow Where to start the scan
272+ * @param stopRow Where to stop the scan
273+ * @param type scanned part of meta
274+ * @param maxRows maximum rows to return
275+ * @param visitor Visitor invoked against each row
278276 */
279277 private static CompletableFuture <Void > scanMeta (AsyncTable <AdvancedScanResultConsumer > metaTable ,
280278 byte [] startRow , byte [] stopRow , QueryType type , int maxRows , final Visitor visitor ) {
@@ -410,25 +408,32 @@ private static Scan getMetaScan(AsyncTable<?> metaTable, int rowUpperLimit) {
410408 * can't deserialize the result.
411409 */
412410 private static Optional <RegionLocations > getRegionLocations (final Result r ) {
413- if (r == null ) return Optional .empty ();
411+ if (r == null ) {
412+ return Optional .empty ();
413+ }
414414 Optional <RegionInfo > regionInfo = getHRegionInfo (r , getRegionInfoColumn ());
415- if (!regionInfo .isPresent ()) return Optional .empty ();
415+ if (!regionInfo .isPresent ()) {
416+ return Optional .empty ();
417+ }
416418
417419 List <HRegionLocation > locations = new ArrayList <HRegionLocation >(1 );
418420 NavigableMap <byte [], NavigableMap <byte [], byte []>> familyMap = r .getNoVersionMap ();
419421
420422 locations .add (getRegionLocation (r , regionInfo .get (), 0 ));
421423
422424 NavigableMap <byte [], byte []> infoMap = familyMap .get (getCatalogFamily ());
423- if (infoMap == null ) return Optional .of (new RegionLocations (locations ));
425+ if (infoMap == null ) {
426+ return Optional .of (new RegionLocations (locations ));
427+ }
424428
425429 // iterate until all serverName columns are seen
426430 int replicaId = 0 ;
427431 byte [] serverColumn = getServerColumn (replicaId );
428- SortedMap <byte [], byte []> serverMap = null ;
429- serverMap = infoMap .tailMap (serverColumn , false );
432+ SortedMap <byte [], byte []> serverMap = infoMap .tailMap (serverColumn , false );
430433
431- if (serverMap .isEmpty ()) return Optional .of (new RegionLocations (locations ));
434+ if (serverMap .isEmpty ()) {
435+ return Optional .of (new RegionLocations (locations ));
436+ }
432437
433438 for (Map .Entry <byte [], byte []> entry : serverMap .entrySet ()) {
434439 replicaId = parseReplicaIdFromServerColumn (entry .getKey ());
0 commit comments