use of org.apache.rya.indexing.mongodb.MongoIndexingConfiguration.MongoDBIndexingConfigBuilder in project incubator-rya by apache.
the class MongoRyaDirectExample method getConf.
private static Configuration getConf() throws IOException {
MongoDBIndexingConfigBuilder builder = MongoIndexingConfiguration.builder().setUseMockMongo(USE_MOCK).setUseInference(USE_INFER).setAuths("U");
if (USE_MOCK) {
final EmbeddedMongoFactory factory = EmbeddedMongoFactory.newFactory();
final IMongoConfig connectionConfig = factory.getMongoServerDetails();
final Net net = connectionConfig.net();
builder.setMongoHost(net.getBindIp() == null ? "127.0.0.1" : net.getBindIp()).setMongoPort(net.getPort() + "");
} else {
// User name and password must be filled in:
builder = builder.setMongoUser(MONGO_USER).setMongoPassword(MONGO_PASSWORD).setMongoHost(MONGO_INSTANCE_URL).setMongoPort(MONGO_INSTANCE_PORT);
}
return builder.setMongoDBName(MONGO_DB).setMongoCollectionPrefix(MONGO_COLL_PREFIX).setUseMongoFreetextIndex(true).setMongoFreeTextPredicates(RDFS.LABEL.stringValue()).build();
}
use of org.apache.rya.indexing.mongodb.MongoIndexingConfiguration.MongoDBIndexingConfigBuilder in project incubator-rya by apache.
the class InferenceExamples method getConf.
private static Configuration getConf() throws IOException {
// MongoDBIndexingConfigBuilder builder = MongoIndexingConfiguration.builder()
// .setUseMockMongo(USE_MOCK).setUseInference(USE_INFER).setAuths("U");
MongoDBIndexingConfigBuilder builder = MongoIndexingConfiguration.builder().setUseMockMongo(USE_EMBEDDED_MONGO).setUseInference(true).setAuths("U");
if (USE_EMBEDDED_MONGO) {
final MongoClient c = EmbeddedMongoFactory.newFactory().newMongoClient();
final ServerAddress address = c.getAddress();
final String url = address.getHost();
final String port = Integer.toString(address.getPort());
c.close();
builder.setMongoHost(url).setMongoPort(port);
} else {
// User name and password must be filled in:
builder = builder.setMongoUser(MongoUserName).setMongoPassword(MongoUserPswd).setMongoHost(MONGO_INSTANCE_URL).setMongoPort(MONGO_INSTANCE_PORT);
}
return builder.setMongoDBName(MONGO_DB).setMongoCollectionPrefix(MONGO_COLL_PREFIX).setUseMongoFreetextIndex(true).setMongoFreeTextPredicates(RDFS.LABEL.stringValue()).build();
}
use of org.apache.rya.indexing.mongodb.MongoIndexingConfiguration.MongoDBIndexingConfigBuilder in project incubator-rya by apache.
the class RyaMongoGeoDirectExample method getConf.
private static Configuration getConf() throws IOException {
MongoDBIndexingConfigBuilder builder = MongoIndexingConfiguration.builder().setUseMockMongo(USE_MOCK).setUseInference(USE_INFER).setAuths("U");
if (USE_MOCK) {
mock = EmbeddedMongoFactory.newFactory();
MongoClient c = mock.newMongoClient();
ServerAddress address = c.getAddress();
String url = address.getHost();
String port = Integer.toString(address.getPort());
c.close();
builder.setMongoHost(url).setMongoPort(port);
} else {
// User name and password must be filled in:
builder = builder.setMongoUser("fill this in").setMongoPassword("fill this in").setMongoHost(MONGO_INSTANCE_URL).setMongoPort(MONGO_INSTANCE_PORT);
}
return builder.setMongoDBName(MONGO_DB).setMongoCollectionPrefix(MONGO_COLL_PREFIX).setUseMongoFreetextIndex(true).setMongoFreeTextPredicates(RDFS.LABEL.stringValue()).build();
}
use of org.apache.rya.indexing.mongodb.MongoIndexingConfiguration.MongoDBIndexingConfigBuilder in project incubator-rya by apache.
the class MongoSpinIT method getConf.
private static MongoDBRdfConfiguration getConf() throws Exception {
MongoDBIndexingConfigBuilder builder = MongoIndexingConfiguration.builder().setUseMockMongo(true);
final MongoClient c = EmbeddedMongoFactory.newFactory().newMongoClient();
final ServerAddress address = c.getAddress();
builder.setMongoHost(address.getHost());
builder.setMongoPort(Integer.toString(address.getPort()));
builder.setUseInference(false);
c.close();
return builder.build();
}
Aggregations