use of ai.grakn.engine.GraknConfig in project grakn by graknlabs.
the class ConfigProcessor method updateQueueConfig.
public static void updateQueueConfig() {
GraknConfig graknConfig = Configs.graknConfig();
String updatedQueueConfigString = Configs.queueConfig().updateFromConfig(graknConfig).toConfigString();
saveConfigStringToFile(updatedQueueConfigString, Configs.queueConfigPath());
}
use of ai.grakn.engine.GraknConfig in project grakn by graknlabs.
the class EmbeddedGraknSession method getTxRemoteConfig.
/**
* Gets the properties needed to create a {@link GraknTx} by pinging engine for the config file
*
* @return the properties needed to build a {@link GraknTx}
*/
private static GraknConfig getTxRemoteConfig(SimpleURI uri, Keyspace keyspace) {
URI keyspaceUri = UriBuilder.fromUri(uri.toURI()).path(REST.resolveTemplate(REST.WebPath.KB_KEYSPACE, keyspace.getValue())).build();
Properties properties = new Properties();
// Get Specific Configs
properties.putAll(read(contactEngine(Optional.of(keyspaceUri), REST.HttpConn.PUT_METHOD)).asMap());
GraknConfig config = GraknConfig.of(properties);
// Overwrite Engine IP with something which is remotely accessible
config.setConfigProperty(GraknConfigKey.SERVER_HOST_NAME, uri.getHost());
config.setConfigProperty(GraknConfigKey.SERVER_PORT, uri.getPort());
return config;
}
use of ai.grakn.engine.GraknConfig in project grakn by graknlabs.
the class EmbeddedGraknSession method getTxInMemoryConfig.
/**
* Gets properties which let you build a toy in-mempoty {@link GraknTx}.
* This does nto contact engine in anyway and can be run in an isolated manner
*
* @return the properties needed to build an in-memory {@link GraknTx}
*/
static GraknConfig getTxInMemoryConfig() {
GraknConfig config = GraknConfig.empty();
config.setConfigProperty(GraknConfigKey.SHARDING_THRESHOLD, 100_000L);
config.setConfigProperty(GraknConfigKey.SESSION_CACHE_TIMEOUT_MS, 30_000);
config.setConfigProperty(GraknConfigKey.KB_MODE, GraknTxFactoryBuilder.IN_MEMORY);
config.setConfigProperty(GraknConfigKey.KB_ANALYTICS, GraknTxFactoryBuilder.IN_MEMORY);
return config;
}
Aggregations