Documentation ¶
Overview ¶
boltcluster is a distribution handling wrapper around boltdb for vertical scaling. The package made for one purpose, to achive higher io and smaller db sizes, on a single computer.
It can be configured with the following Environment variables:
- TRANSACTION_LIMIT_SIZE This will allow you to configure updates transaction limit size, in other words, when multiple update received to be executed, the the cluster try to optimize the execution into a single transaction, so it can be achived faster with less io
Index ¶
- Variables
- type BoltDBTxFunction
- type Cluster
- func (c *Cluster) Batch(distributionKey int, fn BoltDBTxFunction) error
- func (c *Cluster) Close() error
- func (c *Cluster) Open() error
- func (c *Cluster) ParallelBatch(fn BoltDBTxFunction) []error
- func (c *Cluster) ParallelUpdate(fn BoltDBTxFunction) []error
- func (c *Cluster) ParallelView(fn BoltDBTxFunction) []error
- func (c *Cluster) RedistributeTo(newSize int, moveFn BoltDBTxFunction) error
- func (c *Cluster) Update(distributionKey int, fn BoltDBTxFunction) error
- func (c *Cluster) View(distributionKey int, fn BoltDBTxFunction) error
- type Logger
- type Options
Constants ¶
This section is empty.
Variables ¶
var ErrDatabaseAlreadyOpen = errors.New("Database Already open!")
ErrDatabaseAlreadyOpen is an error that returnted when Open method already initialized db connection
Functions ¶
This section is empty.
Types ¶
type BoltDBTxFunction ¶
BoltDBTxFunction bolt db transaction function
type Cluster ¶
type Cluster struct { Logger *Logger // contains filtered or unexported fields }
Cluster object that handles storing new uniq values
func (*Cluster) Batch ¶
func (c *Cluster) Batch(distributionKey int, fn BoltDBTxFunction) error
Batch is the main interface to interact with the database with batch transaction
func (*Cluster) ParallelBatch ¶
func (c *Cluster) ParallelBatch(fn BoltDBTxFunction) []error
ParallelBatch execute batch transaction function on each database
func (*Cluster) ParallelUpdate ¶
func (c *Cluster) ParallelUpdate(fn BoltDBTxFunction) []error
ParallelUpdate execute update transaction function on each database
func (*Cluster) ParallelView ¶
func (c *Cluster) ParallelView(fn BoltDBTxFunction) []error
ParallelView execute view transaction function on each database
func (*Cluster) RedistributeTo ¶
func (c *Cluster) RedistributeTo(newSize int, moveFn BoltDBTxFunction) error
RedistributeTo help you to change the db distribution size on the disc
type Logger ¶
type Logger struct { Verbosity bool // contains filtered or unexported fields }
Logger makes able to set Verbosity using the standard logger
func (*Logger) Fatal ¶
func (l *Logger) Fatal(v ...interface{})
Fatal is equivalent to l.Print() followed by a call to os.Exit(1).
func (*Logger) Fatalln ¶
func (l *Logger) Fatalln(v ...interface{})
Fatalln is equivalent to l.Println() followed by a call to os.Exit(1).
func (*Logger) Print ¶
func (l *Logger) Print(v ...interface{})
Print calls l.Output to print to the logger. Arguments are handled in the manner of fmt.Print.