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


##########
server/base/src/main/java/org/apache/accumulo/server/manager/state/TabletManagementIterator.java:
##########
@@ -66,35 +68,53 @@
  * TabletManagement objects for each Tablet that needs some type of action 
performed on it by the
  * Manager.
  */
-public class TabletManagementIterator extends SkippingIterator {
+public class TabletManagementIterator extends WholeRowIterator {
   private static final Logger LOG = 
LoggerFactory.getLogger(TabletManagementIterator.class);
   public static final String TABLET_GOAL_STATE_PARAMS_OPTION = "tgsParams";
   private CompactionJobGenerator compactionGenerator;
   private TabletBalancer balancer;
+  private final SplitConfig splitConfig = new SplitConfig();
+
+  private static class SplitConfig {
+    TableId tableId;
+    long splitThreshold;
+    long maxEndRowSize;
+    int maxFilesToOpen;
+
+    void update(TableId tableId, Configuration tableConfig) {
+      if (!tableId.equals(this.tableId)) {
+        this.tableId = tableId;
+        splitThreshold = ConfigurationTypeHelper
+            
.getFixedMemoryAsBytes(tableConfig.get(Property.TABLE_SPLIT_THRESHOLD.getKey()));
+        maxEndRowSize = ConfigurationTypeHelper
+            
.getFixedMemoryAsBytes(tableConfig.get(Property.TABLE_MAX_END_ROW_SIZE.getKey()));
+        maxFilesToOpen = (int) ConfigurationTypeHelper
+            
.getFixedMemoryAsBytes(tableConfig.get(Property.SPLIT_MAXOPEN.getKey()));
+      }
+    }
+  }
 
   private static boolean shouldReturnDueToSplit(final TabletMetadata tm,
-      final Configuration tableConfig) {
+      final Configuration tableConfig, SplitConfig splitConfig) {
 
-    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.SPLIT_MAXOPEN.getKey()));
+    // should see the same table many times in a row, so this should only read 
config the first time
+    // seen
+    splitConfig.update(tm.getTableId(), tableConfig);

Review Comment:
   The snapshot aspect is nice, did not really think about that.  Added a 
comment in f2fdf0b



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