congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Cursor.hasNext
Code IndexAdd Tabnine to your IDE (free)

How to use
hasNext
method
in
org.h2.mvstore.Cursor

Best Java code snippets using org.h2.mvstore.Cursor.hasNext (Showing top 20 results out of 315)

origin: com.h2database/h2

@Override
public K next() {
  hasNext();
  K c = current;
  last = current;
  lastValue = currentValue;
  lastPage = pos == null ? null : pos.page;
  fetchNext();
  return c;
}
origin: andsel/moquette

@Override
public List<Subscription> listAllSubscriptions() {
  LOG.debug("Retrieving existing subscriptions");
  List<Subscription> results = new ArrayList<>();
  Cursor<String, Subscription> mapCursor = subscriptions.cursor(null);
  while (mapCursor.hasNext()) {
    String subscriptionStr = mapCursor.next();
    results.add(mapCursor.getValue());
  }
  LOG.debug("Loaded {} subscriptions", results.size());
  return results;
}
origin: com.h2database/h2

private void fetchNext() {
  while (cursor.hasNext()) {
    K k;
    try {
        if (!cursor.hasNext()) {
          break;
        if (!cursor.hasNext()) {
          break;
origin: com.h2database/h2

private void fetchNext() {
  while (cursor.hasNext()) {
    transaction.store.rwLock.readLock().lock();
    try {
          if (!cursor.hasNext()) {
            break;
          if (!cursor.hasNext()) {
            break;
origin: com.h2database/h2

private Set<Integer> collectReferencedChunks() {
  long testVersion = lastChunk.version;
  DataUtils.checkArgument(testVersion > 0, "Collect references on version 0");
  long readCount = getFileStore().readCount.get();
  Set<Integer> referenced = new HashSet<>();
  for (Cursor<String, String> c = meta.cursor("root."); c.hasNext();) {
    String key = c.next();
    if (!key.startsWith("root.")) {
      break;
    }
    long pos = DataUtils.parseHexLong(c.getValue());
    if (pos == 0) {
      continue;
    }
    int mapId = DataUtils.parseHexInt(key.substring("root.".length()));
    collectReferencedChunks(referenced, mapId, pos, 0);
  }
  long pos = lastChunk.metaRootPos;
  collectReferencedChunks(referenced, 0, pos, 0);
  readCount = fileStore.readCount.get() - readCount;
  return referenced;
}
origin: com.h2database/h2

/**
 * Skip over that many entries. This method is relatively fast (for this map
 * implementation) even if many entries need to be skipped.
 *
 * @param n the number of entries to skip
 */
public void skip(long n) {
  if (!hasNext()) {
    return;
  }
  if (n < 10) {
    while (n-- > 0) {
      fetchNext();
    }
    return;
  }
  long index = map.getKeyIndex(current);
  K k = map.getKey(index + n);
  pos = null;
  min(root, k);
  fetchNext();
}
origin: com.h2database/h2

while (cursor.hasNext()) {
  K key = cursor.next();
origin: com.h2database/h2

Cursor<Object, Object> cursor = map.cursor(null);
Page lastPage = null;
while (cursor.hasNext()) {
  cursor.next();
  Page p = cursor.getPage();
origin: org.wowtools/h2

@Override
public K next() {
  hasNext();
  K c = current;
  last = current;
  lastValue = currentValue;
  lastPage = pos == null ? null : pos.page;
  fetchNext();
  return c;
}
origin: com.eventsourcing/h2

@Override
public K next() {
  hasNext();
  K c = current;
  last = current;
  lastValue = currentValue;
  lastPage = pos == null ? null : pos.page;
  fetchNext();
  return c;
}
origin: com.h2database/h2-mvstore

@Override
public K next() {
  hasNext();
  K c = current;
  last = current;
  lastValue = currentValue;
  lastPage = pos == null ? null : pos.page;
  fetchNext();
  return c;
}
origin: com.eventsourcing/h2

private void fetchNext() {
  while (cursor.hasNext()) {
    K k;
    try {
        if (!cursor.hasNext()) {
          break;
        if (!cursor.hasNext()) {
          break;
origin: com.h2database/h2-mvstore

private Set<Integer> collectReferencedChunks() {
  long testVersion = lastChunk.version;
  DataUtils.checkArgument(testVersion > 0, "Collect references on version 0");
  long readCount = getFileStore().readCount.get();
  Set<Integer> referenced = new HashSet<>();
  for (Cursor<String, String> c = meta.cursor("root."); c.hasNext();) {
    String key = c.next();
    if (!key.startsWith("root.")) {
      break;
    }
    long pos = DataUtils.parseHexLong(c.getValue());
    if (pos == 0) {
      continue;
    }
    int mapId = DataUtils.parseHexInt(key.substring("root.".length()));
    collectReferencedChunks(referenced, mapId, pos, 0);
  }
  long pos = lastChunk.metaRootPos;
  collectReferencedChunks(referenced, 0, pos, 0);
  readCount = fileStore.readCount.get() - readCount;
  return referenced;
}
origin: org.wowtools/h2

private Set<Integer> collectReferencedChunks() {
  long testVersion = lastChunk.version;
  DataUtils.checkArgument(testVersion > 0, "Collect references on version 0");
  long readCount = getFileStore().readCount;
  Set<Integer> referenced = New.hashSet();
  for (Cursor<String, String> c = meta.cursor("root."); c.hasNext();) {
    String key = c.next();
    if (!key.startsWith("root.")) {
      break;
    }
    long pos = DataUtils.parseHexLong(c.getValue());
    if (pos == 0) {
      continue;
    }
    int mapId = DataUtils.parseHexInt(key.substring("root.".length()));
    collectReferencedChunks(referenced, mapId, pos, 0);
  }
  long pos = lastChunk.metaRootPos;
  collectReferencedChunks(referenced, 0, pos, 0);
  readCount = fileStore.readCount - readCount;
  return referenced;
}
origin: com.h2database/h2-mvstore

/**
 * Skip over that many entries. This method is relatively fast (for this map
 * implementation) even if many entries need to be skipped.
 *
 * @param n the number of entries to skip
 */
public void skip(long n) {
  if (!hasNext()) {
    return;
  }
  if (n < 10) {
    while (n-- > 0) {
      fetchNext();
    }
    return;
  }
  long index = map.getKeyIndex(current);
  K k = map.getKey(index + n);
  pos = null;
  min(root, k);
  fetchNext();
}
origin: com.eventsourcing/h2

/**
 * Skip over that many entries. This method is relatively fast (for this map
 * implementation) even if many entries need to be skipped.
 *
 * @param n the number of entries to skip
 */
public void skip(long n) {
  if (!hasNext()) {
    return;
  }
  if (n < 10) {
    while (n-- > 0) {
      fetchNext();
    }
    return;
  }
  long index = map.getKeyIndex(current);
  K k = map.getKey(index + n);
  pos = null;
  min(root, k);
  fetchNext();
}
origin: com.eventsourcing/h2

private Set<Integer> collectReferencedChunks() {
  long testVersion = lastChunk.version;
  DataUtils.checkArgument(testVersion > 0, "Collect references on version 0");
  long readCount = getFileStore().readCount;
  Set<Integer> referenced = New.hashSet();
  for (Cursor<String, String> c = meta.cursor("root."); c.hasNext();) {
    String key = c.next();
    if (!key.startsWith("root.")) {
      break;
    }
    long pos = DataUtils.parseHexLong(c.getValue());
    if (pos == 0) {
      continue;
    }
    int mapId = DataUtils.parseHexInt(key.substring("root.".length()));
    collectReferencedChunks(referenced, mapId, pos, 0);
  }
  long pos = lastChunk.metaRootPos;
  collectReferencedChunks(referenced, 0, pos, 0);
  readCount = fileStore.readCount - readCount;
  return referenced;
}
origin: org.wowtools/h2

/**
 * Skip over that many entries. This method is relatively fast (for this map
 * implementation) even if many entries need to be skipped.
 *
 * @param n the number of entries to skip
 */
public void skip(long n) {
  if (!hasNext()) {
    return;
  }
  if (n < 10) {
    while (n-- > 0) {
      fetchNext();
    }
    return;
  }
  long index = map.getKeyIndex(current);
  K k = map.getKey(index + n);
  pos = null;
  min(root, k);
  fetchNext();
}
origin: org.wowtools/h2

Cursor<Object, Object> cursor = map.cursor(null);
Page lastPage = null;
while (cursor.hasNext()) {
  cursor.next();
  Page p = cursor.getPage();
origin: com.eventsourcing/h2

Cursor<Object, Object> cursor = map.cursor(null);
Page lastPage = null;
while (cursor.hasNext()) {
  cursor.next();
  Page p = cursor.getPage();
org.h2.mvstoreCursorhasNext

Popular methods of Cursor

  • getValue
    Get the last read value if there was one.
  • next
  • <init>
  • fetchNext
    Fetch the next entry if there is one.
  • getPage
  • min
    Fetch the next entry that is equal or larger than the given key, starting from the given page. This

Popular in Java

  • Parsing JSON documents to java classes using gson
  • putExtra (Intent)
  • setRequestProperty (URLConnection)
  • scheduleAtFixedRate (Timer)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Path (java.nio.file)
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Top 12 Jupyter Notebook extensions
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