mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-11 07:11:02 +00:00
Merge pull request #1651 from molecula/ma/cloud-110
CLOUD-110 FeatureBase Renaming
This commit is contained in:
commit
12fd95d8cf
4 changed files with 22 additions and 12 deletions
14
cmd/root.go
14
cmd/root.go
|
|
@ -35,12 +35,12 @@ func NewRootCommand(stdin io.Reader, stdout, stderr io.Writer) *cobra.Command {
|
|||
This binary contains Pilosa itself, as well as common
|
||||
tools for administering Pilosa, importing/exporting data,
|
||||
backing up, and more. Complete documentation is available
|
||||
at https://www.pilosa.com/docs/.
|
||||
at https://docs.molecula.cloud/.
|
||||
|
||||
` + pilosa.VersionInfo() + "\n",
|
||||
` + pilosa.VersionInfo(false) + "\n",
|
||||
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
|
||||
v := viper.New()
|
||||
err := setAllConfig(v, cmd.Flags(), "PILOSA")
|
||||
err := setAllConfig(v, cmd.Flags())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -90,13 +90,19 @@ at https://www.pilosa.com/docs/.
|
|||
// setAllConfig looks for environment variables which are capitalized versions
|
||||
// of the flag names with dashes replaced by underscores, and prefixed with
|
||||
// envPrefix plus an underscore.
|
||||
func setAllConfig(v *viper.Viper, flags *pflag.FlagSet, envPrefix string) error { // nolint: unparam
|
||||
func setAllConfig(v *viper.Viper, flags *pflag.FlagSet) error { // nolint: unparam
|
||||
// add cmd line flag def to viper
|
||||
err := v.BindPFlags(flags)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
envPrefix := "PILOSA"
|
||||
rename := v.GetBool("future.rename")
|
||||
if rename {
|
||||
envPrefix = "FEATUREBASE"
|
||||
}
|
||||
|
||||
// add env to viper
|
||||
v.SetEnvPrefix(envPrefix)
|
||||
v.SetEnvKeyReplacer(strings.NewReplacer("-", "_", ".", "_"))
|
||||
|
|
|
|||
|
|
@ -27,16 +27,16 @@ import (
|
|||
func BuildServerFlags(cmd *cobra.Command, srv *server.Command) {
|
||||
flags := cmd.Flags()
|
||||
flags.StringVar(&srv.Config.Name, "name", srv.Config.Name, "Name of the node in the cluster.")
|
||||
flags.StringVarP(&srv.Config.DataDir, "data-dir", "d", srv.Config.DataDir, "Directory to store pilosa data files.")
|
||||
flags.StringVarP(&srv.Config.Bind, "bind", "b", srv.Config.Bind, "Default URI on which pilosa should listen.")
|
||||
flags.StringVar(&srv.Config.BindGRPC, "bind-grpc", srv.Config.BindGRPC, "URI on which pilosa should listen for gRPC requests.")
|
||||
flags.StringVarP(&srv.Config.DataDir, "data-dir", "d", srv.Config.DataDir, "Directory to store FeatureBase data files.")
|
||||
flags.StringVarP(&srv.Config.Bind, "bind", "b", srv.Config.Bind, "Default URI on which FeatureBase should listen.")
|
||||
flags.StringVar(&srv.Config.BindGRPC, "bind-grpc", srv.Config.BindGRPC, "URI on which FeatureBase should listen for gRPC requests.")
|
||||
flags.StringVar(&srv.Config.Advertise, "advertise", srv.Config.Advertise, "Address to advertise externally.")
|
||||
flags.StringVar(&srv.Config.AdvertiseGRPC, "advertise-grpc", srv.Config.AdvertiseGRPC, "Address to advertise externally for gRPC.")
|
||||
flags.IntVar(&srv.Config.MaxWritesPerRequest, "max-writes-per-request", srv.Config.MaxWritesPerRequest, "Number of write commands per request.")
|
||||
flags.StringVar(&srv.Config.LogPath, "log-path", srv.Config.LogPath, "Log path")
|
||||
flags.BoolVar(&srv.Config.Verbose, "verbose", srv.Config.Verbose, "Enable verbose logging")
|
||||
flags.Uint64Var(&srv.Config.MaxMapCount, "max-map-count", srv.Config.MaxMapCount, "Limits the maximum number of active mmaps. Pilosa will fall back to reading files once this is exhausted. Set below your system's vm.max_map_count.")
|
||||
flags.Uint64Var(&srv.Config.MaxFileCount, "max-file-count", srv.Config.MaxFileCount, "Soft limit on the maximum number of fragment files Pilosa keeps open simultaneously.")
|
||||
flags.Uint64Var(&srv.Config.MaxMapCount, "max-map-count", srv.Config.MaxMapCount, "Limits the maximum number of active mmaps. FeatureBase will fall back to reading files once this is exhausted. Set below your system's vm.max_map_count.")
|
||||
flags.Uint64Var(&srv.Config.MaxFileCount, "max-file-count", srv.Config.MaxFileCount, "Soft limit on the maximum number of fragment files FeatureBase keeps open simultaneously.")
|
||||
flags.DurationVar((*time.Duration)(&srv.Config.LongQueryTime), "long-query-time", time.Duration(srv.Config.LongQueryTime), "Duration that will trigger log and stat messages for slow queries. Zero to disable.")
|
||||
flags.IntVar(&srv.Config.QueryHistoryLength, "query-history-length", srv.Config.QueryHistoryLength, "Number of queries to remember in history.")
|
||||
|
||||
|
|
|
|||
|
|
@ -342,7 +342,7 @@ func (m *Command) SetupServer() error {
|
|||
return errors.Wrap(err, "setting up logger")
|
||||
}
|
||||
|
||||
m.logger.Infof("%s", pilosa.VersionInfo())
|
||||
m.logger.Infof("%s", pilosa.VersionInfo(m.Config.Future.Rename))
|
||||
|
||||
handleTrialDeadline(m.logger)
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ var BuildTime string
|
|||
var GoVersion string = runtime.Version()
|
||||
var TrialDeadline string
|
||||
|
||||
func VersionInfo() string {
|
||||
func VersionInfo(rename bool) string {
|
||||
var prefix string
|
||||
if Variant != "" {
|
||||
prefix = Variant + " "
|
||||
|
|
@ -56,5 +56,9 @@ func VersionInfo() string {
|
|||
if TrialDeadline != "" {
|
||||
suffix += " limited time trial ends on: " + TrialDeadline
|
||||
}
|
||||
return prefix + "Pilosa" + suffix
|
||||
productName := "Pilosa"
|
||||
if rename {
|
||||
productName = "FeatureBase"
|
||||
}
|
||||
return prefix + productName + suffix
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue