dlmarion commented on code in PR #3221:
URL: https://github.com/apache/accumulo/pull/3221#discussion_r1123628907


##########
server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java:
##########
@@ -1814,7 +1824,7 @@ List<FileRef> findChopFiles(KeyExtent extent, 
Map<FileRef,Pair<Key,Key>> firstAn
   public synchronized boolean needsSplit() {
     if (isClosing() || isClosed())
       return false;
-    return findSplitRow(getDatafileManager().getFiles()) != null;
+    return isSplitPossible();

Review Comment:
   The DatafileManager manages the files for the Tablet. 
`DatafileManager.datafileSizes` can be modified in several places in 
DatafileManager. I'm wondering if the call to `FileUtil.findMidPoint` that is 
currently in `DatafileManager.findSplitRow` should be moved to 
`DataFileManager` in it's own method. The new method, when invoked, could 
return a previously calculated split row for the Tablet if the `datafileSizes` 
object has not been modified. You could use the same pattern with the call to 
`FileUtil.findLastKey` that is in `DatafileManager.findSplitRow`. This would 
keep the overall logic the same but provide an optimization in the cases where 
it's doing FileIO.



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