use of com.baidu.hugegraph.config.HugeConfig in project incubator-hugegraph by apache.
the class InitStore method main.
public static void main(String[] args) throws Exception {
E.checkArgument(args.length == 1, "HugeGraph init-store need to pass the config file " + "of RestServer, like: conf/rest-server.properties");
E.checkArgument(args[0].endsWith(".properties"), "Expect the parameter is properties config file.");
String restConf = args[0];
RegisterUtil.registerBackends();
RegisterUtil.registerPlugins();
RegisterUtil.registerServer();
HugeConfig restServerConfig = new HugeConfig(restConf);
String graphsDir = restServerConfig.get(ServerOptions.GRAPHS);
Map<String, String> graphs = ConfigUtil.scanGraphsDir(graphsDir);
for (Map.Entry<String, String> entry : graphs.entrySet()) {
initGraph(entry.getValue());
}
StandardAuthenticator.initAdminUserIfNeeded(restConf);
HugeFactory.shutdown(30L);
}
use of com.baidu.hugegraph.config.HugeConfig in project incubator-hugegraph by apache.
the class CassandraTest method testParseReplicaWithNetworkTopologyStrategyWithoutDatacenter.
@Test
public void testParseReplicaWithNetworkTopologyStrategyWithoutDatacenter() {
String strategy = CassandraOptions.CASSANDRA_STRATEGY.name();
String replica = CassandraOptions.CASSANDRA_REPLICATION.name();
Configuration conf = new PropertiesConfiguration();
conf.setProperty(strategy, "NetworkTopologyStrategy");
conf.setProperty(replica, ImmutableList.of(":2", "dc2:1"));
HugeConfig config = new HugeConfig(conf);
Assert.assertThrows(RuntimeException.class, () -> {
Whitebox.invokeStatic(CassandraStore.class, "parseReplica", config);
});
}
use of com.baidu.hugegraph.config.HugeConfig in project incubator-hugegraph by apache.
the class CassandraTest method testParseReplicaWithNetworkTopologyStrategyAndStringReplica.
@Test
public void testParseReplicaWithNetworkTopologyStrategyAndStringReplica() {
String strategy = CassandraOptions.CASSANDRA_STRATEGY.name();
String replica = CassandraOptions.CASSANDRA_REPLICATION.name();
Configuration conf = new PropertiesConfiguration();
conf.setProperty(strategy, "NetworkTopologyStrategy");
conf.setProperty(replica, ImmutableList.of("dc1:2", "dc2:string"));
HugeConfig config = new HugeConfig(conf);
Assert.assertThrows(RuntimeException.class, () -> {
Whitebox.invokeStatic(CassandraStore.class, "parseReplica", config);
});
}
use of com.baidu.hugegraph.config.HugeConfig in project incubator-hugegraph by apache.
the class CassandraTest method testParseReplicaWithSimpleStrategyAndStringReplica.
@Test
public void testParseReplicaWithSimpleStrategyAndStringReplica() {
String strategy = CassandraOptions.CASSANDRA_STRATEGY.name();
String replica = CassandraOptions.CASSANDRA_REPLICATION.name();
Configuration conf = new PropertiesConfiguration();
conf.setProperty(strategy, "SimpleStrategy");
conf.setProperty(replica, ImmutableList.of("string"));
HugeConfig config = new HugeConfig(conf);
Assert.assertThrows(RuntimeException.class, () -> {
Whitebox.invokeStatic(CassandraStore.class, "parseReplica", config);
});
}
use of com.baidu.hugegraph.config.HugeConfig in project incubator-hugegraph by apache.
the class CassandraTest method testParseReplicaWithNetworkTopologyStrategyAndDoubleReplica.
@Test
public void testParseReplicaWithNetworkTopologyStrategyAndDoubleReplica() {
String strategy = CassandraOptions.CASSANDRA_STRATEGY.name();
String replica = CassandraOptions.CASSANDRA_REPLICATION.name();
Configuration conf = new PropertiesConfiguration();
conf.setProperty(strategy, "NetworkTopologyStrategy");
conf.setProperty(replica, ImmutableList.of("dc1:3.5", "dc2:1"));
HugeConfig config = new HugeConfig(conf);
Assert.assertThrows(RuntimeException.class, () -> {
Whitebox.invokeStatic(CassandraStore.class, "parseReplica", config);
});
}
Aggregations