ReplicationConfig (Oracle - Berkeley DB Java API)
Date: 2017-04-13

com.sleepycat.db

## Class ReplicationConfig

- java.lang.Object
- - com.sleepycat.db.ReplicationConfig

- All Implemented Interfaces:
    java.lang.Cloneable

      public final class ReplicationConfig
      extends java.lang.Object
      implements java.lang.Cloneable

  Settings that configure Berkeley DB replication. Used in the `Environment.setReplicationConfig(com.sleepycat.db.ReplicationConfig, boolean)` method.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static ReplicationConfig` | `AUTOINIT` The replication master should automatically re-initialize outdated clients (defaults to on.)
    `static ReplicationConfig` | `BULK` The replication master should send groups of records to the clients in a single network transfer.
    `static ReplicationConfig` | `DELAYCLIENT` The client should delay synchronizing to a newly declared master (defaults to off).
    `static ReplicationConfig` | `ELECTIONS` Replication Manager automatically runs elections to choose a new master when the old master appears to have become disconnected.
    `static ReplicationConfig` | `FORWARD_WRITES` Enable simple write forwarding for this site.
    `static ReplicationConfig` | `LEASE` Master leases will be used for this site.
    `static ReplicationConfig` | `NOWAIT` Berkeley DB method calls that would normally block while clients are in recovery should return errors immediately.
    `static ReplicationConfig` | `PREFMAS_CLIENT` This flag is used to specify the client site in a replication group operating in preferred master mode.
    `static ReplicationConfig` | `PREFMAS_MASTER` This flag is used to specify the preferred master site in a replication group operating in preferred master mode.
    `static ReplicationConfig` | `STRICT_2SITE` Replication Manager observes the strict "majority" rule in managing elections, even in a group with only 2 sites.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `toString()`

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

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

- - ### Field Detail

    - #### BULK

          public static final ReplicationConfig BULK

      The replication master should send groups of records to the clients in a single network transfer.

    - #### DELAYCLIENT

          public static final ReplicationConfig DELAYCLIENT

      The client should delay synchronizing to a newly declared master (defaults to off). Clients configured in this way will remain unsynchronized until the application calls the `Environment.syncReplication()` method.

    - #### AUTOINIT

          public static final ReplicationConfig AUTOINIT

      The replication master should automatically re-initialize outdated clients (defaults to on.)

    - #### NOWAIT

          public static final ReplicationConfig NOWAIT

      Berkeley DB method calls that would normally block while clients are in recovery should return errors immediately.

    - #### STRICT_2SITE

          public static final ReplicationConfig STRICT_2SITE

      Replication Manager observes the strict "majority" rule in managing elections, even in a group with only 2 sites. This means the client in a 2-site group will be unable to take over as master if the original master fails or becomes disconnected. (See the Elections section in the Berkeley DB Reference Guide for more information.) Both sites in the replication group should have the same value for this parameter.

    - #### ELECTIONS

          public static final ReplicationConfig ELECTIONS

      Replication Manager automatically runs elections to choose a new master when the old master appears to have become disconnected. This option is turned on by default.

    - #### LEASE

          public static final ReplicationConfig LEASE

      Master leases will be used for this site.

      Configuring this option may result in the `Database.get()` and `Cursor.get*()` methods throwing a `DatabaseException` when attempting to read entries from a database after the site's master lease has expired.

      Once this option is turned on, it may never be turned off.

    - #### PREFMAS_MASTER

          public static final ReplicationConfig PREFMAS_MASTER

      This flag is used to specify the preferred master site in a replication group operating in preferred master mode. A preferred master replication group must contain only two sites, with one site specified as the preferred master site and the other site specified as the client site. The preferred master site operates as the master site whenever possible.

    - #### PREFMAS_CLIENT

          public static final ReplicationConfig PREFMAS_CLIENT

      This flag is used to specify the client site in a replication group operating in preferred master mode. A preferred master replication group must contain only two sites, with one site specified as the preferred master site and the other site specified as the client site. The client site in a preferred master replication group takes over temporarily as master when the preferred master site is unavailable.

    - #### FORWARD_WRITES

          public static final ReplicationConfig FORWARD_WRITES

      Enable simple write forwarding for this site. This option is turned off by default.

      By default, write operations cannot be performed on a replication client site. This option enables forwarding of simple client database put and delete operations to the master site for processing. These operations must use an implicit NULL transaction ID to be forwarded. Any other write operation that specifies a non-NULL transaction throws a DatabaseException.

      The master must have an open database handle for the database on which a forwarded write operation is being performed.

      All sites in the replication group should have the same value for this configuration option.

  - ### Method Detail

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

Copyright (c) 1996, 2017 Oracle and/or its affiliates. All rights reserved.