Skip to content

Commit

Permalink
fix4
Browse files Browse the repository at this point in the history
  • Loading branch information
confoc committed May 24, 2024
1 parent f7894f9 commit 0c268a5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions cmd/gtctl/cluster_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ type clusterCreateCliOptions struct {
Config string
GreptimeBinVersion string
EnableCache bool
metastore bool
Metastore bool

// Common options.
Timeout int
Expand Down Expand Up @@ -110,7 +110,7 @@ func NewCreateClusterCommand(l logger.Logger) *cobra.Command {
cmd.Flags().StringVar(&options.GreptimeDBClusterValuesFile, "greptimedb-cluster-values-file", "", "The values file for greptimedb cluster.")
cmd.Flags().StringVar(&options.EtcdClusterValuesFile, "etcd-cluster-values-file", "", "The values file for etcd cluster.")
cmd.Flags().StringVar(&options.GreptimeDBOperatorValuesFile, "greptimedb-operator-values-file", "", "The values file for greptimedb operator.")
cmd.Flags().BoolVarP(&options.metastore, "memory-meta-storage", "m", false, "Bootstrap the whole cluster without installing etcd for testing purposes through using the memory storage of metasrv in bare-metal mode.")
cmd.Flags().BoolVarP(&options.Metastore, "memory-meta-storage", "m", false, "Bootstrap the whole cluster without installing etcd for testing purposes through using the memory storage of metasrv in bare-metal mode.")

return cmd
}
Expand Down Expand Up @@ -184,7 +184,7 @@ func NewCluster(args []string, options *clusterCreateCliOptions, l logger.Logger
l.V(0).Infof("Creating GreptimeDB cluster '%s' on bare-metal", logger.Bold(clusterName))

var opts []baremetal.Option
opts = append(opts, baremetal.WithEnableCache(options.EnableCache), baremetal.Withmetastore(options.metastore))
opts = append(opts, baremetal.WithEnableCache(options.EnableCache), baremetal.WithMetastore(options.Metastore))
if len(options.GreptimeBinVersion) > 0 {
opts = append(opts, baremetal.WithGreptimeVersion(options.GreptimeBinVersion))
}
Expand Down
12 changes: 6 additions & 6 deletions pkg/cluster/baremetal/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type Cluster struct {
config *config.BareMetalClusterConfig
createNoDirs bool
enableCache bool
metastore bool
Metastore bool

am artifacts.Manager
mm metadata.Manager
Expand All @@ -55,9 +55,9 @@ type ClusterComponents struct {
}

func NewClusterComponents(config *config.BareMetalClusterComponentsConfig, workingDirs components.WorkingDirs,
wg *sync.WaitGroup, logger logger.Logger, metastore bool) *ClusterComponents {
wg *sync.WaitGroup, logger logger.Logger, Metastore bool) *ClusterComponents {
return &ClusterComponents{
MetaSrv: components.NewMetaSrv(config.MetaSrv, workingDirs, wg, logger, metastore),
MetaSrv: components.NewMetaSrv(config.MetaSrv, workingDirs, wg, logger, Metastore),
Datanode: components.NewDataNode(config.Datanode, config.MetaSrv.ServerAddr, workingDirs, wg, logger),
Frontend: components.NewFrontend(config.Frontend, config.MetaSrv.ServerAddr, workingDirs, wg, logger),
Etcd: components.NewEtcd(workingDirs, wg, logger),
Expand Down Expand Up @@ -85,9 +85,9 @@ func WithEnableCache(enableCache bool) Option {
}
}

func Withmetastore(metastore bool) Option {
func WithMetastore(Metastore bool) Option {
return func(c *Cluster) {
c.metastore = metastore
c.Metastore = Metastore
}
}

Expand Down Expand Up @@ -143,7 +143,7 @@ func NewCluster(l logger.Logger, clusterName string, opts ...Option) (cluster.Op
DataDir: csd.DataDir,
LogsDir: csd.LogsDir,
PidsDir: csd.PidsDir,
}, &c.wg, c.logger, c.metastore)
}, &c.wg, c.logger, c.Metastore)

return c, nil
}
2 changes: 1 addition & 1 deletion pkg/cluster/baremetal/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (c *Cluster) Create(ctx context.Context, options *opt.CreateOptions) error
return nil
}

if c.metastore {
if c.Metastore {
if err := withSpinner("Etcd Cluster", c.createEtcdCluster); err != nil {
return err
}
Expand Down
12 changes: 6 additions & 6 deletions pkg/components/metasrv.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ type metaSrv struct {
workingDirs WorkingDirs
wg *sync.WaitGroup
logger logger.Logger
metastore bool
Metastore bool

allocatedDirs
}

func NewMetaSrv(config *config.MetaSrv, workingDirs WorkingDirs,
wg *sync.WaitGroup, logger logger.Logger, metastore bool) ClusterComponent {
wg *sync.WaitGroup, logger logger.Logger, Metastore bool) ClusterComponent {
return &metaSrv{
config: config,
workingDirs: workingDirs,
wg: wg,
logger: logger,
metastore: metastore,
Metastore: Metastore,
}
}

Expand Down Expand Up @@ -128,9 +128,9 @@ func (m *metaSrv) BuildArgs(params ...interface{}) []string {
args = GenerateAddrArg("--http-addr", m.config.HTTPAddr, nodeID, args)
args = GenerateAddrArg("--bind-addr", bindAddr, nodeID, args)

if m.metastore {
metastore := strconv.FormatBool(m.metastore)
args = GenerateAddrArg("--use-memory-store", metastore, nodeID, args)
if m.Metastore {
Metastore := strconv.FormatBool(m.Metastore)
args = GenerateAddrArg("--use-memory-store", Metastore, nodeID, args)
}

if len(m.config.Config) > 0 {
Expand Down

0 comments on commit 0c268a5

Please sign in to comment.