コード例 #1
0
ファイル: IndexQueryBuilder.java プロジェクト: jhanit/titan
 private Iterable<Result<TitanElement>> execute(ElementType resultType) {
   Preconditions.checkNotNull(indexName);
   Preconditions.checkNotNull(query);
   if (tx.hasModifications())
     log.warn(
         "Modifications in this transaction might not be accurately reflected in this index query: {}",
         query);
   Iterable<RawQuery.Result> result =
       serializer.executeQuery(this, resultType, tx.getTxHandle(), tx);
   final Function<Object, ? extends TitanElement> conversionFct =
       tx.getConversionFunction(resultType);
   return Iterables.filter(
       Iterables.transform(
           result,
           new Function<RawQuery.Result, Result<TitanElement>>() {
             @Nullable
             @Override
             public Result<TitanElement> apply(@Nullable RawQuery.Result result) {
               return new ResultImpl<TitanElement>(
                   conversionFct.apply(result.getResult()), result.getScore());
             }
           }),
       new Predicate<Result<TitanElement>>() {
         @Override
         public boolean apply(@Nullable Result<TitanElement> r) {
           return !r.getElement().isRemoved();
         }
       });
 }
コード例 #2
0
 public static InternalRelation readRelation(
     final InternalVertex vertex, final Entry data, final StandardTitanTx tx) {
   RelationCache relation = tx.getEdgeSerializer().readRelation(data, true, tx);
   return readRelation(vertex, relation, data, tx, tx);
 }
コード例 #3
0
 public static RelationCache readRelationCache(Entry data, StandardTitanTx tx) {
   return tx.getEdgeSerializer().readRelation(data, false, tx);
 }