Examples of StructuralIndex


Examples of org.exist.indexing.StructuralIndex

        vset.setInPredicate(Expression.NO_CONTEXT_ID != contextId);
        return vset;
      }
    } else {
      final DocumentSet docs = getDocumentSet(contextSet);
      final StructuralIndex index = context.getBroker().getStructuralIndex();
      if (context.getProfiler().isEnabled())
        {context.getProfiler().message(this, Profiler.OPTIMIZATIONS,
            "OPTIMIZATION",
            "Using structural index '" + index.toString() + "'");}
      final NodeSelector selector = new SelfSelector(contextSet, contextId);
      return index.findElementsByTagName(ElementValue.ELEMENT, docs, test
          .getName(), selector, this);
    }
  }
View Full Code Here

Examples of org.exist.indexing.StructuralIndex

      synchronized (context) {
        if (currentSet == null
            || currentDocs == null
            || (!optimized && !(docs == currentDocs || docs
                .equalDocs(currentDocs)))) {
          final StructuralIndex index = context.getBroker().getStructuralIndex();
          if (context.getProfiler().isEnabled())
            {context.getProfiler().message(
                this,
                Profiler.OPTIMIZATIONS,
                "OPTIMIZATION",
                "Using structural index '" + index.toString()
                    + "'");}
          // TODO : why a null selector here ? We have one below !
          currentSet = index.findElementsByTagName(ElementValue.ATTRIBUTE, docs, test.getName(), null, this);
          currentDocs = docs;
          registerUpdateListener();
        }
        switch (axis) {
        case Constants.ATTRIBUTE_AXIS:
          return currentSet.selectParentChild(contextSet,
              NodeSet.DESCENDANT, contextId);
        case Constants.DESCENDANT_ATTRIBUTE_AXIS:
          return currentSet.selectAncestorDescendant(contextSet,
              NodeSet.DESCENDANT, false, contextId, true);
        default:
          throw new IllegalArgumentException(
              "Unsupported axis specified");
        }
      }
    } else {
      final DocumentSet docs = getDocumentSet(contextSet);
      final StructuralIndex index = context.getBroker().getStructuralIndex();
      if (context.getProfiler().isEnabled())
        {context.getProfiler().message(this, Profiler.OPTIMIZATIONS,
            "OPTIMIZATION",
            "Using structural index '" + index.toString() + "'");}
      if (!contextSet.getProcessInReverseOrder()) {
        return index.findDescendantsByTagName(ElementValue.ATTRIBUTE,
            test.getName(), axis, docs, contextSet,
            contextId, this);
      } else {
        NodeSelector selector;
        switch (axis) {
        case Constants.ATTRIBUTE_AXIS:
          selector = new ChildSelector(contextSet, contextId);
          break;
        case Constants.DESCENDANT_ATTRIBUTE_AXIS:
          selector = new DescendantSelector(contextSet, contextId);
          break;
        default:
          throw new IllegalArgumentException(
              "Unsupported axis specified");
        }
        return index.findElementsByTagName(ElementValue.ATTRIBUTE, docs, test.getName(), selector, this);
      }
    }
  }
View Full Code Here

Examples of org.exist.indexing.StructuralIndex

        // ones
        if (currentSet == null
            || currentDocs == null
            || (!optimized && !(docs == currentDocs || docs
                .equalDocs(currentDocs)))) {
          final StructuralIndex index = context.getBroker().getStructuralIndex();
          if (context.getProfiler().isEnabled())
            {context.getProfiler().message(
                this,
                Profiler.OPTIMIZATIONS,
                "OPTIMIZATION",
                "Using structural index '" + index.toString()
                    + "'");}
          currentSet = index.findElementsByTagName(
              ElementValue.ELEMENT, docs, test.getName(), null, this);
          currentDocs = docs;
          registerUpdateListener();
        }
        return currentSet.selectParentChild(contextSet,
            NodeSet.DESCENDANT, contextId);
      }
    } else {
      final DocumentSet docs = getDocumentSet(contextSet);
      final StructuralIndex index = context.getBroker().getStructuralIndex();
      if (context.getProfiler().isEnabled())
        {context.getProfiler().message(this, Profiler.OPTIMIZATIONS,
            "OPTIMIZATION",
            "Using structural index '" + index.toString() + "'");}
      if (!contextSet.getProcessInReverseOrder() && !(contextSet instanceof VirtualNodeSet) &&
          contextSet.getLength() < INDEX_SCAN_THRESHOLD) {
        return index.findDescendantsByTagName(ElementValue.ELEMENT,
            test.getName(), axis, docs, contextSet,
            contextId, parent);
      } else {
        // if (contextSet instanceof VirtualNodeSet)
        // ((VirtualNodeSet)contextSet).realize();
        final NodeSelector selector = new ChildSelector(contextSet, contextId);
        return index.findElementsByTagName(ElementValue.ELEMENT, docs,
            test.getName(), selector, this);
      }
    }
  }
