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;
}
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;
}
Aggregations