Skip to content

Commit

Permalink
rafactor and rename range file to scan_range
Browse files Browse the repository at this point in the history
  • Loading branch information
YoshiakiNishimura committed Nov 13, 2024
1 parent 75b8abf commit 0814847
Show file tree
Hide file tree
Showing 28 changed files with 43 additions and 47 deletions.
2 changes: 1 addition & 1 deletion mock/jogasaki/executor/process/mock/task_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
#include "task_context.h"

namespace jogasaki::executor::process::mock {
} // jogasaki::executor::process::mock
} // namespace jogasaki::executor::process::mock
2 changes: 1 addition & 1 deletion src/jogasaki/data/aligned_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,4 @@ void aligned_buffer::dump(std::ostream& out, int indent) const noexcept{

}

} // namespace jogasaki::data
} // namespace jogasaki::data
2 changes: 1 addition & 1 deletion src/jogasaki/data/aligned_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,4 @@ class aligned_buffer {
void resize_internal(std::size_t sz, bool copydata);
};

} // namespace jogasaki::data
} // namespace jogasaki::data
2 changes: 1 addition & 1 deletion src/jogasaki/executor/process/abstract/task_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,4 @@ inline bool operator!=(task_context const& a, task_context const& b) noexcept {
return !(a == b);
}

} // namespace jogasaki::executor::process::abstract
} // namespace jogasaki::executor::process::abstract
2 changes: 1 addition & 1 deletion src/jogasaki/executor/process/flow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,4 +190,4 @@ std::shared_ptr<impl::task_context> flow::create_task_context(
return ctx;
}

} // namespace jogasaki::executor::process
} // namespace jogasaki::executor::process
2 changes: 1 addition & 1 deletion src/jogasaki/executor/process/impl/bound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ void bound::dump(std::ostream& out, int indent) const noexcept {
out << indent_space << " key_: " << *key_ << "\n";
key_->dump(out, indent + 2);
}
} // namespace jogasaki::executor::process::impl
} // namespace jogasaki::executor::process::impl
2 changes: 1 addition & 1 deletion src/jogasaki/executor/process/impl/bound.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ class bound {
std::unique_ptr<data::aligned_buffer> key_{};
};

} // namespace jogasaki::executor::process::impl
} // namespace jogasaki::executor::process::impl
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,4 @@ status two_encode_keys(request_context* context,
return status::ok;
}

} // namespace jogasaki::executor::process::impl::ops::details
} // namespace jogasaki::executor::process::impl::ops::details
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ status two_encode_keys(
std::size_t& elen
);

} // namespace jogasaki::executor::process::impl::ops::details
} // namespace jogasaki::executor::process::impl::ops::details
4 changes: 2 additions & 2 deletions src/jogasaki/executor/process/impl/ops/operator_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include <jogasaki/executor/process/impl/ops/io_info.h>
#include <jogasaki/executor/process/impl/ops/operator_base.h>
#include <jogasaki/executor/process/impl/ops/operator_container.h>
#include <jogasaki/executor/process/impl/range.h>
#include <jogasaki/executor/process/impl/scan_range.h>
#include <jogasaki/executor/process/impl/variable_table_info.h>
#include <jogasaki/executor/process/io_exchange_map.h>
#include <jogasaki/executor/process/processor_info.h>
Expand Down Expand Up @@ -416,4 +416,4 @@ operator_container create_operators(
}();
}

} // namespace jogasaki::executor::process::impl::ops
} // namespace jogasaki::executor::process::impl::ops
4 changes: 2 additions & 2 deletions src/jogasaki/executor/process/impl/ops/operator_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#include <jogasaki/executor/expr/evaluator.h>
#include <jogasaki/executor/process/impl/ops/io_info.h>
#include <jogasaki/executor/process/impl/ops/operator_base.h>
#include <jogasaki/executor/process/impl/range.h>
#include <jogasaki/executor/process/impl/scan_range.h>
#include <jogasaki/executor/process/impl/variable_table.h>
#include <jogasaki/executor/process/io_exchange_map.h>
#include <jogasaki/executor/process/processor_info.h>
Expand Down Expand Up @@ -153,4 +153,4 @@ class operator_builder {
request_context* request_context = nullptr
);

} // namespace jogasaki::executor::process::impl::ops
} // namespace jogasaki::executor::process::impl::ops
4 changes: 2 additions & 2 deletions src/jogasaki/executor/process/impl/ops/operator_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <utility>

#include <jogasaki/executor/process/impl/ops/operator_base.h>
#include <jogasaki/executor/process/impl/range.h>
#include <jogasaki/executor/process/impl/scan_range.h>

