jstart

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// NOTE: "jstart" in prefix improves logging recognizability
	DEBUG = log.New(getDebugLoggerWriter(), "DEBUG jstart ", log.Ldate|log.Ltime|log.Lmicroseconds|log.Lshortfile)
	INFO  = log.New(os.Stderr, "INFO jstart ", log.Ldate|log.Ltime|log.Lmicroseconds|log.Lshortfile)
	WARN  = log.New(os.Stderr, "WARN jstart ", log.Ldate|log.Ltime|log.Lmicroseconds|log.Lshortfile)
	ERROR = log.New(os.Stderr, "ERROR jstart ", log.Ldate|log.Ltime|log.Lmicroseconds|log.Lshortfile)
)
View Source
var (
	// UnlimitedMemorySize defines the bytes size when memory limit is not set (2 ^ 63 - 4096)
	UnlimitedMemorySize = "9223372036854771712"
)

Functions

func FindOptionWithPrefix

func FindOptionWithPrefix(options []string, prefix string) string

func OrderedKeys

func OrderedKeys(m map[string]string) []string

NOTE: this hack avoids random iterate order on golang maps

func RemoveOptionsWithPrefix

func RemoveOptionsWithPrefix(options []string, prefixList ...string) []string

func Run

func Run(registry *RuleRegistry, settingsLoader RuleParamsLoader)

Types

type ApolloLoader

type ApolloLoader struct {
	ApolloUrl     string   // apollo's api endpoint
	ApolloAppId   string   // apollo app id
	PropertyNames []string // property names to search for rule parameters, the first one with non-empty value will be effective.
}

* apollo(https://github.com/apolloconfig/apollo) is a configuration management system. This loader load rule parameters from the application namespace of a given apollo app id.

rule parameters are encoded with format '<key>=<value>;<key>=<value>...'(e.g. 'xmx=quota-512;gc=auto;nmt=off').

func (*ApolloLoader) Load

func (a *ApolloLoader) Load() RuleParams

* load rule parameters from apollo configuration management system.

homepage of apollo: https://github.com/apolloconfig/apollo

type ChainedLoader

type ChainedLoader struct {
	// contains filtered or unexported fields
}

func NewChainedLoader

func NewChainedLoader(loader RuleParamsLoader, others ...RuleParamsLoader) *ChainedLoader

func (*ChainedLoader) Load

func (l *ChainedLoader) Load() RuleParams

type DirectMemRule

type DirectMemRule struct{}

func (*DirectMemRule) ConvertOptions

func (d *DirectMemRule) ConvertOptions(jdkVersion string, originalOptions []string, ruleParam string) []string

func (*DirectMemRule) Name

func (d *DirectMemRule) Name() string

type EnvLoader

type EnvLoader struct{}

func (*EnvLoader) Load

func (e *EnvLoader) Load() RuleParams

type GcLogRule

type GcLogRule struct{}

func (*GcLogRule) ConvertOptions

func (g *GcLogRule) ConvertOptions(jdkVersion string, originalOptions []string, ruleParam string) []string

func (*GcLogRule) Name

func (g *GcLogRule) Name() string

type GcRule

type GcRule struct{}

func (GcRule) ConvertOptions

func (GcRule) ConvertOptions(jdkVersion string, originalOptions []string, ruleParam string) []string

func (GcRule) Name

func (GcRule) Name() string

type LiteralJavaOptionsRule

type LiteralJavaOptionsRule struct{}

func (*LiteralJavaOptionsRule) ConvertOptions

func (r *LiteralJavaOptionsRule) ConvertOptions(jdkVersion string, originalOptions []string, ruleParam string) []string

func (*LiteralJavaOptionsRule) Name

func (r *LiteralJavaOptionsRule) Name() string

type MaxMetaSpaceRule

type MaxMetaSpaceRule struct{}

a jstart rule for setting -XX:MaxMetaspaceSize

func (*MaxMetaSpaceRule) ConvertOptions

func (m *MaxMetaSpaceRule) ConvertOptions(jdkVersion string, originalOptions []string, ruleParam string) []string

func (*MaxMetaSpaceRule) Name

func (m *MaxMetaSpaceRule) Name() string

type ModExportsRule

type ModExportsRule struct{}

func (*ModExportsRule) ConvertOptions

func (r *ModExportsRule) ConvertOptions(jdkVersion string, originalOptions []string, ruleParam string) []string

func (*ModExportsRule) Name

func (r *ModExportsRule) Name() string

type NmtRule

type NmtRule struct{}

func (NmtRule) ConvertOptions

func (NmtRule) ConvertOptions(jdkVersion string, originalOptions []string, ruleParam string) []string

func (NmtRule) Name

func (NmtRule) Name() string

type PredefinedSystemPropertiesRule

type PredefinedSystemPropertiesRule struct {
	// contains filtered or unexported fields
}

func CreatePredefinedSystemPropertiesRule

func CreatePredefinedSystemPropertiesRule(name string, properties map[string]string) *PredefinedSystemPropertiesRule

func (*PredefinedSystemPropertiesRule) ConvertOptions

func (r *PredefinedSystemPropertiesRule) ConvertOptions(jdkVersion string, originalOptions []string, ruleParam string) []string

func (*PredefinedSystemPropertiesRule) Name

type RemoteDebugRule

type RemoteDebugRule struct{}

func (*RemoteDebugRule) ConvertOptions

func (*RemoteDebugRule) ConvertOptions(jdkVersion string, originalOptions []string, ruleParam string) []string

func (*RemoteDebugRule) Name

func (*RemoteDebugRule) Name() string

type Rule

type Rule interface {
	Name() string
	ConvertOptions(jdkVersion string, originalOptions []string, ruleParam string) []string
}

type RuleParams

type RuleParams = map[string]string

RuleParams is a map of rule name to rule settings.

type RuleParamsLoader

type RuleParamsLoader interface {
	Load() RuleParams
}

func AppendDefaults

func AppendDefaults(loader RuleParamsLoader, defaults RuleParams) RuleParamsLoader

type RuleRegistry

type RuleRegistry struct {
	// contains filtered or unexported fields
}

func NewRuleRegistry

func NewRuleRegistry() *RuleRegistry

func (*RuleRegistry) Find

func (r *RuleRegistry) Find(name string) (Rule, bool)

func (*RuleRegistry) Register

func (r *RuleRegistry) Register(rule Rule)

type WithStaticDefaultsLoader

type WithStaticDefaultsLoader struct {
	// contains filtered or unexported fields
}

func (*WithStaticDefaultsLoader) Load

type XmxRule

type XmxRule struct {
}

a jstart rule for setting Xmx by multiple total memory limit with specific ratio

func (*XmxRule) ConvertOptions

func (r *XmxRule) ConvertOptions(jdkVersion string, originalOptions []string, ruleParam string) []string

func (*XmxRule) Name

func (r *XmxRule) Name() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL