patch 4.0
This commit is contained in:
@ -10,28 +10,30 @@
|
||||
* See the Mulan PubL v2 for more details.
|
||||
*/
|
||||
|
||||
#ifndef OCEANBASE_UNITTEST_MEMTABLE_MOCK_ROW_H_
|
||||
#define OCEANBASE_UNITTEST_MEMTABLE_MOCK_ROW_H_
|
||||
#ifndef OCEANBASE_UNITTEST_MEMTABLE_MOCK_ROW_H_
|
||||
#define OCEANBASE_UNITTEST_MEMTABLE_MOCK_ROW_H_
|
||||
|
||||
#include "storage/memtable/ob_memtable_interface.h"
|
||||
#include "storage/ob_i_store.h"
|
||||
#include "storage/access/ob_store_row_iterator.h"
|
||||
#include "lib/allocator/page_arena.h"
|
||||
#include "common/object/ob_object.h"
|
||||
#include "common/rowkey/ob_rowkey.h"
|
||||
|
||||
namespace oceanbase {
|
||||
namespace unittest {
|
||||
namespace oceanbase
|
||||
{
|
||||
namespace unittest
|
||||
{
|
||||
using namespace oceanbase::common;
|
||||
using namespace oceanbase::memtable;
|
||||
using namespace oceanbase::storage;
|
||||
|
||||
class ObMtRowIterator : public ObStoreRowIterator {
|
||||
class ObMtRowIterator : public ObStoreRowIterator
|
||||
{
|
||||
public:
|
||||
ObMtRowIterator() : cursor_(0)
|
||||
{}
|
||||
~ObMtRowIterator()
|
||||
{}
|
||||
int get_next_row(const ObStoreRow*& row)
|
||||
ObMtRowIterator() : cursor_(0) {}
|
||||
~ObMtRowIterator() {}
|
||||
int get_next_row(const ObStoreRow *&row)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
if (cursor_ < rows_.count()) {
|
||||
@ -41,26 +43,20 @@ public:
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
void reset()
|
||||
{
|
||||
cursor_ = 0;
|
||||
rows_.reset();
|
||||
}
|
||||
void reset_iter()
|
||||
{
|
||||
cursor_ = 0;
|
||||
}
|
||||
void add_row(const ObStoreRow& row)
|
||||
void reset() { cursor_ = 0; rows_.reset(); }
|
||||
void reset_iter() { cursor_ = 0; }
|
||||
void add_row(const ObStoreRow &row)
|
||||
{
|
||||
rows_.push_back(row);
|
||||
}
|
||||
|
||||
private:
|
||||
int64_t cursor_;
|
||||
ObSEArray<ObStoreRow, 64> rows_;
|
||||
};
|
||||
|
||||
} // namespace unittest
|
||||
} // namespace oceanbase
|
||||
}
|
||||
}
|
||||
|
||||
#endif //OCEANBASE_UNITTEST_MEMTABLE_MOCK_ROW_H_
|
||||
|
||||
|
||||
#endif // OCEANBASE_UNITTEST_MEMTABLE_MOCK_ROW_H_
|
||||
|
Reference in New Issue
Block a user