namespace jogasaki::executor::process::impl::ops {

Expand Down Expand Up @@ -46,4 +46,4 @@ operator_base& operator_container::root() const noexcept {
std::shared_ptr<impl::scan_range> const& operator_container::range() const noexcept {
return range_;
}
} // namespace jogasaki::executor::process::impl::ops
} // namespace jogasaki::executor::process::impl::ops
6 changes: 3 additions & 3 deletions src/jogasaki/executor/process/impl/ops/operator_container.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <jogasaki/executor/process/impl/ops/operator_base.h>
#include <jogasaki/executor/process/io_exchange_map.h>
#include <jogasaki/executor/process/impl/range.h>
#include <jogasaki/executor/process/impl/scan_range.h>

namespace jogasaki::executor::process::impl::ops {

Expand Down Expand Up @@ -69,7 +69,7 @@ class operator_container {

/**
* @brief accessor to scan_range
* @return the scan_range, or nullptr if there is no scan operation in the process
* @return the range, or nullptr if there is no scan operation in the process
*/
[[nodiscard]] std::shared_ptr<impl::scan_range> const& range() const noexcept;
private:
Expand All @@ -79,4 +79,4 @@ class operator_container {
std::shared_ptr<impl::scan_range> range_{};
};

} // namespace jogasaki::executor::process::impl::ops
} // namespace jogasaki::executor::process::impl::ops
4 changes: 2 additions & 2 deletions src/jogasaki/executor/process/impl/ops/scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <jogasaki/error_code.h>
#include <jogasaki/executor/global.h>
#include <jogasaki/executor/process/impl/bound.h>
#include <jogasaki/executor/process/impl/range.h>
#include <jogasaki/executor/process/impl/scan_range.h>
#include <jogasaki/executor/process/impl/ops/context_container.h>
#include <jogasaki/executor/process/impl/ops/index_field_mapper.h>
#include <jogasaki/executor/process/impl/ops/write_existing.h>
Expand Down Expand Up @@ -325,4 +325,4 @@ void scan::dump() const noexcept {
std::cerr << head << std::setw(width) << "field_mapper_:"
<< "not implemented yet" << std::endl;
}
} // namespace jogasaki::executor::process::impl::ops
} // namespace jogasaki::executor::process::impl::ops
2 changes: 1 addition & 1 deletion src/jogasaki/executor/process/impl/ops/scan_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include <utility>

#include <jogasaki/executor/process/impl/range.h>
#include <jogasaki/executor/process/impl/scan_range.h>
#include <jogasaki/kvs/iterator.h>
#include <jogasaki/transaction_context.h>

Expand Down
4 changes: 2 additions & 2 deletions src/jogasaki/executor/process/impl/ops/scan_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <jogasaki/data/aligned_buffer.h>
#include <jogasaki/executor/process/abstract/task_context.h>
#include <jogasaki/executor/process/impl/ops/operator_kind.h>
#include <jogasaki/executor/process/impl/range.h>
#include <jogasaki/executor/process/impl/scan_range.h>
#include <jogasaki/executor/process/impl/variable_table.h>
#include <jogasaki/executor/process/processor_info.h>
#include <jogasaki/executor/process/step.h>
Expand Down Expand Up @@ -53,7 +53,7 @@ class scan_context : public context_base {
std::unique_ptr<kvs::storage> stg,
std::unique_ptr<kvs::storage> secondary_stg,
transaction_context* tx,
impl::scan_range const* range_,
impl::scan_range const* range,
memory_resource* resource,
memory_resource* varlen_resource
);
Expand Down
2 changes: 1 addition & 1 deletion src/jogasaki/executor/process/impl/processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@ ops::operator_container const& processor::operators() const noexcept {
return operators_;
}

} // namespace jogasaki::executor::process::impl
} // namespace jogasaki::executor::process::impl
2 changes: 1 addition & 1 deletion src/jogasaki/executor/process/impl/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ class processor : public process::abstract::processor {
std::shared_ptr<relation_io_map> relation_io_map_{};
};

} // namespace jogasaki::executor::process::impl
} // namespace jogasaki::executor::process::impl
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,13 @@

#include <boost/assert.hpp>

#include "range.h"
#include "scan_range.h"