View Full Code Here

Examples of org.exist.indexing.StructuralIndex

        // ones
        if (currentSet == null
            || currentDocs == null
            || (!optimized && !(docs == currentDocs || docs
                .equalDocs(currentDocs)))) {
          final StructuralIndex index = context.getBroker().getStructuralIndex();
          if (context.getProfiler().isEnabled())
            {context.getProfiler().message(
                this,
                Profiler.OPTIMIZATIONS,
                "OPTIMIZATION",
                "Using structural index '" + index.toString()
                    + "'");}
          currentSet = index.findElementsByTagName(
              ElementValue.ELEMENT, docs, test.getName(), null, this);
          currentDocs = docs;
          registerUpdateListener();
        }
        switch (axis) {
        case Constants.DESCENDANT_SELF_AXIS:
          final NodeSet tempSet = currentSet.selectAncestorDescendant(
              contextSet, NodeSet.DESCENDANT, true, contextId,
              true);
          return tempSet;
        case Constants.DESCENDANT_AXIS:
          return currentSet.selectAncestorDescendant(contextSet,
              NodeSet.DESCENDANT, false, contextId, true);
        default:
          throw new IllegalArgumentException(
              "Unsupported axis specified");
        }
      }
    } else {
      final DocumentSet docs = contextSet.getDocumentSet();
      final StructuralIndex index = context.getBroker().getStructuralIndex();
      if (context.getProfiler().isEnabled()) {
        context.getProfiler().message(this, Profiler.OPTIMIZATIONS,
            "OPTIMIZATION",
            "Using structural index '" + index.toString() + "'");
      }
      if (!contextSet.getProcessInReverseOrder() && (contextSet instanceof VirtualNodeSet || contextSet.getLength() < INDEX_SCAN_THRESHOLD)) {
        return index.findDescendantsByTagName(ElementValue.ELEMENT,
            test.getName(), axis, docs, contextSet,
            contextId, this);
      } else {
        NodeSelector selector;
        switch (axis) {
        case Constants.DESCENDANT_SELF_AXIS:
          selector = new DescendantOrSelfSelector(contextSet,
              contextId);
          break;
        case Constants.DESCENDANT_AXIS:
          selector = new DescendantSelector(contextSet, contextId);
          break;
        default:
          throw new IllegalArgumentException(
              "Unsupported axis specified");
        }
        return index.findElementsByTagName(ElementValue.ELEMENT, docs,
            test.getName(), selector, this);
      }

    }
  }
View Full Code Here

