C++#

Basic API#

Init

Configures runtime modes and system parameters.

IsInitialized

Determine if openYuanrong has been initialized.

IsLocalMode

Determine if openYuanrong is in local mode.

Finalize

Finalizes the openYuanrong system.

Struct Config

Configuration parameters required by the init() interface.

struct InstanceRange

Number of function instances Range configuration parameters.

Exception

The exception thrown by openYuanrong.

Stateful & Stateless Function API#

YR_INVOKE

Register functions for openYuanrong distributed invocation.

YR_STATE

Marks a class parameter as state, and openYuanrong will automatically save and recover the state member variables of the class.

YR_RECOVER

Users can use this interface to perform data recovery operations.

YR_SHUTDOWN

Users can use this interface to perform data cleanup or data persistence operations.

Function

Constructs a FunctionHandler for a given function.

FunctionHandler::Invoke

Invokes the registered function with the provided arguments.

FunctionHandler::Options

Set the options for the current invocation, including resources, etc.

FunctionHandler::SetUrn

Set the URN for the current function invocation, which can be used in conjunction with CppFunction or JavaFunction.

Instance

Create an InstanceCreator for constructing an instance of a class.

InstanceCreator::Invoke

Execute the creation of an instance and construct an object of the class.

InstanceCreator::Options

Set options for the instance creation, including resource usage settings.

InstanceCreator::SetUrn

Set the function URN for the instance creation.

InstanceFunctionHandler::Invoke

Invokes a remote function by sending the request to a remote backend for execution.

InstanceFunctionHandler::Options

Sets options for the function invocation, such as timeout and retry count.

NamedInstance

Named instance that can invoke the Function method of this class to construct member functions of the instance’s class.

GetInstance

Get instance associated with the specified name and nameSpace within a timeout.

Cancel

Cancel the corresponding function call by specifying an ObjectRef.

Exit

Exit the current function instance.

SaveState

Saves the instance state.

LoadState

Loads the saved instance state.

struct InvokeOptions

Use to set the invoke options.

RuntimeEnv

Configure runtime environment for cross-language invocation of Python functions.

Data Object API#

Put

Save data to the backend.

Get

Retrieve the value of an object from the backend storage based on its key.

Wait

Waits for the values of a set of objects in the data system to be ready based on their keys.

ObjectRef

Object reference, which is the key of a data object.

Stream API#

Stream

Passing ordered unbounded data between openYuanrong functions.

Collective Communication API#

Collective

Complete documentation for collective communication, covering type definitions, group management APIs, and collective operators such as AllReduce, Reduce, AllGather, Broadcast, Scatter, Barrier, Send, Recv.

Function Interoperation API#

PyFunction

Used for C++ to call Python functions, constructs a call to a Python function.

PyInstanceClass::FactoryCreate

Creates a PyInstanceClass object.

JavaFunction

Create a FunctionHandler for invoking a Java function from C++.

JavaInstanceClass FactoryCreate

Create a JavaInstanceClass object for invoking Java functions.

CppFunction

Create a FunctionHandler for invoking a C++ function by name.

CppInstanceClass FactoryCreate

Create a CppInstanceClass object for invoking C++ functions.

Function Group API#

Group

A class for managing the lifecycle of grouped instances.

KV Cache API#

KV().Set

Sets the value of a key.

KV().MSetTx

A transactional interface for setting multiple binary data entries in a batch.

KV().Write

Writes the value of a key.

KV().MWriteTx

Sets multiple key-value pairs.

KV().WriteRaw

Writes the value (raw bytes) of a key.

KV().Get

Retrieves a value associated with a specified key, similar to Redis’s GET command.

KV().GetWithParam

Retrieves multiple values associated with specified keys with additional parameters, supporting offset-based reading.

KV().Read

Retrieves the value of a key.

KV().ReadRaw

Retrieves the value of a key written by WriteRaw.

KV().Del

Deletes a key and its associated data, similar to Redis’s DEL command.

Multithreaded Parallel API#

ParallelFor

ParallelFor is a function framework for parallel computing, enabling tasks to be executed in parallel across multiple threads to improve computational efficiency.

Affinity Scheduling#

Affinity

Affinity Scheduling Configuration Parameters.