Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Some doc updates.

There are still a few completely undocumented classes -- some of which
should probably just be marked as DETAILS so they don't show up in the
docs, but it's good to at least get a bit captured.

Change-Id: I606595f6b7c66f5acc4348fe74688a8e9c2695d7
Reviewed-on: http://review.couchbase.org/13048
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
  • Loading branch information...
commit 4d05a0cb5245769f2e3d52651b71b0503075c6fb 1 parent 7135a13
@dustin dustin authored trondn committed
View
13 checkpoint.hh
@@ -24,16 +24,25 @@
#define DEFAULT_MAX_CHECKPOINTS 2
#define MAX_CHECKPOINTS_UPPER_BOUND 5
+/**
+ * The state of a given checkpoint.
+ */
typedef enum {
- opened,
- closed
+ opened, //!< The checkpoint is open.
+ closed //!< The checkpoint is not open.
} checkpoint_state;
+/**
+ * A checkpoint index entry.
+ */
struct index_entry {
std::list<queued_item>::iterator position;
uint64_t mutation_id;
};
+/**
+ * The checkpoint index maps a key to a checkpoint index_entry.
+ */
typedef unordered_map<std::string, index_entry> checkpoint_index;
class Checkpoint;
View
3  configuration.cc
@@ -275,6 +275,9 @@ void Configuration::addStats(ADD_STAT add_stat, const void *c) const {
}
}
+/**
+ * Internal container of an engine parameter.
+ */
class ConfigItem: public config_item {
public:
ConfigItem(const char *theKey, config_datatype theDatatype) {
View
16 configuration.hh
@@ -144,6 +144,10 @@ public:
virtual ~ValueChangedValidator() { }
};
+/**
+ * A configuration input validator that ensures a numeric (size_t)
+ * value falls between a specified upper and lower limit.
+ */
class SizeRangeValidator : public ValueChangedValidator {
public:
SizeRangeValidator() : lower(0), upper(0) {}
@@ -167,6 +171,10 @@ private:
size_t upper;
};
+/**
+ * A configuration input validator that ensures that a numeric (float)
+ * value falls between a specified upper and lower limit.
+ */
class FloatRangeValidator : public ValueChangedValidator {
public:
FloatRangeValidator() : lower(0), upper(0) {}
@@ -190,6 +198,10 @@ private:
float upper;
};
+/**
+ * A configuration input validator that ensures that a value is one
+ * from a predefined set of acceptable values.
+ */
class EnumValidator : public ValueChangedValidator {
public:
EnumValidator() {}
@@ -208,6 +220,10 @@ private:
std::set<std::string> acceptable;
};
+/**
+ * The configuration class represents and provides access to the
+ * entire configuration of the server.
+ */
class Configuration {
public:
Configuration();
View
5 ep.cc
@@ -106,6 +106,11 @@ class VBucketBatchCountCallback : public DispatcherCallback {
size_t batchCount;
};
+/**
+ * A configuration value changed listener that responds to ep-engine
+ * parameter changes by invoking engine-specific methods on
+ * configuration change events.
+ */
class EPStoreValueChangeListener : public ValueChangedListener {
public:
EPStoreValueChangeListener(EventuallyPersistentStore &st) : store(st) {
View
4 ep.hh
@@ -470,17 +470,15 @@ public:
}
/**
- * Retrieve a value.
+ * Retrieve a value from a vbucket in replica state.
*
* @param key the key to fetch
* @param vbucket the vbucket from which to retrieve the key
* @param cookie the connection cookie
* @param queueBG if true, automatically queue a background fetch if necessary
- * @param requestState fetch a result iff the vbucket state == requestState
*
* @return a GetValue representing the result of the request
*/
-
GetValue getReplica(const std::string &key, uint16_t vbucket,
const void *cookie, bool queueBG) {
return getInternal(key, vbucket, cookie, queueBG, true,
View
5 ep_engine.cc
@@ -1066,6 +1066,11 @@ EventuallyPersistentEngine::EventuallyPersistentEngine(GET_SERVER_API get_server
restore.manager = NULL;
}
+/**
+ * A configuration value changed listener that responds to ep-engine
+ * parameter changes by invoking engine-specific methods on
+ * configuration change events.
+ */
class EpEngineValueChangeListener : public ValueChangedListener {
public:
EpEngineValueChangeListener(EventuallyPersistentEngine &e) : engine(e) {
View
4 kvstore.hh
@@ -261,6 +261,10 @@ public:
virtual void destroyInvalidVBuckets(bool destroyOnlyOne = false) = 0;
};
+/**
+ * The KVStoreFactory creates the correct KVStore instance(s) when
+ * needed by EPStore.
+ */
class KVStoreFactory {
public:
View
52 mutation_log.hh
@@ -38,6 +38,10 @@ const uint8_t FLUSH_FULL(FLUSH_COMMIT_1 | FLUSH_COMMIT_2);
const uint8_t DEFAULT_SYNC_CONF(FLUSH_COMMIT_2 | SYNC_COMMIT_2);
+/**
+ * The header block representing the first 4k (or so) of a MutationLog
+ * file.
+ */
class LogHeaderBlock {
public:
LogHeaderBlock() : _version(htonl(LOG_VERSION)), _blockSize(0), _blockCount(0) {
@@ -86,15 +90,32 @@ typedef enum {
extern const char *mutation_log_type_names[];
+/**
+ * An entry in the MutationLog.
+ */
class MutationLogEntry {
public:
+ /**
+ * Initialize a new entry inside the given buffer.
+ *
+ * @param r the rowid
+ * @param t the type of log entry
+ * @param vb the vbucket
+ * @param k the key
+ */
static MutationLogEntry* newEntry(uint8_t *buf,
uint64_t r, mutation_log_type_t t,
uint16_t vb, const std::string &k) {
return new (buf) MutationLogEntry(r, t, vb, k);
}
+ /**
+ * Initialize a new entry using the contents of the given buffer.
+ *
+ * @param buf a chunk of memory thought to contain a valid MutationLogEntry
+ * @param buflen the length of said buf
+ */
static MutationLogEntry* newEntry(uint8_t *buf, size_t buflen) {
assert(buflen >= len(0));
MutationLogEntry *me = reinterpret_cast<MutationLogEntry*>(buf);
@@ -107,26 +128,46 @@ public:
// Statically buffered. There is no delete.
}
+ /**
+ * The size of a MutationLogEntry, in bytes, containing a key of
+ * the specified length.
+ */
static size_t len(size_t klen) {
// 13 == the exact empty record size as will be packed into
// the layout
return 13 + klen;
}
+ /**
+ * The number of bytes of the serialized form of this
+ * MutationLogEntry.
+ */
size_t len() const {
return MutationLogEntry::len(keylen);
}
+ /**
+ * This entry's key.
+ */
const std::string key() const {
return std::string(_key, keylen);
}
+ /**
+ * This entry's rowid.
+ */
uint64_t rowid() const;
+ /**
+ * This entry's vbucket.
+ */
uint16_t vbucket() const {
return ntohs(_vbucket);
}
+ /**
+ * The type of this log entry.
+ */
uint8_t type() const {
return _type;
}
@@ -157,6 +198,11 @@ private:
std::ostream& operator <<(std::ostream &out, const MutationLogEntry &mle);
+
+/**
+ * The MutationLog records major key events to allow ep-engine to more
+ * quickly restore the server to its previous state upon restart.
+ */
class MutationLog {
public:
@@ -287,12 +333,18 @@ public:
bool isEnd;
};
+ /**
+ * An iterator pointing to the beginning of the log file.
+ */
iterator begin() {
iterator it(iterator(this));
it.nextBlock();
return it;
}
+ /**
+ * An iterator pointing at the end of the log file.
+ */
iterator end() {
return iterator(this, true);
}
View
4 objectregistry.cc
@@ -19,6 +19,10 @@
static ThreadLocal<EventuallyPersistentEngine*> *th;
+/**
+ * Object registry link hook for getting the registry thread local
+ * installed.
+ */
class installer {
public:
installer() {
Please sign in to comment.
Something went wrong with that request. Please try again.