org.modeshape.jcr.query.engine.process

## Class BufferingSequence

- java.lang.Object
- - org.modeshape.jcr.query.NodeSequence
  - - org.modeshape.jcr.query.engine.process.DelegatingSequence
    - - org.modeshape.jcr.query.engine.process.BufferingSequence

- Direct Known Subclasses:
    JoinSequence, SortingSequence

      public abstract class BufferingSequence
      extends DelegatingSequence

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.modeshape.jcr.query.NodeSequence

      `NodeSequence.AlternateSizeBatch, NodeSequence.Batch, NodeSequence.LimitBatch, NodeSequence.MultiWidthBatch, NodeSequence.Restartable, NodeSequence.RowAccessor, NodeSequence.RowFilter, NodeSequence.SingleWidthBatch`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected BufferManager.SortingBuffer<Object,BufferedRows.BufferedRow>` | `buffer`
    `protected CachedNodeSupplier` | `cache`
    `protected RowExtractors.ExtractFromRow` | `extractor`
    `protected static Logger` | `logger`
    `protected AtomicLong` | `remainingRowCount`
    `protected BufferedRows.BufferedRowFactory<? extends BufferedRows.BufferedRow>` | `rowFactory`
    `protected static boolean` | `trace`
    `protected int` | `width`
    `protected String` | `workspaceName`

    - ### Fields inherited from class org.modeshape.jcr.query.engine.process.DelegatingSequence

      `delegate`

    - ### Fields inherited from class org.modeshape.jcr.query.NodeSequence

      `LOGGER, NO_PASS_ROW_FILTER, PASS_ROW_FILTER`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `BufferingSequence(String workspaceName, NodeSequence delegate, RowExtractors.ExtractFromRow extractor, BufferManager bufferMgr, CachedNodeSupplier nodeCache, boolean pack, boolean useHeap, boolean allowDuplicates)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected NodeSequence.Batch` | `batchFrom(Iterator<BufferedRows.BufferedRow> rows, long maxBatchSize)`
    `void` | `close()` Signal that this node sequence is no longer needed.
    `protected BufferedRows.BufferedRow` | `createRow(NodeSequence.Batch currentRow)`
    `boolean` | `isEmpty()` Determine whether this results is known to be empty.
    `protected int` | `loadAll(NodeSequence sequence, RowExtractors.ExtractFromRow extractor, BufferManager.DistinctBuffer<BufferedRows.BufferedRow> rowsWithNullKey)` Load all of the rows from the supplied sequence into the buffer.
    `protected long` | `rowCount()`

    - ### Methods inherited from class org.modeshape.jcr.query.engine.process.DelegatingSequence

      `getRowCount, nextBatch, width`

    - ### Methods inherited from class org.modeshape.jcr.query.NodeSequence

      `append, batchFilteredWith, batchOf, batchOf, batchOf, batchOfKeys, batchOfKeys, batchOfKeys, batchOfKeys, batchWithCount, copy, emptyBatch, emptySequence, filter, keyFor, limit, limit, merging, requireBoth, requireEither, skip, withBatch, withBatches, withBatches, withNode, withNodeKeys, withNodeKeys, withNodeKeys, withNodeKeys, withNodes, withNodes`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### logger

          protected static final Logger logger

    - #### trace

          protected static final boolean trace

    - #### buffer

          protected final BufferManager.SortingBuffer<Object,BufferedRows.BufferedRow> buffer

    - #### rowFactory

          protected final BufferedRows.BufferedRowFactory<? extends BufferedRows.BufferedRow> rowFactory

    - #### extractor

          protected final RowExtractors.ExtractFromRow extractor

    - #### cache

          protected final CachedNodeSupplier cache

    - #### width

          protected final int width

    - #### workspaceName

          protected final String workspaceName

    - #### remainingRowCount

          protected final AtomicLong remainingRowCount

  - ### Constructor Detail

    - #### BufferingSequence

          protected BufferingSequence(String workspaceName,
                           NodeSequence delegate,
                           RowExtractors.ExtractFromRow extractor,
                           BufferManager bufferMgr,
                           CachedNodeSupplier nodeCache,
                           boolean pack,
                           boolean useHeap,
                           boolean allowDuplicates)

  - ### Method Detail

    - #### isEmpty

          public boolean isEmpty()

      Description copied from class: `NodeSequence`
      Determine whether this results is known to be empty.
      Overrides:
        `isEmpty` in class `DelegatingSequence`
      Returns:
        the true if there are no results, or false if there is at least some or if the number of rows is not known

    - #### rowCount

          protected long rowCount()

    - #### createRow

          protected BufferedRows.BufferedRow createRow(NodeSequence.Batch currentRow)

    - #### loadAll

          protected int loadAll(NodeSequence sequence,
                    RowExtractors.ExtractFromRow extractor,
                    BufferManager.DistinctBuffer<BufferedRows.BufferedRow> rowsWithNullKey)

      Load all of the rows from the supplied sequence into the buffer.
      Parameters:
        `sequence` - the node sequence; may not be null
        `extractor` - the extractor for the sortable value; may not be null
        `rowsWithNullKey` - the buffer into which should be placed all rows for which the extracted key value is null; may be null if these are not to be kept
      Returns:
        the size of the first batch, or 0 if there are no rows found

    - #### batchFrom

          protected NodeSequence.Batch batchFrom(Iterator<BufferedRows.BufferedRow> rows,
                                     long maxBatchSize)

    - #### close

          public void close()

      Description copied from class: `NodeSequence`
      Signal that this node sequence is no longer needed.
      Overrides:
        `close` in class `DelegatingSequence`

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.