kcdirdb.h   kcdirdb.h 
skipping to change at line 2162 skipping to change at line 2162
int64_t size_impl() { int64_t size_impl() {
return size_ + count_ * DDBRECUNITSIZ; return size_ + count_ * DDBRECUNITSIZ;
} }
/** Dummy constructor to forbid the use. */ /** Dummy constructor to forbid the use. */
DirDB(const DirDB&); DirDB(const DirDB&);
/** Dummy Operator to forbid the use. */ /** Dummy Operator to forbid the use. */
DirDB& operator =(const DirDB&); DirDB& operator =(const DirDB&);
/** The method lock. */ /** The method lock. */
SpinRWLock mlock_; SpinRWLock mlock_;
/** The record locks. */ /** The record locks. */
SlottedSpinRWLock rlock_; SlottedRWLock rlock_;
/** The last happened error. */ /** The last happened error. */
TSD<Error> error_; TSD<Error> error_;
/** The internal logger. */ /** The internal logger. */
Logger* logger_; Logger* logger_;
/** The kinds of logged messages. */ /** The kinds of logged messages. */
uint32_t logkinds_; uint32_t logkinds_;
/** The internal meta operation trigger. */ /** The internal meta operation trigger. */
MetaTrigger* mtrigger_; MetaTrigger* mtrigger_;
/** The open mode. */ /** The open mode. */
uint32_t omode_; uint32_t omode_;
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 kchashdb.h   kchashdb.h 
skipping to change at line 3495 skipping to change at line 3495
atlock_.unlock(); atlock_.unlock();
return !err; return !err;
} }
/** Dummy constructor to forbid the use. */ /** Dummy constructor to forbid the use. */
HashDB(const HashDB&); HashDB(const HashDB&);
/** Dummy Operator to forbid the use. */ /** Dummy Operator to forbid the use. */
HashDB& operator =(const HashDB&); HashDB& operator =(const HashDB&);
/** The method lock. */ /** The method lock. */
SpinRWLock mlock_; SpinRWLock mlock_;
/** The record locks. */ /** The record locks. */
SlottedSpinRWLock rlock_; SlottedRWLock rlock_;
/** The file lock. */ /** The file lock. */
SpinLock flock_; SpinLock flock_;
/** The auto transaction lock. */ /** The auto transaction lock. */
Mutex atlock_; Mutex atlock_;
/** The last happened error. */ /** The last happened error. */
TSD<Error> error_; TSD<Error> error_;
/** The internal logger. */ /** The internal logger. */
Logger* logger_; Logger* logger_;
/** The kinds of logged messages. */ /** The kinds of logged messages. */
uint32_t logkinds_; uint32_t logkinds_;
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 kcplantdb.h   kcplantdb.h 
skipping to change at line 2118 skipping to change at line 2118
int64_t heir; ///< child before the first link int64_t heir; ///< child before the first link
LinkArray links; ///< sorted array of links LinkArray links; ///< sorted array of links
int64_t size; ///< total size of links int64_t size; ///< total size of links
bool dirty; ///< whether to be written back bool dirty; ///< whether to be written back
bool dead; ///< whether to be removed bool dead; ///< whether to be removed
}; };
/** /**
* Slot cache of leaf nodes. * Slot cache of leaf nodes.
*/ */
struct LeafSlot { struct LeafSlot {
SpinLock lock; ///< lock Mutex lock; ///< lock
LeafCache* hot; ///< hot cache LeafCache* hot; ///< hot cache
LeafCache* warm; ///< warm cache LeafCache* warm; ///< warm cache
}; };
/** /**
* Slot cache of inner nodes. * Slot cache of inner nodes.
*/ */
struct InnerSlot { struct InnerSlot {
SpinLock lock; ///< lock SpinLock lock; ///< lock
InnerCache* warm; ///< warm cache InnerCache* warm; ///< warm cache
}; };
skipping to change at line 2206 skipping to change at line 2206
} }
/** /**
* Clean all of the leaf cache. * Clean all of the leaf cache.
* @return true on success, or false on failure. * @return true on success, or false on failure.
*/ */
bool clean_leaf_cache() { bool clean_leaf_cache() {
_assert_(true); _assert_(true);
bool err = false; bool err = false;
for (int32_t i = 0; i < PLDBSLOTNUM; i++) { for (int32_t i = 0; i < PLDBSLOTNUM; i++) {
LeafSlot* slot = lslots_ + i; LeafSlot* slot = lslots_ + i;
ScopedSpinLock lock(&slot->lock); ScopedMutex lock(&slot->lock);
typename LeafCache::Iterator it = slot->warm->begin(); typename LeafCache::Iterator it = slot->warm->begin();
typename LeafCache::Iterator itend = slot->warm->end(); typename LeafCache::Iterator itend = slot->warm->end();
while (it != itend) { while (it != itend) {
LeafNode* node = it.value(); LeafNode* node = it.value();
if (!save_leaf_node(node)) err = true; if (!save_leaf_node(node)) err = true;
it++; it++;
} }
it = slot->hot->begin(); it = slot->hot->begin();
itend = slot->hot->end(); itend = slot->hot->end();
while (it != itend) { while (it != itend) {
skipping to change at line 2232 skipping to change at line 2232
return !err; return !err;
} }
/** /**
* Clean a part of the leaf cache. * Clean a part of the leaf cache.
* @param slot a slot of leaf nodes. * @param slot a slot of leaf nodes.
* @return true on success, or false on failure. * @return true on success, or false on failure.
*/ */
bool clean_leaf_cache_part(LeafSlot* slot) { bool clean_leaf_cache_part(LeafSlot* slot) {
_assert_(slot); _assert_(slot);
bool err = false; bool err = false;
ScopedSpinLock lock(&slot->lock); ScopedMutex lock(&slot->lock);
if (slot->warm->count() > 0) { if (slot->warm->count() > 0) {
LeafNode* node = slot->warm->first_value(); LeafNode* node = slot->warm->first_value();
if (!save_leaf_node(node)) err = true; if (!save_leaf_node(node)) err = true;
} else if (slot->hot->count() > 0) { } else if (slot->hot->count() > 0) {
LeafNode* node = slot->hot->first_value(); LeafNode* node = slot->hot->first_value();
if (!save_leaf_node(node)) err = true; if (!save_leaf_node(node)) err = true;
} }
return !err; return !err;
} }
/** /**
skipping to change at line 2341 skipping to change at line 2341
/** /**
* Load a leaf node. * Load a leaf node.
* @param id the ID number of the leaf node. * @param id the ID number of the leaf node.
* @param prom whether to promote the warm cache. * @param prom whether to promote the warm cache.
* @return the loaded leaf node. * @return the loaded leaf node.
*/ */
LeafNode* load_leaf_node(int64_t id, bool prom) { LeafNode* load_leaf_node(int64_t id, bool prom) {
_assert_(id > 0); _assert_(id > 0);
int32_t sidx = id % PLDBSLOTNUM; int32_t sidx = id % PLDBSLOTNUM;
LeafSlot* slot = lslots_ + sidx; LeafSlot* slot = lslots_ + sidx;
ScopedSpinLock lock(&slot->lock); ScopedMutex lock(&slot->lock);
LeafNode** np = slot->hot->get(id, LeafCache::MLAST); LeafNode** np = slot->hot->get(id, LeafCache::MLAST);
if (np) return *np; if (np) return *np;
if (prom) { if (prom) {
if (slot->hot->count() * PLDBWARMRATIO > slot->warm->count() + PLDBWA RMRATIO) { if (slot->hot->count() * PLDBWARMRATIO > slot->warm->count() + PLDBWA RMRATIO) {
slot->hot->first_value()->hot = false; slot->hot->first_value()->hot = false;
slot->hot->migrate(slot->hot->first_key(), slot->warm, LeafCache::M LAST); slot->hot->migrate(slot->hot->first_key(), slot->warm, LeafCache::M LAST);
} }
np = slot->warm->migrate(id, slot->hot, LeafCache::MLAST); np = slot->warm->migrate(id, slot->hot, LeafCache::MLAST);
if (np) { if (np) {
(*np)->hot = true; (*np)->hot = true;
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/