DomGarguilo commented on code in PR #3645:
URL: https://github.com/apache/accumulo/pull/3645#discussion_r1271072579


##########
core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsImpl.java:
##########
@@ -2162,12 +2172,54 @@ public Stream<HostingGoalForTablet> 
getTabletHostingGoal(final String tableName,
     return tabletsMetadata.stream().peek(tm -> {
       if (scanRangeStart != null && tm.getEndRow() != null
           && tm.getEndRow().compareTo(scanRangeStart) < 0) {
-        log.debug(">>>> tablet {} is before scan start range: {}", 
tm.getExtent(), scanRangeStart);
+        log.debug("tablet {} is before scan start range: {}", tm.getExtent(), 
scanRangeStart);
         throw new RuntimeException("Bug in ample or this code.");
       }
     }).takeWhile(tm -> tm.getPrevEndRow() == null
         || !range.afterEndKey(new 
Key(tm.getPrevEndRow()).followingKey(PartialKey.ROW)))
         .map(tm -> new HostingGoalForTablet(new TabletIdImpl(tm.getExtent()), 
tm.getHostingGoal()))
         .onClose(tabletsMetadata::close);
   }
+
+  @Override
+  public Stream<TabletInformation> getTabletInformation(final String 
tableName, final Range range)
+      throws TableNotFoundException {
+    EXISTING_TABLE_NAME.validate(tableName);
+
+    final Text scanRangeStart = (range.getStartKey() == null) ? null : 
range.getStartKey().getRow();
+    TableId tableId = context.getTableId(tableName);
+
+    TabletsMetadata tabletsMetadata =
+        
context.getAmple().readTablets().forTable(tableId).overlapping(scanRangeStart, 
true, null)
+            .fetch(HOSTING_GOAL, LOCATION, DIR, PREV_ROW, FILES, LAST, LOGS, 
SUSPEND)
+            .checkConsistency().build();
+
+    Set<TServerInstance> liveTserverSet = 
TabletMetadata.getLiveTServers(context);
+    long[] numEntries = new long[1];
+    long[] size = new long[1];

Review Comment:
   could AtomicLong be used here instead?



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

To unsubscribe, e-mail: [email protected]

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

Reply via email to