Support scheduling compactions during time windows
authorAdam Kocoloski <kocolosk@apache.org>
Fri, 6 Sep 2019 16:10:01 +0000 (12:10 -0400)
committerAdam Kocoloski <kocolosk@apache.org>
Tue, 24 Sep 2019 18:43:04 +0000 (14:43 -0400)
commitdddaa3cd44b65d90bc9bd73888c19c0f703b7c97
treebe34c959890250bd524d2e7e7eb7c1486eece5e9
parent8553ee662c6bfd08daabf521cf5c46e0e1696b9b
Support scheduling compactions during time windows

This patch allows administrators to configure smoosh to only
execute compactions during a specified time window on a
per-channel basis. The (partial) configuration looks like

[smoosh]
db_channels=overnight_channel

[smoosh.overnight_channel]
from = 22:00
to = 06:00
strict_window = true

If `strict_window` is set to true, smoosh will suspend all
currently running compactions in this channel when leaving the
time window, and resume them in the next window. If left at the
default, currently running compactions will be allowed to complete
but no new compactions will be started until the window is open again.
src/smoosh_channel.erl
src/smoosh_utils.erl