Package oracle.kv

# Class BulkWriteOptions

java.lang.Object
oracle.kv.table.WriteOptions
oracle.kv.BulkWriteOptions

All Implemented Interfaces:
  `Cloneable`

public class BulkWriteOptions extends WriteOptions
BulkWriteOptions is used to configure bulk write operations. The default values, documented in the setter methods, should be a good choice for a wide range of conditions. If you should wish to fine tune the bulk load operation further, you can use these values as a starting point for a benchmark using your own application data and actual hardware.

Since:
  4.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BulkWriteOptions()`
  Create a `BulkWriteOptions` with default values.
  `BulkWriteOptions(BulkWriteOptions options)`
  `BulkWriteOptions(Durability durability, long timeout, TimeUnit timeoutUnit)`
  The options used to configure the bulk put operation.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getBulkHeapPercent()`
  Returns the percentage of Runtime.maxMemory() that can be used for the operation.
  `int`
  `getMaxRequestSize()`
  Returns the max number of bytes of records in a single bulk put request.
  `int`
  `getPerShardParallelism()`
  The maximum number of threads that can concurrently write a batch of entries to a single shard in the store.
  `int`
  `getStreamParallelism()`
  Returns the maximum number of streams that can be read concurrently.
  `void`
  `setBulkHeapPercent(int bulkHeapPercent)`
  The percentage of Runtime.maxMemory() that can be used for the operation.
  `void`
  `setMaxRequestSize(int maxRequestSize)`
  The max request size is used to limit the total number of bytes of records in a single bulk put request.
  `void`
  `setPerShardParallelism(int perShardParallelism)`
  Sets the maximum number of threads that can concurrently write it's batch of entries to a single shard in the store.
  `void`
  `setStreamParallelism(int streamParallelism)`
  Sets the maximum number of streams that can be read concurrently.

  ### Methods inherited from class oracle.kv.table.WriteOptions

  `clone, getDurability, getIdentityCacheSize, getTimeout, getTimeoutUnit, getUpdateTTL, setDurability, setIdentityCacheSize, setTimeout, setUpdateTTL, toString`

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

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

- ## Constructor Details

  - ### BulkWriteOptions

    public BulkWriteOptions(Durability durability, long timeout, TimeUnit timeoutUnit)
    The options used to configure the bulk put operation.
    Parameters:
      `durability` - the durability to be used by the underlying write operations that make up the bulk put.
      `timeout` - the timeout associated with the underlying write operations that make up the bulk put.
      `timeoutUnit` - the units associated with the timeout

  - ### BulkWriteOptions

    public BulkWriteOptions(BulkWriteOptions options)

  - ### BulkWriteOptions

    public BulkWriteOptions()
    Create a `BulkWriteOptions` with default values.

- ## Method Details

  - ### getBulkHeapPercent

    public int getBulkHeapPercent()
    Returns the percentage of Runtime.maxMemory() that can be used for the operation.

  - ### setBulkHeapPercent

    public void setBulkHeapPercent(int bulkHeapPercent)
    The percentage of Runtime.maxMemory() that can be used for the operation. This heap is used to assemble batches of entries associated with specific shards and partitions.

    The default is 40%.

  - ### getMaxRequestSize

    public int getMaxRequestSize()
    Returns the max number of bytes of records in a single bulk put request.

  - ### setMaxRequestSize

    public void setMaxRequestSize(int maxRequestSize)
    The max request size is used to limit the total number of bytes of records in a single bulk put request.

    The default is 512K.

  - ### getPerShardParallelism

    public int getPerShardParallelism()
    The maximum number of threads that can concurrently write a batch of entries to a single shard in the store.

  - ### setPerShardParallelism

    public void setPerShardParallelism(int perShardParallelism)
    Sets the maximum number of threads that can concurrently write it's batch of entries to a single shard in the store.

    The default value is 3 and allows for overlapping the reading of the next batch with processing of the current batch at a server node. Higher capacity networks and and storage nodes can allow for higher parallelism.

  - ### getStreamParallelism

    public int getStreamParallelism()
    Returns the maximum number of streams that can be read concurrently. Each stream is read by a dedicated thread from a thread pool. This setting determines the size of the thread pool used for reading streams.

  - ### setStreamParallelism

    public void setStreamParallelism(int streamParallelism)
    Sets the maximum number of streams that can be read concurrently. Each stream is read by a dedicated thread from a thread pool. This setting determines the size of the thread pool used for reading streams.

    The default parallelism is 1. For streams with high overheads, say because the I/O device underlying the stream is slow and there are different I/O devices underlying each stream, a higher value would be appropriate.