Prefer a pile with a specific state
Below is an example of setting the balancing algorithm option that prefers a pile in a given state in the YDB SDK.
If no state is specified when setting the option, the SDK prefers the PRIMARY pile.
This option only makes sense if the cluster is operating in bridge mode. Otherwise, the SDK uses random choice balancing.
Go
C++
Python
JavaScript
Java
This functionality is not currently supported.
#include <ydb-cpp-sdk/client/driver/driver.h>
int main() {
auto connectionString = std::string(std::getenv("YDB_CONNECTION_STRING"));
auto driverConfig = NYdb::TDriverConfig(connectionString)
.SetBalancingPolicy(NYdb::TBalancingPolicy::UsePreferablePileState(NYdb::EPileState::PRIMARY));
NYdb::TDriver driver(driverConfig);
// ...
driver.Stop(true);
return 0;
}
This functionality is not currently supported.
This section is under development.
This functionality is not currently supported.