MCPcopy
hub / github.com/dgraph-io/dgraph / Server

Struct Server

dgraph/cmd/zero/zero.go:37–68  ·  view source on GitHub ↗

Server implements the zero server.

Source from the content-addressed store, hash-verified

35
36// Server implements the zero server.
37type Server struct {
38 x.SafeMutex
39 Node *node
40 orc *Oracle
41
42 NumReplicas int
43 state *pb.MembershipState
44 nextRaftId uint64
45
46 // nextUint is the uint64 which we can hand out next. See maxLease for the
47 // max ID leased via Zero quorum.
48 nextUint map[pb.NumLeaseType]uint64
49 readOnlyTs uint64
50 leaseLock sync.Mutex // protects nextUID, nextTxnTs, nextNsID and corresponding proposals.
51 rateLimiter *x.RateLimiter
52
53 // groupMap map[uint32]*Group
54 nextGroup uint32
55 leaderChangeCh chan struct{}
56 closer *z.Closer // Used to tell stream to close.
57 connectLock sync.Mutex // Used to serialize connect requests from servers.
58
59 // tls client config used to connect with zero internally
60 tlsClientConfig *tls.Config
61
62 moveOngoing chan struct{}
63 blockCommitsOn *sync.Map
64
65 checkpointPerGroup map[uint32]uint64
66 // embedding the pb.UnimplementedZeroServer struct to ensure forward compatibility of the server.
67 pb.UnimplementedZeroServer
68}
69
70// Init initializes the zero server.
71func (s *Server) Init() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected