Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 19CE0200B99 for ; Wed, 5 Oct 2016 19:07:38 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 1867D160AC9; Wed, 5 Oct 2016 17:07:38 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D0173160AEA for ; Wed, 5 Oct 2016 19:07:36 +0200 (CEST) Received: (qmail 86190 invoked by uid 500); 5 Oct 2016 17:07:28 -0000 Mailing-List: contact commits-help@kudu.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kudu.apache.org Delivered-To: mailing list commits@kudu.apache.org Received: (qmail 85982 invoked by uid 99); 5 Oct 2016 17:07:23 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Oct 2016 17:07:23 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 06C6BE08B3; Wed, 5 Oct 2016 17:07:23 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: todd@apache.org To: commits@kudu.apache.org Date: Wed, 05 Oct 2016 17:07:23 -0000 Message-Id: <92a00d67372c4ec3badcfa7066dd300d@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/4] kudu git commit: Separate tablet MM ops into separate .cc file archived-at: Wed, 05 Oct 2016 17:07:38 -0000 Separate tablet MM ops into separate .cc file tablet.cc is a monster, no need for this in there. Plus, these classes already have their own header file Change-Id: Ie40475fdb9f5da6a7300661d5149509da990939d Reviewed-on: http://gerrit.cloudera.org:8080/4362 Reviewed-by: Jean-Daniel Cryans Reviewed-by: Todd Lipcon Tested-by: Todd Lipcon Project: http://git-wip-us.apache.org/repos/asf/kudu/repo Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/2528edf2 Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/2528edf2 Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/2528edf2 Branch: refs/heads/master Commit: 2528edf28489569f4d4625a8eb1e92fb4df37753 Parents: 2a1a6c0 Author: Mike Percy Authored: Tue Sep 6 21:14:30 2016 -0700 Committer: Todd Lipcon Committed: Wed Oct 5 04:41:41 2016 +0000 ---------------------------------------------------------------------- src/kudu/tablet/CMakeLists.txt | 1 + src/kudu/tablet/tablet.cc | 213 ------------------------------ src/kudu/tablet/tablet_mm_ops.cc | 241 ++++++++++++++++++++++++++++++++++ src/kudu/tablet/tablet_mm_ops.h | 3 + 4 files changed, 245 insertions(+), 213 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kudu/blob/2528edf2/src/kudu/tablet/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/CMakeLists.txt b/src/kudu/tablet/CMakeLists.txt index 8fda82c..9c8bc13 100644 --- a/src/kudu/tablet/CMakeLists.txt +++ b/src/kudu/tablet/CMakeLists.txt @@ -19,6 +19,7 @@ set(TABLET_SRCS tablet.cc tablet_bootstrap.cc tablet_metrics.cc + tablet_mm_ops.cc tablet_peer_mm_ops.cc tablet_peer.cc transactions/transaction.cc http://git-wip-us.apache.org/repos/asf/kudu/blob/2528edf2/src/kudu/tablet/tablet.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/tablet.cc b/src/kudu/tablet/tablet.cc index 8b7e0e4..a0c3f3a 100644 --- a/src/kudu/tablet/tablet.cc +++ b/src/kudu/tablet/tablet.cc @@ -937,219 +937,6 @@ bool Tablet::ShouldThrottleAllow(int64_t bytes) { return throttler_->Take(MonoTime::Now(), 1, bytes); } -//////////////////////////////////////////////////////////// -// CompactRowSetsOp -//////////////////////////////////////////////////////////// - -CompactRowSetsOp::CompactRowSetsOp(Tablet* tablet) - : MaintenanceOp(Substitute("CompactRowSetsOp($0)", tablet->tablet_id()), - MaintenanceOp::HIGH_IO_USAGE), - last_num_mrs_flushed_(0), - last_num_rs_compacted_(0), - tablet_(tablet) { -} - -void CompactRowSetsOp::UpdateStats(MaintenanceOpStats* stats) { - std::lock_guard l(lock_); - - // Any operation that changes the on-disk row layout invalidates the - // cached stats. - TabletMetrics* metrics = tablet_->metrics(); - if (metrics) { - uint64_t new_num_mrs_flushed = metrics->flush_mrs_duration->TotalCount(); - uint64_t new_num_rs_compacted = metrics->compact_rs_duration->TotalCount(); - if (prev_stats_.valid() && - new_num_mrs_flushed == last_num_mrs_flushed_ && - new_num_rs_compacted == last_num_rs_compacted_) { - *stats = prev_stats_; - return; - } else { - last_num_mrs_flushed_ = new_num_mrs_flushed; - last_num_rs_compacted_ = new_num_rs_compacted; - } - } - - tablet_->UpdateCompactionStats(&prev_stats_); - *stats = prev_stats_; -} - -bool CompactRowSetsOp::Prepare() { - std::lock_guard l(lock_); - // Invalidate the cached stats so that another section of the tablet can - // be compacted concurrently. - // - // TODO: we should acquire the rowset compaction locks here. Otherwise, until - // Compact() acquires them, the maintenance manager may compute the same - // stats for this op and run it again, even though Perform() will end up - // performing a much less fruitful compaction. See KUDU-790 for more details. - prev_stats_.Clear(); - return true; -} - -void CompactRowSetsOp::Perform() { - WARN_NOT_OK(tablet_->Compact(Tablet::COMPACT_NO_FLAGS), - Substitute("Compaction failed on $0", tablet_->tablet_id())); -} - -scoped_refptr CompactRowSetsOp::DurationHistogram() const { - return tablet_->metrics()->compact_rs_duration; -} - -scoped_refptr > CompactRowSetsOp::RunningGauge() const { - return tablet_->metrics()->compact_rs_running; -} - -//////////////////////////////////////////////////////////// -// MinorDeltaCompactionOp -//////////////////////////////////////////////////////////// - -MinorDeltaCompactionOp::MinorDeltaCompactionOp(Tablet* tablet) - : MaintenanceOp(Substitute("MinorDeltaCompactionOp($0)", tablet->tablet_id()), - MaintenanceOp::HIGH_IO_USAGE), - last_num_mrs_flushed_(0), - last_num_dms_flushed_(0), - last_num_rs_compacted_(0), - last_num_rs_minor_delta_compacted_(0), - tablet_(tablet) { -} - -void MinorDeltaCompactionOp::UpdateStats(MaintenanceOpStats* stats) { - std::lock_guard l(lock_); - - // Any operation that changes the number of REDO files invalidates the - // cached stats. - TabletMetrics* metrics = tablet_->metrics(); - if (metrics) { - uint64_t new_num_mrs_flushed = metrics->flush_mrs_duration->TotalCount(); - uint64_t new_num_dms_flushed = metrics->flush_dms_duration->TotalCount(); - uint64_t new_num_rs_compacted = metrics->compact_rs_duration->TotalCount(); - uint64_t new_num_rs_minor_delta_compacted = - metrics->delta_minor_compact_rs_duration->TotalCount(); - if (prev_stats_.valid() && - new_num_mrs_flushed == last_num_mrs_flushed_ && - new_num_dms_flushed == last_num_dms_flushed_ && - new_num_rs_compacted == last_num_rs_compacted_ && - new_num_rs_minor_delta_compacted == last_num_rs_minor_delta_compacted_) { - *stats = prev_stats_; - return; - } else { - last_num_mrs_flushed_ = new_num_mrs_flushed; - last_num_dms_flushed_ = new_num_dms_flushed; - last_num_rs_compacted_ = new_num_rs_compacted; - last_num_rs_minor_delta_compacted_ = new_num_rs_minor_delta_compacted; - } - } - - double perf_improv = tablet_->GetPerfImprovementForBestDeltaCompact( - RowSet::MINOR_DELTA_COMPACTION, nullptr); - prev_stats_.set_perf_improvement(perf_improv); - prev_stats_.set_runnable(perf_improv > 0); - *stats = prev_stats_; -} - -bool MinorDeltaCompactionOp::Prepare() { - std::lock_guard l(lock_); - // Invalidate the cached stats so that another rowset in the tablet can - // be delta compacted concurrently. - // - // TODO: See CompactRowSetsOp::Prepare(). - prev_stats_.Clear(); - return true; -} - -void MinorDeltaCompactionOp::Perform() { - WARN_NOT_OK(tablet_->CompactWorstDeltas(RowSet::MINOR_DELTA_COMPACTION), - Substitute("Minor delta compaction failed on $0", tablet_->tablet_id())); -} - -scoped_refptr MinorDeltaCompactionOp::DurationHistogram() const { - return tablet_->metrics()->delta_minor_compact_rs_duration; -} - -scoped_refptr > MinorDeltaCompactionOp::RunningGauge() const { - return tablet_->metrics()->delta_minor_compact_rs_running; -} - -//////////////////////////////////////////////////////////// -// MajorDeltaCompactionOp -//////////////////////////////////////////////////////////// - -MajorDeltaCompactionOp::MajorDeltaCompactionOp(Tablet* tablet) - : MaintenanceOp(Substitute("MajorDeltaCompactionOp($0)", tablet->tablet_id()), - MaintenanceOp::HIGH_IO_USAGE), - last_num_mrs_flushed_(0), - last_num_dms_flushed_(0), - last_num_rs_compacted_(0), - last_num_rs_minor_delta_compacted_(0), - last_num_rs_major_delta_compacted_(0), - tablet_(tablet) { -} - -void MajorDeltaCompactionOp::UpdateStats(MaintenanceOpStats* stats) { - std::lock_guard l(lock_); - - // Any operation that changes the size of the on-disk data invalidates the - // cached stats. - TabletMetrics* metrics = tablet_->metrics(); - if (metrics) { - int64_t new_num_mrs_flushed = metrics->flush_mrs_duration->TotalCount(); - int64_t new_num_dms_flushed = metrics->flush_dms_duration->TotalCount(); - int64_t new_num_rs_compacted = metrics->compact_rs_duration->TotalCount(); - int64_t new_num_rs_minor_delta_compacted = - metrics->delta_minor_compact_rs_duration->TotalCount(); - int64_t new_num_rs_major_delta_compacted = - metrics->delta_major_compact_rs_duration->TotalCount(); - if (prev_stats_.valid() && - new_num_mrs_flushed == last_num_mrs_flushed_ && - new_num_dms_flushed == last_num_dms_flushed_ && - new_num_rs_compacted == last_num_rs_compacted_ && - new_num_rs_minor_delta_compacted == last_num_rs_minor_delta_compacted_ && - new_num_rs_major_delta_compacted == last_num_rs_major_delta_compacted_) { - *stats = prev_stats_; - return; - } else { - last_num_mrs_flushed_ = new_num_mrs_flushed; - last_num_dms_flushed_ = new_num_dms_flushed; - last_num_rs_compacted_ = new_num_rs_compacted; - last_num_rs_minor_delta_compacted_ = new_num_rs_minor_delta_compacted; - last_num_rs_major_delta_compacted_ = new_num_rs_major_delta_compacted; - } - } - - double perf_improv = tablet_->GetPerfImprovementForBestDeltaCompact( - RowSet::MAJOR_DELTA_COMPACTION, nullptr); - prev_stats_.set_perf_improvement(perf_improv); - prev_stats_.set_runnable(perf_improv > 0); - *stats = prev_stats_; -} - -bool MajorDeltaCompactionOp::Prepare() { - std::lock_guard l(lock_); - // Invalidate the cached stats so that another rowset in the tablet can - // be delta compacted concurrently. - // - // TODO: See CompactRowSetsOp::Prepare(). - prev_stats_.Clear(); - return true; -} - -void MajorDeltaCompactionOp::Perform() { - WARN_NOT_OK(tablet_->CompactWorstDeltas(RowSet::MAJOR_DELTA_COMPACTION), - Substitute("Major delta compaction failed on $0", tablet_->tablet_id())); -} - -scoped_refptr MajorDeltaCompactionOp::DurationHistogram() const { - return tablet_->metrics()->delta_major_compact_rs_duration; -} - -scoped_refptr > MajorDeltaCompactionOp::RunningGauge() const { - return tablet_->metrics()->delta_major_compact_rs_running; -} - -//////////////////////////////////////////////////////////// -// Tablet -//////////////////////////////////////////////////////////// - Status Tablet::PickRowSetsToCompact(RowSetsInCompaction *picked, CompactFlags flags) const { CHECK_EQ(state_, kOpen); http://git-wip-us.apache.org/repos/asf/kudu/blob/2528edf2/src/kudu/tablet/tablet_mm_ops.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/tablet_mm_ops.cc b/src/kudu/tablet/tablet_mm_ops.cc new file mode 100644 index 0000000..345e898 --- /dev/null +++ b/src/kudu/tablet/tablet_mm_ops.cc @@ -0,0 +1,241 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include "kudu/tablet/tablet_mm_ops.h" + +#include + +#include "kudu/util/locks.h" +#include "kudu/tablet/tablet.h" +#include "kudu/tablet/tablet_metrics.h" + +using strings::Substitute; + +namespace kudu { +namespace tablet { + +//////////////////////////////////////////////////////////// +// CompactRowSetsOp +//////////////////////////////////////////////////////////// + +CompactRowSetsOp::CompactRowSetsOp(Tablet* tablet) + : MaintenanceOp(Substitute("CompactRowSetsOp($0)", tablet->tablet_id()), + MaintenanceOp::HIGH_IO_USAGE), + last_num_mrs_flushed_(0), + last_num_rs_compacted_(0), + tablet_(tablet) { +} + +void CompactRowSetsOp::UpdateStats(MaintenanceOpStats* stats) { + std::lock_guard l(lock_); + + // Any operation that changes the on-disk row layout invalidates the + // cached stats. + TabletMetrics* metrics = tablet_->metrics(); + if (metrics) { + uint64_t new_num_mrs_flushed = metrics->flush_mrs_duration->TotalCount(); + uint64_t new_num_rs_compacted = metrics->compact_rs_duration->TotalCount(); + if (prev_stats_.valid() && + new_num_mrs_flushed == last_num_mrs_flushed_ && + new_num_rs_compacted == last_num_rs_compacted_) { + *stats = prev_stats_; + return; + } else { + last_num_mrs_flushed_ = new_num_mrs_flushed; + last_num_rs_compacted_ = new_num_rs_compacted; + } + } + + tablet_->UpdateCompactionStats(&prev_stats_); + *stats = prev_stats_; +} + +bool CompactRowSetsOp::Prepare() { + std::lock_guard l(lock_); + // Invalidate the cached stats so that another section of the tablet can + // be compacted concurrently. + // + // TODO: we should acquire the rowset compaction locks here. Otherwise, until + // Compact() acquires them, the maintenance manager may compute the same + // stats for this op and run it again, even though Perform() will end up + // performing a much less fruitful compaction. See KUDU-790 for more details. + prev_stats_.Clear(); + return true; +} + +void CompactRowSetsOp::Perform() { + WARN_NOT_OK(tablet_->Compact(Tablet::COMPACT_NO_FLAGS), + Substitute("Compaction failed on $0", tablet_->tablet_id())); +} + +scoped_refptr CompactRowSetsOp::DurationHistogram() const { + return tablet_->metrics()->compact_rs_duration; +} + +scoped_refptr > CompactRowSetsOp::RunningGauge() const { + return tablet_->metrics()->compact_rs_running; +} + +//////////////////////////////////////////////////////////// +// MinorDeltaCompactionOp +//////////////////////////////////////////////////////////// + +MinorDeltaCompactionOp::MinorDeltaCompactionOp(Tablet* tablet) + : MaintenanceOp(Substitute("MinorDeltaCompactionOp($0)", tablet->tablet_id()), + MaintenanceOp::HIGH_IO_USAGE), + last_num_mrs_flushed_(0), + last_num_dms_flushed_(0), + last_num_rs_compacted_(0), + last_num_rs_minor_delta_compacted_(0), + tablet_(tablet) { +} + +void MinorDeltaCompactionOp::UpdateStats(MaintenanceOpStats* stats) { + std::lock_guard l(lock_); + + // Any operation that changes the number of REDO files invalidates the + // cached stats. + TabletMetrics* metrics = tablet_->metrics(); + if (metrics) { + uint64_t new_num_mrs_flushed = metrics->flush_mrs_duration->TotalCount(); + uint64_t new_num_dms_flushed = metrics->flush_dms_duration->TotalCount(); + uint64_t new_num_rs_compacted = metrics->compact_rs_duration->TotalCount(); + uint64_t new_num_rs_minor_delta_compacted = + metrics->delta_minor_compact_rs_duration->TotalCount(); + if (prev_stats_.valid() && + new_num_mrs_flushed == last_num_mrs_flushed_ && + new_num_dms_flushed == last_num_dms_flushed_ && + new_num_rs_compacted == last_num_rs_compacted_ && + new_num_rs_minor_delta_compacted == last_num_rs_minor_delta_compacted_) { + *stats = prev_stats_; + return; + } else { + last_num_mrs_flushed_ = new_num_mrs_flushed; + last_num_dms_flushed_ = new_num_dms_flushed; + last_num_rs_compacted_ = new_num_rs_compacted; + last_num_rs_minor_delta_compacted_ = new_num_rs_minor_delta_compacted; + } + } + + double perf_improv = tablet_->GetPerfImprovementForBestDeltaCompact( + RowSet::MINOR_DELTA_COMPACTION, nullptr); + prev_stats_.set_perf_improvement(perf_improv); + prev_stats_.set_runnable(perf_improv > 0); + *stats = prev_stats_; +} + +bool MinorDeltaCompactionOp::Prepare() { + std::lock_guard l(lock_); + // Invalidate the cached stats so that another rowset in the tablet can + // be delta compacted concurrently. + // + // TODO: See CompactRowSetsOp::Prepare(). + prev_stats_.Clear(); + return true; +} + +void MinorDeltaCompactionOp::Perform() { + WARN_NOT_OK(tablet_->CompactWorstDeltas(RowSet::MINOR_DELTA_COMPACTION), + Substitute("Minor delta compaction failed on $0", tablet_->tablet_id())); +} + +scoped_refptr MinorDeltaCompactionOp::DurationHistogram() const { + return tablet_->metrics()->delta_minor_compact_rs_duration; +} + +scoped_refptr > MinorDeltaCompactionOp::RunningGauge() const { + return tablet_->metrics()->delta_minor_compact_rs_running; +} + +//////////////////////////////////////////////////////////// +// MajorDeltaCompactionOp +//////////////////////////////////////////////////////////// + +MajorDeltaCompactionOp::MajorDeltaCompactionOp(Tablet* tablet) + : MaintenanceOp(Substitute("MajorDeltaCompactionOp($0)", tablet->tablet_id()), + MaintenanceOp::HIGH_IO_USAGE), + last_num_mrs_flushed_(0), + last_num_dms_flushed_(0), + last_num_rs_compacted_(0), + last_num_rs_minor_delta_compacted_(0), + last_num_rs_major_delta_compacted_(0), + tablet_(tablet) { +} + +void MajorDeltaCompactionOp::UpdateStats(MaintenanceOpStats* stats) { + std::lock_guard l(lock_); + + // Any operation that changes the size of the on-disk data invalidates the + // cached stats. + TabletMetrics* metrics = tablet_->metrics(); + if (metrics) { + int64_t new_num_mrs_flushed = metrics->flush_mrs_duration->TotalCount(); + int64_t new_num_dms_flushed = metrics->flush_dms_duration->TotalCount(); + int64_t new_num_rs_compacted = metrics->compact_rs_duration->TotalCount(); + int64_t new_num_rs_minor_delta_compacted = + metrics->delta_minor_compact_rs_duration->TotalCount(); + int64_t new_num_rs_major_delta_compacted = + metrics->delta_major_compact_rs_duration->TotalCount(); + if (prev_stats_.valid() && + new_num_mrs_flushed == last_num_mrs_flushed_ && + new_num_dms_flushed == last_num_dms_flushed_ && + new_num_rs_compacted == last_num_rs_compacted_ && + new_num_rs_minor_delta_compacted == last_num_rs_minor_delta_compacted_ && + new_num_rs_major_delta_compacted == last_num_rs_major_delta_compacted_) { + *stats = prev_stats_; + return; + } else { + last_num_mrs_flushed_ = new_num_mrs_flushed; + last_num_dms_flushed_ = new_num_dms_flushed; + last_num_rs_compacted_ = new_num_rs_compacted; + last_num_rs_minor_delta_compacted_ = new_num_rs_minor_delta_compacted; + last_num_rs_major_delta_compacted_ = new_num_rs_major_delta_compacted; + } + } + + double perf_improv = tablet_->GetPerfImprovementForBestDeltaCompact( + RowSet::MAJOR_DELTA_COMPACTION, nullptr); + prev_stats_.set_perf_improvement(perf_improv); + prev_stats_.set_runnable(perf_improv > 0); + *stats = prev_stats_; +} + +bool MajorDeltaCompactionOp::Prepare() { + std::lock_guard l(lock_); + // Invalidate the cached stats so that another rowset in the tablet can + // be delta compacted concurrently. + // + // TODO: See CompactRowSetsOp::Prepare(). + prev_stats_.Clear(); + return true; +} + +void MajorDeltaCompactionOp::Perform() { + WARN_NOT_OK(tablet_->CompactWorstDeltas(RowSet::MAJOR_DELTA_COMPACTION), + Substitute("Major delta compaction failed on $0", tablet_->tablet_id())); +} + +scoped_refptr MajorDeltaCompactionOp::DurationHistogram() const { + return tablet_->metrics()->delta_major_compact_rs_duration; +} + +scoped_refptr > MajorDeltaCompactionOp::RunningGauge() const { + return tablet_->metrics()->delta_major_compact_rs_running; +} + +} // namespace tablet +} // namespace kudu http://git-wip-us.apache.org/repos/asf/kudu/blob/2528edf2/src/kudu/tablet/tablet_mm_ops.h ---------------------------------------------------------------------- diff --git a/src/kudu/tablet/tablet_mm_ops.h b/src/kudu/tablet/tablet_mm_ops.h index f4ee1c3..1ea8f95 100644 --- a/src/kudu/tablet/tablet_mm_ops.h +++ b/src/kudu/tablet/tablet_mm_ops.h @@ -18,6 +18,7 @@ #ifndef KUDU_TABLET_TABLET_MM_OPS_H_ #define KUDU_TABLET_TABLET_MM_OPS_H_ +#include "kudu/util/locks.h" #include "kudu/util/maintenance_manager.h" namespace kudu { @@ -28,6 +29,8 @@ class AtomicGauge; namespace tablet { +class Tablet; + // MaintenanceOp for rowset compaction. // // This periodically invokes the tablet's CompactionPolicy to select a compaction. The