oracle.kv.table

## Class TableIteratorOptions

- java.lang.Object
- - oracle.kv.table.ReadOptions
  - - oracle.kv.table.TableIteratorOptions

-     public class TableIteratorOptions
      extends ReadOptions

  TableIteratorOptions extends ReadOptions and is passed to read-only store operations that return iterators. It is used to specify non-default behavior. Default behavior is configured when a store is opened using `KVStoreConfig`.
  Since:
    3.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TableIteratorOptions(Direction direction, Consistency consistency, long timeout, TimeUnit timeoutUnit)` Creates a `TableIteratorOptions` with the specified parameters.
    `TableIteratorOptions(Direction direction, Consistency consistency, long timeout, TimeUnit timeoutUnit, int maxConcurrentRequests, int batchResultsSize, int maxResultsBatches)` Creates a `TableIteratorOptions` with the specified parameters.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Direction` | `getDirection()` Returns the direction.
    `int` | `getMaxConcurrentRequests()` Returns the maximum number of concurrent requests.
    `int` | `getMaxResultsBatches()` Returns the maximum number of results batches that can be held in the NoSQL Database client process.
    `int` | `getResultsBatchSize()` Returns the number of results per request.

    - ### Methods inherited from class oracle.kv.table.ReadOptions

      `getConsistency, getTimeout, getTimeoutUnit`

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

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

- - ### Constructor Detail

    - #### TableIteratorOptions

          public TableIteratorOptions(Direction direction,
                              Consistency consistency,
                              long timeout,
                              TimeUnit timeoutUnit)

      Creates a `TableIteratorOptions` with the specified parameters. Equivalent to `TableIteratorOptions(direction, consistency, timeout, timeoutUnit, 0, 0, 0)`
      Parameters:
        `direction` - a direction
        `consistency` - the read consistency to use or null
        `timeout` - the timeout value to use
        `timeoutUnit` - the `TimeUnit` used by the `timeout` parameter or null
      Throws:
        `IllegalArgumentException` - if direction is null, the timeout is negative or timeout is > 0 and timeoutUnit is null

    - #### TableIteratorOptions

          public TableIteratorOptions(Direction direction,
                              Consistency consistency,
                              long timeout,
                              TimeUnit timeoutUnit,
                              int maxConcurrentRequests,
                              int batchResultsSize,
                              int maxResultsBatches)

      Creates a `TableIteratorOptions` with the specified parameters.

      If `consistency` is `null`, the `default consistency` is used. If `timeout` is zero the `default request timeout` is used.

      `maxConcurrentRequests` specifies the maximum degree of parallelism (in effect the maximum number of client-side threads) to be used when running an iteration. Setting `maxConcurrentRequests` to 1 causes the iteration to be performed using only the current thread. Setting it to 0 lets the KV Client determine the number of threads based on topology information (up to a maximum of the number of available processors as returned by java.lang.Runtime.availableProcessors()). Values less than 0 are reserved for some future use and cause an `IllegalArgumentException` to be thrown.

      `maxResultsBatches` specifies the maximum number of results batches that can be held in the NoSQL Database client process before processing on the Replication Node pauses. This ensures that client side memory is not exceeded if the client can't consume results as fast as they are generated by the Rep Nodes.

      Parameters:
        `direction` - a direction
        `consistency` - the read consistency to use or null
        `timeout` - the timeout value to use
        `timeoutUnit` - the `TimeUnit` used by the `timeout` parameter or null
        `maxConcurrentRequests` - the maximum number of client-side threads
        `batchResultsSize` - the number of results per request
        `maxResultsBatches` - the maximum number of results sets that can be held on the client side
      Throws:
        `IllegalArgumentException` - if direction is null, the timeout is negative, timeout is > 0 and timeoutUnit is null, or if maxConcurrentRequests, maxResultsSize, or maxResultsBatches is less than 0.

  - ### Method Detail

    - #### getDirection

          public Direction getDirection()

      Returns the direction.
      Returns:
        the direction

    - #### getMaxConcurrentRequests

          public int getMaxConcurrentRequests()

      Returns the maximum number of concurrent requests.
      Returns:
        the maximum number of concurrent requests

    - #### getResultsBatchSize

          public int getResultsBatchSize()

      Returns the number of results per request.
      Returns:
        the number of results

    - #### getMaxResultsBatches

          public int getMaxResultsBatches()

      Returns the maximum number of results batches that can be held in the NoSQL Database client process.
      Returns:
        the maximum number of results batches that can be held in the NoSQL Database client process.

Copyright (c) 2011, 2014 Oracle and/or its affiliates. All rights reserved.