Java Code Examples for com.thinkaurelius.titan.core.schema.TitanGraphIndex.isMixedIndex()

The following are Jave code examples for showing how to use isMixedIndex() of the com.thinkaurelius.titan.core.schema.TitanGraphIndex class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: titan1withtp3.1   File: IndexRemoveJob.java   View Source Code Vote up 6 votes
@Override
protected void validateIndexStatus() {
    if (index instanceof RelationTypeIndex) {
        //Nothing specific to be done
    } else if (index instanceof TitanGraphIndex) {
        TitanGraphIndex gindex = (TitanGraphIndex)index;
        if (gindex.isMixedIndex())
            throw new UnsupportedOperationException("Cannot remove mixed indexes through Titan. This can " +
                    "only be accomplished in the indexing system directly.");
        CompositeIndexType indexType = (CompositeIndexType)mgmt.getSchemaVertex(index).asIndexType();
        graphIndexId = indexType.getID();
    } else throw new UnsupportedOperationException("Unsupported index found: "+index);

    //Must be a relation type index or a composite graph index
    TitanSchemaVertex schemaVertex = mgmt.getSchemaVertex(index);
    SchemaStatus actualStatus = schemaVertex.getStatus();
    Preconditions.checkArgument(actualStatus==SchemaStatus.DISABLED,"The index [%s] must be disabled before it can be removed",indexName);
}
 
Example 2
Project: titan1.0.1.kafka   File: IndexRemoveJob.java   View Source Code Vote up 6 votes
@Override
protected void validateIndexStatus() {
    if (index instanceof RelationTypeIndex) {
        //Nothing specific to be done
    } else if (index instanceof TitanGraphIndex) {
        TitanGraphIndex gindex = (TitanGraphIndex)index;
        if (gindex.isMixedIndex())
            throw new UnsupportedOperationException("Cannot remove mixed indexes through Titan. This can " +
                    "only be accomplished in the indexing system directly.");
        CompositeIndexType indexType = (CompositeIndexType)mgmt.getSchemaVertex(index).asIndexType();
        graphIndexId = indexType.getID();
    } else throw new UnsupportedOperationException("Unsupported index found: "+index);

    //Must be a relation type index or a composite graph index
    TitanSchemaVertex schemaVertex = mgmt.getSchemaVertex(index);
    SchemaStatus actualStatus = schemaVertex.getStatus();
    Preconditions.checkArgument(actualStatus==SchemaStatus.DISABLED,"The index [%s] must be disabled before it can be removed",indexName);
}