tugboat-logdb

module
v0.0.0-...-2f989cd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2022 License: MIT

README

tugboat-logdb

This is the default LogDB implementation for the Tugboat library.

How to use

package main

import (
	"github.com/coufalja/tugboat"
	"github.com/coufalja/tugboat/config"
	"github.com/coufalja/tugboat-transport/tcp"
	"github.com/coufalja/tugboat-logdb/pebble" // Import the pebble package
)

func main() {
	nhc := config.NodeHostConfig{
		NodeHostDir:    "/tmp",
		RTTMillisecond: 50,
		RaftAddress:    "localhost:8079",
	}

	// Configure the transport
	cfg := tcp.Config{
		MaxSnapshotSendBytesPerSecond: 5 * 1024 * 1024,
		MaxSnapshotRecvBytesPerSecond: 5 * 1024 * 1024,
		MutualTLS:                     false,
		RaftAddress:                   "localhost:8079", // The same RaftAddress must be passed both to transport and the NodeHost
	}
	// Configure LogDB
	lcfg := pebble.GetDefaultLogDBConfig()
	lcfg.KVLRUCacheSize = 2048
	_, _ = tugboat.NewNodeHost(nhc, tcp.Factory(cfg), pebble.Factory(lcfg))
}

Directories

Path Synopsis
Package pebble implements the persistent log storage used by Tugboat.
Package pebble implements the persistent log storage used by Tugboat.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL