featurebase/dax/mds/controller/config.go
Matthew Jaffee b8b08bc9eb first cut at automatic snapshotting
- had to make sure we don't snapshot until directive is fully applied
on a computer... otherwise there's races between loading the files and
truncating the write log.

- added a dirty bit to resources and a bool return to incrementing the
write log... don't snapshot if it returns false because that means
there's been no writes. (but make sure you close the storage transaction!)

- added the actually snapshotting routine which just fires every
<timeout> and serially snapshots everything.

- tweaked some logging

- added ability to get all tables in an org/db or literally all. I
think I just needed the "literally all", but it was natural to allow
it to be scoped to org or DB as well.
2022-12-21 07:42:04 -06:00

36 lines
1.1 KiB
Go

package controller
import (
"time"
"github.com/molecula/featurebase/v3/dax/boltdb"
"github.com/molecula/featurebase/v3/dax/mds/schemar"
"github.com/molecula/featurebase/v3/logger"
)
type NewBalancerFn func(string, logger.Logger) Balancer
type Config struct {
Director Director
Schemar schemar.Schemar
ComputeBalancer Balancer
TranslateBalancer Balancer
StorageMethod string
BoltDB *boltdb.DB
// RegistrationBatchTimeout is the time that the controller will
// wait after a node registers itself to see if any more nodes
// will register before sending out directives to all nodes which
// have been registered.
RegistrationBatchTimeout time.Duration
// SnappingTurtleTimeout is the period on which the automatic
// snapshotting routine will run. If performing all the snapshots
// takes longer than this amount of time, snapshotting will run
// continuously. If it finishes before the timeout, it will wait
// until the timeout expires to start another round of snapshots.
SnappingTurtleTimeout time.Duration
Logger logger.Logger
}