keith-turner commented on a change in pull request #1187: Log busy tablets by
ingest and query at a configurable time duration
URL: https://github.com/apache/accumulo/pull/1187#discussion_r291656519
##########
File path:
server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
##########
@@ -358,6 +359,60 @@ 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 numBusyTabletsToLog =
aconf.getCount(Property.TSERV_LOG_BUSY_TABLETS_COUNT);
+ final long logBusyTabletsDelay =
+ aconf.getTimeInMillis(Property.TSERV_LOG_BUSY_TABLETS_INTERVAL);
+
+ // This thread will calculate and log out the busiest tablets based on
ingest count and
+ // query count every #{logBusiestTabletsDelay}
+ if (numBusyTabletsToLog > 0) {
+ SimpleTimer.getInstance(aconf).schedule(new Runnable() {
+ @Override
+ public void run() {
+ Comparator<Pair<String,Long>> busiestTabletComparator =
+ 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>> busiestTabletsByIngestCount =
+ new PriorityQueue<>(numBusyTabletsToLog,
busiestTabletComparator);
+ PriorityQueue<Pair<String,Long>> busiestTabletsByQueryCount =
+ new PriorityQueue<>(numBusyTabletsToLog,
busiestTabletComparator);
+ synchronized (onlineTablets) {
+ for (Tablet tablet : onlineTablets.values()) {
+ addToBusiestTablets(tablet.totalIngest(),
busiestTabletsByIngestCount,
+ numBusyTabletsToLog);
+ addToBusiestTablets(tablet.totalQueries(),
busiestTabletsByQueryCount,
Review comment:
The counts the priority queue is tracking just increase forever. So if one
tablet has been on a tablet server a year and its count is high, it may show up
as busy even though its not currently busy. Need to track the delta in the
counts between sampling.
----------------------------------------------------------------
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