From f486baafee54173263d646366931eb796a5d18d4 Mon Sep 17 00:00:00 2001
From: Konstantin Osipov <kostja@tarantool.org>
Date: Fri, 3 Apr 2015 22:02:44 +0300
Subject: [PATCH] style: follow camelNotation for C++ class method names

---
 src/box/engine.cc        | 14 +++++++-------
 src/box/engine.h         | 14 +++++++-------
 src/box/memtx_engine.cc  | 20 ++++++++++----------
 src/box/memtx_engine.h   | 14 +++++++-------
 src/box/sophia_engine.cc | 16 ++++++++--------
 src/box/sophia_engine.h  | 14 +++++++-------
 6 files changed, 46 insertions(+), 46 deletions(-)

diff --git a/src/box/engine.cc b/src/box/engine.cc
index 1930b2e830..d7ce55f99b 100644
--- a/src/box/engine.cc
+++ b/src/box/engine.cc
@@ -116,7 +116,7 @@ engine_begin_recover_snapshot(int64_t snapshot_lsn)
 	/* recover engine snapshot */
 	Engine *engine;
 	engine_foreach(engine) {
-		engine->begin_recover_snapshot(snapshot_lsn);
+		engine->beginRecoverSnapshot(snapshot_lsn);
 	}
 }
 
@@ -139,7 +139,7 @@ engine_end_recover_snapshot()
 	 */
 	Engine *engine;
 	engine_foreach(engine) {
-		engine->end_recover_snapshot();
+		engine->endRecoverSnapshot();
 	}
 }
 
@@ -152,7 +152,7 @@ engine_end_recovery()
 	 */
 	Engine *engine;
 	engine_foreach(engine)
-		engine->end_recovery();
+		engine->endRecovery();
 }
 
 int
@@ -167,19 +167,19 @@ engine_checkpoint(int64_t checkpoint_id)
 	/* create engine snapshot */
 	Engine *engine;
 	engine_foreach(engine) {
-		if (engine->begin_checkpoint(checkpoint_id))
+		if (engine->beginCheckpoint(checkpoint_id))
 			goto error;
 	}
 
 	/* wait for engine snapshot completion */
 	engine_foreach(engine) {
-		if (engine->wait_checkpoint())
+		if (engine->waitCheckpoint())
 			goto error;
 	}
 
 	/* remove previous snapshot reference */
 	engine_foreach(engine) {
-		engine->commit_checkpoint();
+		engine->commitCheckpoint();
 	}
 	snapshot_is_in_progress = false;
 	return 0;
@@ -187,7 +187,7 @@ engine_checkpoint(int64_t checkpoint_id)
 	int save_errno = errno;
 	/* rollback snapshot creation */
 	engine_foreach(engine)
-		engine->abort_checkpoint();
+		engine->abortCheckpoint();
 	snapshot_is_in_progress = false;
 	return save_errno;
 }
