Skip to content

Commit

Permalink
Removing the sync divisor
Browse files Browse the repository at this point in the history
  • Loading branch information
ianbarber committed Nov 17, 2011
1 parent 2e81df7 commit e5f1024
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 15 deletions.
6 changes: 0 additions & 6 deletions README.md
Expand Up @@ -40,12 +40,6 @@ Consistency
Defines how long to wait for an ACK for message delivered before scheduling
it for retransmission.

--sync-divisor
Sync divisor is used to determine how often the messages should be flushed
to disk. On each operation a random number between 0 and sync_divisor is chosen and if the number is 0 then a sync is done. Setting higher sync
divisor causes things to run faster but this comes at the cost of possibly
losing more messages on crash.

--hard-sync
Define this option for physical synchronization with the device, or leave out
for logical synchronization with the file system.
Expand Down
2 changes: 0 additions & 2 deletions src/main.cpp
Expand Up @@ -65,7 +65,6 @@ int main (int argc, char *argv [])
po::options_description desc ("Command-line options");
po::variables_map vm;
std::string filename;
int sync_divisor;
int64_t inflight_size;
uint64_t ack_timeout, reaper_frequency;
std::string receiver_dsn, sender_dsn, monitor_dsn, peer_uuid;
Expand Down Expand Up @@ -153,7 +152,6 @@ int main (int argc, char *argv [])
uint64_t in_hwm = 10, out_hwm = 1;

boost::shared_ptr<pzq::datastore_t> store (new pzq::datastore_t ());
store.get ()->set_sync_divisor (sync_divisor);
store.get ()->open (filename, inflight_size);
store.get ()->set_ack_timeout (ack_timeout);

Expand Down
8 changes: 1 addition & 7 deletions src/store.hpp
Expand Up @@ -31,15 +31,14 @@ namespace pzq {
TreeDB m_db;
CacheDB m_inflight_db;
boost::scoped_ptr<TreeDB::Cursor> m_cursor;
int m_divisor;
uint64_t m_ack_timeout;
bool m_hard_sync;
uint64_t m_syncs;
int m_expired;
boost::mutex m_mutex;

public:
datastore_t () : m_divisor (0), m_ack_timeout (5000000ULL), m_hard_sync (false), m_syncs (0),
datastore_t () : m_ack_timeout (5000000ULL), m_hard_sync (false), m_syncs (0),
m_expired (0)
{}

Expand Down Expand Up @@ -84,11 +83,6 @@ namespace pzq {

void mark_in_flight (const std::string &k);

void set_sync_divisor (int divisor)
{
m_divisor = divisor;
}

void set_ack_timeout (uint64_t ack_timeout)
{
m_ack_timeout = ack_timeout;
Expand Down

0 comments on commit e5f1024

Please sign in to comment.