Class MergePolicyConfig

    • Field Detail

      • DEFAULT_MERGE_POLICY

        public static final java.lang.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​(java.lang.String policy,
                                 int batchSize)
      • MergePolicyConfig

        public MergePolicyConfig​(MergePolicyConfig mergePolicyConfig)
    • Method Detail

      • getPolicy

        public java.lang.String getPolicy()
        Returns the classname of the SplitBrainMergePolicy.
        Returns:
        the classname of the merge policy
      • setPolicy

        public MergePolicyConfig setPolicy​(java.lang.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
      • writeData

        public void writeData​(ObjectDataOutput out)
                       throws java.io.IOException
        Description copied from interface: DataSerializable
        Writes object fields to output stream
        Specified by:
        writeData in interface DataSerializable
        Parameters:
        out - output
        Throws:
        java.io.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 java.io.IOException
        Description copied from interface: DataSerializable
        Reads fields from the input stream
        Specified by:
        readData in interface DataSerializable
        Parameters:
        in - input
        Throws:
        java.io.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​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object