Tabnine Logo
Store.openCursor
Code IndexAdd Tabnine to your IDE (free)

How to use
openCursor
method
in
jetbrains.exodus.env.Store

Best Java code snippets using jetbrains.exodus.env.Store.openCursor (Showing top 9 results out of 315)

origin: io.permazen/permazen-kv-xodus

@Override
public CloseableIterator<KVPair> getRange(byte[] minKey, byte[] maxKey, boolean reverse) {
  Preconditions.checkState(!this.closed.get(), "transaction closed");
  return new XodusIter(this.store.openCursor(this.tx), minKey, maxKey, reverse);
}
origin: pwm-project/pwm

InnerIterator( final LocalDB.DB db )
{
  this.transaction = environment.beginReadonlyTransaction();
  this.cursor = getStore( db ).openCursor( transaction );
  doNext();
}
origin: lmdbjava/benchmarks

@Benchmark
public void readCrc(final Reader r, final Blackhole bh) {
 r.crc.reset();
 try (Cursor c = r.store.openCursor(r.tx)) {
  while (c.getNext()) {
   r.crc.update(c.getKey().getBytesUnsafe(), 0, r.keySize);
   r.crc.update(c.getValue().getBytesUnsafe(), 0, r.valSize);
  }
 }
 bh.consume(r.crc.getValue());
}
origin: io.permazen/permazen-kv-xodus

@Override
public void removeRange(byte[] minKey, byte[] maxKey) {
  Preconditions.checkState(!this.closed.get(), "transaction closed");
  Preconditions.checkState(!this.txType.isReadOnly(), "read-only transaction");
  try (final Cursor cursor = this.store.openCursor(this.tx)) {
    boolean found = minKey != null && minKey.length > 0 ?
     cursor.getSearchKeyRange(new ArrayByteIterable(minKey)) != null : cursor.getNext();
    while (found) {
      if (maxKey != null && ByteUtil.compare(XodusKVStore.get(cursor.getKey(), false), maxKey) >= 0)
        break;
      cursor.deleteCurrent();
      found = cursor.getNext();
    }
  }
}
origin: lmdbjava/benchmarks

@Benchmark
public void readSeq(final Reader r, final Blackhole bh) {
 try (Cursor c = r.store.openCursor(r.tx)) {
  while (c.getNext()) {
   bh.consume(c.getValue().getBytesUnsafe());
  }
 }
}
origin: io.permazen/permazen-kv-xodus

@Override
public KVPair getAtLeast(byte[] minKey, byte[] maxKey) {
  Preconditions.checkState(!this.closed.get(), "transaction closed");
  try (final Cursor cursor = this.store.openCursor(this.tx)) {
    final boolean found = minKey != null && minKey.length > 0 ?
     cursor.getSearchKeyRange(new ArrayByteIterable(minKey)) != null : cursor.getNext();
    if (!found)
      return null;
    final byte[] key = XodusKVStore.get(cursor.getKey(), true);
    if (maxKey != null && ByteUtil.compare(key, maxKey) >= 0)
      return null;
    return new KVPair(key, XodusKVStore.get(cursor.getValue(), true));
  }
}
origin: lmdbjava/benchmarks

@Benchmark
public void readRev(final Reader r, final Blackhole bh) {
 try (Cursor c = r.store.openCursor(r.tx)) {
  c.getLast();
  do {
   bh.consume(c.getValue().getBytesUnsafe());
  } while (c.getPrev());
 }
}
origin: io.permazen/permazen-kv-xodus

@Override
public KVPair getAtMost(byte[] maxKey, byte[] minKey) {
  Preconditions.checkState(!this.closed.get(), "transaction closed");
  try (final Cursor cursor = this.store.openCursor(this.tx)) {
    // It's possible somebody could be simultaneously inserting keys just after maxKey, in which case we
    // could be tricked into returning a key > maxKey. This is unlikely, but make sure it can't affect us.
    while (true) {
      if (maxKey != null)
        cursor.getSearchKeyRange(new ArrayByteIterable(maxKey));
      if (!cursor.getPrev())
        return null;
      final byte[] key = XodusKVStore.get(cursor.getKey(), true);
      if (maxKey != null && ByteUtil.compare(key, maxKey) >= 0)
        continue;
      if (minKey != null && ByteUtil.compare(key, minKey) < 0)
        return null;
      return new KVPair(key, XodusKVStore.get(cursor.getValue(), true));
    }
  }
}
origin: lmdbjava/benchmarks

@Benchmark
public void readXxh64(final Reader r, final Blackhole bh) {
 long result = 0;
 try (Cursor c = r.store.openCursor(r.tx)) {
  while (c.getNext()) {
   result += xx_r39().hashBytes(c.getKey().getBytesUnsafe(), 0, r.keySize);
   result += xx_r39().
     hashBytes(c.getValue().getBytesUnsafe(), 0, r.valSize);
  }
 }
 bh.consume(result);
}
jetbrains.exodus.envStoreopenCursor

Popular methods of Store

  • get
  • delete
  • put
  • add
  • count
  • getName

Popular in Java

  • Making http requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • addToBackStack (FragmentTransaction)
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • JTable (javax.swing)
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now