use of org.apache.atlas.repository.graphdb.AtlasPropertyKey in project 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 atlas by apache.
the class Titan0GraphManagement method createEdgeCompositeIndex.
@Override
public void createEdgeCompositeIndex(String propertyName, boolean isUnique, List<AtlasPropertyKey> propertyKeys) {
TitanManagement.IndexBuilder indexBuilder = management.buildIndex(propertyName, Edge.class);
for (AtlasPropertyKey key : propertyKeys) {
PropertyKey titanKey = TitanObjectFactory.createPropertyKey(key);
indexBuilder.addKey(titanKey);
}
if (isUnique) {
indexBuilder.unique();
}
indexBuilder.buildCompositeIndex();
}
use of org.apache.atlas.repository.graphdb.AtlasPropertyKey in project atlas by apache.
the class TitanObjectFactory 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 atlas by apache.
the class AtlasJanusGraphIndex method getFieldKeys.
@Override
public Set<AtlasPropertyKey> getFieldKeys() {
PropertyKey[] keys = wrapped.getFieldKeys();
Set<AtlasPropertyKey> result = new HashSet<AtlasPropertyKey>();
for (PropertyKey key : keys) {
result.add(GraphDbObjectFactory.createPropertyKey(key));
}
return result;
}
use of org.apache.atlas.repository.graphdb.AtlasPropertyKey in project atlas by apache.
the class AtlasJanusGraphManagement method createVertexCompositeIndex.
@Override
public void createVertexCompositeIndex(String propertyName, boolean isUnique, List<AtlasPropertyKey> propertyKeys) {
IndexBuilder indexBuilder = management.buildIndex(propertyName, Vertex.class);
for (AtlasPropertyKey key : propertyKeys) {
PropertyKey janusKey = AtlasJanusObjectFactory.createPropertyKey(key);
indexBuilder.addKey(janusKey);
}
if (isUnique) {
indexBuilder.unique();
}
indexBuilder.buildCompositeIndex();
}
Aggregations