yiguolei commented on a change in pull request #1678: Add rowset id generator
to FE and BE
URL: https://github.com/apache/incubator-doris/pull/1678#discussion_r318516650
##########
File path: be/src/olap/rowset/rowset_id_generator.h
##########
@@ -28,27 +28,17 @@ class OlapMeta;
class RowsetIdGenerator {
public:
- RowsetIdGenerator(OlapMeta* meta) : _meta(meta) { }
- ~RowsetIdGenerator() {}
-
- // This function would try to restore sate from meta first,
- // If there is no such state, will initialize a state, and store
- // it into meta.
- OLAPStatus init();
+ RowsetIdGenerator() {}
+ virtual ~RowsetIdGenerator() {}
// generator a id according to data dir
// rowsetid is not globally unique, it is dir level
// it saves the batch end id into meta env
- OLAPStatus get_next_id(RowsetId* rowset_id);
-
- OLAPStatus set_next_id(RowsetId new_rowset_id);
+ virtual OLAPStatus next_id(RowsetId* rowset_id) = 0;
-private:
- OlapMeta* _meta = nullptr;
+ virtual bool id_in_use(RowsetId& rowset_id) = 0;
- std::mutex _lock;
- RowsetId _next_id = -1;
- RowsetId _id_batch_end = -1;
+ virtual void release_id(RowsetId& rowset_id) = 0;
Review comment:
Done
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]