Skip to content

Commit

Permalink
Remove some redundant code; Minor refactoring. (y-scope#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
LinZhihao-723 authored Dec 19, 2023
1 parent afdf07c commit fc2c863
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion components/core/src/clp/FileDecompressor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ using std::string;

namespace clp {
bool FileDecompressor::decompress_file(
streaming_archive::MetadataDB::FileIterator& file_metadata_ix,
streaming_archive::MetadataDB::FileIterator const& file_metadata_ix,
string const& output_dir,
streaming_archive::reader::Archive& archive_reader,
std::unordered_map<string, string>& temp_path_to_final_path
Expand Down
2 changes: 1 addition & 1 deletion components/core/src/clp/FileDecompressor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class FileDecompressor {
public:
// Methods
bool decompress_file(
streaming_archive::MetadataDB::FileIterator& file_metadata_ix,
streaming_archive::MetadataDB::FileIterator const& file_metadata_ix,
std::string const& output_dir,
streaming_archive::reader::Archive& archive_reader,
std::unordered_map<std::string, std::string>& temp_path_to_final_path
Expand Down
5 changes: 0 additions & 5 deletions components/core/src/clp/decompression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ bool decompress(
for (auto& file_metadata_ix = *file_metadata_ix_ptr; file_metadata_ix.has_next();
file_metadata_ix.next())
{
file_metadata_ix.get_path(orig_path);

// Decompress file
if (false
== file_decompressor.decompress_file(
Expand Down Expand Up @@ -140,8 +138,6 @@ bool decompress(
for (auto& file_metadata_ix = *file_metadata_ix_ptr; file_metadata_ix.has_next();
file_metadata_ix.next())
{
file_metadata_ix.get_path(orig_path);

// Decompress file
if (false
== file_decompressor.decompress_file(
Expand Down Expand Up @@ -193,7 +189,6 @@ bool decompress(
{
return false;
}
file_metadata_ix.get_path(orig_path);
decompressed_files.insert(orig_path);
}
file_metadata_ix_ptr.reset(nullptr);
Expand Down
2 changes: 1 addition & 1 deletion components/core/src/streaming_archive/reader/Archive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ namespace streaming_archive { namespace reader {
m_var_dictionary.read_new_entries();
}

ErrorCode Archive::open_file(File& file, MetadataDB::FileIterator& file_metadata_ix) {
ErrorCode Archive::open_file(File& file, MetadataDB::FileIterator const& file_metadata_ix) {
return file.open_me(m_logtype_dictionary, file_metadata_ix, m_segment_manager);
}

Expand Down
2 changes: 1 addition & 1 deletion components/core/src/streaming_archive/reader/Archive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace streaming_archive { namespace reader {
* @param file_metadata_ix
* @return Same as streaming_archive::reader::File::open_me
*/
ErrorCode open_file(File& file, MetadataDB::FileIterator& file_metadata_ix);
ErrorCode open_file(File& file, MetadataDB::FileIterator const& file_metadata_ix);
/**
* Wrapper for streaming_archive::reader::File::close_me
* @param file
Expand Down
2 changes: 1 addition & 1 deletion components/core/src/streaming_archive/reader/File.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ epochtime_t File::get_end_ts() const {

ErrorCode File::open_me(
LogTypeDictionaryReader const& archive_logtype_dict,
MetadataDB::FileIterator& file_metadata_ix,
MetadataDB::FileIterator const& file_metadata_ix,
SegmentManager& segment_manager
) {
m_archive_logtype_dict = &archive_logtype_dict;
Expand Down
2 changes: 1 addition & 1 deletion components/core/src/streaming_archive/reader/File.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class File {
*/
ErrorCode open_me(
LogTypeDictionaryReader const& archive_logtype_dict,
MetadataDB::FileIterator& file_metadata_ix,
MetadataDB::FileIterator const& file_metadata_ix,
SegmentManager& segment_manager
);
/**
Expand Down

0 comments on commit fc2c863

Please sign in to comment.