use of com.thinkaurelius.titan.core.schema.TitanManagement in project titan by thinkaurelius.
the class AbstractTitanGraphProvider method loadGraphData.
@Override
public void loadGraphData(final Graph g, final LoadGraphWith loadGraphWith, final Class testClass, final String testName) {
if (loadGraphWith != null) {
this.createIndices((TitanGraph) g, loadGraphWith.value());
} else {
if (TransactionTest.class.equals(testClass) && testName.equalsIgnoreCase("shouldExecuteWithCompetingThreads")) {
TitanManagement mgmt = ((TitanGraph) g).openManagement();
mgmt.makePropertyKey("blah").dataType(Double.class).make();
mgmt.makePropertyKey("bloop").dataType(Integer.class).make();
mgmt.makePropertyKey("test").dataType(Object.class).make();
mgmt.makeEdgeLabel("friend").make();
mgmt.commit();
}
}
super.loadGraphData(g, loadGraphWith, testClass, testName);
}
use of com.thinkaurelius.titan.core.schema.TitanManagement in project titan by thinkaurelius.
the class ManagementTest method testReservedNamesRejectedForEdgeLabels.
@Test
public void testReservedNamesRejectedForEdgeLabels() {
for (String s : ILLEGAL_USER_DEFINED_NAMES) {
TitanManagement tm = graph.openManagement();
try {
tm.makeEdgeLabel(s);
Assert.fail("Edge label \"" + s + "\" must be rejected");
} catch (IllegalArgumentException e) {
log.debug("Caught expected exception", e);
} finally {
tm.commit();
}
}
}
use of com.thinkaurelius.titan.core.schema.TitanManagement in project titan by thinkaurelius.
the class ManagementTest method testReservedNamesRejectedForVertexLabels.
@Test
public void testReservedNamesRejectedForVertexLabels() {
for (String s : ILLEGAL_USER_DEFINED_NAMES) {
TitanManagement tm = graph.openManagement();
VertexLabelMaker vlm = null;
try {
vlm = tm.makeVertexLabel(s);
Assert.fail("Vertex label \"" + s + "\" must be rejected");
} catch (IllegalArgumentException e) {
log.debug("Caught expected exception", e);
} finally {
tm.commit();
}
}
}
use of com.thinkaurelius.titan.core.schema.TitanManagement in project incubator-atlas by apache.
the class Titan1GraphDatabase method validateIndexBackend.
static void validateIndexBackend(Configuration config) {
String configuredIndexBackend = config.getString(INDEX_BACKEND_CONF);
TitanManagement managementSystem = getGraphInstance().openManagement();
String currentIndexBackend = managementSystem.get(INDEX_BACKEND_CONF);
managementSystem.commit();
if (!configuredIndexBackend.equals(currentIndexBackend)) {
throw new RuntimeException("Configured Index Backend " + configuredIndexBackend + " differs from earlier configured Index Backend " + currentIndexBackend + ". Aborting!");
}
}
use of com.thinkaurelius.titan.core.schema.TitanManagement in project incubator-atlas by apache.
the class Titan0GraphDatabase method validateIndexBackend.
static void validateIndexBackend(Configuration config) {
String configuredIndexBackend = config.getString(INDEX_BACKEND_CONF);
TitanManagement managementSystem = null;
try {
managementSystem = getGraphInstance().getManagementSystem();
String currentIndexBackend = managementSystem.get(INDEX_BACKEND_CONF);
if (!equals(configuredIndexBackend, currentIndexBackend)) {
throw new RuntimeException("Configured Index Backend " + configuredIndexBackend + " differs from earlier configured Index Backend " + currentIndexBackend + ". Aborting!");
}
} finally {
if (managementSystem != null) {
managementSystem.commit();
}
}
}
Aggregations