Search in sources :

Example 1 with DingoRowStoreOptions

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

the class DefaultDingoRowStoreStartup method main.

public static void main(String[] args) throws Exception {
    if (args.length != 1) {
        LOG.error("Usage: io.dingodb.store.row.DefaultDingoRowStoreStartup <ConfigFilePath>");
        System.exit(1);
    }
    final String configPath = args[0];
    final ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
    final DingoRowStoreOptions opts = mapper.readValue(new File(configPath), DingoRowStoreOptions.class);
    final DefaultDingoRowStore store = new DefaultDingoRowStore();
    if (!store.init(opts)) {
        throw new StoreStartupException("Fail to start [DefaultDingoRowStoreStartup].");
    }
    LOG.info("Starting DefaultDingoRowStore with config: {}.", opts);
}
Also used : DefaultDingoRowStore(io.dingodb.store.row.client.DefaultDingoRowStore) DingoRowStoreOptions(io.dingodb.store.row.options.DingoRowStoreOptions) YAMLFactory(com.fasterxml.jackson.dataformat.yaml.YAMLFactory) StoreStartupException(io.dingodb.store.row.errors.StoreStartupException) File(java.io.File) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Example 2 with DingoRowStoreOptions

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

the class ExecutorServer method buildRowStoreOptions.

private DingoRowStoreOptions buildRowStoreOptions() {
    DingoRowStoreOptions rowStoreOpts = new DingoRowStoreOptions();
    ExecutorExtOptions extOpts = svrOpts.getOptions();
    rowStoreOpts.setClusterName(DingoOptions.instance().getClusterOpts().getName());
    rowStoreOpts.setInitialServerList(svrOpts.getRaft().getInitExecRaftSvrList());
    rowStoreOpts.setFailoverRetries(extOpts.getCliOptions().getMaxRetry());
    rowStoreOpts.setFutureTimeoutMillis(extOpts.getCliOptions().getTimeoutMs());
    PlacementDriverOptions driverOptions = new PlacementDriverOptions();
    driverOptions.setFake(false);
    driverOptions.setPdGroupId(extOpts.getCoordOptions().getGroup());
    driverOptions.setInitialPdServerList(extOpts.getCoordOptions().getInitCoordRaftSvrList());
    CliOptions cliOptions = new CliOptions();
    cliOptions.setMaxRetry(extOpts.getCliOptions().getMaxRetry());
    cliOptions.setTimeoutMs(extOpts.getCliOptions().getTimeoutMs());
    driverOptions.setCliOptions(cliOptions);
    rowStoreOpts.setPlacementDriverOptions(driverOptions);
    Endpoint endpoint = new Endpoint(svrOpts.getIp(), svrOpts.getRaft().getPort());
    extOpts.getStoreEngineOptions().setServerAddress(endpoint);
    rowStoreOpts.setStoreEngineOptions(extOpts.getStoreEngineOptions());
    return rowStoreOpts;
}
Also used : PlacementDriverOptions(io.dingodb.store.row.options.PlacementDriverOptions) Endpoint(io.dingodb.raft.util.Endpoint) DingoRowStoreOptions(io.dingodb.store.row.options.DingoRowStoreOptions) ExecutorExtOptions(io.dingodb.server.executor.config.ExecutorExtOptions) CliOptions(io.dingodb.raft.option.CliOptions)

Example 3 with DingoRowStoreOptions

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

the class ExecutorServer method start.

public void start(final ExecutorOptions opts) throws Exception {
    this.svrOpts = opts;
    log.info("Executor all configuration: {}.", this.svrOpts);
    log.info("instance configuration: {}.", DingoOptions.instance());
    netService.listenPort(svrOpts.getExchange().getPort());
    DingoRowStoreOptions rowStoreOpts = buildRowStoreOptions();
    RowStoreInstance.setRowStoreOptions(rowStoreOpts);
    StoreService storeService = loadStoreService();
    storeService.getInstance("/tmp");
    // todo refactor
    storeHeartBeatSender();
}
Also used : DingoRowStoreOptions(io.dingodb.store.row.options.DingoRowStoreOptions) StoreService(io.dingodb.store.api.StoreService)

Aggregations

DingoRowStoreOptions (io.dingodb.store.row.options.DingoRowStoreOptions)3 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 YAMLFactory (com.fasterxml.jackson.dataformat.yaml.YAMLFactory)1 CliOptions (io.dingodb.raft.option.CliOptions)1 Endpoint (io.dingodb.raft.util.Endpoint)1 ExecutorExtOptions (io.dingodb.server.executor.config.ExecutorExtOptions)1 StoreService (io.dingodb.store.api.StoreService)1 DefaultDingoRowStore (io.dingodb.store.row.client.DefaultDingoRowStore)1 StoreStartupException (io.dingodb.store.row.errors.StoreStartupException)1 PlacementDriverOptions (io.dingodb.store.row.options.PlacementDriverOptions)1 File (java.io.File)1