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


Java Query类代码示例

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


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

示例1: profile

import com.thinkaurelius.titan.graphdb.query.Query; //导入依赖的package包/类
public static<Q extends Query,R extends Collection> R profile(String groupName, QueryProfiler profiler, Q query, boolean multiQuery, Function<Q,R> queryExecutor) {
    QueryProfiler sub = profiler.addNested(groupName);
    sub.setAnnotation(QUERY_ANNOTATION, query);
    if (query.hasLimit()) sub.setAnnotation(LIMIT_ANNOTATION,query.getLimit());
    sub.startTimer();
    R result = queryExecutor.apply(query);
    sub.stopTimer();
    long resultSize = 0;
    if (multiQuery && profiler!=QueryProfiler.NO_OP) {
        //The result set is a collection of collections, but don't do this computation if profiling is disabled
        for (Object r : result) {
            if (r instanceof Collection) resultSize+=((Collection)r).size();
            else resultSize++;
        }
    } else {
        resultSize = result.size();
    }
    sub.setResultSize(resultSize);
    return result;
}
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:21,代码来源:QueryProfiler.java

示例2: IndexQuery

import com.thinkaurelius.titan.graphdb.query.Query; //导入依赖的package包/类
public IndexQuery(String store, Condition condition, ImmutableList<OrderEntry> orders) {
    this(store, condition, orders, Query.NO_LIMIT);
}
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:4,代码来源:IndexQuery.java

示例3: TitanPropertiesStep

import com.thinkaurelius.titan.graphdb.query.Query; //导入依赖的package包/类
public TitanPropertiesStep(PropertiesStep<E> originalStep) {
    super(originalStep.getTraversal(), originalStep.getReturnType(), originalStep.getPropertyKeys());
    originalStep.getLabels().forEach(this::addLabel);
    this.hasContainers = new ArrayList<>();
    this.limit = Query.NO_LIMIT;
}
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:7,代码来源:TitanPropertiesStep.java

示例4: TitanVertexStep

import com.thinkaurelius.titan.graphdb.query.Query; //导入依赖的package包/类
public TitanVertexStep(VertexStep<E> originalStep) {
    super(originalStep.getTraversal(), originalStep.getReturnClass(), originalStep.getDirection(), originalStep.getEdgeLabels());
    originalStep.getLabels().forEach(this::addLabel);
    this.hasContainers = new ArrayList<>();
    this.limit = Query.NO_LIMIT;
}
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:7,代码来源:TitanVertexStep.java

示例5: getRelations

import com.thinkaurelius.titan.graphdb.query.Query; //导入依赖的package包/类
protected Iterable<FaunusRelation> getRelations(FaunusElement element, RelationCategory returnType) {
    FaunusSchemaManager typeManager = element.getTypeManager();

    final And<TitanRelation> condition = getCondition(element,returnType);
    if (condition==null) return Collections.EMPTY_LIST;

    Iterable<FaunusRelation> result=null;
    for (Direction direction : Direction.proper) {
        if (dir!=direction && dir!=Direction.BOTH) continue;

        SetMultimap<FaunusRelationType, FaunusRelation> adjacency = element.getAdjacency(direction);
        if (types.length==0) {
            if (result==null) result=adjacency.values();
            else result = Iterables.concat(result,adjacency.values());
        } else {
            for (String type : types) {
                FaunusRelationType rt = typeManager.getRelationType(type);
                if (rt==null) continue;
                Iterable<FaunusRelation> rels;
                if (rt.isPropertyKey() && ((FaunusPropertyKey)rt).isImplicit()) {
                    FaunusPropertyKey key = (FaunusPropertyKey)rt;
                    Object value = key.computeImplicit(element);
                    if (value!=null)
                        rels = Lists.newArrayList((FaunusRelation)new SimpleFaunusProperty(key,value));
                    else rels = Collections.EMPTY_LIST;
                } else {
                    rels = adjacency.get(rt);
                }
                if (result==null) result=rels;
                else result = Iterables.concat(result,rels);
            }
        }
    }

    result = new FilterIterable(condition, element, result, dir);

    //Order
    if (!orders.isEmpty()) {
        ArrayList<FaunusRelation> allRels = Lists.newArrayList(result);
        Collections.sort(allRels,orders);
        result = new RemoveOriginalIterable(allRels, element, dir);
    }
    //Limit
    if (limit!= Query.NO_LIMIT) {
        result = Iterables.limit(result,limit);
    }

    return result;
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:50,代码来源:FaunusVertexQuery.java


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