milleruntime commented on a change in pull request #1187: Log top tablets by 
ingest and query at a configurable time duration
URL: https://github.com/apache/accumulo/pull/1187#discussion_r291605103
 
 

 ##########
 File path: 
server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
 ##########
 @@ -358,6 +359,53 @@ public TabletServer(ServerConfigurationFactory 
confFactory, VolumeManager fs) th
     this.logSorter = new LogSorter(instance, fs, aconf);
     this.replWorker = new ReplicationWorker(this, fs);
     this.statsKeeper = new TabletStatsKeeper();
+    final int numTopTabletsToLog = 
aconf.getCount(Property.TSERV_LOG_TOP_TABLETS_COUNT);
+    final long logTopTabletsDelay = 
aconf.getTimeInMillis(Property.TSERV_LOG_TOP_TABLETS_INTERVAL);
+    if (numTopTabletsToLog > 0) {
+      SimpleTimer.getInstance(aconf).schedule(new Runnable() {
+        @Override
+        public void run() {
+          Comparator<Pair<String,Long>> topTabletComparator = new 
Comparator<Pair<String,Long>>() {
+            @Override
+            public int compare(Pair<String,Long> first, Pair<String,Long> 
second) {
+              return second.getSecond().compareTo(first.getSecond());
+            }
+          };
+          PriorityQueue<Pair<String,Long>> topTabletsByIngestCount =
+              new PriorityQueue<>(numTopTabletsToLog, topTabletComparator);
+          PriorityQueue<Pair<String,Long>> topTabletsByQueryCount =
+              new PriorityQueue<>(numTopTabletsToLog, topTabletComparator);
+          synchronized (onlineTablets) {
+            for (Tablet tablet : onlineTablets.values()) {
 
 Review comment:
   Looping on every online Tablet could hinder performance on a larger cluster. 
 There could be a lot of tablets.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to