Package wt.impact

Class AbstractWTEntryChunkedIterator<E extends WTKeyedMap.WTEntry>

java.lang.Object
wt.impact.AbstractWTEntryChunkedIterator<E>
All Implemented Interfaces:
AutoCloseable, Iterator<E>
Direct Known Subclasses:
WTEntryChunkedIterator, WTValuedEntryChunkedIterator

public class AbstractWTEntryChunkedIterator<E extends WTKeyedMap.WTEntry> extends Object implements Iterator<E>, AutoCloseable
WTEntry and WTValuedEntry set iterator that inflates and deflates references in chunks. This iterator keeps memory usage low when iterating over large, deflated maps. This is an abstract implementation used by WTEntryChunkedIterator and WTValuedEntryChunkedIterator.

This iterator can only be used in the method server.

Supported API: true

Extendable: false

See Also:
  • Constructor Details

    • AbstractWTEntryChunkedIterator

      public AbstractWTEntryChunkedIterator(WTKeyedMap map, int chunkSize, Class<? extends Persistable> keyFilter, boolean includeSubclasses)
      Construct a new WTEntryChunkedIterator for map entries with filtered keys.

      This iterator can only be used in the method server.

      Supported API: true

      Parameters:
      map - WTKeyedMap with deflated key references.
      chunkSize - Number of entries that are inflated in a chunk.
      keyFilter - Key class filter.
      includeSubclasses - True to iterated over the key filter objects and all of its sub-classes, or false to iterated over only the key filter objects.
  • Method Details

    • close

      public void close()
      Deflate references and clear chunk collections. Called automatically if iterator is a resource in a try-with-resources block.

      Supported API: true
      Specified by:
      close in interface AutoCloseable
    • hasNext

      public boolean hasNext()


      Supported API: true
      Specified by:
      hasNext in interface Iterator<E extends WTKeyedMap.WTEntry>
      Throws:
      WTRuntimeException
    • next

      public E next()
      Returns the next map entry object. References will be inflated and deflated in chunks within next() calls.

      Supported API: true
      Specified by:
      next in interface Iterator<E extends WTKeyedMap.WTEntry>
      Throws:
      NoSuchElementException