Examples of org.exist.indexing.StructuralIndex

      // TODO : no test on preloaded data ?
      DocumentSet docs = getDocumentSet(contextSet);
      synchronized (context) {
        if (currentSet == null || currentDocs == null
            || !(docs.equalDocs(currentDocs))) {
          final StructuralIndex index = context.getBroker().getStructuralIndex();
          if (context.getProfiler().isEnabled())
            {context.getProfiler().message(
                this,
                Profiler.OPTIMIZATIONS,
                "OPTIMIZATION",
                "Using structural index '" + index.toString()
                    + "'");}
          currentSet = index.findElementsByTagName(
              ElementValue.ELEMENT, docs, test.getName(), null, this);
          currentDocs = docs;
          registerUpdateListener();
        }
        switch (axis) {
View Full Code Here

Examples of org.exist.indexing.StructuralIndex

      // TODO : no test on preloaded data ?
      DocumentSet docs = getDocumentSet(contextSet);
      synchronized (context) {
        if (currentSet == null || currentDocs == null
            || !(docs.equalDocs(currentDocs))) {
          final StructuralIndex index = context.getBroker().getStructuralIndex();
          if (context.getProfiler().isEnabled())
            {context.getProfiler().message(
                this,
                Profiler.OPTIMIZATIONS,
                "OPTIMIZATION",
                "Using structural index '" + index.toString()
                    + "'");}
          currentSet = index.findElementsByTagName(
              ElementValue.ELEMENT, docs, test.getName(), null, this);
          currentDocs = docs;
          registerUpdateListener();
        }
        if (hasPositionalPredicate) {
View Full Code Here

Examples of org.exist.indexing.StructuralIndex

      // TODO : no test on preloaded data ?
      DocumentSet docs = getDocumentSet(contextSet);
      synchronized (context) {
        if (currentSet == null || currentDocs == null
            || !(docs.equalDocs(currentDocs))) {
          final StructuralIndex index = context.getBroker().getStructuralIndex();
          if (context.getProfiler().isEnabled())
            {context.getProfiler().message(
                this,
                Profiler.OPTIMIZATIONS,
                "OPTIMIZATION",
                "Using structural index '" + index.toString()
                    + "'");}
          currentSet = index.findElementsByTagName(
              ElementValue.ELEMENT, docs, test.getName(), null, this);
          currentDocs = docs;
          registerUpdateListener();
        }
        if (hasPositionalPredicate) {
View Full Code Here

Examples of org.exist.indexing.StructuralIndex

      synchronized (context) {
        if (currentSet == null
            || currentDocs == null
            || (!optimized && !(docs == currentDocs || docs
                .equalDocs(currentDocs)))) {
          final StructuralIndex index = context.getBroker().getStructuralIndex();
          if (context.getProfiler().isEnabled())
            {context.getProfiler().message(
                this,
                Profiler.OPTIMIZATIONS,
                "OPTIMIZATION",
                "Using structural index '" + index.toString()
                    + "'");}
          currentSet = index.findElementsByTagName(ElementValue.ELEMENT, docs, test.getName(), null, this);
          currentDocs = docs;
          registerUpdateListener();
        }
        switch (axis) {
        case Constants.ANCESTOR_SELF_AXIS:
          return currentSet.selectAncestors(contextSet, true,
              contextId);
        case Constants.ANCESTOR_AXIS:
          return currentSet.selectAncestors(contextSet, false,
              contextId);
        default:
          throw new IllegalArgumentException(
              "Unsupported axis specified");
        }
      }
    } else {
      final DocumentSet docs = getDocumentSet(contextSet);
      final StructuralIndex index = context.getBroker().getStructuralIndex();
      if (context.getProfiler().isEnabled())
        {context.getProfiler().message(this, Profiler.OPTIMIZATIONS,
            "OPTIMIZATION",
            "Using structural index '" + index.toString() + "'");}
            return index.findAncestorsByTagName(ElementValue.ELEMENT, test.getName(), axis, docs, contextSet, contextId);
    }
  }
View Full Code Here

Examples of org.exist.indexing.StructuralIndex

      synchronized (context) {
        if (currentSet == null
            || currentDocs == null
            || (!optimized && !(docs == currentDocs || docs
                .equalDocs(currentDocs)))) {
          final StructuralIndex index = context.getBroker().getStructuralIndex();
          if (context.getProfiler().isEnabled())
            {context.getProfiler().message(
                this,
                Profiler.OPTIMIZATIONS,
                "OPTIMIZATION",
                "Using structural index '" + index.toString()
                    + "'");}
          currentSet = index.findElementsByTagName(
              ElementValue.ELEMENT, docs, test.getName(), null, this);
          currentDocs = docs;
          registerUpdateListener();
        }
        return contextSet.selectParentChild(currentSet,
            NodeSet.ANCESTOR);
      }
    } else {
      final DocumentSet docs = getDocumentSet(contextSet);
      final StructuralIndex index = context.getBroker().getStructuralIndex();
      if (context.getProfiler().isEnabled())
        {context.getProfiler().message(this, Profiler.OPTIMIZATIONS,
            "OPTIMIZATION",
            "Using structural index '" + index.toString() + "'");}
            return index.findAncestorsByTagName(ElementValue.ELEMENT, test.getName(), Constants.PARENT_AXIS, docs, contextSet, contextId);
    }
  }
View Full Code Here

Examples of org.exist.indexing.StructuralIndex

        vset.setInPredicate(Expression.NO_CONTEXT_ID != contextId);
        return !vset.isEmpty();
      }
    } else {
      final DocumentSet docs = getDocumentSet(contextSet);
      final StructuralIndex index = context.getBroker().getStructuralIndex();
      if (context.getProfiler().isEnabled())
        {context.getProfiler().message(this, Profiler.OPTIMIZATIONS,
            "OPTIMIZATION",
            "Using structural index '" + index.toString() + "'");}
      final NodeSelector selector = new SelfSelector(contextSet, contextId);
      return index.matchElementsByTagName(ElementValue.ELEMENT, docs, test
          .getName(), selector);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.