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

Function NewClusterConfig

dgraphtest/config.go:118–136  ·  view source on GitHub ↗

NewClusterConfig generates a default ClusterConfig

()

Source from the content-addressed store, hash-verified

116
117// NewClusterConfig generates a default ClusterConfig
118func NewClusterConfig() ClusterConfig {
119 prefix := fmt.Sprintf("dgraphtest-%d", rand.NewSource(time.Now().UnixNano()).Int63()%1000000)
120 defaultBackupVol := fmt.Sprintf("%v_backup", prefix)
121 defaultExportVol := fmt.Sprintf("%v_export", prefix)
122 return ClusterConfig{
123 prefix: prefix,
124 numAlphas: 1,
125 numZeros: 1,
126 replicas: 1,
127 verbosity: 2,
128 version: localVersion,
129 volumes: map[string]string{DefaultBackupDir: defaultBackupVol, DefaultExportDir: defaultExportVol},
130 refillInterval: 20 * time.Second,
131 uidLease: 50,
132 portOffset: -1,
133 customPlugins: false,
134 mcp: false,
135 }
136}
137
138//func newClusterConfigFrom(cc ClusterConfig) ClusterConfig {
139// prefix := fmt.Sprintf("dgraphtest-%d", rand.NewSource(time.Now().UnixNano()).Int63()%1000000)

Callers 15

TestCheckUpgradeFunction · 0.92
TestQueryDuplicateNodesFunction · 0.92
setupBulkClusterFunction · 0.92
setupTargetClusterFunction · 0.92
TestMCPSSEFunction · 0.92
TestMainFunction · 0.92
TestShortestPathFunction · 0.92
SetupSubTestMethod · 0.92

Calls 1

Int63Method · 0.80

Tested by 15

TestCheckUpgradeFunction · 0.74
TestQueryDuplicateNodesFunction · 0.74
setupBulkClusterFunction · 0.74
setupTargetClusterFunction · 0.74
TestMCPSSEFunction · 0.74
TestMainFunction · 0.74
TestShortestPathFunction · 0.74
SetupSubTestMethod · 0.74