keith-turner commented on code in PR #4317:
URL: https://github.com/apache/accumulo/pull/4317#discussion_r1509113017


##########
server/base/src/main/java/org/apache/accumulo/server/manager/state/TabletManagementIterator.java:
##########
@@ -69,7 +72,23 @@ public class TabletManagementIterator extends 
SkippingIterator {
   private TabletBalancer balancer;
 
   private static boolean shouldReturnDueToSplit(final TabletMetadata tm,
-      final long splitThreshold) {
+      final Configuration tableConfig) {
+
+    final long splitThreshold = ConfigurationTypeHelper
+        
.getFixedMemoryAsBytes(tableConfig.get(Property.TABLE_SPLIT_THRESHOLD.getKey()));
+    final long maxEndRowSize = ConfigurationTypeHelper
+        
.getFixedMemoryAsBytes(tableConfig.get(Property.TABLE_MAX_END_ROW_SIZE.getKey()));
+    final int maxFilesToOpen = (int) 
ConfigurationTypeHelper.getFixedMemoryAsBytes(
+        
tableConfig.get(Property.TSERV_TABLET_SPLIT_FINDMIDPOINT_MAXOPEN.getKey()));
+
+    // If current config/files match unsplittable metadata then we can't split
+    if (Optional
+        .ofNullable(tm.getUnSplittable()).filter(um -> 
um.equals(UnSplittableMetadata
+            .toUnSplittable(splitThreshold, maxEndRowSize, maxFilesToOpen, 
tm.getFiles())))
+        .isPresent()) {
+      return false;
+    }
+

Review Comment:
   Maybe this method should always return true if unsplittable column is 
present and things changed.  This would give the split code in the manager a 
chance to remove the column if its not needed anymore.  Thinking of something 
like the following.
   
   ```java
   if(unsplittable is present AND unsplittableFromTablet != 
computedUnsplittable){
      // when unsplittable column is out of date always return true, even if 
tablet is not over
      // split threshold.  This gives code in manager a chance to remove the 
column.
      return true;
   } else if(unsplittable is absent AND tablet is over split threshold){
      return true;
   }
   ```



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