Java Code Examples for com.thinkaurelius.titan.core.schema.SchemaStatus.ENABLED

The following are Jave code examples for showing how to use ENABLED of the com.thinkaurelius.titan.core.schema.SchemaStatus class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: titan1withtp3.1   File: GraphCentricQueryBuilder.java   Source Code and License Vote up 6 votes
private static final boolean coversAll(final MixedIndexType index, Condition<TitanElement> condition, IndexSerializer indexInfo) {
    if (condition.getType()==Condition.Type.LITERAL) {
        if (!(condition instanceof  PredicateCondition)) return false;
        PredicateCondition<RelationType, TitanElement> atom = (PredicateCondition) condition;
        if (atom.getValue()==null) return false;

        Preconditions.checkArgument(atom.getKey().isPropertyKey());
        PropertyKey key = (PropertyKey) atom.getKey();
        ParameterIndexField[] fields = index.getFieldKeys();
        ParameterIndexField match = null;
        for (int i = 0; i < fields.length; i++) {
            if (fields[i].getStatus()!= SchemaStatus.ENABLED) continue;
            if (fields[i].getFieldKey().equals(key)) match = fields[i];
        }
        if (match==null) return false;
        return indexInfo.supports(index,match,atom.getPredicate());
    } else {
        for (Condition<TitanElement> child : condition.getChildren()) {
            if (!coversAll(index,child,indexInfo)) return false;
        }
        return true;
    }
}
 
Example 2
Project: incubator-atlas   File: GraphCentricQueryBuilder.java   Source Code and License Vote up 6 votes
private static final boolean coversAll(final MixedIndexType index, Condition<TitanElement> condition, IndexSerializer indexInfo) {
    if (condition.getType()==Condition.Type.LITERAL) {
        if (!(condition instanceof  PredicateCondition)) return false;
        PredicateCondition<RelationType, TitanElement> atom = (PredicateCondition) condition;
        if (atom.getValue()==null) return false;

        Preconditions.checkArgument(atom.getKey().isPropertyKey());
        PropertyKey key = (PropertyKey) atom.getKey();
        ParameterIndexField[] fields = index.getFieldKeys();
        ParameterIndexField match = null;
        for (ParameterIndexField field : fields) {
            if (field.getStatus() != SchemaStatus.ENABLED) continue;
            if (field.getFieldKey().equals(key)) match = field;
        }
        if (match==null) return false;
        return indexInfo.supports(index, match, atom.getPredicate());
    } else {
        for (Condition<TitanElement> child : condition.getChildren()) {
            if (!coversAll(index, child, indexInfo)) return false;
        }
        return true;
    }
}
 
Example 3
Project: titan1.0.1.kafka   File: GraphCentricQueryBuilder.java   Source Code and License Vote up 6 votes
private static final boolean coversAll(final MixedIndexType index, Condition<TitanElement> condition, IndexSerializer indexInfo) {
    if (condition.getType()==Condition.Type.LITERAL) {
        if (!(condition instanceof  PredicateCondition)) return false;
        PredicateCondition<RelationType, TitanElement> atom = (PredicateCondition) condition;
        if (atom.getValue()==null) return false;

        Preconditions.checkArgument(atom.getKey().isPropertyKey());
        PropertyKey key = (PropertyKey) atom.getKey();
        ParameterIndexField[] fields = index.getFieldKeys();
        ParameterIndexField match = null;
        for (int i = 0; i < fields.length; i++) {
            if (fields[i].getStatus()!= SchemaStatus.ENABLED) continue;
            if (fields[i].getFieldKey().equals(key)) match = fields[i];
        }
        if (match==null) return false;
        return indexInfo.supports(index,match,atom.getPredicate());
    } else {
        for (Condition<TitanElement> child : condition.getChildren()) {
            if (!coversAll(index,child,indexInfo)) return false;
        }
        return true;
    }
}
 
Example 4
Project: titan0.5.4-hbase1.1.1-custom   File: GraphCentricQueryBuilder.java   Source Code and License Vote up 6 votes
private static final boolean coversAll(final MixedIndexType index, Condition<TitanElement> condition, IndexSerializer indexInfo) {
    if (condition.getType()==Condition.Type.LITERAL) {
        if (!(condition instanceof  PredicateCondition)) return false;
        PredicateCondition<RelationType, TitanElement> atom = (PredicateCondition) condition;
        if (atom.getValue()==null) return false;

        Preconditions.checkArgument(atom.getKey().isPropertyKey());
        PropertyKey key = (PropertyKey) atom.getKey();
        ParameterIndexField[] fields = index.getFieldKeys();
        ParameterIndexField match = null;
        for (int i = 0; i < fields.length; i++) {
            if (fields[i].getStatus()!= SchemaStatus.ENABLED) continue;
            if (fields[i].getFieldKey().equals(key)) match = fields[i];
        }
        if (match==null) return false;
        return indexInfo.supports(index,match,atom.getPredicate());
    } else {
        for (Condition<TitanElement> child : condition.getChildren()) {
            if (!coversAll(index,child,indexInfo)) return false;
        }
        return true;
    }
}
 
Example 5
Project: titan1withtp3.1   File: EmptyRelationType.java   Source Code and License Vote up 4 votes
@Override
public SchemaStatus getStatus() {
    return SchemaStatus.ENABLED;
}
 
Example 6
Project: titan1.0.1.kafka   File: EmptyRelationType.java   Source Code and License Vote up 4 votes
@Override
public SchemaStatus getStatus() {
    return SchemaStatus.ENABLED;
}
 
Example 7
Project: titan0.5.4-hbase1.1.1-custom   File: EmptyRelationType.java   Source Code and License Vote up 4 votes
@Override
public SchemaStatus getStatus() {
    return SchemaStatus.ENABLED;
}