blob: f218ae7e28fb9f2e544213813847e2f8af2a188d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
// Author: arnej
package jvm
import (
"bytes"
"os"
"strings"
"github.com/vespa-engine/vespa/client/go/defaults"
)
const (
DEFAULT_MAIN_CLASS = "com.yahoo.jdisc.core.StandaloneMain"
DEFAULT_CP_FILE = "lib/jars/jdisc_core-jar-with-dependencies.jar"
)
func selectedEnv() []byte {
var buf bytes.Buffer
for _, vv := range os.Environ() {
varName := strings.Split(vv, "=")[0]
if strings.Contains(vv, "\n") || strings.Contains(varName, "%%") {
continue
}
buf.WriteString(vv)
buf.WriteString("\n")
}
return buf.Bytes()
}
func (opts *Options) AddCommonJdiscProperties() {
logCtlDir := defaults.UnderVespaHome("var/db/vespa/logcontrol")
opts.fixSpec.FixDir(logCtlDir)
opts.AddOption("-Djdisc.bundle.path=" + defaults.UnderVespaHome("lib/jars"))
opts.AddOption("-Djdisc.logger.enabled=false")
opts.AddOption("-Djdisc.logger.level=WARNING")
opts.AddOption("-Dvespa.log.control.dir=" + logCtlDir)
}
|