當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。