Go to the documentation of this file.
4 #include <nlohmann/json.hpp>
8 #include <experimental/filesystem>
10 #ifdef __cpp_lib_filesystem
11 namespace fs = std::filesystem;
12 #elif __cpp_lib_experimental_filesystem
13 namespace fs = std::experimental::filesystem;
15 #error "no filesystem support ='("
23 std::string projection_name) {
24 return fs::absolute(fs::path(column_store_path) /
"projections" /
25 (projection_name +
".projection"));
29 return fs::absolute(fs::path(column_store_path) /
"metadata.json");
33 return fs::absolute(fs::path(column_store_path) /
"schema.xml");
37 std::string source_projection_name,
39 std::string fileName =
40 source_projection_name +
"_" + join_index.
projection +
".index";
41 auto path = fs::path(column_store_path) /
"joins" / fileName;
42 return fs::absolute(path);
46 fs::create_directories(path.parent_path());
48 std::ofstream ofs(path);
69 json projection_metadata = {
72 {
"tuples_move_count", 0},
73 {
"joins", json::object()},
77 projection_metadata[
"joins"][index.projection] =
80 return projection_metadata;
92 std::cout <<
metadata.dump(4) << std::endl;
101 metadata[
"projections"] = json::object();
108 std::string name = projection.get_projection_name();
116 std::string db_password) {
117 metadata[
"source_db_config"] = {{
"db_name", db_name},
118 {
"db_user", db_user},
119 {
"db_password", db_password}};
124 fs::copy_file(schame_path, path, fs::copy_options::overwrite_existing);
void createFile(fs::path path)
Definition: StoreInitializer.h:45
vector< join_index > get_join_indexes()
Definition: Projection.h:70
Definition: ColStoreDataGenerator.h:22
int main(int ac, char *av[])
Definition: Driver.cpp:61
void configureSchema(std::string schame_path)
Definition: StoreInitializer.h:122
void saveMetadata()
Definition: StoreInitializer.h:90
Definition: SchemaLoader.h:13
json generateMetadataProjection(Parser::Projection &projection)
Definition: StoreInitializer.h:66
void _createProjection(std::string column_store_path, Parser::Projection projection)
Definition: StoreInitializer.h:53
void configureSourceDB(std::string db_name, std::string db_user, std::string db_password)
Definition: StoreInitializer.h:115
Definition: Projection.h:44
void createProjections(Parser::SchemaMetaData schema_metadata)
Definition: StoreInitializer.h:100
std::string get_projection_name()
Definition: Projection.h:65
fs::path getMetaDataPath(std::string column_store_path)
Definition: StoreInitializer.h:28
std::string column_store_path
Definition: StoreInitializer.h:84
Definition: JoinIndex.h:6
fs::path getSchemaPath(std::string column_store_path)
Definition: StoreInitializer.h:32
fs::path getProjectionPath(std::string column_store_path, std::string projection_name)
Definition: StoreInitializer.h:22
void initConfig(int ac, char *av[])
Definition: Driver.cpp:13
Initializer(std::string column_store_path)
Definition: StoreInitializer.h:87
Definition: DataLoader.h:9
Definition: StoreInitializer.h:52
po::variables_map config
Definition: Driver.cpp:11
json metadata
Definition: StoreInitializer.h:83
std::string projection
Definition: JoinIndex.h:8
fs::path getJoinIndexPath(std::string column_store_path, std::string source_projection_name, Parser::join_index join_index)
Definition: StoreInitializer.h:36