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

 ##########
 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:
   There is a version of this deployed on all of our production clusters today. 
(This version actually has some improvements). The code to collect stats loops 
over the tablets every 5 seconds, and the default for this is once an hour

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