当前位置: 首页>>代码示例>>Java>>正文


Java RelationTypeVertex类代码示例

本文整理汇总了Java中com.thinkaurelius.titan.graphdb.types.vertices.RelationTypeVertex的典型用法代码示例。如果您正苦于以下问题:Java RelationTypeVertex类的具体用法?Java RelationTypeVertex怎么用?Java RelationTypeVertex使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RelationTypeVertex类属于com.thinkaurelius.titan.graphdb.types.vertices包,在下文中一共展示了RelationTypeVertex类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setConsistency

import com.thinkaurelius.titan.graphdb.types.vertices.RelationTypeVertex; //导入依赖的package包/类
/**
 * Sets the consistency level for those schema elements that support it (types and internal indexes)
 * </p>
 * Note, that it is possible to have a race condition here if two threads simultaneously try to change the
 * consistency level. However, this is resolved when the consistency level is being read by taking the
 * first one and deleting all existing attached consistency levels upon modification.
 *
 * @param element
 * @param consistency
 */
@Override
public void setConsistency(TitanSchemaElement element, ConsistencyModifier consistency) {
    if (element instanceof RelationType) {
        RelationTypeVertex rv = (RelationTypeVertex) element;
        Preconditions.checkArgument(consistency != ConsistencyModifier.FORK || !rv.multiplicity().isConstrained(),
                "Cannot apply FORK consistency mode to constraint relation type: %s", rv.name());
    } else if (element instanceof TitanGraphIndex) {
        IndexType index = ((TitanGraphIndexWrapper) element).getBaseIndex();
        if (index.isMixedIndex())
            throw new IllegalArgumentException("Cannot change consistency on mixed index: " + element);
    } else throw new IllegalArgumentException("Cannot change consistency of schema element: " + element);
    setTypeModifier(element, ModifierType.CONSISTENCY, consistency);
}
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:24,代码来源:ManagementSystem.java

示例2: getTTL

import com.thinkaurelius.titan.graphdb.types.vertices.RelationTypeVertex; //导入依赖的package包/类
@Override
public Duration getTTL(final TitanSchemaType type) {
    Preconditions.checkArgument(type != null);
    int ttl;
    if (type instanceof VertexLabelVertex) {
        ttl = ((VertexLabelVertex) type).getTTL();
    } else if (type instanceof RelationTypeVertex) {
        ttl = ((RelationTypeVertex) type).getTTL();
    } else {
        throw new IllegalArgumentException("given type does not support TTL: " + type.getClass());
    }
    return Duration.ofSeconds(ttl);
}
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:14,代码来源:ManagementSystem.java

示例3: setConsistency

import com.thinkaurelius.titan.graphdb.types.vertices.RelationTypeVertex; //导入依赖的package包/类
/**
 * Sets the consistency level for those schema elements that support it (types and internal indexes)
 * </p>
 * Note, that it is possible to have a race condition here if two threads simultaneously try to change the
 * consistency level. However, this is resolved when the consistency level is being read by taking the
 * first one and deleting all existing attached consistency levels upon modification.
 *
 * @param element
 * @param consistency
 */
@Override
public void setConsistency(TitanSchemaElement element, ConsistencyModifier consistency) {
    if (element instanceof RelationType) {
        RelationTypeVertex rv = (RelationTypeVertex) element;
        Preconditions.checkArgument(consistency != ConsistencyModifier.FORK || !rv.getMultiplicity().isConstrained(),
                "Cannot apply FORK consistency mode to constraint relation type: %s",rv.getName());
    } else if (element instanceof TitanGraphIndex) {
        IndexType index = ((TitanGraphIndexWrapper)element).getBaseIndex();
        if (index.isMixedIndex()) throw new IllegalArgumentException("Cannot change consistency on mixed index: " + element);
    } else throw new IllegalArgumentException("Cannot change consistency of schema element: " + element);
    setTypeModifier(element, ModifierType.CONSISTENCY, consistency);
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:23,代码来源:ManagementSystem.java

示例4: getTTL

import com.thinkaurelius.titan.graphdb.types.vertices.RelationTypeVertex; //导入依赖的package包/类
@Override
public Duration getTTL(final TitanSchemaType type) {
    Preconditions.checkArgument(type != null);
    int ttl;
    if (type instanceof VertexLabelVertex) {
        ttl = ((VertexLabelVertex) type).getTTL();
    } else if (type instanceof RelationTypeVertex) {
        ttl = ((RelationTypeVertex) type).getTTL();
    } else {
        throw new IllegalArgumentException("given type does not support TTL: " + type.getClass());
    }
    return new StandardDuration(ttl, TimeUnit.SECONDS);
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:14,代码来源:ManagementSystem.java


注:本文中的com.thinkaurelius.titan.graphdb.types.vertices.RelationTypeVertex类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。