Package com.persistit

Examples of com.persistit.KeyFilter$Term


  public Iterable<V> values(Object firstKey, Object secondKey) {
    try {
      exchange.clear();
      exchange.append(firstKey).append(secondKey).append(Key.BEFORE);
      Exchange iteratorExchange = new Exchange(exchange);
      KeyFilter filter = new KeyFilter().append(KeyFilter.simpleTerm(firstKey)).append(KeyFilter.simpleTerm(secondKey));
      return new ValueIterable<V>(iteratorExchange, filter);
    } catch (Exception e) {
      throw failToGetValues(e);
    }
  }
View Full Code Here


  public Iterable<V> values(Object firstKey) {
    try {
      exchange.clear();
      exchange.append(firstKey).append(Key.BEFORE);
      Exchange iteratorExchange = new Exchange(exchange);
      KeyFilter filter = new KeyFilter().append(KeyFilter.simpleTerm(firstKey));
      return new ValueIterable<V>(iteratorExchange, filter);
    } catch (Exception e) {
      throw failToGetValues(e);
    }
  }
View Full Code Here

   */
  public Iterable<V> values() {
    try {
      exchange.clear().append(Key.BEFORE);
      Exchange iteratorExchange = new Exchange(exchange);
      KeyFilter filter = new KeyFilter().append(KeyFilter.ALL);
      return new ValueIterable<V>(iteratorExchange, filter);
    } catch (Exception e) {
      throw failToGetValues(e);
    }
  }
View Full Code Here

    }
  }

  public Iterable<Entry<V>> entries() {
    exchange.clear().to(Key.BEFORE);
    KeyFilter filter = new KeyFilter().append(KeyFilter.ALL);
    return new EntryIterable<V>(new Exchange(exchange), filter);
  }
View Full Code Here

    return new EntryIterable<V>(new Exchange(exchange), filter);
  }

  public Iterable<Entry<V>> entries(Object firstKey) {
    exchange.clear().append(firstKey).append(Key.BEFORE);
    KeyFilter filter = new KeyFilter().append(KeyFilter.simpleTerm(firstKey));
    return new EntryIterable<V>(new Exchange(exchange), filter);
  }
View Full Code Here

    private static boolean entryExistsSkipSelf(Index index, Exchange exchange) throws PersistitException {
       
        boolean status = false;
        if (exchange.getKey().getDepth() < index.getAllColumns().size() &&
                exchange.hasChildren()) {
            KeyFilter kf = new KeyFilter(exchange.getKey());
            status = exchange.next(kf);
            status = status && exchange.next(kf);
        } else {
            status = exchange.traverse(Key.Direction.EQ, false, -1);
        }
View Full Code Here

                            // Don't reload memory table definitions
                            ex.clear().append(S_K_PROTOBUF_MEM).remove();
                        }
                        // Clear old trees
                        ex.clear();
                        KeyFilter filter = new KeyFilter().append(KeyFilter.simpleTerm(S_K_DELAYED));
                        while(ex.traverse(Key.Direction.GT, filter, Integer.MAX_VALUE)) {
                            ex.getKey().indexTo(1);     // skip delayed key
                            ex.getKey().decodeLong();   // skip id
                            long timestamp = ex.getKey().decodeLong();
                            ex.getValue().setStreamMode(true);
View Full Code Here

            throw new InvalidRequestException(String.format("Invalid operation, %s is not of map type", column.name));

        MapType mt = (MapType)column.type;
        for (Map.Entry<Term, Term> entry : values.entrySet())
        {
            Term key = entry.getKey();
            Term value = entry.getValue();
            if (key.isBindMarker())
                boundNames[key.bindIndex] = keySpecOf(column, mt);
            if (value.isBindMarker())
                boundNames[value.bindIndex] = valueSpecOf(column, mt);
        }
    }
View Full Code Here

    }

    private void doSet(ColumnFamily cf, ColumnNameBuilder builder, UpdateParameters params, CollectionType validator, List<Pair<ByteBuffer, IColumn>> list) throws InvalidRequestException
    {
        int idx = validateListIdx(values.get(0), list);
        Term value = values.get(1);

        ByteBuffer name = list.get(idx).right.name();
        cf.addColumn(params.makeColumn(name, value.getByteBuffer(validator.valueComparator(), params.variables)));
    }
View Full Code Here

        ListType lt = (ListType)column.type;
        if (kind == Kind.SET_IDX)
        {
            assert values.size() == 2;
            Term idx = values.get(0);
            Term value = values.get(1);
            if (idx.isBindMarker())
                boundNames[idx.bindIndex] = indexSpecOf(column);
            if (value.isBindMarker())
                boundNames[value.bindIndex] = valueSpecOf(column, lt);
        }
        else
        {
            for (Term t : values)
View Full Code Here

TOP

Related Classes of com.persistit.KeyFilter$Term

Copyright © 2018 www.massapicom. 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.