Tkrzw-RPC
|
Reader for update logs for asynchronous replicatoin. More...
#include <tkrzw_dbm_remote.h>
Public Member Functions | |
~Replicator () | |
Destructor. More... | |
Replicator (const Replicator &rhs)=delete | |
Copy and assignment are disabled. More... | |
Replicator & | operator= (const Replicator &rhs)=delete |
void | Cancel () |
Cancels the current operation. More... | |
int32_t | GetMasterServerID () |
Get the server ID of the master server. More... | |
Status | Start (int64_t min_timestamp, int32_t server_id=0, double wait_time=-1) |
Starts replication. More... | |
Status | Read (int64_t *timestamp, ReplicateLog *op) |
Reads the next update log. More... | |
Replicator (RemoteDBMImpl *dbm_impl) | |
Constructor. More... | |
Public Attributes | |
RemoteDBMReplicatorImpl * | impl_ |
Pointer to the actual implementation. More... | |
Friends | |
class | tkrzw::RemoteDBM |
Reader for update logs for asynchronous replicatoin.
An instance of this class dominates a thread on the server so you should destroy when it is no longer in use.
tkrzw::RemoteDBM::Replicator::~Replicator | ( | ) |
Destructor.
|
explicitdelete |
Copy and assignment are disabled.
|
explicit |
Constructor.
dbm_impl | The database implementation object. |
void tkrzw::RemoteDBM::Replicator::Cancel | ( | ) |
Cancels the current operation.
This is called by another thread than the thread doing the operation.
int32_t tkrzw::RemoteDBM::Replicator::GetMasterServerID | ( | ) |
Get the server ID of the master server.
Ths can be called only after the Start method returns success.
Status tkrzw::RemoteDBM::Replicator::Start | ( | int64_t | min_timestamp, |
int32_t | server_id = 0 , |
||
double | wait_time = -1 |
||
) |
Starts replication.
min_timestamp | The minimum timestamp in milliseconds of messages to read. |
server_id | The server ID of the process. Logs with the same server ID are skipped to avoid infinite loop. |
wait_time | The time in seconds to wait for the next log. Zero means no wait. Negative means unlimited. |
Status tkrzw::RemoteDBM::Replicator::Read | ( | int64_t * | timestamp, |
ReplicateLog * | op | ||
) |
Reads the next update log.
timestamp | The pointer to a variable to store the timestamp in milliseconds of the message. This is set if the result is SUCCESS or INFEASIBLE_ERROR. |
op | The pointer to the update log object to store the result. The life duration of the key and the value fields is the same as the given message. |
RemoteDBMReplicatorImpl* tkrzw::RemoteDBM::Replicator::impl_ |
Pointer to the actual implementation.