removed debug info

This commit is contained in:
bronku 2025-11-13 19:56:18 +01:00
parent 635ad1a225
commit eeb7f77911
2 changed files with 2 additions and 10 deletions

View file

@ -17,21 +17,16 @@ private:
// returns true if at least one record was returned // returns true if at least one record was returned
bool refill_buffer() bool refill_buffer()
{ {
std::cout << "refilling buffer\n";
last_element_idx = -1; last_element_idx = -1;
current_idx = 0; current_idx = 0;
for (size_t i = 0; i < buffer_size; i++) { for (size_t i = 0; i < buffer_size; i++) {
std::cout << "buffer refill: i: " << i << '\n';
if (!(input_stream >> read_buffer[i])) { if (!(input_stream >> read_buffer[i])) {
std::cout << "input stream error\n";
std::cout << read_buffer[i] << '\n';
break; break;
} }
last_element_idx = i; last_element_idx = i;
} }
std::cout << "buffer refill successfull\n";
return last_element_idx >= 0; return last_element_idx >= 0;
} }

View file

@ -4,7 +4,7 @@
#include "reader.hpp" #include "reader.hpp"
#include "writer.hpp" #include "writer.hpp"
#include <fstream> #include <fstream>
//
// returns amount of records read // returns amount of records read
size_t read_chunk(Reader& reader, SubBuffer& buff) size_t read_chunk(Reader& reader, SubBuffer& buff)
{ {
@ -34,9 +34,7 @@ void create_initial_runs(const std::string& input_filename, const std::string& d
std::ifstream in_stream(input_filename); std::ifstream in_stream(input_filename);
Reader input_reader(in_stream); Reader input_reader(in_stream);
for (size_t run_index = 0;; run_index++) { for (size_t run_index = 0;; run_index++) {
std::cout << "creating run " << run_index << '\n';
size_t size = read_chunk(input_reader, buff); size_t size = read_chunk(input_reader, buff);
std::cout << "read " << size << " records\n";
if (size == 0) { if (size == 0) {
break; break;
} }
@ -49,7 +47,6 @@ int sort_file(const Configuration& opts)
{ {
Buffer main_buffer(opts.n * opts.b); Buffer main_buffer(opts.n * opts.b);
create_initial_runs(opts.input_file, opts.directory, main_buffer); create_initial_runs(opts.input_file, opts.directory, main_buffer);
// TODO: Implement sorting with new buffer classes
std::cout << "Sorting not yet implemented\n";
return 0; return 0;
} }