DiskWriteAttributesFactory (Apache Geode 1.10.0)
Date: 2019-09-19

org.apache.geode.cache

## Class DiskWriteAttributesFactory

- java.lang.Object
- - org.apache.geode.cache.DiskWriteAttributesFactory

- All Implemented Interfaces:
    Serializable

  Deprecated.
  as of 6.5 use `DiskStoreFactory` instead

      @Deprecated
      public class DiskWriteAttributesFactory
      extends Object
      implements Serializable

  Factory for getting DiskWriteAttribute objects
  Since:
    GemFire 5.1
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DiskWriteAttributesFactory()` Deprecated. Creates a new instance of DiskWriteAttributesFactory ready to create a `DiskWriteAttributes` with default settings.
    `DiskWriteAttributesFactory(DiskWriteAttributes dwa)` Deprecated. Creates a new instance of DiskWriteAttributesFactory Factory ready to create a `DiskWriteAttributes` with the same settings as those in the specified `DiskWriteAttributes`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `DiskWriteAttributes` | `create()` Deprecated. as of 6.5 use `DiskStoreFactory.create(java.lang.String)` instead
    `void` | `setBytesThreshold(long bytesThreshold)` Deprecated. as of 6.5 use `DiskStoreFactory.setQueueSize(int)` instead
    `void` | `setCompactionThreshold(int compactionThreshold)` Deprecated. as of 6.5 use `DiskStoreFactory.setCompactionThreshold(int)` instead
    `void` | `setMaxOplogSize(int maxOplogSize)` Deprecated. as of 6.5 use `DiskStoreFactory.setMaxOplogSize(long)` instead
    `void` | `setMaxOplogSizeInBytes(long maxOplogSize)` Deprecated. as of 6.5 use `DiskStoreFactory.setMaxOplogSize(long)` instead
    `void` | `setRollOplogs(boolean rollingEnabled)` Deprecated. as of 6.5 use `DiskStoreFactory.setAutoCompact(boolean)` instead
    `void` | `setSynchronous(boolean isSynchronous)` Deprecated. as of 6.5 use `AttributesFactory.setDiskSynchronous(boolean)` instead
    `void` | `setTimeInterval(long timeInterval)` Deprecated. as of 6.5 use `DiskStoreFactory.setTimeInterval(long)` instead

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

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

- - ### Constructor Detail

    - #### DiskWriteAttributesFactory

          public DiskWriteAttributesFactory()

      Deprecated.
      Creates a new instance of DiskWriteAttributesFactory ready to create a `DiskWriteAttributes` with default settings. The default `DiskWriteAttributes` thus created will have following behaviour.
      - synchronous = false
      - auto-compact = true
      - allow-force-compaction = false
      - max-oplog-size = 1024 MB
      - time-interval = 1 sec
      - byte-threshold = 0 bytes

    - #### DiskWriteAttributesFactory

          public DiskWriteAttributesFactory(DiskWriteAttributes dwa)

      Deprecated.
      Creates a new instance of DiskWriteAttributesFactory Factory ready to create a `DiskWriteAttributes` with the same settings as those in the specified `DiskWriteAttributes`.
      Parameters:
        `dwa` - the `DiskWriteAttributes` used to initialize this DiskWriteAttributesFactory

  - ### Method Detail

    - #### setSynchronous

          @Deprecated
          public void setSynchronous(boolean isSynchronous)

      Deprecated. as of 6.5 use `AttributesFactory.setDiskSynchronous(boolean)` instead
      Sets whether or not the writing to the disk is synchronous.
      Parameters:
        `isSynchronous` - boolean if true indicates synchronous writes

    - #### setRollOplogs

          @Deprecated
          public void setRollOplogs(boolean rollingEnabled)

      Deprecated. as of 6.5 use `DiskStoreFactory.setAutoCompact(boolean)` instead
      Sets whether or not the rolling of Oplog is enabled .
      Parameters:
        `rollingEnabled` - true if oplogs are to be compacted automatically; false if no compaction.

    - #### setCompactionThreshold

          @Deprecated
          public void setCompactionThreshold(int compactionThreshold)

      Deprecated. as of 6.5 use `DiskStoreFactory.setCompactionThreshold(int)` instead
      Sets the threshold at which an oplog will become compactable. While the percentage of live records in the oplog exceeds this threshold the oplog will not be compacted. Once the percentage of live is less than or equal to the threshold the oplog can be compacted. The lower the threshold the longer the compactor will wait before compacting an oplog. The threshold is a percentage in the range 0..100. The default is 50%.

      Examples: A threshold of 100 causes any oplog that is no longer being written to to be compactable. A threshold of 0 causes only oplogs that have no live records to be compactable in which case the compact can simply remove the oplog file. A threshold of 50 causes an oplog to become compactable when half of its live records become dead.

    - #### setMaxOplogSizeInBytes

          @Deprecated
          public void setMaxOplogSizeInBytes(long maxOplogSize)

      Deprecated. as of 6.5 use `DiskStoreFactory.setMaxOplogSize(long)` instead
      Sets the maximum oplog size in bytes. When the active oplog size hits the maximum a new oplog will be created.

      Note that this method sets the same attribute as `setMaxOplogSize(int)`. The last set of the attribute determines its value.

      Parameters:
        `maxOplogSize` - the maximum size of the oplog in bytes.
      Throws:
        `IllegalArgumentException` - if the value specified is a negative number

    - #### setMaxOplogSize

          @Deprecated
          public void setMaxOplogSize(int maxOplogSize)

      Deprecated. as of 6.5 use `DiskStoreFactory.setMaxOplogSize(long)` instead
      Sets the maximum oplog size in megabytes. When the active oplog size hits the maximum a new oplog will be created.

      Note that this method sets the same attribute as `setMaxOplogSizeInBytes(long)`. The last set of the attribute determines its value.

      Parameters:
        `maxOplogSize` - the maximum size of the oplog in megabytes.
      Throws:
        `IllegalArgumentException` - if the value specified is a negative number

    - #### setTimeInterval

          @Deprecated
          public void setTimeInterval(long timeInterval)

      Deprecated. as of 6.5 use `DiskStoreFactory.setTimeInterval(long)` instead
      Sets the number of milliseconds that can elapse before unwritten data is written to disk. It has significance only in case of asynchronous mode of writing.
      Parameters:
        `timeInterval` - Time interval in milliseconds
      Throws:
        `IllegalArgumentException` - if the value specified is a negative number

    - #### setBytesThreshold

          @Deprecated
          public void setBytesThreshold(long bytesThreshold)

      Deprecated. as of 6.5 use `DiskStoreFactory.setQueueSize(int)` instead
      Sets the number of unwritten bytes of data that can be enqueued before being written to disk. It has significance only in case of asynchronous mode of writing.
      Parameters:
        `bytesThreshold` - the maximum number of bytes to enqueue before async data is flushed.
      Throws:
        `IllegalArgumentException` - if the value specified is a negative number

    - #### create

          @Deprecated
          public DiskWriteAttributes create()

      Deprecated. as of 6.5 use `DiskStoreFactory.create(java.lang.String)` instead
      Creates a `DiskWriteAttributes` with the current settings.
      Returns:
        the newly created `DiskWriteAttributes`
      Throws:
        `IllegalStateException` - if the current settings has compaction enabled with maximum Oplog Size specified as infinite ( represented by 0 ) *
      Since:
        GemFire 5.1