Column Store
ColStoreDataGenerator.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <iostream>
4 #include <queue>
5 #include <vector>
6 #include <nlohmann/json.hpp>
7 
9 
16 using std::vector;
17 using std::queue;
18 using std::string;
19 
20 using nlohmann::json;
21 
22 namespace ColumnStore {
25  std::ifstream file;
29  vector<Parser::Column> columns;
30 
31  public:
32  ColStoreDataSource(string column_store_path, string p_name)
33  : manager(MetadataManager::getInstance(column_store_path)), projection_name(p_name) {
34  count = 0;
35  json &projection_json = manager->getProjectionFileInfo(projection_name);
36  file = std::ifstream((std::string)projection_json["file"]);
37  tuples_move_count = projection_json["tuples_move_count"];
38  Parser::Projection &projection = manager->getProjectionSchemaInfo(projection_name);
39  columns = projection.get_metadata_columns();
41  metadata = Metadata(projection.get_metadata());
42  }
43 
45  count++;
48  }
49 
50  bool hasNext() { return count < tuples_move_count; }
51 };
52 }
ColumnStore::ColStoreDataSource::projection_name
string projection_name
Definition: ColStoreDataGenerator.h:26
ColumnStore::ColStoreDataSource::count
int count
Definition: ColStoreDataGenerator.h:27
ColumnStore::DataType
DataType
Different datatypes supported by this project.
Definition: Column.h:16
ColumnStore::ColStoreDataSource::manager
MetadataManagerSingleton manager
Definition: ColStoreDataGenerator.h:24
ColumnStore::DataRecordMetadata
Stores metadata information of the data record.
Definition: DataRecord.h:88
ColumnStore::ColStoreDataSource::next
DataRecord next()
Definition: ColStoreDataGenerator.h:44
ColumnStore::ColumnStoreData::read
void read(std::istream &input)
Definition: ProjectionData.h:97
ColumnStore
Definition: ColStoreDataGenerator.h:22
ColumnStore::ColumnStoreData::get
DataRecord get(std::vector< Parser::Column > &columns)
Definition: ProjectionData.h:101
Parser
Definition: Column.h:6
GenericQuery
Data Generator for GenericQueryBuilder.
Definition: GenericGenerator.cpp:11
ColumnStore::ColStoreDataSource::file
std::ifstream file
Definition: ColStoreDataGenerator.h:25
ColumnStore::Metadata
std::shared_ptr< DataRecordMetadata > Metadata
Shared pointer to DataRecordMetadata.
Definition: DataRecord.h:208
add_executable
interfaces postgres_data_generator add_executable(column_store_init src/ColumnStoreInitializer/Driver.cpp) target_link_libraries(column_store_init PRIVATE parser Boost
Definition: CMakeLists.txt:41
ColumnStore::DataSource
std::shared_ptr< DataGeneratorInterface > DataSource
Shared pointer to the DataGeneratorInterface.
Definition: DataGeneratorInterface.h:73
Parser::Projection
Definition: Projection.h:44
ColumnStore::DataRecord
Stores a row of data.
Definition: DataRecord.h:64
Parser::Projection::get_metadata
ColumnStore::DataRecordMetadata * get_metadata()
Definition: Projection.h:95
ColumnStore::MetadataManagerSingleton
std::shared_ptr< MetadataManager > MetadataManagerSingleton
Definition: ProjectionData.h:201
Parser::Projection::get_metadata_columns
std::vector< Parser::Column > get_metadata_columns()
Definition: Projection.h:87
create_dummy_data
void create_dummy_data(string file_name)
Definition: create_dummy_data.cpp:10
ColumnStore::ColStoreDataSource::ColStoreDataSource
ColStoreDataSource(string column_store_path, string p_name)
Definition: ColStoreDataGenerator.h:32
ColumnStore::MetadataManager
Definition: ProjectionData.h:142
ColumnStore::ColStoreDataSource::tuples_move_count
int tuples_move_count
Definition: ColStoreDataGenerator.h:27
DataGeneratorInterface.h
Data Generator Interface.
ColumnStore::ColumnStoreData
Definition: ProjectionData.h:32
ColumnStore::DataGeneratorInterface::metadata
Metadata metadata
metadata for processing queries
Definition: DataGeneratorInterface.h:27
cmake_minimum_required
cmake_minimum_required(VERSION 3.10) project(ColumnStore VERSION 0.1) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED True) set(LIB_DIR $
Definition: CMakeLists.txt:1
ColumnStore::ColStoreDataSource
Definition: ColStoreDataGenerator.h:23
add_library
add_library(column_store_init Initializer.cpp) target_compile_options(column_store_init PRIVATE -Wall) target_include_directories(column_store_init PUBLIC $
Definition: CMakeLists.txt:3
ColumnStore::DataValue
Implementation of a single data element.
Definition: DataRecord.h:28
ColumnStore::ColStoreDataSource::columns
vector< Parser::Column > columns
Definition: ColStoreDataGenerator.h:29
ColumnStore::ColStoreDataSource::hasNext
bool hasNext()
Definition: ColStoreDataGenerator.h:50
ColumnStore::ColStoreDataSource::column_store_data
ColumnStoreData column_store_data
Definition: ColStoreDataGenerator.h:28
ColumnStore::DataGeneratorInterface
Interface for relational data sources.
Definition: DataGeneratorInterface.h:24