@@ -35,7 +35,7 @@ import (
35
35
)
36
36
37
37
const (
38
- // service project layout
38
+ // service project layout in container
39
39
LAYOUT_DINGO_ROOT_DIR = "/dingo"
40
40
LAYOUT_DINGOFS_ROOT_DIR = "/dingofs"
41
41
LAYOUT_DINGOSTORE_ROOT_DIR = "/opt/dingo-store"
@@ -159,11 +159,16 @@ func (dc *DeployConfig) GetServiceConfig() map[string]string { return dc.service
159
159
func (dc * DeployConfig ) GetVariables () * variable.Variables { return dc .variables }
160
160
161
161
// (2): config item
162
- func (dc * DeployConfig ) GetPrefix () string { return dc .getString (CONFIG_PREFIX ) }
163
- func (dc * DeployConfig ) GetReportUsage () bool { return dc .getBool (CONFIG_REPORT_USAGE ) }
164
- func (dc * DeployConfig ) GetContainerImage () string { return dc .getString (CONFIG_CONTAINER_IMAGE ) }
165
- func (dc * DeployConfig ) GetLogDir () string { return dc .getString (CONFIG_LOG_DIR ) }
166
- func (dc * DeployConfig ) GetDataDir () string { return dc .getString (CONFIG_DATA_DIR ) }
162
+ func (dc * DeployConfig ) GetPrefix () string { return dc .getString (CONFIG_PREFIX ) }
163
+ func (dc * DeployConfig ) GetReportUsage () bool { return dc .getBool (CONFIG_REPORT_USAGE ) }
164
+ func (dc * DeployConfig ) GetContainerImage () string { return dc .getString (CONFIG_CONTAINER_IMAGE ) }
165
+ func (dc * DeployConfig ) GetLogDir () string { return dc .getString (CONFIG_LOG_DIR ) }
166
+ func (dc * DeployConfig ) GetDataDir () string {
167
+ if dc .GetRole () == ROLE_MDS_V2 || dc .GetRole () == ROLE_DINGODB_EXECUTOR {
168
+ return "-"
169
+ }
170
+ return dc .getString (CONFIG_DATA_DIR )
171
+ }
167
172
func (dc * DeployConfig ) GetSeqOffset () int { return dc .getInt (CONFIG_SEQ_OFFSET ) }
168
173
func (dc * DeployConfig ) GetSourceCoreDir () string { return dc .getString (CONFIG_SOURCE_CORE_DIR ) }
169
174
func (dc * DeployConfig ) GetTargetCoreDir () string { return dc .getString (CONFIG_TARGET_CORE_DIR ) }
@@ -203,8 +208,13 @@ func (dc *DeployConfig) GetListenExternalPort() int {
203
208
return dc .GetListenPort ()
204
209
}
205
210
211
+ // GetDingoRaftDir returns the raft directory on the host for the Dingo Store service.
206
212
func (dc * DeployConfig ) GetDingoRaftDir () string {
207
- return dc .getString (CONFIG_DINGO_STORE_RAFT_DIR )
213
+ if dc .GetRole () == ROLE_COORDINATOR || dc .GetRole () == ROLE_STORE {
214
+ return dc .getString (CONFIG_DINGO_STORE_RAFT_DIR )
215
+ } else {
216
+ return "-"
217
+ }
208
218
}
209
219
210
220
func (dc * DeployConfig ) GetDingoStoreServerListenHost () string {
@@ -279,6 +289,7 @@ type (
279
289
SourcePath string
280
290
}
281
291
292
+ // Layout defines the service project container path layout
282
293
Layout struct {
283
294
// project: curvebs/curvefs
284
295
ProjectRootDir string // /curvebs
@@ -340,6 +351,7 @@ type (
340
351
}
341
352
)
342
353
354
+ // GetProjectLayout return service project container path layout
343
355
func (dc * DeployConfig ) GetProjectLayout () Layout {
344
356
kind := dc .GetKind ()
345
357
role := dc .GetRole ()
0 commit comments