MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / init

Function init

lists.go:30–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28 h := fnv.New32a()
29 h.Write(key)
30 return h.Sum32() % mutexCount
31}
32
33func init() {
34 //All block type instructions of the queue need to be avoided, dangerous operation
35 //conf.AddReadCommand("BLPOP", cmdBLPOP) //Danger here: If it is a Raft write command, Raft will perform command rollback => stuck Raft. If it is a Raft read command, then Raft will not be able to roll back the queue consumption log, and dirty data in the queue will appear.
36 conf.AddWriteCommand("RPUSH", cmdRPUSH)
37 conf.AddWriteCommand("LPOP", cmdLPOP)
38 conf.AddReadCommand("LINDEX", cmdLINDEX)
39 conf.AddWriteCommand("LPUSH", cmdLPUSH)
40 conf.AddWriteCommand("RPOP", cmdRPOP)
41 conf.AddReadCommand("LRANGE", cmdLRANGE)
42 conf.AddWriteCommand("LSET", cmdLSET)
43 conf.AddReadCommand("LLEN", cmdLLEN)
44 conf.AddWriteCommand("RPOPLPUSH", cmdRPOPLPUSH)
45
46 // IceFireDB special commands
47 conf.AddWriteCommand("LCLEAR", cmdLCLEAR)
48 conf.AddWriteCommand("LMCLEAR", cmdLMCLEAR)
49 // Timeout instructions: be cautious, raft log rollback causes dirty data: timeout LEXPIRE => LEXPIREAT
50 conf.AddWriteCommand("LEXPIRE", cmdLEXPIRE)
51 conf.AddWriteCommand("LEXPIREAT", cmdLEXPIREAT)
52 conf.AddReadCommand("LTTL", cmdLTTL)
53 // conf.AddWriteCommand("LPERSIST", cmdLPERSIST)
54 conf.AddReadCommand("LKEYEXISTS", cmdLKEYEXISTS)
55
56 conf.AddWriteCommand("LTRIM", cmdLTRIM)
57 conf.AddWriteCommand("LINSERT", cmdLINSERT)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected