summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/qpid/linearstore/jrnl/enq_map.h
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/cpp/src/qpid/linearstore/jrnl/enq_map.h')
-rw-r--r--qpid/cpp/src/qpid/linearstore/jrnl/enq_map.h51
1 files changed, 20 insertions, 31 deletions
diff --git a/qpid/cpp/src/qpid/linearstore/jrnl/enq_map.h b/qpid/cpp/src/qpid/linearstore/jrnl/enq_map.h
index 75404afebe..603993ce59 100644
--- a/qpid/cpp/src/qpid/linearstore/jrnl/enq_map.h
+++ b/qpid/cpp/src/qpid/linearstore/jrnl/enq_map.h
@@ -19,17 +19,6 @@
*
*/
-/**
- * \file enq_map.h
- *
- * Qpid asynchronous store plugin library
- *
- * File containing code for class mrg::journal::enq_map (enqueue map).
- * See class documentation for details.
- *
- * \author Kim van der Riet
- */
-
#ifndef QPID_LEGACYSTORE_JRNL_ENQ_MAP_H
#define QPID_LEGACYSTORE_JRNL_ENQ_MAP_H
@@ -41,8 +30,8 @@ class enq_map;
}
}
-#include "qpid/legacystore/jrnl/jexception.h"
-#include "qpid/legacystore/jrnl/smutex.h"
+#include "qpid/linearstore/jrnl/jexception.h"
+#include "qpid/linearstore/jrnl/smutex.h"
#include <map>
#include <pthread.h>
#include <vector>
@@ -87,38 +76,38 @@ namespace journal
struct emap_data_struct
{
- u_int16_t _pfid;
+ uint16_t _pfid;
bool _lock;
- emap_data_struct(const u_int16_t pfid, const bool lock) : _pfid(pfid), _lock(lock) {}
+ emap_data_struct(const uint16_t pfid, const bool lock) : _pfid(pfid), _lock(lock) {}
};
- typedef std::pair<u_int64_t, emap_data_struct> emap_param;
- typedef std::map<u_int64_t, emap_data_struct> emap;
+ typedef std::pair<uint64_t, emap_data_struct> emap_param;
+ typedef std::map<uint64_t, emap_data_struct> emap;
typedef emap::iterator emap_itr;
emap _map;
smutex _mutex;
- std::vector<u_int32_t> _pfid_enq_cnt;
+ std::vector<uint32_t> _pfid_enq_cnt;
public:
enq_map();
virtual ~enq_map();
- void set_num_jfiles(const u_int16_t num_jfiles);
- inline u_int32_t get_enq_cnt(const u_int16_t pfid) const { return _pfid_enq_cnt.at(pfid); };
+ void set_num_jfiles(const uint16_t num_jfiles);
+ inline uint32_t get_enq_cnt(const uint16_t pfid) const { return _pfid_enq_cnt.at(pfid); };
- int16_t insert_pfid(const u_int64_t rid, const u_int16_t pfid); // 0=ok; -3=duplicate rid;
- int16_t insert_pfid(const u_int64_t rid, const u_int16_t pfid, const bool locked); // 0=ok; -3=duplicate rid;
- int16_t get_pfid(const u_int64_t rid); // >=0=pfid; -1=rid not found; -2=locked
- int16_t get_remove_pfid(const u_int64_t rid, const bool txn_flag = false); // >=0=pfid; -1=rid not found; -2=locked
- bool is_enqueued(const u_int64_t rid, bool ignore_lock = false);
- int16_t lock(const u_int64_t rid); // 0=ok; -1=rid not found
- int16_t unlock(const u_int64_t rid); // 0=ok; -1=rid not found
- int16_t is_locked(const u_int64_t rid); // 1=true; 0=false; -1=rid not found
+ int16_t insert_pfid(const uint64_t rid, const uint16_t pfid); // 0=ok; -3=duplicate rid;
+ int16_t insert_pfid(const uint64_t rid, const uint16_t pfid, const bool locked); // 0=ok; -3=duplicate rid;
+ int16_t get_pfid(const uint64_t rid); // >=0=pfid; -1=rid not found; -2=locked
+ int16_t get_remove_pfid(const uint64_t rid, const bool txn_flag = false); // >=0=pfid; -1=rid not found; -2=locked
+ bool is_enqueued(const uint64_t rid, bool ignore_lock = false);
+ int16_t lock(const uint64_t rid); // 0=ok; -1=rid not found
+ int16_t unlock(const uint64_t rid); // 0=ok; -1=rid not found
+ int16_t is_locked(const uint64_t rid); // 1=true; 0=false; -1=rid not found
inline void clear() { _map.clear(); }
inline bool empty() const { return _map.empty(); }
- inline u_int32_t size() const { return u_int32_t(_map.size()); }
- void rid_list(std::vector<u_int64_t>& rv);
- void pfid_list(std::vector<u_int16_t>& fv);
+ inline uint32_t size() const { return uint32_t(_map.size()); }
+ void rid_list(std::vector<uint64_t>& rv);
+ void pfid_list(std::vector<uint16_t>& fv);
};
} // namespace journal