use of org.apache.atlas.repository.graphdb.AtlasPropertyKey in project incubator-atlas by apache.
the class GraphBackedSearchIndexer method createFullTextIndex.
private void createFullTextIndex(AtlasGraphManagement management) {
AtlasPropertyKey fullText = management.makePropertyKey(Constants.ENTITY_TEXT_PROPERTY_KEY, String.class, AtlasCardinality.SINGLE);
management.createFullTextIndex(Constants.FULLTEXT_INDEX, fullText, Constants.BACKING_INDEX);
}
use of org.apache.atlas.repository.graphdb.AtlasPropertyKey in project incubator-atlas by apache.
the class GraphBackedSearchIndexer method createIndexes.
private AtlasPropertyKey createIndexes(AtlasGraphManagement management, String propertyName, Class propertyClass, boolean isUnique, AtlasCardinality cardinality, boolean createCompositeForAttribute, boolean createCompositeWithTypeandSuperTypes) {
AtlasPropertyKey propertyKey = management.getPropertyKey(propertyName);
if (propertyKey == null) {
propertyKey = management.makePropertyKey(propertyName, propertyClass, cardinality);
updateVertexIndex(management, propertyName, propertyClass, cardinality, propertyKey);
}
if (createCompositeForAttribute) {
createExactMatchIndex(management, propertyClass, propertyKey, isUnique);
} else if (createCompositeWithTypeandSuperTypes) {
// Index with typename since typename+property key queries need to
// speed up
createExactMatchIndexWithTypeName(management, propertyClass, propertyKey);
createExactMatchIndexWithSuperTypeName(management, propertyClass, propertyKey);
}
return propertyKey;
}
use of org.apache.atlas.repository.graphdb.AtlasPropertyKey in project incubator-atlas by apache.
the class GraphBackedSearchIndexer method getVertexIndexKeys.
public Set<String> getVertexIndexKeys() {
if (recomputeIndexedKeys) {
AtlasGraphManagement management = null;
try {
management = provider.get().getManagementSystem();
} catch (RepositoryException excp) {
LOG.error("failed to get indexedKeys from graph", excp);
}
if (management != null) {
recomputeIndexedKeys = false;
AtlasGraphIndex vertexIndex = management.getGraphIndex(Constants.VERTEX_INDEX);
Set<String> indexKeys = new HashSet<>();
for (AtlasPropertyKey fieldKey : vertexIndex.getFieldKeys()) {
indexKeys.add(fieldKey.getName());
}
vertexIndexKeys = indexKeys;
}
}
return vertexIndexKeys;
}
use of org.apache.atlas.repository.graphdb.AtlasPropertyKey in project atlas by apache.
the class AtlasJanusGraphManagement method addMixedIndex.
@Override
public void addMixedIndex(String indexName, AtlasPropertyKey propertyKey) {
PropertyKey janusKey = AtlasJanusObjectFactory.createPropertyKey(propertyKey);
JanusGraphIndex vertexIndex = management.getGraphIndex(indexName);
management.addIndexKey(vertexIndex, janusKey);
}
use of org.apache.atlas.repository.graphdb.AtlasPropertyKey in project atlas by apache.
the class AtlasJanusGraphManagement method createEdgeCompositeIndex.
@Override
public void createEdgeCompositeIndex(String propertyName, boolean isUnique, List<AtlasPropertyKey> propertyKeys) {
IndexBuilder indexBuilder = management.buildIndex(propertyName, Edge.class);
for (AtlasPropertyKey key : propertyKeys) {
PropertyKey janusKey = AtlasJanusObjectFactory.createPropertyKey(key);
indexBuilder.addKey(janusKey);
}
if (isUnique) {
indexBuilder.unique();
}
indexBuilder.buildCompositeIndex();
}
Aggregations