namespace jogasaki::executor::process::impl {

scan_range::scan_range(bound begin, bound end, bool is_empty) noexcept
: begin_(std::move(begin)), end_(std::move(end)), is_empty_(is_empty) {

BOOST_ASSERT(&begin_);
BOOST_ASSERT(&end_);
}

: begin_(std::move(begin)), end_(std::move(end)), is_empty_(is_empty) {}
scan_range::scan_range() noexcept: is_empty_(true) {}
[[nodiscard]] bound const& scan_range::begin() const noexcept { return begin_; }
[[nodiscard]] bound const& scan_range::end() const noexcept { return end_; }
[[nodiscard]] bool scan_range::is_empty() const noexcept { return is_empty_; }
Expand All @@ -39,4 +35,4 @@ void scan_range::dump(std::ostream& out, int indent) const noexcept {
end_.dump(out, indent + 2);
out << indent_space << " is_empty_: " << is_empty_ << "\n";
}
} // namespace jogasaki::executor::process::impl
} // namespace jogasaki::executor::process::impl
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ namespace jogasaki::executor::process::impl {
class scan_range : public abstract::range {
public:
explicit scan_range(bound begin, bound end, bool is_empty = true) noexcept;

~scan_range() override = default;
scan_range() noexcept;
~scan_range() override = default;
scan_range(scan_range const& other) = delete;
scan_range& operator=(scan_range const& other) = delete;
scan_range(scan_range&& other) noexcept = default;
Expand All @@ -46,4 +46,4 @@ class scan_range : public abstract::range {
bool is_empty_;
};

} // namespace jogasaki::executor::process::impl
} // namespace jogasaki::executor::process::impl
4 changes: 2 additions & 2 deletions src/jogasaki/executor/process/impl/task_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <jogasaki/executor/io/record_writer.h>
#include <jogasaki/executor/process/abstract/range.h>
#include <jogasaki/executor/process/abstract/task_context.h>
#include <jogasaki/executor/process/impl/range.h>
#include <jogasaki/executor/process/impl/scan_range.h>
#include <jogasaki/executor/process/io_exchange_map.h>
#include <jogasaki/model/flow.h>
#include <jogasaki/model/step_kind.h>
Expand Down Expand Up @@ -132,4 +132,4 @@ io::record_channel* task_context::channel() const noexcept {
return channel_;
}

} // namespace jogasaki::executor::process::impl
} // namespace jogasaki::executor::process::impl
4 changes: 2 additions & 2 deletions src/jogasaki/executor/process/impl/task_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <jogasaki/executor/process/abstract/task_context.h>
#include <jogasaki/executor/process/abstract/work_context.h>
#include <jogasaki/executor/process/impl/ops/emit.h>
#include <jogasaki/executor/process/impl/range.h>
#include <jogasaki/executor/process/impl/scan_range.h>
#include <jogasaki/executor/process/io_exchange_map.h>
#include <jogasaki/request_context.h>

Expand Down Expand Up @@ -94,4 +94,4 @@ class task_context : public abstract::task_context {
partition_index sink_index_{};
};

} // namespace jogasaki::executor::process::impl
} // namespace jogasaki::executor::process::impl
2 changes: 1 addition & 1 deletion src/jogasaki/kvs/storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,4 @@ std::ostream& operator<<(std::ostream& os, end_point_kind kind) {
return os;
}

}
} // namespace jogasaki::kvs
2 changes: 1 addition & 1 deletion src/jogasaki/kvs/storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,5 +263,5 @@ end_point_kind adjust_endpoint_kind(bool use_secondary, kvs::end_point_kind endp
* @return The output stream with the string representation appended.
*/
std::ostream& operator<<(std::ostream& os, end_point_kind kind);
}

} // namespace jogasaki::kvs
2 changes: 1 addition & 1 deletion test/jogasaki/executor/process/ops/join_find_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,4 +434,4 @@ TEST_F(join_find_test, host_variable_with_condition_expr) {
ctx.release();
}

} // namespace jogasaki::executor::process::impl::ops
} // namespace jogasaki::executor::process::impl::ops
4 changes: 2 additions & 2 deletions test/jogasaki/executor/process/ops/scan_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
#include <jogasaki/executor/process/impl/ops/operator_builder.h>
#include <jogasaki/executor/process/impl/ops/scan.h>
#include <jogasaki/executor/process/impl/ops/scan_context.h>
#include <jogasaki/executor/process/impl/range.h>
#include <jogasaki/executor/process/impl/scan_range.h>
#include <jogasaki/executor/process/impl/variable_table.h>
#include <jogasaki/executor/process/io_exchange_map.h>
#include <jogasaki/executor/process/mock/task_context.h>
Expand Down Expand Up @@ -583,4 +583,4 @@ TEST_F(scan_test, host_variables) {
ASSERT_EQ(status::ok, tx->commit());
}

} // namespace jogasaki::executor::process::impl::ops
} // namespace jogasaki::executor::process::impl::ops
2 changes: 1 addition & 1 deletion test/jogasaki/executor/process/process_executor_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,4 @@ TEST_F(process_executor_test, custom_factory) {
EXPECT_TRUE(ewriter->is_released());
}

} // namespace jogasaki::executor::process::impl
} // namespace jogasaki::executor::process::impl
2 changes: 1 addition & 1 deletion test/jogasaki/executor/process/processor_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ TEST_F(processor_test, basic) {
// proc->run(context.get());
}

} // namespace jogasaki::executor::process::impl
} // namespace jogasaki::executor::process::impl

0 comments on commit 0814847

Please sign in to comment.