Search in sources :

Example 1 with DefaultDingoRowStore

use of io.dingodb.store.row.client.DefaultDingoRowStore 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)

Aggregations

ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 YAMLFactory (com.fasterxml.jackson.dataformat.yaml.YAMLFactory)1 DefaultDingoRowStore (io.dingodb.store.row.client.DefaultDingoRowStore)1 StoreStartupException (io.dingodb.store.row.errors.StoreStartupException)1 DingoRowStoreOptions (io.dingodb.store.row.options.DingoRowStoreOptions)1 File (java.io.File)1