Init

Contents

Init#

ClientInfo YR::Init(const Config &conf)#

YuanRong Init API, Configures runtime modes and system parameters. Refer to the data structure documentation for parameter specifications struct-Config .

// local mode
YR::Config conf;
conf.mode = YR::Config::Mode::LOCAL_MODE;
config.threadPoolSize = 10;
YR::Init(conf);

// cluster mode
YR::Config conf;
conf.mode = YR::Config::Mode::CLUSTER_MODE;
conf.functionID = "sn:cn:yrk:xxxxx:function:0-mysvc-myfunc";
conf.serverAddr = "127.0.0.1:8888";
conf.dataSystemAddr = "127.0.0.1:20001";
YR::Init(conf);

Note

When multi-tenancy is enabled on the YuanRong Cluster, users must configure a tenant ID. For details on tenant ID configuration, refer to the “About Tenant ID” section in struct-Config .

Parameters:

conf – YuanRong initialization parameter configuration. For parameter specifications, refer to struct-Config .

Throws:

Exception – The system will throw an exception when invalid config parameters are detected, such as an invalid mode type.

Returns:

ClientInfo Refer to struct-Config .