blob: 4edb02b2a8459019b8ea92d989503995071c64b1 (
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
// Author: arnej
package jvm
import (
"encoding/json"
"strings"
"github.com/vespa-engine/vespa/client/go/internal/admin/trace"
"github.com/vespa-engine/vespa/client/go/internal/util"
)
type QrStartConfig struct {
Jvm struct {
Server bool `json:"server"`
Verbosegc bool `json:"verbosegc"`
Gcopts string `json:"gcopts"`
Heapsize int `json:"heapsize"`
MinHeapsize int `json:"minHeapsize"`
Stacksize int `json:"stacksize"`
CompressedClassSpaceSize int `json:"compressedClassSpaceSize"`
BaseMaxDirectMemorySize int `json:"baseMaxDirectMemorySize"`
DirectMemorySizeCache int `json:"directMemorySizeCache"`
HeapSizeAsPercentageOfPhysicalMemory int `json:"heapSizeAsPercentageOfPhysicalMemory"`
AvailableProcessors int `json:"availableProcessors"`
} `json:"jvm"`
Qrs struct {
Env string `json:"env"`
} `json:"qrs"`
Jdisc struct {
ClasspathExtra string `json:"classpath_extra"`
ExportPackages string `json:"export_packages"`
} `json:"jdisc"`
}
func (a *ApplicationContainer) getQrStartCfg() *QrStartConfig {
var parsedJson QrStartConfig
args := []string{
"-j",
"-w", "10",
"-n", "search.config.qr-start",
"-i", a.ConfigId(),
}
backticks := util.BackTicksForwardStderr
data, err := backticks.Run("vespa-get-config", args...)
if err != nil {
util.JustExitMsg("could not get qr-start config: " + err.Error())
} else {
codec := json.NewDecoder(strings.NewReader(data))
err = codec.Decode(&parsedJson)
if err != nil {
trace.Trace("could not decode JSON >>>", data, "<<< error:", err)
}
}
return &parsedJson
}
|