blob: 738f70f8b198bacca39116ce90ab9ea039a90de9 (
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <string>
#include <vector>
namespace vespa {
/**
* This is a class containing the defaults for basic Vespa configuration variables.
**/
class Defaults {
public:
/**
* bootstrap VESPA_HOME (if unset) from argv[0]
**/
static void bootstrap(const char *argv0);
/**
* Compute the path prefix where Vespa files will live;
* the return value ends with a "/" so you can just append
* the relative pathname to the file(s) you want.
*
* @return the vespa home directory, ending by "/"
**/
static const char *vespaHome();
/**
* Compute the user name to own directories and run processes.
* @return the vespa user name
**/
static const char *vespaUser();
/**
* Compute the port number where the Vespa webservice
* container should be available.
*
* @return the vespa webservice port
**/
static int vespaWebServicePort();
/**
* Compute the base for port numbers where the Vespa services
* should listen.
*
* @return the vespa base number for ports
**/
static int vespaPortBase();
/**
* Find the hostnames of configservers that are configured
* @return a list of hostnames
**/
static std::vector<std::string> vespaConfigServerHosts();
/**
* Find the RPC port for talking to configservers
*
* @return the RPC port number
**/
static int vespaConfigServerRpcPort();
/**
* Find the RPC addresses to configservers that are configured
* @return a list of RPC specs in the format tcp/{hostname}:{portnumber}
**/
static std::vector<std::string> vespaConfigServerRpcAddrs();
/**
* Find the URLs to the REST api on configservers
* @return a list of URLS in the format http://{hostname}:{portnumber}/
**/
static std::vector<std::string> vespaConfigServerRestUrls();
/**
* Find the RPC address to the local config proxy
* @return one RPC spec in the format tcp/{hostname}:{portnumber}
**/
static std::string vespaConfigProxyRpcAddr();
/**
* Get the RPC addresses to all known config sources
* @return same as vespaConfigProxyRpcAddr + vespaConfigServerRpcAddrs
**/
static std::vector<std::string> vespaConfigSourcesRpcAddrs();
};
} // namespace vespa
|