use of org.apache.atlas.repository.graphdb.AtlasPropertyKey in project atlas by apache.
the class AtlasJanusObjectFactory method createPropertyKeys.
public static PropertyKey[] createPropertyKeys(List<AtlasPropertyKey> keys) {
PropertyKey[] ret = new PropertyKey[keys.size()];
int i = 0;
for (AtlasPropertyKey key : keys) {
ret[i] = createPropertyKey(key);
i++;
}
return ret;
}
use of org.apache.atlas.repository.graphdb.AtlasPropertyKey in project incubator-atlas by apache.
the class Titan0GraphManagement method createVertexIndex.
@Override
public void createVertexIndex(String propertyName, String backingIndex, List<AtlasPropertyKey> propertyKeys) {
TitanManagement.IndexBuilder indexBuilder = management.buildIndex(propertyName, Vertex.class);
for (AtlasPropertyKey key : propertyKeys) {
PropertyKey titanKey = TitanObjectFactory.createPropertyKey(key);
indexBuilder.addKey(titanKey);
}
indexBuilder.buildMixedIndex(backingIndex);
}
use of org.apache.atlas.repository.graphdb.AtlasPropertyKey in project incubator-atlas by apache.
the class Titan0GraphManagement method makePropertyKey.
@Override
public AtlasPropertyKey makePropertyKey(String propertyName, Class propertyClass, AtlasCardinality cardinality) {
if (cardinality.isMany()) {
newMultProperties.add(propertyName);
}
PropertyKeyMaker propertyKeyBuilder = management.makePropertyKey(propertyName).dataType(propertyClass);
if (cardinality != null) {
Cardinality titanCardinality = TitanObjectFactory.createCardinality(cardinality);
propertyKeyBuilder.cardinality(titanCardinality);
}
PropertyKey propertyKey = propertyKeyBuilder.make();
return GraphDbObjectFactory.createPropertyKey(propertyKey);
}
use of org.apache.atlas.repository.graphdb.AtlasPropertyKey in project incubator-atlas by apache.
the class Titan0GraphManagement method addVertexIndexKey.
@Override
public void addVertexIndexKey(String indexName, AtlasPropertyKey propertyKey) {
PropertyKey titanKey = TitanObjectFactory.createPropertyKey(propertyKey);
TitanGraphIndex vertexIndex = management.getGraphIndex(indexName);
management.addIndexKey(vertexIndex, titanKey);
}
use of org.apache.atlas.repository.graphdb.AtlasPropertyKey in project incubator-atlas by apache.
the class Titan0DatabaseTest method getGraph.
private <V, E> AtlasGraph<V, E> getGraph() {
GraphSandboxUtil.create();
if (atlasGraph == null) {
Titan0GraphDatabase db = new Titan0GraphDatabase();
atlasGraph = db.getGraph();
AtlasGraphManagement mgmt = atlasGraph.getManagementSystem();
// many)
for (String propertyName : new String[] { "__superTypeNames", "__traitNames" }) {
AtlasPropertyKey propertyKey = mgmt.getPropertyKey(propertyName);
if (propertyKey == null) {
propertyKey = mgmt.makePropertyKey(propertyName, String.class, AtlasCardinality.SET);
mgmt.createExactMatchIndex(propertyName, false, Collections.singletonList(propertyKey));
}
}
mgmt.commit();
}
return (AtlasGraph<V, E>) atlasGraph;
}
Aggregations