diff --git a/src/box/engine.h b/src/box/engine.h
index 26f6a691e1..4df345706d 100644
--- a/src/box/engine.h
+++ b/src/box/engine.h
@@ -112,14 +112,14 @@ class Engine: public Object {
 	virtual void commit(struct txn*);
 	virtual void rollback(struct txn*);
 	/** Recovery */
-	virtual void begin_recover_snapshot(int64_t snapshot_lsn) = 0;
+	virtual void beginRecoverSnapshot(int64_t snapshot_lsn) = 0;
 	/* Inform engine about a recovery stage change. */
-	virtual void end_recover_snapshot() = 0;
+	virtual void endRecoverSnapshot() = 0;
 	/**
 	 * Inform the engine about the global recovery
 	 * state change (end of recovery from the binary log).
 	 */
-	virtual void end_recovery() = 0;
+	virtual void endRecovery() = 0;
 	/**
 	 * Notify engine about a JOIN start (slave-side)
 	 */
@@ -128,21 +128,21 @@ class Engine: public Object {
 	 * Begin a two-phase snapshot creation in this
 	 * engine (snapshot is a memtx idea of a checkpoint).
 	 */
-	virtual int begin_checkpoint(int64_t) = 0;
+	virtual int beginCheckpoint(int64_t) = 0;
 	/**
 	 * Wait for a checkpoint to complete. The LSN
 	 * must match one in begin_checkpoint().
 	 */
-	virtual int wait_checkpoint() = 0;
+	virtual int waitCheckpoint() = 0;
 	/**
 	 * All engines prepared their checkpoints,
 	 * fix up the changes.
 	 */
-	virtual void commit_checkpoint() = 0;
+	virtual void commitCheckpoint() = 0;
 	/**
 	 * An error in one of the engines, abort checkpoint.
 	 */
-	virtual void abort_checkpoint() = 0;
+	virtual void abortCheckpoint() = 0;
 public:
 	/** Name of the engine. */
 	const char *name;
diff --git a/src/box/memtx_engine.cc b/src/box/memtx_engine.cc
index d0bdd0ec84..bb3401dfb6 100644
--- a/src/box/memtx_engine.cc
+++ b/src/box/memtx_engine.cc
@@ -213,20 +213,20 @@ MemtxEngine::MemtxEngine()
 
 /** Called at start to tell memtx to recover to a given LSN. */
 void
-MemtxEngine::begin_recover_snapshot(int64_t /* lsn */)
+MemtxEngine::beginRecoverSnapshot(int64_t /* lsn */)
 {
 	m_state = MEMTX_READING_SNAPSHOT;
 }
 
 void
-MemtxEngine::end_recover_snapshot()
+MemtxEngine::endRecoverSnapshot()
 {
 	m_state = MEMTX_READING_WAL;
 	space_foreach(memtx_end_build_primary_key, this);
 }
 
 void
-MemtxEngine::end_recovery()
+MemtxEngine::endRecovery()
 {
 	m_state = MEMTX_OK;
 	space_foreach(memtx_build_secondary_keys, this);
@@ -549,7 +549,7 @@ snapshot_save(struct recovery_state *r)
 }
 
 int
-MemtxEngine::begin_checkpoint(int64_t lsn)
+MemtxEngine::beginCheckpoint(int64_t lsn)
 {
 	assert(m_snapshot_lsn == -1);
 	assert(m_snapshot_pid == 0);
@@ -593,7 +593,7 @@ MemtxEngine::begin_checkpoint(int64_t lsn)
 }
 
 int
-MemtxEngine::wait_checkpoint()
+MemtxEngine::waitCheckpoint()
 {
 	assert(m_snapshot_lsn >= 0);
 	assert(m_snapshot_pid > 0);
@@ -612,11 +612,11 @@ MemtxEngine::wait_checkpoint()
 }
 
 void
-MemtxEngine::commit_checkpoint()
+MemtxEngine::commitCheckpoint()
 {
-	/* begin_checkpoint() must have been done */
+	/* beginCheckpoint() must have been done */
 	assert(m_snapshot_lsn >= 0);
-	/* wait_checkpoint() must have been done. */
+	/* waitCheckpoint() must have been done. */
 	assert(m_snapshot_pid == 0);
 
 	struct xdir *dir = &::recovery->snap_dir;
@@ -633,14 +633,14 @@ MemtxEngine::commit_checkpoint()
 }
 
 void
-MemtxEngine::abort_checkpoint()
+MemtxEngine::abortCheckpoint()
 {
 	if (m_snapshot_pid > 0) {
 		assert(m_snapshot_lsn >= 0);
 		/**
 		 * An error in the other engine's first phase.
 		 */
-		wait_checkpoint();
+		waitCheckpoint();
 	}
 	if (m_snapshot_lsn > 0) {
 		/** Remove garbage .inprogress file. */
diff --git a/src/box/memtx_engine.h b/src/box/memtx_engine.h
index ba2540eee7..dcdc6f1171 100644
--- a/src/box/memtx_engine.h
+++ b/src/box/memtx_engine.h
@@ -48,14 +48,14 @@ struct MemtxEngine: public Engine {
 	virtual void keydefCheck(struct space *space, struct key_def *key_def);
 	virtual void rollback(struct txn*);
 	virtual void beginJoin();
-	virtual void begin_recover_snapshot(int64_t lsn);
-	virtual void end_recover_snapshot();
-	virtual void end_recovery();
+	virtual void beginRecoverSnapshot(int64_t lsn);
+	virtual void endRecoverSnapshot();
+	virtual void endRecovery();
 	virtual void join(Relay*);
-	virtual int begin_checkpoint(int64_t);
-	virtual int wait_checkpoint();
-	virtual void commit_checkpoint();
-	virtual void abort_checkpoint();
+	virtual int beginCheckpoint(int64_t);
+	virtual int waitCheckpoint();
+	virtual void commitCheckpoint();
+	virtual void abortCheckpoint();
 	virtual void initSystemSpace(struct space *space);
 private:
 	/**
diff --git a/src/box/sophia_engine.cc b/src/box/sophia_engine.cc
index 5f387d0918..fa9fd263bb 100644
--- a/src/box/sophia_engine.cc
+++ b/src/box/sophia_engine.cc
@@ -136,7 +136,7 @@ static inline void
 sophia_snapshot_recover(void *env, int64_t lsn);
 
 void
-SophiaEngine::end_recover_snapshot()
+SophiaEngine::endRecoverSnapshot()
 {
 	/* create snapshot reference after tarantool
 	 * recovery, to ensure correct ref counting
@@ -231,7 +231,7 @@ SophiaEngine::join(Relay *relay)
 }
 
 void
-SophiaEngine::end_recovery()
+SophiaEngine::endRecovery()
 {
 	if (recovery_complete)
 		return;
@@ -376,7 +376,7 @@ SophiaEngine::beginJoin()
 {
 	/* put engine to recovery-complete state to
 	 * correctly support join */
-	end_recovery();
+	endRecovery();
 }
 
 static inline void
@@ -464,13 +464,13 @@ sophia_delete_checkpoint(void *env, int64_t lsn)
 }
 
 void
-SophiaEngine::begin_recover_snapshot(int64_t lsn)
+SophiaEngine::beginRecoverSnapshot(int64_t lsn)
 {
 	m_checkpoint_lsn = lsn;
 }
 
 int
-SophiaEngine::begin_checkpoint(int64_t lsn)
+SophiaEngine::beginCheckpoint(int64_t lsn)
 {
 	assert(m_checkpoint_lsn == -1);
 	if (lsn != m_prev_checkpoint_lsn) {
@@ -483,7 +483,7 @@ SophiaEngine::begin_checkpoint(int64_t lsn)
 }
 
 int
-SophiaEngine::wait_checkpoint()
+SophiaEngine::waitCheckpoint()
 {
 	assert(m_checkpoint_lsn != -1);
 	while (! sophia_snapshot_ready(env, m_checkpoint_lsn))
@@ -492,7 +492,7 @@ SophiaEngine::wait_checkpoint()
 }
 
 void
-SophiaEngine::commit_checkpoint()
+SophiaEngine::commitCheckpoint()
 {
 	if (m_prev_checkpoint_lsn >= 0)
 		sophia_delete_checkpoint(env, m_prev_checkpoint_lsn);
@@ -501,7 +501,7 @@ SophiaEngine::commit_checkpoint()
 }
 
 void
-SophiaEngine::abort_checkpoint()
+SophiaEngine::abortCheckpoint()
 {
 	if (m_checkpoint_lsn >= 0) {
 		sophia_delete_checkpoint(env, m_checkpoint_lsn);
diff --git a/src/box/sophia_engine.h b/src/box/sophia_engine.h
index f48abf228a..cc35900687 100644
--- a/src/box/sophia_engine.h
+++ b/src/box/sophia_engine.h
@@ -41,14 +41,14 @@ struct SophiaEngine: public Engine {
 	virtual void commit(struct txn*);
 	virtual void rollback(struct txn*);
 	virtual void beginJoin();
-	virtual void begin_recover_snapshot(int64_t);
-	virtual void end_recover_snapshot();
-	virtual void end_recovery();
+	virtual void beginRecoverSnapshot(int64_t);
+	virtual void endRecoverSnapshot();
+	virtual void endRecovery();
 	virtual void join(Relay*);
-	virtual int begin_checkpoint(int64_t);
-	virtual int wait_checkpoint();
-	virtual void commit_checkpoint();
-	virtual void abort_checkpoint();
+	virtual int beginCheckpoint(int64_t);
+	virtual int waitCheckpoint();
+	virtual void commitCheckpoint();
+	virtual void abortCheckpoint();
 	void *env;
 private:
 	int64_t m_prev_checkpoint_lsn;
-- 
GitLab