mirror of
https://github.com/HDT3213/godis.git
synced 2025-10-05 00:42:43 +08:00
add aof-use-rdb-preamble
This commit is contained in:
@@ -3,6 +3,11 @@ package cluster
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"runtime/debug"
|
||||
"strings"
|
||||
|
||||
"github.com/hdt3213/rdb/core"
|
||||
|
||||
"github.com/hdt3213/godis/config"
|
||||
database2 "github.com/hdt3213/godis/database"
|
||||
"github.com/hdt3213/godis/datastruct/dict"
|
||||
@@ -15,8 +20,6 @@ import (
|
||||
"github.com/hdt3213/godis/lib/utils"
|
||||
"github.com/hdt3213/godis/redis/client"
|
||||
"github.com/hdt3213/godis/redis/protocol"
|
||||
"runtime/debug"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type PeerPicker interface {
|
||||
@@ -51,8 +54,7 @@ var allowFastTransaction = true
|
||||
// MakeCluster creates and starts a node of cluster
|
||||
func MakeCluster() *Cluster {
|
||||
cluster := &Cluster{
|
||||
self: config.Properties.Self,
|
||||
|
||||
self: config.Properties.Self,
|
||||
db: database2.NewStandaloneServer(),
|
||||
transactions: dict.MakeSimple(),
|
||||
peerPicker: consistenthash.New(replicas, nil),
|
||||
@@ -61,6 +63,7 @@ func MakeCluster() *Cluster {
|
||||
idGenerator: idgenerator.MakeGenerator(config.Properties.Self),
|
||||
relayImpl: defaultRelayImpl,
|
||||
}
|
||||
|
||||
contains := make(map[string]struct{})
|
||||
nodes := make([]string, 0, len(config.Properties.Peers)+1)
|
||||
for _, peer := range config.Properties.Peers {
|
||||
@@ -178,3 +181,7 @@ func (cluster *Cluster) Exec(c redis.Connection, cmdLine [][]byte) (result redis
|
||||
func (cluster *Cluster) AfterClientClose(c redis.Connection) {
|
||||
cluster.db.AfterClientClose(c)
|
||||
}
|
||||
|
||||
func (cluster *Cluster) LoadRDB(dec *core.Decoder) error {
|
||||
return cluster.db.LoadRDB(dec)
|
||||
}
|
||||
|
Reference in New Issue
Block a user