Search in sources :

Example 1 with IndexBuilder

use of org.janusgraph.core.schema.JanusGraphManagement.IndexBuilder 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();
}
Also used : AtlasPropertyKey(org.apache.atlas.repository.graphdb.AtlasPropertyKey) AtlasPropertyKey(org.apache.atlas.repository.graphdb.AtlasPropertyKey) PropertyKey(org.janusgraph.core.PropertyKey) IndexBuilder(org.janusgraph.core.schema.JanusGraphManagement.IndexBuilder)

Example 2 with IndexBuilder

use of org.janusgraph.core.schema.JanusGraphManagement.IndexBuilder 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();
}
Also used : AtlasPropertyKey(org.apache.atlas.repository.graphdb.AtlasPropertyKey) AtlasPropertyKey(org.apache.atlas.repository.graphdb.AtlasPropertyKey) PropertyKey(org.janusgraph.core.PropertyKey) IndexBuilder(org.janusgraph.core.schema.JanusGraphManagement.IndexBuilder)

Example 3 with IndexBuilder

use of org.janusgraph.core.schema.JanusGraphManagement.IndexBuilder in project atlas by apache.

the class AtlasJanusGraphManagement method createVertexMixedIndex.

@Override
public void createVertexMixedIndex(String indexName, String backingIndex, List<AtlasPropertyKey> propertyKeys) {
    IndexBuilder indexBuilder = management.buildIndex(indexName, Vertex.class);
    for (AtlasPropertyKey key : propertyKeys) {
        PropertyKey janusKey = AtlasJanusObjectFactory.createPropertyKey(key);
        indexBuilder.addKey(janusKey);
    }
    indexBuilder.buildMixedIndex(backingIndex);
}
Also used : AtlasPropertyKey(org.apache.atlas.repository.graphdb.AtlasPropertyKey) AtlasPropertyKey(org.apache.atlas.repository.graphdb.AtlasPropertyKey) PropertyKey(org.janusgraph.core.PropertyKey) IndexBuilder(org.janusgraph.core.schema.JanusGraphManagement.IndexBuilder)

Example 4 with IndexBuilder

use of org.janusgraph.core.schema.JanusGraphManagement.IndexBuilder in project atlas by apache.

the class AtlasJanusGraphManagement method createFullTextMixedIndex.

@Override
public void createFullTextMixedIndex(String indexName, String backingIndex, List<AtlasPropertyKey> propertyKeys) {
    IndexBuilder indexBuilder = management.buildIndex(indexName, Vertex.class);
    for (AtlasPropertyKey key : propertyKeys) {
        PropertyKey janusKey = AtlasJanusObjectFactory.createPropertyKey(key);
        indexBuilder.addKey(janusKey, org.janusgraph.core.schema.Parameter.of("mapping", Mapping.TEXT));
    }
    indexBuilder.buildMixedIndex(backingIndex);
}
Also used : AtlasPropertyKey(org.apache.atlas.repository.graphdb.AtlasPropertyKey) AtlasPropertyKey(org.apache.atlas.repository.graphdb.AtlasPropertyKey) PropertyKey(org.janusgraph.core.PropertyKey) IndexBuilder(org.janusgraph.core.schema.JanusGraphManagement.IndexBuilder)

Example 5 with IndexBuilder

use of org.janusgraph.core.schema.JanusGraphManagement.IndexBuilder in project atlas by apache.

the class AtlasJanusGraphManagement method createEdgeMixedIndex.

@Override
public void createEdgeMixedIndex(String indexName, String backingIndex, List<AtlasPropertyKey> propertyKeys) {
    IndexBuilder indexBuilder = management.buildIndex(indexName, Edge.class);
    for (AtlasPropertyKey key : propertyKeys) {
        PropertyKey janusKey = AtlasJanusObjectFactory.createPropertyKey(key);
        indexBuilder.addKey(janusKey);
    }
    indexBuilder.buildMixedIndex(backingIndex);
}
Also used : AtlasPropertyKey(org.apache.atlas.repository.graphdb.AtlasPropertyKey) AtlasPropertyKey(org.apache.atlas.repository.graphdb.AtlasPropertyKey) PropertyKey(org.janusgraph.core.PropertyKey) IndexBuilder(org.janusgraph.core.schema.JanusGraphManagement.IndexBuilder)

Aggregations

AtlasPropertyKey (org.apache.atlas.repository.graphdb.AtlasPropertyKey)5 PropertyKey (org.janusgraph.core.PropertyKey)5 IndexBuilder (org.janusgraph.core.schema.JanusGraphManagement.IndexBuilder)5