kangpinghuang commented on a change in pull request #1200: Merge refactor code
into master
URL: https://github.com/apache/incubator-doris/pull/1200#discussion_r288474815
##########
File path: be/src/olap/data_dir.h
##########
@@ -21,70 +21,97 @@
#include <set>
#include <string>
#include <mutex>
+#include <condition_variable>
#include "common/status.h"
#include "gen_cpp/Types_types.h"
#include "olap/olap_common.h"
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
+#include "olap/rowset/rowset_id_generator.h"
namespace doris {
-class OLAPRootPath;
-class OLAPEngine;
-
-// A OlapStore used to manange data in same path.
-// Now, After OlapStore was created, it will never be deleted for easy
implementation.
-class OlapStore {
+// A DataDir used to manange data in same path.
+// Now, After DataDir was created, it will never be deleted for easy
implementation.
+class DataDir {
public:
- OlapStore(const std::string& path, int64_t capacity_bytes = -1);
- ~OlapStore();
+ DataDir(const std::string& path,
+ int64_t capacity_bytes = -1,
+ TabletManager* tablet_manager = nullptr,
+ TxnManager* txn_manager = nullptr);
+ ~DataDir();
- Status load();
+ Status init();
const std::string& path() const { return _path; }
- const int64_t path_hash() const { return _path_hash; }
+ const size_t path_hash() const { return _path_hash; }
bool is_used() const { return _is_used; }
void set_is_used(bool is_used) { _is_used = is_used; }
int32_t cluster_id() const { return _cluster_id; }
- RootPathInfo to_root_path_info() {
- RootPathInfo info;
+ DataDirInfo get_dir_info() {
+ DataDirInfo info;
info.path = _path;
info.path_hash = _path_hash;
info.is_used = _is_used;
info.capacity = _capacity_bytes;
return info;
}
+ // save a cluster_id file under data path to prevent
+ // invalid be config for example two be use the same
+ // data path
Status set_cluster_id(int32_t cluster_id);
void health_check();
OLAPStatus get_shard(uint64_t* shard);
- OlapMeta* get_meta();
+
Review comment:
addtional empty line
----------------------------------------------------------------
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]