From: Sage Weil Date: Tue, 9 Jul 2013 04:33:37 +0000 (-0700) Subject: mon/PaxosService: reorder definitions X-Git-Tag: v0.67-rc1~134^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2f8ff2de170af2b23d6e37143acf130549be2647;p=ceph.git mon/PaxosService: reorder definitions Signed-off-by: Sage Weil --- diff --git a/src/mon/PaxosService.cc b/src/mon/PaxosService.cc index dca64360348a..fcfc3c88b53f 100644 --- a/src/mon/PaxosService.cc +++ b/src/mon/PaxosService.cc @@ -340,28 +340,6 @@ bool PaxosService::should_trim() return true; } -void PaxosService::trim(MonitorDBStore::Transaction *t, - version_t from, version_t to) -{ - dout(10) << __func__ << " from " << from << " to " << to << dendl; - assert(from != to); - - for (version_t v = from; v < to; ++v) { - dout(20) << __func__ << " " << v << dendl; - t->erase(get_service_name(), v); - - string full_key = mon->store->combine_strings("full", v); - if (mon->store->exists(get_service_name(), full_key)) { - dout(20) << __func__ << " " << full_key << dendl; - t->erase(get_service_name(), full_key); - } - } - if (g_conf->mon_compact_on_trim) { - dout(20) << " compacting prefix " << get_service_name() << dendl; - t->compact_range(get_service_name(), stringify(from - 1), stringify(to)); - } -} - void PaxosService::encode_trim(MonitorDBStore::Transaction *t) { version_t first_committed = get_first_committed(); @@ -393,3 +371,25 @@ void PaxosService::encode_trim(MonitorDBStore::Transaction *t) set_trim_to(0); } +void PaxosService::trim(MonitorDBStore::Transaction *t, + version_t from, version_t to) +{ + dout(10) << __func__ << " from " << from << " to " << to << dendl; + assert(from != to); + + for (version_t v = from; v < to; ++v) { + dout(20) << __func__ << " " << v << dendl; + t->erase(get_service_name(), v); + + string full_key = mon->store->combine_strings("full", v); + if (mon->store->exists(get_service_name(), full_key)) { + dout(20) << __func__ << " " << full_key << dendl; + t->erase(get_service_name(), full_key); + } + } + if (g_conf->mon_compact_on_trim) { + dout(20) << " compacting prefix " << get_service_name() << dendl; + t->compact_range(get_service_name(), stringify(from - 1), stringify(to)); + } +} +