use of org.apache.commons.configuration.BaseConfiguration in project titan by thinkaurelius.
the class TitanEventualGraphTest method clopen.
public void clopen(Map<String, ? extends Object> settings) {
super.close();
BaseConfiguration newConfig = new BaseConfiguration();
newConfig.copy(config);
for (Map.Entry<String, ? extends Object> entry : settings.entrySet()) newConfig.addProperty(entry.getKey(), entry.getValue());
graph = (StandardTitanGraph) TitanFactory.open(newConfig);
tx = graph.newTransaction();
}
use of org.apache.commons.configuration.BaseConfiguration in project titan by thinkaurelius.
the class VertexIDAssignerTest method getInMemoryGraph.
private static TitanGraph getInMemoryGraph() {
BaseConfiguration config = new BaseConfiguration();
config.subset(GraphDatabaseConfiguration.STORAGE_NAMESPACE).addProperty(GraphDatabaseConfiguration.STORAGE_BACKEND_KEY, InMemoryStorageAdapter.class.getCanonicalName());
config.subset(GraphDatabaseConfiguration.IDS_NAMESPACE).addProperty(GraphDatabaseConfiguration.IDS_FLUSH_KEY, false);
return TitanFactory.open(config);
}
use of org.apache.commons.configuration.BaseConfiguration in project titan by thinkaurelius.
the class RidGenerationTest method testThreadBasedRidGeneration.
@Test
public void testThreadBasedRidGeneration() throws InterruptedException {
Configuration c = new BaseConfiguration();
int n = 8;
// n <= 1 is useless
Preconditions.checkArgument(1 < n);
Collection<byte[]> rids = new ConcurrentSkipListSet<byte[]>();
RidThread[] threads = new RidThread[n];
for (int i = 0; i < n; i++) {
threads[i] = new RidThread(rids, c);
}
for (int i = 0; i < n; i++) {
threads[i].start();
}
for (int i = 0; i < n; i++) {
threads[i].join();
}
assertEquals(n, rids.size());
}
use of org.apache.commons.configuration.BaseConfiguration in project titan by thinkaurelius.
the class InMemoryGraphTest method getConfiguration.
public static final Configuration getConfiguration() {
Configuration config = new BaseConfiguration();
config.subset(GraphDatabaseConfiguration.STORAGE_NAMESPACE).setProperty(GraphDatabaseConfiguration.STORAGE_BACKEND_KEY, "inmemory");
return config;
}
use of org.apache.commons.configuration.BaseConfiguration in project pinot by linkedin.
the class RoutingTableTest method testTimeBoundaryRegression.
@Test
public void testTimeBoundaryRegression() throws Exception {
final FakePropertyStore propertyStore = new FakePropertyStore();
final OfflineSegmentZKMetadata offlineSegmentZKMetadata = new OfflineSegmentZKMetadata();
offlineSegmentZKMetadata.setTimeUnit(TimeUnit.DAYS);
offlineSegmentZKMetadata.setEndTime(1234L);
propertyStore.setContents(ZKMetadataProvider.constructPropertyStorePathForSegment("myTable_OFFLINE", "someSegment_0"), offlineSegmentZKMetadata.toZNRecord());
final ExternalView offlineExternalView = new ExternalView("myTable_OFFLINE");
offlineExternalView.setState("someSegment_0", "Server_1.2.3.4_1234", "ONLINE");
final MutableBoolean timeBoundaryUpdated = new MutableBoolean(false);
HelixExternalViewBasedRouting routingTable = new HelixExternalViewBasedRouting(propertyStore, NO_LLC_ROUTING, null, new BaseConfiguration()) {
@Override
protected ExternalView fetchExternalView(String table) {
return offlineExternalView;
}
@Override
protected void updateTimeBoundary(String tableName, ExternalView externalView) {
if (tableName.equals("myTable_OFFLINE")) {
timeBoundaryUpdated.setValue(true);
}
}
};
routingTable.setBrokerMetrics(new BrokerMetrics(new MetricsRegistry()));
Assert.assertFalse(timeBoundaryUpdated.booleanValue());
final ArrayList<InstanceConfig> instanceConfigList = new ArrayList<>();
instanceConfigList.add(new InstanceConfig("Server_1.2.3.4_1234"));
routingTable.markDataResourceOnline("myTable_OFFLINE", offlineExternalView, instanceConfigList);
routingTable.markDataResourceOnline("myTable_REALTIME", new ExternalView("myTable_REALTIME"), null);
Assert.assertTrue(timeBoundaryUpdated.booleanValue());
}
Aggregations