Struct Config#
-
struct Config#
Initinput parameters for initializing the openYuanRong system.Note
When both Config fields and environment variables are set, Config parameters take precedence over environment variables.
Public Members
-
Mode mode = Mode::CLUSTER_MODE#
Deployment model.
Required. Supported values:
LOCAL_MODE: Local mode (single-machine multi-threading),CLUSTER_MODE: Cluster mode (multi-machine multi-process).
-
std::vector<std::string> loadPaths#
Custom
.sofile paths.Defaults to
services.yamlif empty.
-
std::string functionUrn = ""#
Function ID returned after deploying C++ function.
Required in
CLUSTER_MODE. The corresponding environment variable isYRFUNCID.
-
std::string pythonFunctionUrn = ""#
Function ID returned after deploying Python function.
Optional in
CLUSTER_MODE. The corresponding environment variable isYR_PYTHON_FUNCID.
-
std::string javaFunctionUrn = ""#
Function ID returned after deploying Java function.
Optional in
CLUSTER_MODE. The corresponding environment variable isYR_JAVA_FUNCID.
-
std::string serverAddr = ""#
openYuanRong cluster address.
Required in
CLUSTER_MODE. The corresponding environment variable isYR_SERVER_ADDRESS.
-
std::string dataSystemAddr = ""#
Data system server address within the cluster.
Required in
CLUSTER_MODE. The corresponding environment variable isYR_DS_ADDRESS.
-
bool enableServerMode = false#
true: function-proxy acts as server,false: runtime acts as server.Default is
false.
-
int threadPoolSize = 0#
Thread pool size.
Valid range:
1~64. If out of range, defaults to CPU cores count. Only used in ParallelFor.
-
uint32_t localThreadPoolSize = 10#
Local thread pool size.
Required in
LOCAL_MODE. Valid range:1-64. If out of range, defaults to CPU cores count. Default is10.
-
int recycleTime = DEFAULT_RECYCLETIME#
Maximum idle time for instances.
Instances will be terminated if idle beyond this duration. Unit: seconds. Valid range:
1~3000. Defaults to2if not configured.
-
bool enableMTLS = false#
Enable mutual TLS for external clients.
Default is
false.
-
std::string certificateFilePath = ""#
Client certificate file path.
-
std::string privateKeyPath = ""#
Client private key file path.
-
std::string verifyFilePath = ""#
Server certificate file path.
-
std::string metricsLogPath = ""#
Custom path for metrics logs.
The corresponding environment variable is
YR_METRICS_LOG_PATH.
-
bool enableMetrics = true#
Whether to enable metrics collection.
falsemeans disabled,truemeans enabled. Only effective within the cluster. Default isfalse. The corresponding environment variable isYR_ENABLE_METRICS.
-
int maxConcurrencyCreateNum = 100#
Max concurrent stateless instance creations.
Must be >
0. Default is100.
-
uint32_t maxLogSizeMb = 0#
Optional.
Max single log file size (MB). Default
0(if0, it will ultimately be set to40). Negative values throw exceptions. Log rotation every 30s. The corresponding environment variable isYR_MAX_LOG_SIZE_MB.
-
uint32_t maxLogFileNum = 0#
Optional.
Max rotated log files retained. Default
0(if0, it will ultimately be set to20). Oldest files deleted when exceeded. The corresponding environment variable isYR_MAX_LOG_FILE_NUM.
-
bool logCompress = true#
Optional.
Compress rotated logs. Default is
true. The corresponding environment variable isYR_LOG_COMPRESS.
-
std::string logLevel = ""#
Optional.
Log level:
DEBUG,INFO,WARN,ERROR. Invalid values default toINFO. The corresponding environment variable isYR_LOG_LEVEL.
-
std::int32_t rpcTimeout = 30 * 60#
RPC timeout (seconds).
Must be >
10. Default is1800.
-
std::string logDir = ""#
Optional.
Client log directory (created if nonexistent).
-
std::string logPath = ""#
(Deprecated, use
logDir) Optional.Alternate log directory.
-
std::string workingDir = ""#
Absolute path to openYuanRong function directory (where
service.yamlresides).Empty by default.
-
std::string ns = ""#
Default namespace of this client’s function.
-
std::unordered_map<std::string, std::string> customEnvs#
Custom environment variables for runtime (only
LD_LIBRARY_PATHsupported).
-
std::string tenantId = ""#
Tenant ID.
-
Mode mode = Mode::CLUSTER_MODE#
-
struct ClientInfo#
Object returned by
Init, containing runtime context metadata.