org.modeshape.jcr.query.engine.process

## Class PartialMemoryCountableSequence

- java.lang.Object
- - org.modeshape.jcr.query.NodeSequence
  - - org.modeshape.jcr.query.engine.process.CountableSequence
    - - org.modeshape.jcr.query.engine.process.PartialMemoryCountableSequence

-     public class PartialMemoryCountableSequence
      extends CountableSequence

  A sequence that will return an accurate size for a given NodeSequence by buffering and counting the nodes and then accessing the buffered sequence. Some number of batches will be stored in-memory, while the rest are stored off-heap.
  See Also:
    `CountableSequence`

- - ### 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 inherited from class org.modeshape.jcr.query.engine.process.CountableSequence

      `remainingRowCount, width, workspaceName`

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

      `LOGGER, NO_PASS_ROW_FILTER, PASS_ROW_FILTER`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PartialMemoryCountableSequence(String workspaceName, NodeSequence original, BufferManager bufferMgr, CachedNodeSupplier nodeCache, int numRowsInMemory)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected NodeSequence.Batch` | `doNextBatch()`
    `protected long` | `loadAll(NodeSequence sequence, BufferManager.QueueBuffer<BufferedRows.BufferedRow> buffer, AtomicLong batchSize)` Load all of the rows from the supplied sequence into the buffer.

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

      `batchFrom, close, createRow, doInitialize, getRowCount, initialize, isEmpty, loadAll, 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`

- - ### Constructor Detail

    - #### PartialMemoryCountableSequence

          public PartialMemoryCountableSequence(String workspaceName,
                                        NodeSequence original,
                                        BufferManager bufferMgr,
                                        CachedNodeSupplier nodeCache,
                                        int numRowsInMemory)

  - ### Method Detail

    - #### doNextBatch

          protected NodeSequence.Batch doNextBatch()

      Overrides:
        `doNextBatch` in class `CountableSequence`

    - #### loadAll

          protected long loadAll(NodeSequence sequence,
                     BufferManager.QueueBuffer<BufferedRows.BufferedRow> buffer,
                     AtomicLong batchSize)

      Description copied from class: `CountableSequence`
      Load all of the rows from the supplied sequence into the buffer.
      Overrides:
        `loadAll` in class `CountableSequence`
      Parameters:
        `sequence` - the node sequence; may not be null
        `buffer` - the buffer into which all rows should be loaded; may not be null
        `batchSize` - the atomic that should be set with the size of the first batch
      Returns:
        the total number of rows

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