Search in sources :

Example 1 with RegionRouteTableOptions

use of io.dingodb.store.row.options.RegionRouteTableOptions in project dingo by dingodb.

the class MultiRegionRouteTableOptionsConfigured method getOrCreateOptsById.

private RegionRouteTableOptions getOrCreateOptsById(final String regionId) {
    Requires.requireNonNull(regionId, "regionId");
    RegionRouteTableOptions opts = this.optsTable.get(regionId);
    if (opts != null) {
        return opts;
    }
    opts = new RegionRouteTableOptions();
    opts.setRegionId(regionId);
    this.optsTable.put(regionId, opts);
    return opts;
}
Also used : RegionRouteTableOptions(io.dingodb.store.row.options.RegionRouteTableOptions)

Example 2 with RegionRouteTableOptions

use of io.dingodb.store.row.options.RegionRouteTableOptions in project dingo by dingodb.

the class AbstractPlacementDriverClient method init.

@Override
public synchronized boolean init(final PlacementDriverOptions opts) {
    initCli(opts.getCliOptions());
    this.pdRpcService = new DefaultPlacementDriverRpcService(this);
    RpcOptions rpcOpts = opts.getPdRpcOptions();
    if (rpcOpts == null) {
        rpcOpts = RpcOptionsConfigured.newDefaultConfig();
        rpcOpts.setCallbackExecutorCorePoolSize(0);
        rpcOpts.setCallbackExecutorMaximumPoolSize(0);
    }
    if (!this.pdRpcService.init(rpcOpts)) {
        LOG.error("Fail to init [PlacementDriverRpcService].");
        return false;
    }
    // region route table
    final List<RegionRouteTableOptions> regionRouteTableOptionsList = opts.getRegionRouteTableOptionsList();
    if (regionRouteTableOptionsList != null) {
        final String initialServerList = opts.getInitialServerList();
        for (final RegionRouteTableOptions regionRouteTableOpts : regionRouteTableOptionsList) {
            if (Strings.isBlank(regionRouteTableOpts.getInitialServerList())) {
                // if blank, extends parent's value
                regionRouteTableOpts.setInitialServerList(initialServerList);
            }
            initRouteTableByRegion(regionRouteTableOpts);
        }
    }
    return true;
}
Also used : RegionRouteTableOptions(io.dingodb.store.row.options.RegionRouteTableOptions) RpcOptions(io.dingodb.store.row.options.RpcOptions)

Aggregations

RegionRouteTableOptions (io.dingodb.store.row.options.RegionRouteTableOptions)2 RpcOptions (io.dingodb.store.row.options.RpcOptions)1