Examples of Indices


Examples of lupos.engine.operators.index.Indices

                // URILiterals
                // to be applicable
                // later on
                for (final String name : this.root.namedGraphs) {

                  final Indices indices = this.root.dataset
                      .getNamedGraphIndices(LiteralFactory
                          .createURILiteralWithoutLazyLiteral(name));

                  final URILiteral rdfName = indices
                      .getRdfName();
                  if (namedGraphs.contains(rdfName)) {
                    final TriplePattern ztp = new TriplePattern(
                        graphConstraint.equals(tp
                            .getPos(0)) ? rdfName
                            : tp.getPos(0),
                        graphConstraint.equals(tp
                            .getPos(1)) ? rdfName
                            : tp.getPos(1),
                        graphConstraint.equals(tp
                            .getPos(2)) ? rdfName
                            : tp.getPos(2));
                    final Triple zkey = getKey(ztp, null);
                    final Triple keyMinimum = this.getKey(ztp,
                        null, minima);
                    final Triple keyMaximum = this.getKey(ztp,
                        null, maxima);

                    final VarBucket vb = this.getVarBucket(v,
                        ztp, zkey, keyMinimum,
                        keyMaximum,
                        (SixIndices) indices);
                    if (vb != null) {
                      final VarBucket previous_vb = result
                          .get(v);
                      if (previous_vb != null) {
                        vb.add(previous_vb);
                      }
                      vb.minimum = (minima == null) ? null
                          : minima.get(v);
                      vb.maximum = (maxima == null) ? null
                          : maxima.get(v);
                      result.put(v, vb);
                    }
                  }

                }

              }

              // otherwise there might have been named graphs
              // added
              // during the evaluation
              else {

                // get all indices of named graphs and bind them
                // to
                // the graph constraint
                final Collection<Indices> dataSetIndices = this.root.dataset
                    .getNamedGraphIndices();
                if (dataSetIndices != null) {

                  for (final Indices indices : dataSetIndices) {
                    final TriplePattern ztp = new TriplePattern(
                        graphConstraint.equals(tp
                            .getPos(0)) ? indices
                            .getRdfName() : tp
                            .getPos(0),
                        graphConstraint.equals(tp
                            .getPos(1)) ? indices
                            .getRdfName() : tp
                            .getPos(1),
                        graphConstraint.equals(tp
                            .getPos(2)) ? indices
                            .getRdfName() : tp
                            .getPos(2));
                    final Triple zkey = getKey(ztp, null);
                    final Triple keyMinimum = this.getKey(ztp,
                        null, minima);
                    final Triple keyMaximum = this.getKey(ztp,
                        null, maxima);
                    final VarBucket vb = this.getVarBucket(v,
                        ztp, zkey, keyMinimum,
                        keyMaximum,
                        (SixIndices) indices);
                    if (vb != null) {
                      final VarBucket previous_vb = result
                          .get(v);
                      if (previous_vb != null) {
                        vb.add(previous_vb);
                      }
                      vb.minimum = (minima == null) ? null
                          : minima.get(v);
                      vb.maximum = (maxima == null) ? null
                          : maxima.get(v);
                      result.put(v, vb);
                    }
                  }
                }
              }
            }

            // if the graph constraint is an URILiteral fetch the
            // matching indices object
            // but do not bind anything
            else {
              final Triple keyMinimum = this.getKey(tp, null, minima);
              final Triple keyMaximum = this.getKey(tp, null, maxima);
              for (final Indices indices : indicesC) {

                final URILiteral rdfName = indices.getRdfName();
                if (namedGraphs.contains(rdfName)) {
                  final VarBucket vb = this.getVarBucket(v, tp,
                      key, keyMinimum, keyMaximum,
                      (SixIndices) indices);
                  if (vb != null) {
View Full Code Here

Examples of lupos.engine.operators.index.Indices

            indices.add(t);
          }
        } else {
          for (final URILiteral uri : cu) {
            boolean flag = false;
            Indices indices = this.dataset.getNamedGraphIndices(uri);
            if (indices != null){
              flag = true;
              indices.add(t);
            }
            indices = this.dataset.getDefaultGraphIndices(uri);
            if (indices != null){
              flag = true;
              indices.add(t);
            }
            if(!flag){
              try {
                this.dataset.addNamedGraph(uri, new StringURILiteral("<inlinedata:"+t.getSubject()+" "+t.getPredicate()+" "+t.getObject()+".>"), false, false);
              } catch (Exception e) {
View Full Code Here

Examples of lupos.engine.operators.index.Indices

  public URILiteral getURI(){
    return uri;
  }

  public QueryResult process(QueryResult bindings, final int operandID) {
    Indices indices = dataset.getNamedGraphIndices(uri);
    if (indices != null){
      if(silent) return null;
      else throw new Error("Named Graph "+uri+" already exists");
    }
//    indices = dataset.getDefaultGraphIndices(uri);
View Full Code Here

Examples of lupos.engine.operators.index.Indices

        indices.clear();
      }
    } else {
      for(URILiteral uri: cu){
        boolean deleted = false;
        Indices indices = dataset.getNamedGraphIndices(uri);
        if (indices != null){
          indices.clear();
          deleted = true;
        }
        indices = dataset.getDefaultGraphIndices(uri);
        if (indices != null){
          indices.clear();
          deleted = true;
        }
        if(!isSilent && !deleted)
          throw new Error("Graph "+ uri + "to be deleted does not exist!");
      }
View Full Code Here

Examples of lupos.engine.operators.index.Indices

    if (into != null)
      System.err.println("Named graphs currently not supported!");
    else {
      try {
        for (final URILiteral u : cu) {
          final Indices indices = dataset.getIndicesFactory().createIndices((into==null)?u:into);
          dataset.indexingRDFGraph(u, indices, false, false);
          if (into == null) {
            // default graph!
            dataset.putIntoDefaultGraphs(u, indices);
          } else {
View Full Code Here

Examples of org.graylog2.indexer.indices.Indices

public class SizeBasedRotationStrategyTest {

    @Test
    public void testRotate() throws IndexNotFoundException {
        final Configuration configuration = mock(Configuration.class);
        final Indices indices = mock(Indices.class);

        final IndexStatistics stats = new IndexStatistics();
        final CommonStats commonStats = new CommonStats();
        commonStats.store = new StoreStats(1000, 0);
        stats.setPrimaries(commonStats);

        when(indices.getIndexStats("name")).thenReturn(stats);
        when(configuration.getElasticSearchMaxSizePerIndex()).thenReturn(100L);

        final SizeBasedRotationStrategy strategy = new SizeBasedRotationStrategy(configuration,
                                                                                       indices);
        final RotationStrategy.Result rotate = strategy.shouldRotate("name");
View Full Code Here

Examples of org.graylog2.indexer.indices.Indices


    @Test
    public void testDontRotate() throws IndexNotFoundException {
        final Configuration configuration = mock(Configuration.class);
        final Indices indices = mock(Indices.class);

        final IndexStatistics stats = new IndexStatistics();
        final CommonStats commonStats = new CommonStats();
        commonStats.store = new StoreStats(1000, 0);
        stats.setPrimaries(commonStats);

        when(indices.getIndexStats("name")).thenReturn(stats);
        when(configuration.getElasticSearchMaxSizePerIndex()).thenReturn(100000L);

        final SizeBasedRotationStrategy strategy = new SizeBasedRotationStrategy(configuration,
                                                                                 indices);
        final RotationStrategy.Result rotate = strategy.shouldRotate("name");
View Full Code Here

Examples of org.graylog2.indexer.indices.Indices


    @Test
    public void testRotateFailed() throws IndexNotFoundException {
        final Configuration configuration = mock(Configuration.class);
        final Indices indices = mock(Indices.class);

        when(indices.getIndexStats("name")).thenReturn(null);
        when(configuration.getElasticSearchMaxSizePerIndex()).thenReturn(100L);

        final SizeBasedRotationStrategy strategy = new SizeBasedRotationStrategy(configuration,
                                                                                 indices);
        final RotationStrategy.Result rotate = strategy.shouldRotate("name");
View Full Code Here

Examples of org.graylog2.indexer.indices.Indices

public class MessageCountRotationStrategyTest {

    @Test
    public void testRotate() throws IndexNotFoundException {
        final Configuration configuration = mock(Configuration.class);
        final Indices indices = mock(Indices.class);

        when(indices.numberOfMessages("name")).thenReturn(10L);
        when(configuration.getElasticSearchMaxDocsPerIndex()).thenReturn(5);

        final MessageCountRotationStrategy strategy = new MessageCountRotationStrategy(configuration,
                                                                                       indices);
        final RotationStrategy.Result rotate = strategy.shouldRotate("name");
View Full Code Here

Examples of org.graylog2.indexer.indices.Indices

    }

    @Test
    public void testDontRotate() throws IndexNotFoundException {
        final Configuration configuration = mock(Configuration.class);
        final Indices indices = mock(Indices.class);

        when(indices.numberOfMessages("name")).thenReturn(1L);
        when(configuration.getElasticSearchMaxDocsPerIndex()).thenReturn(5);

        final MessageCountRotationStrategy strategy = new MessageCountRotationStrategy(configuration,
                                                                                       indices);
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.