Berkeley DB
version 4.3.29

com.sleepycat.db
Interface ReplicationTransport


public interface ReplicationTransport

An interface specifying a replication transmit function, which sends information to other members of the replication group.


Field Summary
static int EID_BROADCAST
          A message that should be broadcast to every environment in the replication group.
static int EID_INVALID
          An invalid environment ID, and may be used to initialize environment ID variables that are subsequently checked for validity.
 
Method Summary
 int send(Environment environment, DatabaseEntry control, DatabaseEntry rec, LogSequenceNumber lsn, int envid, boolean noBuffer, boolean permanent)
          The callback used when Berkeley DB needs to transmit a replication message.
 

Field Detail

EID_BROADCAST

public static final int EID_BROADCAST
A message that should be broadcast to every environment in the replication group. The application may use a true broadcast protocol or may send the message in sequence to each machine with which it is in communication. In both cases, the sending site should not be asked to process the message.

See Also:
Constant Field Values

EID_INVALID

public static final int EID_INVALID
An invalid environment ID, and may be used to initialize environment ID variables that are subsequently checked for validity.

See Also:
Constant Field Values
Method Detail

send

public int send(Environment environment,
                DatabaseEntry control,
                DatabaseEntry rec,
                LogSequenceNumber lsn,
                int envid,
                boolean noBuffer,
                boolean permanent)
         throws DatabaseException
The callback used when Berkeley DB needs to transmit a replication message. This method must not call back down into Berkeley DB. It must return 0 on success and non-zero on failure. If the transmission fails, the message being sent is necessary to maintain database integrity, and the local log is not configured for synchronous flushing, the local log will be flushed; otherwise, any error from the function will be ignored.

Parameters:
environment - The enclosing database environment handle.

control - The first of the two data elements to be transmitted.

rec - The second of the two data elements to be transmitted.

lsn - If the type of message to be sent has an LSN associated with it, then the lsn contains the LSN of the record being sent. This LSN can be used to determine that certain records have been processed successfully by clients.

envid - A positive integer identifier that specifies the replication environment to which the message should be sent.

The value DB_EID_BROADCAST indicates that a message should be broadcast to every environment in the replication group. The application may use a true broadcast protocol or may send the message in sequence to each machine with which it is in communication. In both cases, the sending site should not be asked to process the message.

noBuffer - The record being sent should be transmitted immediately and not buffered or delayed.

permanent - The record being sent is critical for maintaining database integrity (for example, the message includes a transaction commit). The application should take appropriate action to enforce the reliability guarantees it has chosen, such as waiting for acknowledgement from one or more clients.

Throws:
DatabaseException - if a failure occurs.

Berkeley DB
version 4.3.29

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved.