com.hazelcast.config

## Class MergePolicyConfig

- java.lang.Object
- - com.hazelcast.config.MergePolicyConfig

- All Implemented Interfaces:
    DataSerializable, IdentifiedDataSerializable

      public class MergePolicyConfig
      extends Object
      implements IdentifiedDataSerializable

  Configuration for `SplitBrainMergePolicy`.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_BATCH_SIZE` Default batch size.
    `static String` | `DEFAULT_MERGE_POLICY` Default merge policy.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MergePolicyConfig()`
    `MergePolicyConfig(MergePolicyConfig mergePolicyConfig)`
    `MergePolicyConfig(String policy, int batchSize)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `MergePolicyConfig` | `getAsReadOnly()` Deprecated. this method will be removed in 4.0; it is meant for internal usage only
    `int` | `getBatchSize()` Returns the batch size, which will be used to determine the number of entries to be sent in a merge operation.
    `int` | `getFactoryId()` Returns DataSerializableFactory factory ID for this class.
    `int` | `getId()` Returns type identifier for this class.
    `String` | `getPolicy()` Returns the classname of the `SplitBrainMergePolicy`.
    `int` | `hashCode()`
    `void` | `readData(ObjectDataInput in)` Reads fields from the input stream
    `MergePolicyConfig` | `setBatchSize(int batchSize)` Sets the batch size, which will be used to determine the number of entries to be sent in a merge operation.
    `MergePolicyConfig` | `setPolicy(String policy)` Sets the classname of your `SplitBrainMergePolicy`.
    `String` | `toString()`
    `void` | `writeData(ObjectDataOutput out)` Writes object fields to output stream

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_MERGE_POLICY

          public static final String DEFAULT_MERGE_POLICY

      Default merge policy.

    - #### DEFAULT_BATCH_SIZE

          public static final int DEFAULT_BATCH_SIZE

      Default batch size.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### MergePolicyConfig

          public MergePolicyConfig()

    - #### MergePolicyConfig

          public MergePolicyConfig(String policy,
                                   int batchSize)

    - #### MergePolicyConfig

          public MergePolicyConfig(MergePolicyConfig mergePolicyConfig)

  - ### Method Detail

    - #### getPolicy

          public String getPolicy()

      Returns the classname of the `SplitBrainMergePolicy`.
      Returns:
        the classname of the merge policy

    - #### setPolicy

          public MergePolicyConfig setPolicy(String policy)

      Sets the classname of your `SplitBrainMergePolicy`.

      For the out-of-the-box merge policies the simple classname is sufficient, e.g. `PutIfAbsentMergePolicy`. But also the fully qualified classname is fine, e.g. com.hazelcast.spi.merge.PutIfAbsentMergePolicy. For a custom merge policy the fully qualified classname is needed.

      Must be a non-empty string. The default value is `PutIfAbsentMergePolicy`.

      Parameters:
        `policy` - the classname of the merge policy
      Returns:
        this `MergePolicyConfig` instance

    - #### getBatchSize

          public int getBatchSize()

      Returns the batch size, which will be used to determine the number of entries to be sent in a merge operation.
      Returns:
        the batch size

    - #### setBatchSize

          public MergePolicyConfig setBatchSize(int batchSize)

      Sets the batch size, which will be used to determine the number of entries to be sent in a merge operation.

      Must be a positive number. Set to `1` to disable batching. The default value is 100.

      Parameters:
        `batchSize` - the batch size
      Returns:
        this `MergePolicyConfig` instance

    - #### getFactoryId

          public int getFactoryId()

      Description copied from interface: `IdentifiedDataSerializable`
      Returns DataSerializableFactory factory ID for this class.
      Specified by:
        `getFactoryId` in interface `IdentifiedDataSerializable`
      Returns:
        factory ID

    - #### getId

          public int getId()

      Description copied from interface: `IdentifiedDataSerializable`
      Returns type identifier for this class. It should be unique per DataSerializableFactory.
      Specified by:
        `getId` in interface `IdentifiedDataSerializable`
      Returns:
        type ID

    - #### writeData

          public void writeData(ObjectDataOutput out)
                         throws IOException

      Description copied from interface: `DataSerializable`
      Writes object fields to output stream
      Specified by:
        `writeData` in interface `DataSerializable`
      Parameters:
        `out` - output
      Throws:
        `IOException` - if an I/O error occurs. In particular, an `IOException` may be thrown if the output stream has been closed.

    - #### readData

          public void readData(ObjectDataInput in)
                        throws IOException

      Description copied from interface: `DataSerializable`
      Reads fields from the input stream
      Specified by:
        `readData` in interface `DataSerializable`
      Parameters:
        `in` - input
      Throws:
        `IOException` - if an I/O error occurs. In particular, an `IOException` may be thrown if the input stream has been closed.

    - #### equals

          public final boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public final int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getAsReadOnly

          public MergePolicyConfig getAsReadOnly()

      Deprecated. this method will be removed in 4.0; it is meant for internal usage only
      Gets immutable version of this configuration.
      Returns:
        immutable version of this configuration

Copyright © 2018. All rights reserved.